* { box-sizing: border-box; }
html { height: 100%; color-scheme: light dark; }
body {
  min-width: 320px;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: var(--font-sans);
}
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--color-structure) 24%, transparent) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: color-mix(in srgb, var(--color-structure) 24%, transparent); background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--color-brand-blue) 48%, transparent); background-clip: padding-box; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary) 34%, transparent);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 3000; top: 8px; left: 8px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--color-structure); color: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.viewport-stage { width: 100%; min-height: 100dvh; margin: 0; padding: 0; }
.app-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); width: 100%; height: 100dvh; overflow: hidden; background: var(--color-surface-muted); }
.appbar { display: flex; gap: 30px; align-items: center; min-height: 86px; padding: 0 32px; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface); box-shadow: inset 0 3px var(--color-brand-blue); }
.brand { display: flex; gap: 10px; align-items: center; min-width: max-content; }
.brand-mark { display: block; width: 54px; height: 54px; flex: 0 0 auto; border: 0; background: transparent; object-fit: contain; clip-path: circle(46.4% at 50% 50%); }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { color: var(--color-text); font-size: .96rem; font-weight: 800; letter-spacing: -.025em; }
.brand-copy small { margin-top: 2px; color: var(--color-text-muted); font-size: .66rem; font-weight: 600; letter-spacing: .035em; }
.case-line { display: flex; gap: 9px; align-items: center; min-width: 0; padding-left: 22px; border-left: 1px solid var(--color-border-soft); color: var(--color-text-muted); font-size: .79rem; }
.case-line strong { overflow: hidden; color: var(--color-text); text-overflow: ellipsis; white-space: nowrap; }
.appbar-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.environment-label, .context-label { display: inline-flex; gap: 7px; align-items: center; width: max-content; color: var(--color-text-muted); font-size: .67rem; font-weight: 650; white-space: nowrap; }
.environment-label::before, .context-label::before { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--color-brand-green); content: ""; }
.context-label::before { background: var(--color-brand-blue); }
.profile-switcher { position: relative; }
.profile-button { display: grid; grid-template-columns: 38px minmax(0, 1fr) 16px; gap: 10px; align-items: center; min-width: 224px; min-height: 54px; padding: 6px 10px; border: 1px solid var(--color-border-soft); border-radius: var(--radius-md); background: var(--color-surface); text-align: left; transition: background 160ms ease, border-color 160ms ease; }
.profile-button .profile-avatar { width: 38px; height: 38px; }
.profile-button:hover, .profile-button[aria-expanded="true"] { border-color: var(--color-border); background: var(--color-surface-muted); }
.profile-avatar { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--color-structure); color: #fff; font: 600 .68rem/1 var(--font-mono); letter-spacing: .02em; }
.profile-copy strong, .profile-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: .74rem; }
.profile-copy small { margin-top: 3px; color: var(--color-text-muted); font-size: .61rem; }
.profile-chevron { color: var(--color-text-muted); font-size: 1rem; transition: transform 160ms ease; }
.profile-button[aria-expanded="true"] .profile-chevron { transform: rotate(180deg); }
.profile-menu { position: absolute; z-index: 1200; top: calc(100% + 8px); right: 0; width: min(340px, calc(100vw - 24px)); padding: 8px; border: 1px solid var(--color-border-soft); border-radius: 14px; background: var(--color-surface-raised); box-shadow: var(--shadow-lg); }
.profile-menu-head { padding: 12px 12px 10px; }
.profile-menu-head p { margin: 5px 0 0; color: var(--color-text-muted); font-size: .66rem; line-height: 1.45; }
.profile-option { display: grid; grid-template-columns: 34px minmax(0, 1fr) 18px; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; transition: background 150ms ease; }
.profile-option:hover { background: var(--color-surface-muted); }
.profile-option.active { background: var(--color-primary-soft); }
.profile-option strong, .profile-option small { display: block; }
.profile-option strong { font-size: .72rem; }
.profile-option small { margin-top: 2px; color: var(--color-text-muted); font-size: .62rem; }
.profile-check { color: var(--color-primary); opacity: 0; font-weight: 800; }
.profile-option.active .profile-check { opacity: 1; }
.demo-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; padding: 12px 10px 4px; border-top: 1px solid var(--color-border-soft); }
.demo-tools .tiny-label { grid-column: 1 / -1; margin-bottom: 2px; }
.demo-tools button { min-height: 36px; border: 0; border-radius: var(--radius-sm); background: var(--color-surface-muted); color: var(--color-text); font-size: .66rem; }
.demo-tools button:hover { background: var(--color-current-soft); }

.application-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 0; }
.app-nav { display: flex; min-height: 0; flex-direction: column; gap: 6px; overflow-y: auto; padding: 22px 12px 18px; background: var(--color-structure); color: rgba(255,255,255,.76); box-shadow: inset -1px 0 rgba(255,255,255,.055); }
.nav-label { margin: 2px 11px 13px; color: rgba(255,255,255,.48); font: 600 .57rem/1 var(--font-mono); letter-spacing: .085em; text-transform: uppercase; }
.nav-button { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; width: 100%; min-height: 48px; padding: 7px 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: inherit; text-align: left; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease; }
.nav-button:hover { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.055); color: #fff; }
.nav-button.active { border-color: rgba(52,168,221,.24); background: rgba(0,128,184,.17); box-shadow: inset 3px 0 var(--color-brand-blue); color: #fff; }
.nav-button:disabled { cursor: not-allowed; opacity: .44; }
.nav-button:disabled:hover { border-color: transparent; background: transparent; color: inherit; }
.nav-code { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(255,255,255,.055); border-radius: 7px; background: rgba(255,255,255,.065); font: 600 .62rem/1 var(--font-mono); }
.nav-button.active .nav-code { border-color: transparent; background: var(--color-brand-blue); }
.nav-copy strong, .nav-copy small { display: block; }
.nav-copy strong { font-size: .76rem; letter-spacing: -.01em; }
.nav-copy small { margin-top: 3px; color: rgba(255,255,255,.5); font-size: .61rem; }
.nav-button.active .nav-copy small { color: rgba(255,255,255,.7); }
.nav-spacer { flex: 1; }
.nav-session { display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: start; margin: 10px 10px 0; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.12); }
.nav-session-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--color-brand-green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand-green) 18%, transparent); }
.nav-session strong, .nav-session small { display: block; }
.nav-session strong { color: rgba(255,255,255,.88); font-size: .66rem; }
.nav-session small { margin-top: 4px; color: rgba(255,255,255,.48); font-size: .58rem; line-height: 1.4; }
.demo-note { margin: 12px 10px 3px 28px; color: rgba(255,255,255,.46); font-size: .6rem; line-height: 1.5; }

.view-stack { min-width: 0; min-height: 0; overflow: hidden; background: var(--color-surface-muted); }
.app-view { display: none; width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.app-view.active { display: grid; grid-template-rows: auto minmax(0, 1fr); }
#view-operator.active, #view-control.active { grid-template-rows: auto auto minmax(0, 1fr); }
#operator-feedback, #control-feedback { grid-row: 2; }
#operator-workspace, .control-main { grid-row: 3; }
.tiny-label, .eyebrow { color: var(--color-text-muted); font: 600 .66rem/1.4 var(--font-mono); letter-spacing: .055em; text-transform: uppercase; }
.badge, .status-pill { display: inline-flex; gap: 7px; align-items: center; width: max-content; padding: 0; background: transparent; color: var(--color-success); font: 600 .67rem/1.25 var(--font-mono); white-space: nowrap; }
.badge::before, .status-pill::before { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; content: ""; }
.chip { display: inline-flex; align-items: center; width: max-content; padding: 5px 8px; border: 1px solid var(--color-border-soft); border-radius: 6px; background: var(--color-surface-muted); color: var(--color-text-muted); font: 600 .65rem/1 var(--font-mono); white-space: nowrap; }
.warning { background: transparent; color: var(--color-warning-text); }
.danger { background: transparent; color: var(--color-danger); }
.neutral { background: transparent; color: var(--color-text-muted); }
.chip.warning { border-color: color-mix(in srgb, var(--color-accent) 30%, var(--color-border-soft)); background: var(--color-accent-soft); }
.chip.danger { border-color: color-mix(in srgb, var(--color-danger) 26%, var(--color-border-soft)); background: var(--color-danger-soft); }
.chip.neutral { background: var(--color-surface-muted); }
.secondary-button, .primary-button, .danger-button { min-height: 40px; padding: 0 15px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-raised); font-size: .74rem; font-weight: 700; transition: border-color 160ms ease, transform 160ms cubic-bezier(.23,1,.32,1), filter 160ms ease; }
.secondary-button:hover { border-color: var(--color-primary); transform: translateY(-1px); }
.secondary-button:active, .primary-button:active, .danger-button:active { transform: scale(.98); }
.primary-button { border-color: var(--color-primary); background: var(--color-primary); color: #fff; font-weight: 800; }
.primary-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.danger-button { border-color: var(--color-danger); background: var(--color-danger-soft); color: var(--color-danger); font-weight: 700; }
button:disabled { cursor: not-allowed; opacity: .58; transform: none !important; }
.full-width { width: 100%; }

.view-heading { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 48px; align-items: end; min-height: 124px; padding: 28px 36px 25px; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface); }
.view-heading h1 { margin: 6px 0 0; font-size: clamp(1.55rem, 2.5vw, 2.35rem); line-height: 1.04; letter-spacing: -.038em; }
.view-heading p { margin: 0; color: var(--color-text-muted); font-size: .78rem; line-height: 1.55; }

