/* Scope the approved training modal primitives so the same renderer can be
   mounted in the standalone inbox without changing its page design. */
.emichat-debug-root .modal-backdrop{position:fixed;inset:0;background:#0008;z-index:40}
.emichat-debug-root .debug-modal{position:fixed;z-index:41;top:50%;left:50%;transform:translate(-50%,-50%);padding:0;background:#fff;width:min(614px,calc(100vw - 30px));max-height:calc(100dvh - 28px);border-radius:15px;display:flex;flex-direction:column;box-shadow:0 15px 55px #0004;color:#303030;font:13px Inter,Arial,sans-serif}
.emichat-debug-root .training-modal-head{height:52px;flex:none;display:flex;align-items:center;justify-content:space-between;background:#f7f7f7;border-bottom:1px solid #e5e5e5;padding:0 16px;border-radius:15px 15px 0 0}
.emichat-debug-root h2{font-size:14px;margin:0}.emichat-debug-root .training-modal-close{font-size:19px;border:0;background:transparent;min-width:24px}
.emichat-debug-root .training-modal-body{padding:16px;overflow:auto;min-height:0}.emichat-debug-root .training-modal-footer{min-height:60px;flex:none;display:flex;align-items:center;justify-content:flex-end;gap:8px;border-top:1px solid #e9e9e9;padding:0 16px}
.emichat-debug-root .training-editor-tabs{display:flex;gap:4px;margin-bottom:16px}.emichat-debug-root .training-editor-tabs button{font:inherit;border:0;background:none;border-radius:7px;padding:7px 12px;cursor:pointer}.emichat-debug-root .training-editor-tabs button.active{background:#ededed}
.emichat-debug-root .training-detail-field{display:grid;gap:5px}.emichat-debug-root textarea{box-sizing:border-box;min-height:260px;height:min(340px,45dvh);width:100%;resize:vertical;white-space:pre;overflow:auto;border:1px solid #ddd;border-radius:7px;padding:10px;font:12px/1.5 monospace;background:#fafafa;color:#303030}
.emichat-debug-root .btn{font:12px Inter,Arial,sans-serif;padding:7px 12px;border:1px solid #d7d7d7;border-radius:8px;background:#fff;cursor:pointer}.emichat-debug-root .btn.dark{background:#303030;color:#fff}.emichat-debug-root .btn:disabled{opacity:.5;cursor:default}.emichat-debug-root .muted{color:#616161;line-height:1.5}

.emichat-debug-root [data-debug-copy]{min-width:120px}
/* Reply-tool form layout follows the observed 620px Zipchat modal. */
/* Approved styles.css / rules.css primitives, scoped here for the standalone
   Member inbox as well as the static reference. No page-wide stylesheet needed. */
.emichat-debug-root .reply-rule-fields .input{box-sizing:border-box;border:1px solid #aaa;border-radius:7px;background:#fff;padding:7px 11px;color:#333;outline:none;min-height:32px;height:32px;font:450 13px/20px Inter,Arial,sans-serif}
.emichat-debug-root .reply-rule-fields .input:focus{border-color:#666;box-shadow:0 0 0 2px #00000013}
.emichat-debug-root .reply-rule-fields .rules-ask{box-sizing:border-box;display:flex;align-items:center;gap:10px;border:1px solid transparent;background:linear-gradient(#fff,#fff) padding-box,linear-gradient(110deg,#c7b8ff,#f6b5ce,#fed5ba) border-box;border-radius:16px;padding:8px 16px;min-height:48px;box-shadow:0 0 0 3px #bba4f70d}
.emichat-debug-root .reply-rule-fields .rules-ask>span{display:flex;color:#8473b2}
.emichat-debug-root .reply-rule-fields .rules-ask .input{flex:1;min-width:0;min-height:0;height:30px;border:0;box-shadow:none;background:transparent;padding:0;font-size:14px}
.emichat-debug-root .reply-rule-fields .rules-ask>button{width:30px;height:30px;padding:0;border:0;border-radius:50%;background:#303030;color:white;font-size:22px;flex:none}
.emichat-debug-root .reply-rule-fields .rules-ask>button:disabled{background:#e6e6e6;color:#fff}
.emichat-debug-root .reply-rule-fields .rules-ask>span img{width:16px;height:16px}
.emichat-debug-root .reply-rule-fields .rules-ask>button img{width:16px;height:16px;filter:invert(1)}
.emichat-debug-root .debug-modal{width:min(620px,calc(100vw - 32px));max-height:calc(100dvh - 60px);border-radius:12px}
.emichat-debug-root .training-modal-head{height:48px;border-radius:12px 12px 0 0}.emichat-debug-root .training-modal-footer{min-height:64px}
.emichat-debug-root .training-editor-tabs{margin-bottom:20px}.emichat-debug-root .debug-question,.reply-rule-fields>label{display:grid;gap:6px}
.emichat-debug-root .debug-counted{position:relative;border:1px solid #999;border-radius:8px;overflow:hidden}.emichat-debug-root .debug-counted textarea{font:13px/20px Inter,Arial,sans-serif;white-space:pre-wrap;background:#fff;border:0;border-radius:0;resize:vertical;min-height:120px;height:180px;padding:8px 12px 28px}.emichat-debug-root .debug-counted span{position:absolute;bottom:6px;right:10px;color:#616161;font-size:12px;pointer-events:none}
.emichat-debug-root .debug-banner{padding:12px;background:#eaf4ff;border-radius:8px;line-height:20px}.emichat-debug-root .debug-banner p{margin:0 0 8px}.emichat-debug-root .debug-trace h3{font-size:13px;text-transform:capitalize;margin:16px 0 8px}.emichat-debug-root pre{font:12px/19px ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;padding:12px;background:#f4f4f4;border-radius:8px}.debug-error{color:#b42318}
.reply-rule-fields{display:grid;gap:16px}.reply-rule-fields h3{font-size:13px;margin:0}.reply-rule-fields p{margin:4px 0 0;line-height:20px}.reply-rule-fields .debug-counted textarea{height:140px}.reply-rule-fields .input{height:32px}.reply-rule-fields .rules-ask{margin:10px 0 0}.reply-rule-channel{position:relative;margin-top:4px}.reply-rule-menu{position:absolute;bottom:36px;left:0;background:white;padding:12px;box-shadow:0 3px 15px #0003;border-radius:8px;min-width:180px;z-index:2;display:grid;gap:8px}.reply-rule-menu label{display:flex;gap:8px;align-items:center}
.emichat-internal-support{position:fixed;bottom:72px;right:24px;width:400px;max-width:calc(100vw - 32px);z-index:44}.emichat-internal-support .emichat-bubble{height:min(600px,calc(100dvh - 110px))}.internal-support-close{position:absolute;right:0;bottom:-48px;z-index:1;border:0;border-radius:50%;width:36px;height:36px;background:#000;color:#fff;font-size:24px}.emichat-internal-support .channel-message [role=alert]{color:#b42318}
.emichat-debug-root .training-modal-head{height:52.8px}.emichat-debug-root .training-modal-footer{min-height:60.8px}.reply-rule-fields>p.muted{margin-top:-12px}.reply-rule-menu small{color:#616161;font-size:12px}.reply-rule-menu label:has(small){flex-wrap:wrap}.reply-rule-menu label:first-child small{flex-basis:100%;margin-left:24px}