/* Bandeja */
.inbox-workspace { display: grid; grid-template-columns: minmax(260px, var(--inbox-queue-width, .85fr)) 10px minmax(420px, 2fr) 10px minmax(320px, var(--inbox-decision-width, 1.05fr)); width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.queue-panel, .email-panel, .decision-panel { min-width: 0; background: var(--color-surface); }
.queue-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 0; overflow: hidden; }
.workspace-splitter { position: relative; z-index: 4; width: 10px; min-width: 10px; height: 100%; padding: 0; border: 0; outline: 0; background: var(--color-surface); cursor: col-resize; touch-action: none; }
.workspace-splitter::before { position: absolute; inset-block: 0; left: 50%; width: 1px; background: var(--color-border-soft); content: ""; transform: translateX(-50%); transition: width 140ms ease, background 140ms ease; }
.workspace-splitter::after { position: absolute; top: 50%; left: 50%; width: 3px; height: 34px; border-radius: 999px; background: var(--color-brand-blue); content: ""; opacity: 0; transform: translate(-50%, -50%); transition: opacity 140ms ease, height 140ms ease; }
.workspace-splitter:hover::before, .workspace-splitter:focus-visible::before, .workspace-splitter.is-dragging::before { width: 3px; background: color-mix(in srgb, var(--color-brand-blue) 38%, var(--color-border-soft)); }
.workspace-splitter:hover::after, .workspace-splitter:focus-visible::after, .workspace-splitter.is-dragging::after { opacity: 1; }
.workspace-splitter:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--color-brand-blue) 24%, transparent); }
body.is-resizing, body.is-resizing * { cursor: col-resize !important; user-select: none !important; }
.panel-heading { padding: 18px; border-bottom: 1px solid var(--color-border-soft); }
.panel-heading h2, .panel-heading h3 { margin: 4px 0 0; font-size: .98rem; letter-spacing: -.025em; }
.panel-heading-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.search { width: 100%; height: 40px; margin-top: 12px; padding: 0 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-raised); color: var(--color-text); }
.filter-row { display: flex; gap: 6px; margin-top: 9px; overflow-x: auto; }
.filter-chip { padding: 7px 10px; border: 0; border-radius: 5px; background: var(--color-surface-muted); color: var(--color-text-muted); font-size: .68rem; white-space: nowrap; }
.filter-chip:hover, .filter-chip.active { background: var(--color-primary-soft); color: var(--color-primary); }
.queue-list { display: grid; align-content: start; overflow: auto; }
.request-item { display: grid; gap: 8px; padding: 15px 18px; border: 0; border-bottom: 1px solid var(--color-border-soft); background: transparent; text-align: left; }
.request-item:hover { background: var(--color-surface-muted); }
.request-item.active { box-shadow: inset 3px 0 var(--color-primary); background: var(--color-primary-soft); }
.request-top, .request-meta { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.request-top strong { overflow: hidden; font-size: .81rem; text-overflow: ellipsis; white-space: nowrap; }
.request-top .status-pill { max-width: 148px; justify-content: flex-end; line-height: 1.3; text-align: right; white-space: normal; }
.request-subject { color: var(--color-text-muted); font-size: .74rem; line-height: 1.45; }
.request-meta { color: var(--color-text-muted); font: 500 .62rem/1 var(--font-mono); }
.meta-top { margin-top: 8px; }
.email-panel { display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: 100%; min-height: 0; overflow: hidden; }
.email-toolbar { display: flex; gap: 4px; min-width: 0; padding: 8px 16px; overflow-x: auto; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface); scrollbar-width: none; }
.email-toolbar::-webkit-scrollbar { display: none; }
.text-tab { position: relative; min-height: 34px; padding: 7px 11px; border: 0; border-radius: 4px; background: transparent; color: var(--color-text-muted); font-size: .68rem; font-weight: 600; white-space: nowrap; }
.text-tab:hover { background: var(--color-surface-muted); color: var(--color-text); }
.text-tab.active { background: var(--color-primary-soft); color: var(--color-primary); }
.email-toolbar .text-tab.active::after { position: absolute; right: 9px; bottom: -9px; left: 9px; height: 2px; background: var(--color-brand-blue); content: ""; }
.tab-count { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; padding-inline: 5px; place-items: center; border-radius: var(--radius-full); background: var(--color-surface-muted); color: var(--color-text-muted); font: 600 .55rem/1 var(--font-mono); }
.text-tab.active .tab-count { background: color-mix(in srgb, var(--color-brand-blue) 14%, var(--color-surface)); color: var(--color-primary); }
.email-body { overflow: auto; padding: 28px clamp(20px, 4vw, 52px); font-size: .84rem; line-height: 1.75; }
.email-body blockquote { margin: 22px 0 0; padding: 15px 18px; border-left: 3px solid var(--color-brand-blue); background: var(--color-primary-soft); color: var(--color-text-muted); }
.assignment-mail-view { min-width: 0; min-height: 0; height: calc(100% - 22px); overflow: hidden; margin: 10px 12px 12px; border: 1px solid var(--color-border-soft); border-left: 3px solid var(--color-brand-blue); border-radius: var(--radius-sm); background: var(--color-surface); box-shadow: var(--shadow-sm); }
#assignment-tab-reading.active { display: grid; grid-template-rows: minmax(0, 1fr); }
#assignment-tab-original.active { display: grid; grid-template-rows: auto minmax(0, 1fr); }
#assignment-tab-attachments.active { display: grid; grid-template-columns: minmax(190px, .72fr) minmax(0, 1.28fr); }
#assignment-tab-technical.active { display: block; overflow: auto; }
.assignment-mail-view .thread-mail-frame { width: 100%; height: 100%; min-height: 0; }
.mail-viewer { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; overflow: hidden; background: var(--color-surface-muted); }
.mail-headers { display: grid; align-content: start; gap: 1px; max-height: 148px; overflow: auto; padding: 11px 16px; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface); color: var(--color-text-muted); font-size: .67rem; line-height: 1.45; scrollbar-gutter: stable; }
.mail-headers > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; min-width: 0; padding: 3px 0; }
.mail-headers > div > span, .mail-headers dt { color: var(--color-text-muted); font: 600 .57rem/1.5 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.mail-headers > div > strong, .mail-headers dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--color-text); font-size: .65rem; font-weight: 600; }
.mail-frame { display: block; width: 100%; height: 100%; min-height: 0; border: 0; background: #fff; color-scheme: light; }
.mail-attachments { display: flex; gap: 7px; min-height: 0; overflow-x: auto; padding: 9px 18px; border-top: 1px solid var(--color-border-soft); background: var(--color-surface); scrollbar-gutter: stable; }
.mail-attachment { display: inline-flex; gap: 7px; align-items: center; max-width: 280px; padding: 7px 9px; border: 1px solid var(--color-border-soft); border-radius: var(--radius-sm); background: var(--color-surface-muted); color: var(--color-text-muted); font-size: .63rem; white-space: nowrap; }
.mail-attachment strong { overflow: hidden; color: var(--color-text); text-overflow: ellipsis; }
.assignment-attachments, .assignment-attachment-workspace { display: grid; grid-template-columns: minmax(180px, .72fr) minmax(0, 1.28fr); min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.assignment-attachment-list, .attachment-list { min-width: 0; min-height: 0; overflow: auto; border-right: 1px solid var(--color-border-soft); background: var(--color-surface); }
.assignment-attachment-item, .attachment-list-item { display: grid; gap: 4px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--color-border-soft); background: transparent; color: var(--color-text); text-align: left; }
.assignment-attachment-item:hover, .attachment-list-item:hover { background: var(--color-surface-muted); }
.assignment-attachment-item.active, .attachment-list-item.active { background: var(--color-primary-soft); box-shadow: inset 3px 0 var(--color-brand-blue); }
.assignment-attachment-item strong, .attachment-list-item strong { overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.assignment-attachment-item small, .attachment-list-item small { color: var(--color-text-muted); font-size: .59rem; line-height: 1.4; }
.assignment-attachment-preview, .attachment-preview { min-width: 0; min-height: 0; overflow: auto; padding: 18px; background: var(--color-surface-muted); }
.assignment-attachment-preview iframe, .attachment-preview iframe { display: block; width: 100%; min-height: 100%; border: 1px solid var(--color-border-soft); background: #fff; }
.assignment-technical, .assignment-technical-view { min-width: 0; min-height: 0; overflow: auto; padding: 18px; }
.attachment-browser { display: grid; align-content: start; min-width: 0; min-height: 0; overflow: auto; border-right: 1px solid var(--color-border-soft); background: var(--color-surface); }
.attachment-browser > button, .attachment-browser .attachment-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--color-border-soft); background: transparent; color: var(--color-text); text-align: left; }
.attachment-browser > button:hover, .attachment-browser .attachment-item:hover { background: var(--color-surface-muted); }
.attachment-browser > button.active, .attachment-browser .attachment-item.active { background: var(--color-primary-soft); box-shadow: inset 3px 0 var(--color-brand-blue); }
.attachment-browser strong { overflow: hidden; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.attachment-browser small { color: var(--color-text-muted); font-size: .58rem; line-height: 1.4; }
.attachment-browser .attachment-item > span:first-child { display: grid; min-width: 0; gap: 3px; }
.attachment-state { max-width: 116px; color: var(--color-text-muted); font: 600 .55rem/1.35 var(--font-mono); text-align: right; }
.attachment-preview { display: grid; align-content: start; gap: 12px; }
.attachment-preview-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding-bottom: 13px; border-bottom: 1px solid var(--color-border-soft); }
.attachment-preview-head h3 { max-width: 100%; margin: 3px 0 0; overflow: hidden; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview > img { display: block; max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.attachment-preview > pre, .attachment-text { max-width: 100%; margin: 0; overflow: auto; padding: 14px; border: 1px solid var(--color-border-soft); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); font: 500 .65rem/1.55 var(--font-mono); white-space: pre-wrap; }
.attachment-preview-empty { display: grid; min-height: 220px; padding: 24px; place-content: center; color: var(--color-text-muted); text-align: center; }
.attachment-preview-empty strong { color: var(--color-text); font-size: .78rem; }
.attachment-preview-empty p { max-width: 380px; margin: 7px auto 0; font-size: .68rem; line-height: 1.55; }
.attachment-preview-empty small { max-width: 420px; margin-top: 8px; font-size: .59rem; line-height: 1.5; }
.technical-sheet { display: grid; align-content: start; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; padding: 14px 18px 24px; }
.technical-sheet > div, .technical-row { min-width: 0; padding: 11px 0; border-bottom: 1px solid var(--color-border-soft); }
.technical-sheet small, .technical-sheet span { display: block; }
.technical-sheet small, .technical-row span { color: var(--color-text-muted); font: 600 .56rem/1.4 var(--font-mono); letter-spacing: .035em; text-transform: uppercase; }
.technical-sheet > div > span:not(:first-child), .technical-row strong { display: block; margin-top: 5px; overflow-wrap: anywhere; color: var(--color-text); font-size: .68rem; line-height: 1.45; }
.decision-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; min-height: 0; overflow: hidden; }
.decision-scroll { overflow: auto; padding: 18px; }
.human-banner { padding: 12px 14px; border: 0; border-left: 3px solid var(--color-accent); background: var(--color-accent-soft); font-size: .75rem; line-height: 1.5; }
.field-group { margin-top: 19px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.data-field { padding: 11px 2px 10px; border: 0; border-bottom: 1px solid var(--color-border-soft); background: transparent; }
.data-field small, .data-field span { display: block; }
.data-field small { color: var(--color-text-muted); font-size: .62rem; }
.data-field span { margin-top: 5px; font-size: .76rem; font-weight: 700; }
.source-note { margin-top: 6px; overflow: hidden; color: var(--color-text-muted); font: 500 .61rem/1.25 var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.proposal-card { margin-top: 18px; padding: 16px; border: 0; border-left: 3px solid var(--color-primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--color-primary-soft); }
.proposal-title { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.proposal-person { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--color-structure); color: #fff; font-size: .68rem; font-weight: 800; line-height: 1; }
.proposal-person > div > strong, .proposal-person > div > span { display: block; font-size: .76rem; }
.proposal-person > div > span { margin-top: 2px; color: var(--color-text-muted); }
.reason { margin-top: 13px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--color-primary) 28%, transparent); color: var(--color-text-muted); font-size: .7rem; line-height: 1.5; }
.decision-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--color-border-soft); background: var(--color-surface-raised); }
.decision-actions .primary-button { grid-column: 1 / -1; }

/* Asignación */
.step { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 8px; }
.step:not(:last-child)::after { position: absolute; top: 42px; bottom: -4px; left: 22px; width: 1px; background: var(--color-border); content: ""; }
.step-dot { display: grid; z-index: 1; width: 28px; height: 28px; place-items: center; border: 1px solid var(--color-border); border-radius: 50%; background: var(--color-surface); color: var(--color-text-muted); font: 600 .64rem/1 var(--font-mono); }
.step strong, .step small { display: block; }
.step strong { margin-top: 2px; font-size: .74rem; }
.step small { margin-top: 4px; color: var(--color-text-muted); font-size: .63rem; }
.step.active .step-dot, .step.done .step-dot { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.form-field { display: grid; gap: 7px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: var(--color-text-muted); font: 600 .63rem/1 var(--font-mono); text-transform: uppercase; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-raised); color: var(--color-text); }
.form-field input, .form-field select { height: 43px; padding: 0 12px; }
.form-field textarea { min-height: 82px; padding: 11px 12px; resize: vertical; }
.rule-box { grid-column: 1 / -1; padding: 13px 14px; border: 1px dashed var(--color-accent); border-radius: var(--radius-sm); background: var(--color-accent-soft); color: var(--color-text-muted); font-size: .72rem; line-height: 1.5; }
.context-copy { overflow: auto; padding: 18px; color: var(--color-text-muted); font-size: .74rem; line-height: 1.65; }
.context-copy strong { color: var(--color-text); }
.context-footer { padding: 14px 18px; border-top: 1px solid var(--color-border-soft); }

/* Mi bandeja */
.operator-heading { align-items: center; }
.operator-identity { display: grid; gap: 7px; justify-self: end; width: min(100%, 290px); }
.operator-identity label { color: var(--color-text-muted); font: 600 .63rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.operator-identity select { height: 42px; padding: 0 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-raised); color: var(--color-text); }
.workspace-feedback { display: none; padding: 11px 22px; border-bottom: 1px solid var(--color-border-soft); background: var(--color-primary-soft); color: var(--color-text-muted); font-size: .73rem; }
.workspace-feedback.visible { display: block; }
.workspace-feedback.danger-state { background: var(--color-danger-soft); color: var(--color-danger); }
.operator-workspace { display: grid; grid-template-columns: minmax(240px, var(--operator-queue-width, 300px)) 10px minmax(400px, 1fr) 10px minmax(360px, var(--operator-compose-width, 460px)); width: 100%; height: 100%; min-height: 0; overflow: hidden; background: var(--color-border-soft); }
.operator-queue { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; background: var(--color-surface); }
.operator-queue .panel-heading { padding: 17px 16px 15px; }
.operator-queue .panel-heading p { margin: 7px 0 0; color: var(--color-text-muted); font-size: .67rem; line-height: 1.45; }
.operator-queue .search { height: 38px; margin-top: 11px; }
.operator-queue .request-item { padding: 14px 16px; }
.operator-case { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; overflow: hidden; padding: 0; background: var(--color-surface-muted); }
.operator-case-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; padding: 18px 20px 16px; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface); }
.operator-case-head h2 { margin: 4px 0; font-size: clamp(1.05rem, 1.55vw, 1.38rem); letter-spacing: -.04em; }
.operator-case-head p { margin: 0; color: var(--color-text-muted); font-size: .7rem; line-height: 1.45; }
.operator-case-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr); gap: 14px; margin-top: 18px; }
.operator-section { min-width: 0; padding: 20px; border: 0; border-radius: var(--radius-md); background: var(--color-surface); box-shadow: 0 10px 30px color-mix(in srgb, var(--color-structure) 6%, transparent); }
.operator-section.full { grid-column: 1 / -1; }
.operator-copy { margin-top: 12px; color: var(--color-text-muted); font-size: .76rem; line-height: 1.65; }
.operator-copy strong { color: var(--color-text); }
.operator-history { display: grid; margin-top: 10px; }
.operator-history-row { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-border-soft); }
.operator-history-row:last-child { border-bottom: 0; }
.operator-history-row time { color: var(--color-text-muted); font: 500 .6rem/1.4 var(--font-mono); }
.operator-history-row strong, .operator-history-row small { display: block; }
.operator-history-row strong { font-size: .72rem; }
.operator-history-row small { margin-top: 4px; color: var(--color-text-muted); font-size: .66rem; line-height: 1.45; }
.operator-section .case-facts { grid-template-columns: 1fr 1fr; padding: 12px 0 0; }
.operator-action-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.operator-action-head h3 { margin: 5px 0 0; font-size: 1rem; }
.operator-action-note { max-width: 760px; margin: 10px 0 18px; color: var(--color-text-muted); font-size: .72rem; line-height: 1.55; }
.operator-action-grid { display: grid; grid-template-columns: minmax(250px, .75fr) minmax(340px, 1.25fr); gap: 14px; }
.operator-action-block { display: grid; align-content: start; gap: 9px; padding: 16px; border: 0; border-radius: var(--radius-sm); background: var(--color-surface-muted); }
.operator-action-block > label { color: var(--color-text-muted); font: 600 .65rem/1 var(--font-mono); text-transform: uppercase; }
.operator-action-block input, .operator-action-block textarea { width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-raised); color: var(--color-text); }
.operator-action-block input { min-height: 42px; padding: 8px 10px; }
.operator-action-block input[type="file"] { height: auto; font-size: .7rem; }
.operator-action-block textarea { min-height: 92px; padding: 10px; resize: vertical; }
.artifact-list { display: grid; gap: 6px; margin-top: 4px; }
.artifact-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 9px 10px; border: 1px solid var(--color-border-soft); border-radius: var(--radius-sm); background: var(--color-surface); }
.artifact-row strong, .artifact-row small { display: block; }
.artifact-row strong { font-size: .7rem; }
.artifact-row small { margin-top: 3px; color: var(--color-text-muted); font: 500 .58rem/1.35 var(--font-mono); }
.artifact-empty { margin: 8px 0 0; color: var(--color-text-muted); font-size: .7rem; }
.operator-thread { display: grid; grid-auto-rows: max-content; align-content: start; gap: 12px; min-width: 0; min-height: 0; margin: 0; overflow: auto; padding: 18px 20px 28px; scrollbar-gutter: stable; }
.thread-message { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 4px 12px; padding: 13px 14px; border: 1px solid color-mix(in srgb, var(--color-primary) 16%, var(--color-border-soft)); border-left: 3px solid var(--color-primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--color-surface); }
.thread-message > strong { font-size: .75rem; }
.thread-message > small { grid-column: 2; color: var(--color-text-muted); font-size: .62rem; }
.thread-message > p { grid-column: 2; margin: 4px 0 0; color: var(--color-text-muted); font-size: .7rem; line-height: 1.5; }
.thread-card { overflow: hidden; border: 1px solid var(--color-border-soft); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-sm); }
.thread-card[open] { box-shadow: 0 8px 22px color-mix(in srgb, var(--color-structure) 7%, transparent); }
.thread-card > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px 12px; align-items: center; padding: 13px 15px; cursor: pointer; list-style: none; }
.thread-card > summary::-webkit-details-marker { display: none; }
.thread-card > summary::after { color: var(--color-text-muted); content: "+"; font: 600 .85rem/1 var(--font-mono); }
.thread-card[open] > summary::after { content: "\2212"; }
.thread-card > summary:hover { background: var(--color-surface-muted); }
.thread-card.incoming { border-left: 3px solid var(--color-brand-blue); }
.thread-card.outgoing { border-left: 3px solid var(--color-brand-green); }
.thread-card.attention { border-left: 3px solid var(--color-accent); }
.thread-direction { display: inline-flex; align-items: center; min-height: 24px; padding: 0 7px; border-radius: 4px; background: var(--color-primary-soft); color: var(--color-primary); font: 600 .56rem/1 var(--font-mono); letter-spacing: .025em; white-space: nowrap; }
.thread-card.outgoing .thread-direction { background: color-mix(in srgb, var(--color-brand-green) 14%, var(--color-surface)); color: var(--color-success); }
.thread-card.attention .thread-direction { background: var(--color-accent-soft); color: var(--color-warning-text); }
.thread-summary-copy { display: grid; min-width: 0; gap: 3px; }
.thread-summary-copy strong, .thread-summary-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-summary-copy strong { font-size: .73rem; }
.thread-summary-copy small { color: var(--color-text-muted); font-size: .59rem; }
.thread-time { color: var(--color-text-muted); font: 500 .57rem/1 var(--font-mono); white-space: nowrap; }
.thread-card-head, .thread-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; min-width: 0; }
.thread-card-head strong, .thread-summary strong { overflow: hidden; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.thread-card-head small, .thread-summary small { grid-column: 2; color: var(--color-text-muted); font-size: .61rem; }
.thread-card-body, .thread-body { min-width: 0; border-top: 1px solid var(--color-border-soft); }
#operator-thread .thread-card-body { max-height: min(62vh, 680px); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.thread-card .mail-headers { max-height: 96px; }
.thread-card .mail-frame { height: clamp(320px, 50vh, 600px); }
.thread-card.text-only .mail-frame { height: clamp(180px, 24vh, 260px); }
.thread-mail-frame { display: block; width: 100%; border: 0; background: #fff; }
.mail-headers.compact { gap: 3px 10px; max-height: 92px; padding: 10px 13px; font-size: .61rem; }
.mail-attachments.compact { min-height: 42px; padding: 7px 12px; }
.attachment-chip { display: inline-grid; max-width: 270px; padding: 6px 9px; border: 1px solid var(--color-border-soft); border-radius: var(--radius-sm); background: var(--color-surface-muted); white-space: nowrap; }
.attachment-chip strong, .attachment-chip small { display: block; overflow: hidden; text-overflow: ellipsis; }
.attachment-chip strong { color: var(--color-text); font-size: .62rem; }
.attachment-chip small, .attachment-empty { margin-top: 2px; color: var(--color-text-muted); font-size: .57rem; }
.thread-text { margin: 0; padding: 18px; color: var(--color-text); font-size: .74rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.case-details { max-height: 42%; overflow: auto; border-top: 1px solid var(--color-border-soft); background: var(--color-surface); scrollbar-gutter: stable; }
.case-details > summary { position: sticky; z-index: 2; top: 0; padding: 12px 20px; background: var(--color-surface); color: var(--color-text-muted); cursor: pointer; font: 600 .64rem/1.35 var(--font-mono); letter-spacing: .035em; }
.case-details > .case-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 6px 20px 14px; }
.case-details > .operator-copy, .case-details > .operator-history { margin: 0; padding: 0 20px 16px; }
.operator-composer { position: relative; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; overflow: hidden; background: var(--color-surface); box-shadow: -10px 0 30px color-mix(in srgb, var(--color-structure) 4%, transparent); }
.operator-composer::before { position: absolute; z-index: 3; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--color-brand-blue) 0 72%, var(--color-brand-green) 72%); content: ""; }
.operator-composer.is-empty { grid-template-rows: auto minmax(0, 1fr); }
.composer-empty { display: grid; min-height: 0; padding: 32px; place-items: center; color: var(--color-text-muted); text-align: center; }
.composer-empty strong { display: block; color: var(--color-text); font-size: .9rem; }
.composer-empty p { max-width: 280px; margin: 9px 0 0; font-size: .7rem; line-height: 1.55; }
.composer-empty[hidden], .composer-tabs[hidden], .composer-recipients[hidden], .composer-actions[hidden] { display: none; }
.composer-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 20px 20px 14px; border-bottom: 1px solid var(--color-border-soft); }
.composer-head h2 { margin: 4px 0 0; font-size: 1.05rem; letter-spacing: -.035em; }
.reference-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border: 1px solid color-mix(in srgb, var(--color-brand-blue) 28%, var(--color-border-soft)); border-radius: var(--radius-sm); background: var(--color-primary-soft); color: var(--color-primary); font: 600 .64rem/1 var(--font-mono); white-space: nowrap; }
.composer-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 8px 20px; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface); }
.composer-tabs .text-tab { min-height: 34px; border-radius: 4px; }
.composer-tabs .text-tab.active { background: var(--color-primary-soft); color: var(--color-primary); font-weight: 700; }
.composer-recipients { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; padding: 11px 20px 12px; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface-muted); }
.composer-recipients label { display: grid; min-width: 0; gap: 5px; color: var(--color-text-muted); font: 600 .57rem/1.35 var(--font-mono); letter-spacing: .035em; text-transform: uppercase; }
.composer-recipients input { width: 100%; min-height: 36px; padding: 0 9px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-raised); color: var(--color-text); font: .69rem/1.4 var(--font-sans); text-transform: none; }
.composer-recipients input[aria-invalid="true"] { border-color: var(--color-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger) 10%, transparent); }
.composer-recipients > small { grid-column: 1 / -1; color: var(--color-text-muted); font-size: .59rem; line-height: 1.35; }
.composer-scroll, .composer-preview { min-width: 0; min-height: 0; overflow: auto; padding: 18px 20px 28px; scrollbar-gutter: stable; }
.composer-preview { padding: 0; background: #fff; }
.composer-preview .mail-frame { min-height: 100%; }
.composer-note { margin: 0 0 16px; padding: 11px 12px; border-left: 3px solid var(--color-brand-blue); background: var(--color-primary-soft); color: var(--color-text-muted); font-size: .68rem; line-height: 1.5; }
.composer-form { display: grid; gap: 13px; }
.composer-form > label, .composer-row > label, .composer-section-body > label { display: grid; align-content: start; min-width: 0; gap: 6px; color: var(--color-text-muted); font: 600 .59rem/1.35 var(--font-mono); letter-spacing: .035em; text-transform: uppercase; }
.composer-row { display: grid; align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.composer-form input, .composer-form textarea { width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-raised); color: var(--color-text); font-family: var(--font-sans); font-size: .72rem; line-height: 1.45; text-transform: none; }
.composer-form input { min-height: 40px; padding: 0 10px; }
.composer-form textarea { min-height: 84px; padding: 9px 10px; resize: vertical; }
.composer-form :is(input, textarea)[aria-invalid="true"] { border-color: var(--color-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger) 10%, transparent); }
.composer-field-error { margin-top: 1px; color: var(--color-danger); font: 600 .62rem/1.4 var(--font-sans); letter-spacing: 0; text-transform: none; }
.composer-form > label:nth-last-child(1) textarea { min-height: 72px; }
.supporting-document { margin-top: 16px; padding: 12px; border: 1px solid var(--color-border-soft); border-radius: var(--radius-sm); background: var(--color-surface-muted); }
.supporting-document > summary { color: var(--color-text); cursor: pointer; font-size: .69rem; font-weight: 700; }
.supporting-document input[type="file"] { display: block; width: 100%; margin: 12px 0 8px; color: var(--color-text-muted); font-size: .65rem; }
.supporting-document .secondary-button { width: 100%; }
.composer-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 68px; padding: 12px 20px; border-top: 1px solid var(--color-border-soft); background: var(--color-surface-raised); box-shadow: 0 -9px 24px color-mix(in srgb, var(--color-structure) 5%, transparent); }
.composer-actions .primary-button { min-width: 160px; }
.composer-action-buttons, .agency-response-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.agency-response-actions button { white-space: nowrap; }
.composer-state { color: var(--color-text-muted); font-size: .64rem; line-height: 1.35; }
.empty-state.compact { min-height: 180px; padding: 24px 18px; }

/* Proveedores y cotización */
.operator-heading-actions { display: flex; gap: 16px; align-items: end; justify-content: flex-end; }
.operator-area-switch { min-width: 300px; }
.operator-workspace.quotation-active { grid-template-columns: minmax(240px, var(--operator-queue-width, 300px)) 10px minmax(0, 1fr); }
.quotation-workspace { display: grid; grid-column: 3 / -1; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; background: var(--color-surface-muted); }
.quotation-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; padding: 17px 22px 15px; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface); }
.quotation-head > div:first-child { min-width: 0; }
.quotation-head h2 { margin: 4px 0; font-size: clamp(1.05rem, 1.55vw, 1.38rem); letter-spacing: -.04em; }
.quotation-head p { margin: 0; color: var(--color-text-muted); font-size: .69rem; line-height: 1.45; }
.quotation-head .text-link { display: block; margin: 0 0 8px; padding: 0; border: 0; background: transparent; color: var(--color-primary); font-size: .67rem; font-weight: 700; }
.quotation-policy-summary { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.quotation-content { min-width: 0; min-height: 0; overflow: auto; padding: 18px; scrollbar-gutter: stable; }
.quotation-board { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; width: min(100%, 1500px); height: 100%; min-width: 0; margin: 0 auto; }
.quotation-editor, .quotation-result { min-width: 0; border: 1px solid var(--color-border-soft); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: 0 10px 30px color-mix(in srgb, var(--color-structure) 5%, transparent); }
.quotation-editor { max-height: 100%; overflow: auto; }
.quotation-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface-raised); }
.quotation-options { display: flex; gap: 5px; min-width: 0; overflow-x: auto; }
.quotation-commercial-options { display: grid; gap: 8px; font-size: .72rem; }
.quotation-commercial-options label { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.quotation-workspace .quotation-commercial-options input { width: 16px; min-height: 16px; flex: 0 0 16px; }
.quotation-option-tab { min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; background: var(--color-surface-muted); color: var(--color-text-muted); font-size: .69rem; font-weight: 700; white-space: nowrap; }
.quotation-option-tab.active { border-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-border-soft)); background: var(--color-primary-soft); color: var(--color-primary); }
.quotation-toolbar .secondary-button { min-height: 36px; white-space: nowrap; }
.quotation-form { display: grid; gap: 18px; padding: 16px; }
.quotation-section { min-width: 0; }
.quotation-section-head { display: flex; gap: 12px; align-items: end; justify-content: space-between; margin-bottom: 10px; }
.quotation-section-head h3 { margin: 3px 0 0; font-size: .92rem; letter-spacing: -.025em; }
.quotation-section-head p { max-width: 600px; margin: 4px 0 0; color: var(--color-text-muted); font-size: .64rem; line-height: 1.45; }
.quotation-fields { display: grid; grid-template-columns: 1.4fr .8fr; gap: 10px; }
.quotation-field, .quotation-policy-field, .supplement-fields label { display: grid; min-width: 0; gap: 5px; color: var(--color-text-muted); font: 600 .58rem/1.35 var(--font-mono); letter-spacing: .035em; text-transform: uppercase; }
.quotation-workspace :is(input, select, textarea), .providers-main :is(input, select) { width: 100%; min-width: 0; min-height: 38px; padding: 0 9px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-raised); color: var(--color-text); font: .69rem/1.4 var(--font-sans); text-transform: none; }
.quotation-workspace input[aria-invalid="true"] { border-color: var(--color-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger) 10%, transparent); }
.quote-provider-picker { position: relative; grid-column: 1 / -1; padding: 12px; border: 1px solid var(--color-border-soft); border-radius: var(--radius-sm); background: var(--color-surface-muted); }
.quote-provider-picker > label { display: grid; gap: 5px; color: var(--color-text-muted); font: 600 .58rem/1.35 var(--font-mono); letter-spacing: .035em; text-transform: uppercase; }
.quote-provider-results { display: grid; gap: 5px; max-height: 210px; margin-top: 8px; overflow: auto; }
.quote-provider-choice { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border: 1px solid var(--color-border-soft); border-radius: 6px; background: var(--color-surface); text-align: left; }
.quote-provider-choice:hover { border-color: var(--color-primary); }
.quote-provider-choice strong, .quote-provider-choice small { display: block; }
.quote-provider-choice strong { font-size: .7rem; }
.quote-provider-choice small { margin-top: 3px; color: var(--color-text-muted); font-size: .61rem; line-height: 1.35; }
.quote-provider-choice .chip { align-self: start; }
.quote-rate-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quote-rate-actions button { min-height: 32px; padding: 0 9px; border: 1px solid var(--color-border); border-radius: 5px; background: var(--color-surface-raised); color: var(--color-primary); font-size: .64rem; font-weight: 700; }
.quotation-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--color-border-soft); border-radius: var(--radius-sm); }
.quotation-table { width: 100%; min-width: 810px; border-collapse: collapse; table-layout: fixed; }
.quotation-table th { padding: 8px; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface-muted); color: var(--color-text-muted); font: 600 .56rem/1.3 var(--font-mono); letter-spacing: .035em; text-align: left; text-transform: uppercase; }
.quotation-table td { padding: 6px; border-bottom: 1px solid var(--color-border-soft); vertical-align: top; }
.quotation-table tr:last-child td { border-bottom: 0; }
.quotation-table th:nth-child(1) { width: 22%; }
.quotation-table th:nth-child(2) { width: 14%; }
.quotation-table th:nth-child(3) { width: 16%; }
.quotation-table th:nth-child(4), .quotation-table th:nth-child(5) { width: 12%; }
.quotation-table th:nth-child(6) { width: 19%; }
.quotation-table th:nth-child(7) { width: 5%; }
.quotation-table :is(input, select) { min-height: 34px; padding-inline: 7px; font-size: .65rem; }
.quotation-table .remove-line { width: 32px; min-height: 34px; padding: 0; border: 0; border-radius: 5px; background: var(--color-danger-soft); color: var(--color-danger); font-weight: 800; }
.quotation-table-actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; }
.quotation-table-actions small { color: var(--color-text-muted); font-size: .61rem; }
.quotation-table-actions .secondary-button { min-height: 34px; }
.quotation-settings { display: grid; grid-template-columns: 1fr 1.1fr; gap: 12px; }
.quotation-setting-card { padding: 12px; border: 1px solid var(--color-border-soft); border-radius: var(--radius-sm); background: var(--color-surface-muted); }
.quotation-setting-card h4 { margin: 0 0 10px; font-size: .74rem; }
.supplement-fields, .quotation-policy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.supplement-fields label:first-child { grid-column: 1 / -1; }
.quotation-policy-field.checkbox { display: flex; grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; min-height: 38px; }
.quotation-policy-field.checkbox input { width: 16px; min-height: 16px; margin: 0; }
.quotation-policy-note { grid-column: 1 / -1; margin: 2px 0 0; color: var(--color-warning-text); font-size: .61rem; line-height: 1.45; }
.quotation-result { align-self: start; position: sticky; top: 0; max-height: 100%; overflow: auto; }
.quotation-result-head { padding: 15px 16px; border-bottom: 1px solid var(--color-border-soft); }
.quotation-result-head h3 { margin: 4px 0 0; font-size: 1rem; }
.quotation-result-body { display: grid; gap: 14px; padding: 16px; }
.quotation-empty-result { min-height: 190px; padding: 24px 12px; color: var(--color-text-muted); text-align: center; font-size: .7rem; line-height: 1.55; }
.quotation-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--color-border-soft); border-radius: 8px; background: var(--color-border-soft); }
.quotation-kpi { padding: 12px; background: var(--color-surface); }
.quotation-kpi small, .quotation-kpi strong { display: block; }
.quotation-kpi small { color: var(--color-text-muted); font: 500 .56rem/1.3 var(--font-mono); text-transform: uppercase; }
.quotation-kpi strong { margin-top: 5px; font-size: .82rem; }
.quotation-kpi.primary { background: var(--color-primary-soft); }
.quotation-kpi.primary strong { color: var(--color-primary); font-size: 1.02rem; }
.quotation-tier-wrap { max-height: 260px; overflow: auto; border: 1px solid var(--color-border-soft); border-radius: 7px; }
.quotation-tier-table { width: 100%; border-collapse: collapse; }
.quotation-tier-table th, .quotation-tier-table td { padding: 7px 9px; border-bottom: 1px solid var(--color-border-soft); font-size: .62rem; text-align: left; }
.quotation-tier-table th { position: sticky; top: 0; background: var(--color-surface-muted); color: var(--color-text-muted); font: 600 .55rem/1.3 var(--font-mono); text-transform: uppercase; }
.quotation-tier-table td:last-child { text-align: right; font-weight: 700; }
.quotation-version-list { display: grid; gap: 5px; }
.quotation-version { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; align-items: center; width: 100%; padding: 8px 9px; border: 1px solid var(--color-border-soft); border-radius: 6px; background: var(--color-surface); text-align: left; }
.quotation-version:hover, .quotation-version.active { border-color: var(--color-primary); background: var(--color-primary-soft); }
.quotation-version strong, .quotation-version small { display: block; }
.quotation-version strong { font: 600 .62rem/1 var(--font-mono); }
.quotation-version small { margin-top: 3px; color: var(--color-text-muted); font-size: .59rem; }
.quotation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 13px 16px; border-top: 1px solid var(--color-border-soft); background: var(--color-surface-raised); }
.quotation-actions .secondary-button, .quotation-actions .primary-button { min-width: 0; }
.quotation-action-state { grid-column: 1 / -1; margin: 0; color: var(--color-text-muted); font-size: .61rem; line-height: 1.4; }

.providers-main { display: grid; grid-template-columns: minmax(500px, 1.15fr) minmax(330px, .85fr); min-width: 0; min-height: 0; overflow: hidden; background: var(--color-border-soft); }
.provider-browser, .provider-detail { min-width: 0; min-height: 0; overflow: hidden; background: var(--color-surface); }
.provider-browser { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.provider-searchbar { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(360px, 1.3fr); gap: 24px; align-items: end; padding: 19px 22px; border-bottom: 1px solid var(--color-border-soft); }
.provider-searchbar h2 { margin: 4px 0 0; font-size: 1.05rem; letter-spacing: -.03em; }
.provider-search-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.provider-search-controls label { display: grid; min-width: 0; gap: 5px; font: 600 .59rem/1.35 var(--font-mono); color: var(--color-text-muted); }
.provider-search-controls :is(input, select) { width: 100%; min-width: 0; min-height: 36px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 7px; background: var(--color-surface-raised); color: var(--color-text); font: .68rem/1.4 var(--font-sans); }
.provider-search-controls > small { grid-column: 1 / -1; color: var(--color-text-muted); font-size: .62rem; line-height: 1.4; }
.provider-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--color-border-soft); font-size: .68rem; }
.provider-offer-table { min-width: 790px; }
.provider-offer-header, .provider-row.provider-offer-row { display: grid; grid-template-columns: minmax(155px, 1.8fr) minmax(90px, 1fr) repeat(2, 90px) 65px repeat(3, 65px); gap: 8px; align-items: center; }
.provider-offer-header { padding: 10px 16px; font: 600 .6rem/1.4 var(--font-mono); color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); }
.provider-row.provider-offer-row { padding: 12px 16px; font-size: .68rem; }
.provider-offer-row > span { min-width: 0; overflow-wrap: anywhere; }
.provider-use { margin-top: 16px; display: grid; gap: 8px; }
.provider-search-controls .search { margin: 0; }
.provider-catalog-note { padding: 9px 22px; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface-muted); color: var(--color-text-muted); font-size: .63rem; }
.provider-list { display: grid; align-content: start; min-height: 0; overflow: auto; }
.provider-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(150px, .55fr) auto; gap: 14px; align-items: center; width: 100%; padding: 13px 22px; border: 0; border-bottom: 1px solid var(--color-border-soft); background: var(--color-surface); text-align: left; }
.provider-row:hover, .provider-row.active { background: var(--color-primary-soft); }
.provider-row.active { box-shadow: inset 3px 0 var(--color-primary); }
.provider-kind { color: var(--color-primary); font: 600 .58rem/1.3 var(--font-mono); text-transform: uppercase; }
.provider-row strong, .provider-row small { display: block; }
.provider-row strong { font-size: .75rem; }
.provider-row small { margin-top: 3px; color: var(--color-text-muted); font-size: .62rem; line-height: 1.4; }
.provider-source { color: var(--color-text-muted); font: 500 .57rem/1.35 var(--font-mono); }
.provider-detail { overflow: auto; border-left: 1px solid var(--color-border-soft); padding: 22px; }
.provider-detail-head { padding-bottom: 17px; border-bottom: 1px solid var(--color-border-soft); }
.provider-detail-head h2 { margin: 6px 0 5px; font-size: 1.3rem; letter-spacing: -.035em; }
.provider-detail-head p { margin: 0; color: var(--color-text-muted); font-size: .69rem; }
.provider-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; margin-top: 12px; }
.provider-detail .fact { min-width: 0; padding: 10px 0; }
.provider-detail .fact strong { overflow-wrap: anywhere; }
.provider-warning { margin-top: 16px; padding: 12px; border-left: 3px solid var(--color-accent); background: var(--color-accent-soft); color: var(--color-warning-text); font-size: .65rem; line-height: 1.5; }
.provider-provenance { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--color-border-soft); color: var(--color-text-muted); font: 500 .58rem/1.55 var(--font-mono); overflow-wrap: anywhere; }

/* Control */
.control-main { width: min(100%, 1540px); height: 100%; min-height: 0; margin: 0 auto; overflow: auto; padding: 20px clamp(22px, 3.2vw, 48px) 28px; }
.audit-main { display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: 100%; min-height: 0; overflow: hidden; padding: 20px clamp(22px, 3vw, 42px); }
.control-head { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; }
.control-head h2, .audit-head h2 { margin: 5px 0 0; font-size: clamp(1.5rem, 2.5vw, 2.3rem); letter-spacing: -.038em; }
.control-head p, .audit-head p { max-width: 560px; margin: 0; color: var(--color-text-muted); font-size: .8rem; line-height: 1.55; }
.simulation-stamp { display: grid; gap: 4px; justify-items: end; padding-left: 16px; border-left: 2px solid var(--color-brand-blue); }
.simulation-stamp strong { font: 600 .65rem/1 var(--font-mono); letter-spacing: .06em; }
.simulation-stamp span { color: var(--color-text-muted); font-size: .68rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 28px; overflow: hidden; border: 1px solid var(--color-border-soft); border-radius: var(--radius-md); background: var(--color-border-soft); }
.kpi-card { padding: 19px 20px; border: 0; border-radius: 0; background: var(--color-surface); box-shadow: none; }
.kpi-card strong { display: block; margin-top: 9px; font-size: 1.7rem; letter-spacing: -.05em; }
.kpi-card span:last-child { color: var(--color-text-muted); font-size: .68rem; }
.control-console { margin-top: 18px; padding: clamp(20px, 2.4vw, 30px); border: 1px solid var(--color-border-soft); border-radius: var(--radius-md); background: var(--color-surface); }
.console-head { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid var(--color-border-soft); }
.console-head h3 { margin: 4px 0 5px; font-size: 1.15rem; letter-spacing: -.035em; }
.console-head p { max-width: 680px; margin: 0; color: var(--color-text-muted); font-size: .73rem; line-height: 1.5; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; min-width: 330px; padding: 3px; border-radius: 8px; background: var(--color-surface-muted); }
.mode-button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--color-text-muted); font-size: .68rem; font-weight: 700; }
.mode-button:hover { color: var(--color-text); }
.mode-button.active { background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-sm); }
.control-console-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 28px; margin-top: 22px; }
.section-title-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; min-height: 28px; }
.operator-load-list { display: grid; margin-top: 8px; }
.load-row { display: grid; grid-template-columns: minmax(190px, .75fr) minmax(180px, 1fr) 150px; gap: 22px; align-items: center; padding: 16px 2px; border-bottom: 1px solid var(--color-border-soft); }
.load-row:last-child { border-bottom: 0; }
.load-row.unavailable { background: linear-gradient(90deg, color-mix(in srgb, var(--color-accent-soft) 72%, transparent), transparent 76%); }
.load-person { display: flex; gap: 11px; align-items: center; }
.load-person strong, .load-person small { display: block; }
.load-person strong { font-size: .75rem; }
.load-person small { margin-top: 4px; color: var(--color-text-muted); font-size: .62rem; }
.load-meter > div { display: flex; gap: 10px; align-items: center; justify-content: space-between; color: var(--color-text-muted); font-size: .62rem; }
.load-meter > div strong { color: var(--color-text); font: 600 .65rem/1 var(--font-mono); }
.load-track { display: block; height: 7px; margin-top: 7px; overflow: hidden; border-radius: 2px; background: var(--color-surface-muted); }
.load-track > span { display: block; height: 100%; border-radius: inherit; background: var(--color-primary); transition: width 180ms ease; }
.availability-field { display: grid; gap: 6px; }
.availability-field > span { color: var(--color-text-muted); font: 600 .58rem/1 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; }
.availability-field select { width: 100%; height: 38px; padding: 0 9px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-raised); color: var(--color-text); font-size: .68rem; }
.recommendation-panel { min-width: 0; padding-left: 24px; border-left: 1px solid var(--color-border-soft); }
.control-recommendations { display: grid; margin-top: 8px; }
.recommendation { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--color-border-soft); }
.recommendation:last-child { border-bottom: 0; }
.recommendation-mark { width: 8px; height: 8px; margin-top: 4px; border-radius: 2px; background: var(--color-accent); }
.recommendation.success .recommendation-mark { background: var(--color-primary); }
.recommendation.danger .recommendation-mark { background: var(--color-danger); }
.recommendation strong, .recommendation small { display: block; }
.recommendation strong { font-size: .72rem; }
.recommendation small { margin-top: 4px; color: var(--color-text-muted); font-size: .65rem; line-height: 1.5; }
.control-skeleton { display: grid; gap: 12px; padding: 16px 0; }
.control-skeleton span { display: block; height: 58px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--color-surface-muted), var(--color-current-soft), var(--color-surface-muted)); background-size: 220% 100%; animation: control-pulse 1.5s ease-in-out infinite; }
@keyframes control-pulse { to { background-position: -220% 0; } }
.territory-card { margin-top: 18px; overflow: hidden; border: 1px solid var(--color-border-soft); border-radius: var(--radius-md); background: var(--color-surface); }
.territory-head { align-items: flex-end; padding: 20px 22px; }
.territory-head h3 { margin-top: 4px; }
.territory-head > div:last-child { display: grid; gap: 7px; justify-items: end; }
.territory-head p { max-width: 480px; margin: 0; color: var(--color-text-muted); font-size: .66rem; text-align: right; }
.territory-map { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--color-border-soft); }
.territory-node { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; min-height: 104px; padding: 18px; background: var(--color-surface); }
.territory-index { color: var(--color-primary); font: 600 .62rem/1.4 var(--font-mono); }
.territory-node strong, .territory-node small { display: block; }
.territory-node strong { font-size: .72rem; }
.territory-node small { margin-top: 7px; color: var(--color-text-muted); font-size: .63rem; line-height: 1.5; }
.territory-note { margin: 0; padding: 11px 22px; border-top: 1px solid var(--color-border-soft); background: var(--color-primary-soft); color: var(--color-text-muted); font-size: .64rem; }
.control-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 340px); gap: 14px; margin-top: 14px; }
.table-card, .exceptions-card, .audit-card { overflow: hidden; border: 1px solid var(--color-border-soft); border-radius: var(--radius-md); background: var(--color-surface); }
.card-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 17px 18px; border-bottom: 1px solid var(--color-border-soft); }
.card-head h3 { margin: 0; font-size: .9rem; }
.table-scroll { overflow-x: auto; }
.request-table { width: 100%; border-collapse: collapse; font-size: .74rem; }
.request-table th { padding: 11px 15px; color: var(--color-text-muted); font: 600 .6rem/1 var(--font-mono); text-align: left; text-transform: uppercase; }
.request-table td { padding: 14px 15px; border-top: 1px solid var(--color-border-soft); }
.request-table tbody tr { transition: background .15s ease; }
.request-table tbody tr:hover { background: var(--color-surface-muted); cursor: pointer; }
.exception-list { display: grid; }
.exception-item { display: grid; grid-template-columns: auto 1fr; gap: 11px; padding: 16px 18px; border: 0; border-bottom: 1px solid var(--color-border-soft); background: transparent; text-align: left; }
.exception-item:hover { background: var(--color-surface-muted); }
.exception-mark { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--color-danger); }
.exception-mark.warning { background: var(--color-accent); }
.exception-item strong, .exception-item span { display: block; }
.exception-item strong { font-size: .74rem; }
.exception-item span { margin-top: 4px; color: var(--color-text-muted); font-size: .67rem; line-height: 1.45; }

/* Historial */
.audit-head { display: flex; gap: 24px; align-items: end; justify-content: space-between; }
.audit-filters { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.3fr) minmax(135px, .65fr) minmax(135px, .65fr) auto; align-items: end; gap: 12px; margin-top: 20px; }
.audit-filters label { display: grid; min-width: 0; gap: 6px; color: var(--color-text-muted); font-size: .72rem; }
.audit-filters :is(input, select) { width: 100%; min-width: 0; height: 40px; padding: 0 8px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); font: inherit; }
.event-copy small { display: block; margin-top: 6px; color: var(--color-text-muted); font: 500 .75rem/1.5 var(--font-sans); overflow-wrap: anywhere; }
#case-facts { align-content: start; }
#case-facts .fact span { display: block; margin-top: 6px; color: var(--color-text-muted); font-size: .7rem; }
.audit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; min-height: 0; margin-top: 24px; }
#view-audit .audit-card { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.timeline { display: grid; align-content: start; min-height: 0; overflow: auto; padding: 10px 22px 22px; }
#case-facts { min-height: 0; overflow: auto; }
.event { position: relative; display: grid; grid-template-columns: 104px 20px minmax(0, 1fr); gap: 12px; padding: 18px 0; }
.event:not(:last-child)::after { position: absolute; top: 40px; bottom: -20px; left: 125px; width: 1px; background: var(--color-border); content: ""; }
.event time { color: var(--color-text-muted); font: 500 .61rem/1.45 var(--font-mono); text-align: right; }
.event-dot { z-index: 1; width: 12px; height: 12px; margin-top: 2px; border: 3px solid var(--color-surface); border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.event.warning .event-dot { background: var(--color-accent); box-shadow: 0 0 0 1px var(--color-accent); }
.event.danger .event-dot { background: var(--color-danger); box-shadow: 0 0 0 1px var(--color-danger); }
.event-copy strong, .event-copy span { display: block; }
.event-copy strong { font-size: .78rem; }
.event-copy span { margin-top: 5px; color: var(--color-text-muted); font-size: .7rem; line-height: 1.5; }
.case-facts { display: grid; gap: 10px; padding: 18px; }
.fact { padding-bottom: 10px; border-bottom: 1px solid var(--color-border-soft); }
.fact:last-child { padding-bottom: 0; border-bottom: 0; }
.fact small, .fact strong { display: block; }
.fact small { color: var(--color-text-muted); font: 500 .6rem/1.3 var(--font-mono); text-transform: uppercase; }
.fact strong { margin-top: 5px; font-size: .74rem; }

.modal-backdrop { position: fixed; z-index: 1500; inset: 0; display: none; place-items: center; padding: 20px; background: rgba(5,12,22,.58); }
.modal-backdrop.open { display: grid; }
.modal { width: min(100%, 500px); padding: 24px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-lg); }
.modal h2 { margin: 4px 0 8px; font-size: 1.25rem; }
.modal > p { margin: 0 0 18px; color: var(--color-text-muted); font-size: .78rem; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.toast { position: fixed; z-index: 2000; right: 22px; bottom: 22px; max-width: 380px; padding: 13px 16px; border: 1px solid var(--color-primary); border-radius: var(--radius-md); background: var(--color-surface-raised); box-shadow: var(--shadow-md); font-size: .76rem; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 180ms ease, transform 180ms cubic-bezier(.23,1,.32,1); }
.toast.show { opacity: 1; transform: translateY(0); }
.empty-state { display: grid; min-height: 260px; padding: 32px; place-items: center; color: var(--color-text-muted); text-align: center; }
.empty-state strong { display: block; color: var(--color-text); }

@media (max-width: 1260px) {
  .audit-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .application-body { grid-template-columns: 72px minmax(0, 1fr); }
  .app-nav { padding-inline: 9px; }
  .nav-label, .nav-copy, .demo-note, .nav-session { display: none; }
  .nav-button { grid-template-columns: 1fr; justify-items: center; padding: 6px; }
  .inbox-workspace { grid-template-columns: 280px minmax(380px, 1fr); overflow: auto; }
  .inbox-workspace > .workspace-splitter { display: none; }
  .queue-panel, .email-panel { border-right: 1px solid var(--color-border-soft); }
  .decision-panel { grid-column: 1 / -1; max-height: none; border-top: 1px solid var(--color-border-soft); }
  .decision-scroll { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(420px, 1.2fr); gap: 18px; }
  .decision-scroll .field-group { margin-top: 0; }
  .control-grid { grid-template-columns: 1fr; }
  .control-console-grid { grid-template-columns: 1fr; }
  .recommendation-panel { padding: 20px 0 0; border-top: 1px solid var(--color-border-soft); border-left: 0; }
  .territory-map { grid-template-columns: repeat(2, 1fr); }
  .operator-workspace { grid-template-columns: minmax(220px, var(--operator-queue-width, 260px)) 10px minmax(320px, 1fr) 10px minmax(320px, var(--operator-compose-width, 390px)); }
  .operator-heading-actions { flex-wrap: wrap; }
  .operator-area-switch { min-width: 280px; }
  .quotation-board { grid-template-columns: minmax(0, 1fr) 290px; }
  .operator-case-grid { grid-template-columns: 1fr; }
  .operator-section.full { grid-column: auto; }
  .operator-action-grid { grid-template-columns: 1fr; }
  .composer-row { grid-template-columns: 1fr; }
  .composer-recipients { grid-template-columns: 1fr; }
}

@media (max-width: 1040px) {
  #view-operator.active { overflow: auto; }
  .operator-workspace { display: block; height: auto; overflow: visible; background: var(--color-surface-muted); }
  .operator-workspace > .workspace-splitter { display: none; }
  .operator-queue { height: 320px; border-bottom: 1px solid var(--color-border-soft); }
  .operator-case { height: min(720px, 78dvh); min-height: 560px; border-bottom: 1px solid var(--color-border-soft); }
  .operator-composer { height: min(760px, 82dvh); min-height: 620px; }
  .quotation-workspace { min-height: 720px; }
  .quotation-board { grid-template-columns: 1fr; height: auto; }
  .quotation-editor, .quotation-result { max-height: none; }
  .quotation-result { position: static; }
  .providers-main { grid-template-columns: minmax(420px, 1.1fr) minmax(300px, .9fr); }
  .provider-searchbar { grid-template-columns: 1fr; gap: 12px; }
  .composer-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  html, body { height: auto; }
  body { overflow: auto; }
  .viewport-stage { padding: 0; }
  .app-shell { display: block; height: auto; min-height: 100dvh; }
  .appbar { min-height: 72px; padding: 0 14px; }
  .case-line { display: none; }
  .environment-label, .context-label { font-size: .61rem; }
  .application-body { display: block; }
  .view-stack { overflow: visible; }
  .app-view { height: auto; min-height: 0; overflow: visible; }
  .app-view.active, #view-operator.active, #view-control.active { display: block; }
  .app-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: sticky; z-index: 20; top: 0; overflow: visible; padding: 7px; }
  .nav-button { min-height: 48px; }
  .nav-code { display: none; }
  .nav-copy { display: block; text-align: center; }
  .nav-copy strong { font-size: .66rem; }
  .nav-copy small { display: none; }
  .nav-spacer, .nav-session { display: none; }
  .view-heading { grid-template-columns: 1fr; gap: 10px; padding: 22px 16px; }
  .inbox-workspace, .operator-workspace { display: block; width: auto; height: auto; overflow: visible; }
  .workspace-splitter { display: none; }
  .queue-panel, .email-panel, .decision-panel { height: auto; max-height: none; overflow: visible; border: 0; border-bottom: 1px solid var(--color-border-soft); }
  .queue-panel, .operator-queue { display: block; }
  .queue-list { max-height: 310px; }
  .request-top { align-items: flex-start; flex-wrap: wrap; }
  .request-top .status-pill { max-width: 100%; }
  .email-body { max-height: 390px; padding: 22px 18px; }
  .mail-viewer { display: block; overflow: visible; }
  .assignment-mail-view { height: auto; min-height: 520px; margin: 8px; overflow: visible; }
  #assignment-tab-reading.active, #assignment-tab-original.active { display: block; }
  #assignment-tab-reading .thread-mail-frame, #assignment-tab-original .thread-mail-frame { height: 520px; }
  #assignment-tab-attachments.active { display: grid; grid-template-columns: 1fr; }
  .attachment-browser { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--color-border-soft); }
  .attachment-preview { min-height: 420px; }
  .mail-headers { max-height: 150px; }
  .mail-frame { height: 520px; min-height: 360px; }
  .mail-attachments { flex-wrap: wrap; overflow: visible; }
  .decision-scroll { display: block; }
  .decision-scroll .field-group { margin-top: 19px; }
  .step { flex: 0 0 auto; grid-template-columns: 28px auto; padding: 8px; }
  .control-head, .audit-head { display: block; }
  .control-head p, .audit-head p { margin-top: 10px; }
  .operator-identity { justify-self: stretch; }
  .operator-heading-actions { display: grid; gap: 10px; justify-content: stretch; }
  .operator-area-switch { min-width: 0; width: 100%; }
  .operator-queue { height: auto; min-height: 0; overflow: visible; border-right: 0; border-bottom: 1px solid var(--color-border-soft); }
  .operator-queue .queue-list { max-height: 310px; }
  .operator-case { display: block; height: auto; min-height: 0; overflow: visible; padding: 0; }
  .operator-case-head { display: block; }
  .operator-case-head .status-pill { margin-top: 12px; }
  .operator-thread { max-height: none; overflow: visible; padding: 16px 14px 22px; }
  #operator-thread .thread-card-body { max-height: none; overflow: visible; }
  .thread-card .mail-frame { height: 480px; }
  .thread-card > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .thread-card > summary::after { grid-column: 2; grid-row: 1; }
  .thread-direction { justify-self: start; }
  .thread-summary-copy { grid-column: 1 / -1; }
  .thread-time { grid-column: 1; }
  .case-details { max-height: none; overflow: visible; }
  .case-details > summary { position: static; }
  .operator-composer { display: block; height: auto; min-height: 0; overflow: visible; }
  .quotation-workspace { display: block; min-height: 0; overflow: visible; }
  .quotation-head { display: grid; padding: 16px 14px; }
  .quotation-policy-summary { justify-content: flex-start; }
  .quotation-content { overflow: visible; padding: 12px; }
  .quotation-board { display: grid; grid-template-columns: 1fr; }
  .quotation-fields, .quotation-settings { grid-template-columns: 1fr; }
  .quotation-result { position: static; }
  .composer-scroll, .composer-preview { overflow: visible; padding: 18px 14px 24px; }
  .composer-preview { min-height: 560px; padding: 0; }
  .composer-preview .mail-frame { height: 560px; }
  .composer-actions { position: sticky; z-index: 8; bottom: 0; }
  .providers-main { display: block; overflow: visible; }
  .provider-browser, .provider-detail { overflow: visible; }
  .provider-list { max-height: 460px; overflow: auto; }
  .provider-detail { border-top: 1px solid var(--color-border-soft); border-left: 0; }
  .provider-searchbar { grid-template-columns: 1fr; gap: 12px; padding: 16px 14px; }
  .control-main, .audit-main { display: block; height: auto; overflow: visible; padding: 22px 14px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .console-head { display: grid; }
  .mode-switch { min-width: 0; width: 100%; }
  .load-row { grid-template-columns: minmax(0, 1fr) 130px; gap: 14px; }
  .load-meter { grid-column: 1 / -1; grid-row: 2; }
  .territory-head { display: grid; align-items: start; }
  .territory-head > div:last-child { justify-items: start; }
  .territory-head p { text-align: left; }
  .request-table { min-width: 680px; }
  .audit-grid { grid-template-columns: 1fr; }
  #view-audit .audit-card { display: block; }
  .timeline, #case-facts { overflow: visible; }
  .event { grid-template-columns: 72px 16px minmax(0,1fr); gap: 8px; }
  .event:not(:last-child)::after { left: 87px; }
}

@media (max-width: 480px) {
  .appbar { gap: 8px; padding-inline: 12px; }
  .brand-copy { display: none; }
  .appbar-actions > .environment-label { display: none; }
  .profile-button { grid-template-columns: 32px 14px; min-width: 0; min-height: 44px; padding: 5px 7px; }
  .profile-button .profile-copy { display: none; }
  .profile-avatar { width: 32px; height: 32px; }
  .profile-menu { position: fixed; top: 60px; right: 8px; left: 8px; width: auto; }
  .appbar-actions .secondary-button { display: none; }
  .app-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .nav-copy strong { font-size: .58rem; }
  .nav-button { min-width: 0; }
  .field-grid, .form-grid { grid-template-columns: 1fr; }
  .technical-sheet { grid-template-columns: 1fr; }
  .request-top { display: grid; justify-content: stretch; }
  .request-top .status-pill { justify-self: start; }
  .form-field.full, .rule-box { grid-column: auto; }
  .decision-actions { grid-template-columns: 1fr; }
  .decision-actions .primary-button { grid-column: auto; }
  .modal-actions { display: grid; }
  .kpi-grid { grid-template-columns: 1fr; }
  .control-main { padding-inline: 10px; }
  .control-console { padding: 18px 14px; }
  .mode-switch { grid-template-columns: 1fr; }
  .load-row { grid-template-columns: 1fr; gap: 10px; }
  .load-meter { grid-column: auto; grid-row: auto; }
  .availability-field { width: 100%; }
  .territory-map { grid-template-columns: 1fr; }
  .territory-node { min-height: 0; }
  .operator-section .case-facts { grid-template-columns: 1fr; }
  .composer-row { grid-template-columns: 1fr; }
  .supplement-fields, .quotation-policy-grid, .quotation-actions, .quotation-kpis { grid-template-columns: 1fr; }
  .quotation-action-state, .quotation-policy-field.checkbox, .supplement-fields label:first-child { grid-column: auto; }
  .quotation-form { padding: 12px; }
  .quotation-toolbar { align-items: stretch; flex-direction: column; }
  .quotation-toolbar .secondary-button { width: 100%; }
  .provider-search-controls, .provider-detail-grid { grid-template-columns: 1fr; }
  .provider-row { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 10px; padding: 12px 14px; }
  .provider-row .provider-source, .provider-row .status-pill { grid-column: 2; justify-self: start; }
  .composer-actions { grid-template-columns: 1fr; }
  .composer-actions .primary-button { width: 100%; }
  .case-details > .case-facts { grid-template-columns: 1fr; }
  .composer-action-buttons, .agency-response-actions { display: grid; grid-template-columns: 1fr; }
  .thread-message { grid-template-columns: 1fr; }
  .thread-message > small, .thread-message > p { grid-column: auto; }
  .toast { right: 12px; bottom: 12px; left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .control-skeleton span { animation: none; }
}

@media print {
  body { background: #fff; }
  .viewport-stage { max-width: none; padding: 0; }
  .workspace-splitter { display: none; }
  .app-shell { box-shadow: none; }
  .app-nav, .appbar-actions, button { display: none !important; }
  .application-body { display: block; }
}
.source-pdf-pages { display: grid; gap: 16px; margin-top: 12px; }
.source-pdf-page { display: block; max-width: 100%; height: auto; background: white; border: 1px solid #d5dfe5; }
.source-html-frame { width: 100%; min-height: 520px; margin-top: 12px; border: 1px solid #d5dfe5; background: white; }
.attachment-download { display: inline-flex; margin-bottom: 12px; }
.provider-zone-heading { text-align: left; background: #eaf0f3; color: #244355; padding: 10px 12px; }
.provider-zone-heading small { display: block; font-size: 12px; font-weight: 400; margin-top: 3px; }
.quote-rate-preview { padding: 14px; border: 1px solid #d5dfe5; border-radius: 8px; margin-top: 12px; }
.quote-rate-preview label { display: grid; gap: 5px; max-width: 160px; }
