.workspace-tools { display:flex; align-items:center; gap:12px; min-height:44px; padding:6px 16px; background:#fff; border-bottom:1px solid var(--line); position:relative; z-index:15; }
.workspace-tools button { display:inline-flex; align-items:center; justify-content:center; gap:8px; border:1px solid #deded6; border-radius:20px; padding:6px 10px; min-height:30px; background:#fff; color:#24251f; font:600 11px/16px Manrope,system-ui,sans-serif; cursor:pointer; }
.window-menu-wrap { margin-left:auto; position:relative; }
.window-menu { position:absolute; right:0; top:38px; width:280px; max-width:calc(100vw - 32px); max-height:65dvh; overflow:auto; padding:12px; background:white; border:1px solid #deded6; border-radius:10px; box-shadow:0 8px 32px #0003; }
.window-menu label { display:flex; align-items:center; gap:10px; padding:8px 4px; font-size:12px; cursor:pointer; }
.window-menu input { width:16px; height:16px; min-height:16px; margin:0; accent-color:#d9ad00; }
.window-menu button { width:100%; margin-top:8px; }
.window-canvas { position:relative; display:block; min-width:0; height:calc(100dvh - 220px); min-height:420px; isolation:isolate; }
.app-window { position:absolute; margin:0; padding:0; min-width:0; display:flex; flex-direction:column; border-radius:12px; overflow:clip; box-shadow:0 3px 14px #26302107; }
.app-window.window-closed { display:none !important; }
.app-window.window-maximized { inset:0 !important; width:100% !important; height:100% !important; z-index:10000 !important; }
.window-header { display:flex; align-items:center; gap:8px; padding:10px 12px; min-height:42px; flex-shrink:0; background:#fff; border-bottom:1px solid #eeeee8; cursor:grab; touch-action:none; user-select:none; }
.window-header:active { cursor:grabbing; }
.window-header h2 { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; line-height:18px; margin:0; }
.window-grip { width:8px; height:16px; background:radial-gradient(circle,#a5a79b 1px,transparent 1.5px) 0 0/4px 4px; flex-shrink:0; }
.window-header button { flex-shrink:0; border:0; background:transparent; min-height:24px; padding:4px; color:#85877b; border-radius:4px; }
.window-header button:hover { color:#171815; background:#f2f2ed; }
.window-header button .icon { width:13px; height:13px; }
.window-body { flex:1; min-height:0; overflow:auto; padding:16px; scrollbar-width:thin; }
.window-body > h2 { margin-top:0; }
.window-body .section-details > summary { font-size:12px; }
.window-resize { position:absolute; bottom:0; right:0; width:18px; height:18px; min-height:18px !important; padding:0 !important; background:linear-gradient(135deg,transparent 45%,#b5b6aa 46%,#b5b6aa 50%,transparent 51%,transparent 60%,#b5b6aa 61%,#b5b6aa 65%,transparent 66%) !important; border:0 !important; border-radius:0 !important; cursor:nwse-resize !important; touch-action:none; }
.window-resize:not(.resize-se) { background:transparent !important; }
.window-resize.resize-e,.window-resize.resize-w { top:18px; bottom:18px; width:6px; height:auto; cursor:ew-resize !important; }
.window-resize.resize-w { left:0; right:auto; }
.window-resize.resize-n,.window-resize.resize-s { left:18px; right:18px; width:auto; height:6px; min-height:6px !important; cursor:ns-resize !important; }
.window-resize.resize-n { top:0; bottom:auto; }
.window-resize.resize-ne { top:0; bottom:auto; cursor:nesw-resize !important; }
.window-resize.resize-nw { top:0; bottom:auto; left:0; right:auto; }
.window-resize.resize-sw { left:0; right:auto; cursor:nesw-resize !important; }
.window-maximized > .window-resize { display:none; }
.sidebar-brand-row { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; min-width:0; }
.sidebar-brand-row .brand { flex:1; min-width:0; margin:0; font-size:20px; gap:8px; }
.sidebar-brand-row .brand svg { width:30px; height:30px; }
#sidebarToggle { display:grid; place-items:center; flex-shrink:0; width:36px; height:36px; min-height:36px; padding:8px; border:1px solid #4c5664; border-radius:10px; color:#edf0f4; background:#242a33; cursor:pointer; }
#sidebarToggle:hover { background:#363d2e; border-color:#697854; color:#fff; }
#sidebarToggle:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
#sidebarToggle .icon { width:18px; height:18px; }
.app-nav { top:128px; scrollbar-width:none; }
.app-nav::-webkit-scrollbar { display:none; }
.sidebar-resize { position:absolute; right:0; top:0; bottom:0; width:6px; min-height:0 !important; padding:0 !important; border:0 !important; border-radius:0 !important; background:transparent !important; cursor:ew-resize; touch-action:none; z-index:22; }
.sidebar-resize:hover,.sidebar-resize:focus-visible { background:var(--accent) !important; }
.app-header > .sidebar-resize { right:-6px; }
.inbox-list { position:relative; }
.sidebar-collapsed .app-header > .sidebar-resize { display:none; }
.sidebar-resizing body,.sidebar-resizing body > .app-header,.sidebar-resizing .app-nav { transition:none !important; }
.window-body #attachmentPreview { display:block; border:1px solid #e7e7df; width:100%; height:380px; background:#f6f6f0; margin-bottom:12px; }
.window-body #attachmentPreview[hidden] { display:none; }
.window-body .message-footer { margin-top:16px; }
.window-body pre { max-height:none; }
.window-body .specification-panel { min-height:0; }
.document-workspace .window-body .grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.document-workspace .window-body .row { gap:8px; }
.document-workspace .window-body #actions > button { flex:1 1 120px; }
.inbox-work.window-canvas { height:calc(100dvh - 136px); min-height:420px; }
.inbox-page .inbox-list { min-height:calc(100dvh - 136px); }
.inbox-page .message-panel { min-height:0; }
.app-window.specification-panel { min-height:0; }
.editor-page #tbl { min-width:760px; width:100%; }
.editor-page #tbl > thead > tr > th { font-size:9px; padding:10px 6px; }
.editor-page #tbl > tbody > tr > td { font-size:11px; padding:10px 6px; }
.editor-page #tbl .product-cell { width:32%; min-width:180px; }
.editor-page #tbl .product-fields { width:100%; min-width:0; border:0; border-collapse:collapse; margin:0; }
.editor-page #tbl .product-fields td,.editor-page #tbl .product-fields th { border:0; padding:2px 0; min-width:0; max-width:240px; background:transparent; text-align:left; font-size:10px; overflow-wrap:anywhere; }
.editor-page #tbl .product-fields > tbody > tr > td[contenteditable] { font-weight:600; }
.editor-page #tbl .product-fields input { width:100%; min-width:0; text-align:left; font-size:10px; min-height:24px; padding:2px 6px; border-color:#e8e8e0; }
.editor-page #tbl .product-fields th { width:76px; padding-right:8px; white-space:normal; }
.product-details { margin-top:4px; }
.product-details > summary { font-size:9px; color:#888a7d; cursor:pointer; }
.editor-page #tbl > tbody > tr > td > input { width:64px; font-size:11px; padding:4px; }
.editor-page #tbl .controls { white-space:normal !important; width:64px; }
.editor-page #tbl .controls button { min-height:24px; padding:4px; font-size:9px; }
.editor-page #tbl .controls .icon { width:12px; height:12px; }
.editor-page #tbl .amount { font-weight:700; white-space:nowrap; }
.editor-page #tbl .price-explanation { white-space:normal; min-width:0; font-size:10px; }
.editor-page #tbl .product-details .imgcell img { max-width:100%; }
.editor-page main { margin-bottom:0; min-height:calc(100dvh - 44px); padding-bottom:12px; }
.window-body .section-heading:empty { display:none; }
.window-canvas.window-narrow { display:flex; flex-direction:column; height:auto !important; min-height:0; gap:12px; }
.window-narrow > .app-window,.window-narrow > .app-window.window-maximized { position:relative; inset:auto !important; width:100% !important; height:auto !important; min-height:0; max-height:none; }
.window-narrow .window-header { cursor:default; touch-action:auto; }
.window-narrow .window-body { max-height:70dvh; }
.window-narrow .window-resize { display:none; }
@media (min-width:701px) {
  html:not(.sidebar-collapsed) .app-nav { width:var(--sidebar); }
  .inbox-page .inbox-list { height:var(--inbox-panel-height,calc(100dvh - 88px)); min-height:0; display:flex; flex-direction:column; }
  .inbox-page .message-list { flex:1; overflow:auto; min-height:0; scrollbar-width:thin; }
}
.sidebar-collapsed { --sidebar:68px; }
.brand { overflow:hidden; }
.brand svg { flex-shrink:0; }
.brand > span,.app-nav a > span { display:block; max-width:180px; opacity:1; overflow:hidden; white-space:nowrap; }
.workspace-label { max-height:40px; overflow:hidden; opacity:1; }
#hUser > span { max-height:80px; opacity:1; }
.sidebar-collapsed .app-header { padding:24px 16px 16px; }
.sidebar-collapsed .sidebar-brand-row { flex-direction:column; gap:10px; }
.sidebar-collapsed .sidebar-brand-row .brand { flex:none; }
.sidebar-collapsed .brand > span,.sidebar-collapsed .app-nav a > span { max-width:0; opacity:0; }
.sidebar-collapsed .brand,.sidebar-collapsed .app-nav a { gap:0; }
.sidebar-collapsed .workspace-label { max-height:0; opacity:0; margin:0; }
.sidebar-collapsed #hUser > span { max-height:0; opacity:0; }
.sidebar-collapsed .app-nav { top:124px; padding:0 8px; }
.sidebar-collapsed .app-nav a { padding:12px 16px; }
.sidebar-collapsed #hUser { align-items:center; }
.sidebar-collapsed #hUser .hbtn { padding:4px; font-size:9px; }
.motion-ready body { transition:padding-left 320ms cubic-bezier(.22,.8,.2,1); }
.motion-ready body > .app-header { transition:width 320ms cubic-bezier(.22,.8,.2,1),padding 320ms cubic-bezier(.22,.8,.2,1); }
.motion-ready .app-nav { transition:width 320ms cubic-bezier(.22,.8,.2,1),top 320ms cubic-bezier(.22,.8,.2,1),padding 320ms cubic-bezier(.22,.8,.2,1); }
.motion-ready .brand,.motion-ready .app-nav a { transition:gap 320ms cubic-bezier(.22,.8,.2,1),padding 320ms cubic-bezier(.22,.8,.2,1),background-color 160ms; }
.motion-ready .brand > span,.motion-ready .app-nav a > span { transition:max-width 320ms cubic-bezier(.22,.8,.2,1),opacity 160ms; }
.motion-ready .workspace-label,.motion-ready #hUser > span { transition:max-height 320ms cubic-bezier(.22,.8,.2,1),margin 320ms cubic-bezier(.22,.8,.2,1),opacity 160ms; }
.cards .card { transition:transform 180ms ease,box-shadow 180ms ease; }
.app-window.window-moving { box-shadow:0 16px 40px #26302126; opacity:.93; cursor:grabbing; }
.app-window.window-resizing { border-color:#d3b84b; box-shadow:0 0 0 2px #e8cf6c40; }
.window-drop-preview { position:absolute; z-index:20000; pointer-events:none; border:2px solid #d8b329; border-radius:12px; background:#fff5c4d9; display:grid; place-items:center; padding:20px; color:#675215; font-size:12px; font-weight:600; text-align:center; backdrop-filter:blur(2px); }
.window-header:hover .window-grip { background:radial-gradient(circle,#9d873b 1px,transparent 1.5px) 0 0/4px 4px; }
@media (max-width:1000px) {
  .window-canvas,.inbox-work.window-canvas { display:flex; flex-direction:column; height:auto !important; min-height:0; gap:12px; }
  .app-window,.app-window.window-maximized { position:relative; inset:auto !important; width:100% !important; height:auto !important; min-height:0; max-height:none; }
  .window-header { cursor:default; touch-action:auto; }
  .window-body { max-height:70dvh; }
  .window-resize { display:none; }
  .window-body #attachmentPreview { height:340px; }
  .inbox-page main { grid-template-columns:min(var(--inbox-width,240px),45%) minmax(0,1fr); }
}
@media (max-width:700px) {
  .review-table { min-width:0; table-layout:auto; }
  .review-table thead { display:none; }
  .review-table :is(tbody,tr,td) { display:block; width:100%; }
  .review-table tr { padding:8px 0; border-bottom:1px solid var(--line); }
  .review-table td { border:0; }
  .review-table td::before { content:attr(data-label); display:block; margin-bottom:8px; font-weight:700; color:var(--muted); }
  .sidebar-brand-row,.sidebar-collapsed .sidebar-brand-row { flex:1; width:auto; flex-direction:row; gap:8px; }
  .sidebar-brand-row .brand,.sidebar-collapsed .sidebar-brand-row .brand { flex:1; font-size:18px; gap:6px; }
  .sidebar-brand-row .brand svg { width:26px; height:26px; }
  .sidebar-resize { display:none; }
  .app-nav { top:auto; }
  .inbox-page .inbox-list { min-height:0; height:auto; }
  .workspace-tools { padding:8px 12px; }
  .sidebar-collapsed .app-header { padding:12px 16px; }
  .sidebar-collapsed .brand > span,.sidebar-collapsed #hUser > span { max-width:180px; max-height:80px; opacity:1; }
  .sidebar-collapsed .brand { gap:10px; }
  .sidebar-collapsed .brand { font-size:20px; }
  .app-nav { max-height:100px; opacity:1; }
  .sidebar-collapsed .app-nav { top:auto; display:flex; max-height:0; opacity:0; padding:0 8px; pointer-events:none; }
  .sidebar-collapsed .app-nav a > span { max-width:180px; opacity:1; }
  .motion-ready .app-nav { transition:max-height 280ms cubic-bezier(.22,.8,.2,1),padding 280ms cubic-bezier(.22,.8,.2,1),opacity 160ms; }
  .sidebar-collapsed #hUser { align-items:flex-end; }
  .sidebar-collapsed #hUser .hbtn { padding:2px 8px; font-size:10px; }
  .window-body { padding:12px; max-height:none; }
  .window-header { padding:10px; }
  .window-header h2 { font-size:11px; }
  .document-workspace .window-body .grid { grid-template-columns:1fr; }
  .window-canvas,.inbox-work.window-canvas { gap:8px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { transition:none !important; animation:none !important; scroll-behavior:auto !important; }
}

/* Stable controls and readable content in both themes. */
.operation-toast { position:fixed; z-index:20000; right:16px; bottom:16px; max-width:calc(100vw - 32px); display:flex; align-items:center; gap:12px; padding:14px 18px; border:1px solid var(--line); border-radius:10px; background:var(--paper); color:var(--ink); box-shadow:0 6px 24px #0002; pointer-events:none; }
.operation-spinner { width:20px; height:20px; border:2px solid var(--line); border-top-color:var(--accent); border-radius:50%; flex-shrink:0; animation:operation-spin 900ms linear infinite; }
@keyframes operation-spin { to { transform:rotate(360deg); } }
.editor-loading { position:fixed; inset:0; z-index:19000; display:grid; grid-template-columns:minmax(0,1fr); place-items:center; padding:16px; background:color-mix(in srgb,var(--paper) 78%,transparent); backdrop-filter:blur(3px); }
.editor-loading[hidden] { display:none; }
.editor-loading-card { display:flex; align-items:center; gap:18px; width:400px; max-width:100%; padding:24px; border:1px solid var(--line); border-radius:14px; background:var(--paper); color:var(--ink); box-shadow:0 12px 48px #0002; }
.editor-loading-card .operation-spinner { width:36px; height:36px; border-width:3px; }
.editor-loading-card > div { min-width:0; overflow-wrap:anywhere; }
.editor-loading-card strong { display:block; min-height:3em; font-size:16px; line-height:1.5; }
.editor-loading-card p { margin:6px 0 0; min-height:3em; font-size:13px; line-height:1.5; color:var(--muted); }
@media (prefers-reduced-motion:reduce) { .operation-spinner { animation:none; } }
.workspace-tools { position:relative; margin-left:auto; width:auto; background:transparent; border:0; min-height:32px; padding:0; flex-shrink:0; }
.workspace-notification-slot:empty { display:none; }
.workspace-notification-slot:has(.mail-notifications[hidden]) { display:none; }
.workspace-tools:not(:has(.window-menu-wrap)):not(:has(.mail-notifications:not([hidden]))) { display:none; }
.page-heading { padding:16px 12px; }
.page-heading > div:first-child { min-width:0; }
.cards > button.card { display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:12px; padding:10px 16px; min-height:54px; }
.cards > button.card b,.cards > button.card.attn b { margin:0; font-size:24px; line-height:30px; flex-shrink:0; }
.cards > button.card span { font-size:11px; line-height:16px; }
.app-nav a > span { white-space:normal; overflow-wrap:normal; min-width:0; }
.sidebar-collapsed .app-nav a > span { white-space:nowrap; }
.cards .card:hover { transform:none; }
.inbox-stats > button { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:4px; }
.inbox-stats > button b,.inbox-filters #filterAll { white-space:nowrap; overflow-wrap:normal; flex-shrink:0; }
.inbox-stats > button b { font-size:26px; line-height:30px; }
.inbox-filters button { display:flex; justify-content:center; align-items:center; gap:4px; flex-wrap:nowrap; }
html { overflow-anchor:none; }
main,.window-body,.table-scroll { min-width:0; }
.window-body,.review-scroll { scrollbar-gutter:stable; overscroll-behavior:contain; }
button:enabled:active,.btn:active { transform:none; }
.btn,main button { white-space:normal; overflow-wrap:anywhere; text-align:center; }
.btn:not(.window-resize),main button:not(.window-resize) { font-weight:600; }
button.card { width:100%; text-align:left; color:var(--ink); border:1px solid var(--line); cursor:pointer; }
button.card[aria-pressed=true],.inbox-stats > button[aria-pressed=true] { outline:2px solid var(--accent); outline-offset:-2px; }
.inbox-stats > button { background:#e4eee6; padding:12px; border:1px solid transparent; border-radius:7px; text-align:left; color:#232a24; min-width:0; }
.inbox-stats > button:first-child { background:#171815; color:white; }
.inbox-stats > button:last-child { background:#fff0d4; }
.inbox-result { position:fixed; z-index:20000; right:16px; bottom:16px; max-width:calc(100vw - 32px); margin:0; padding:12px 16px; border:1px solid var(--line); border-radius:10px; background:var(--paper); color:var(--ink); box-shadow:0 6px 24px #0002; }
.inbox-result:empty { display:none; }
.inbox-page main { padding:12px; grid-template-rows:auto 1fr; }
.inbox-page .page-heading { margin:-12px -12px 0; min-height:64px; }
.inbox-page .inbox-list { border-radius:12px; }
.inbox-filters { align-items:stretch; }
.inbox-filters button { min-width:0; flex:1 1 85px; }
.archive-filter { margin:8px 0; }
#mailFolder { width:100%; margin:0 0 8px; }
.intake-address { min-height:40px; overflow-wrap:anywhere; }
#build { min-width:148px; }
#clarificationOption { margin-top:12px; font-size:12px; }
.mail-folder-tools { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; margin:12px 0; align-items:stretch; }
.mail-folder-tools label { grid-column:1/-1; }
#detail .mail-folder-tools input { min-width:0; width:100%; margin:0; }
.mail-attention { color:#8a4c06; font-weight:700; }
#body { width:100%; min-height:220px; resize:vertical; white-space:pre-wrap; overflow-wrap:anywhere; }
#sourceBody { white-space:pre-wrap; overflow-wrap:anywhere; }
#subject,#sender,.fld,.message-copy,.window-body p { overflow-wrap:anywhere; }
.actions-panel #actions { display:flex; flex-direction:column; align-items:stretch; gap:8px; }
.document-workspace .window-body #actions > :is(button,a) { flex:none; width:100%; min-width:0; min-height:36px; padding:8px 12px; height:auto; margin:0; border-radius:7px; }
.actions-panel #actions > button.primary { order:-1; }
#status,#msg,#progress { min-height:24px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.totals b,.cards b,.inbox-stats b { font-variant-numeric:tabular-nums; }
.sidebar-footer { order:3; margin-top:auto; padding-top:16px; border-top:1px solid #30312b; display:grid; grid-template-columns:minmax(0,1fr) 32px auto; align-items:center; gap:8px 6px; }
.sidebar-footer #hUser { display:contents; }
.sidebar-footer #hUser > span { grid-column:1/-1; grid-row:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12px; line-height:20px; }
.sidebar-footer #hUser > button { grid-column:3; grid-row:2; }
.sidebar-footer .hbtn { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:32px; min-width:0; padding:4px 8px; font-size:11px; white-space:nowrap; }
.language-menu { grid-column:1; grid-row:2; position:relative; min-width:0; }
#languageToggle { width:100%; }
#languageToggle .icon { width:16px; height:16px; flex-shrink:0; }
#languageToggle .icon,.theme-toggle .icon { fill:none; }
.language-options { position:absolute; bottom:40px; left:0; z-index:30; width:200px; padding:12px; border:1px solid #454a3f; border-radius:10px; background:#252920; color:#fff; box-shadow:0 6px 24px #0003; }
.language-options label { display:block; margin-bottom:8px; font-size:12px; }
.language-options select { width:100%; min-height:36px; color:#fff; background:#171815; border-color:#454a3f; font-size:12px; }
.sidebar-footer .theme-toggle { grid-column:2; grid-row:2; width:32px; padding:6px; border-color:transparent; background:transparent; }
.theme-toggle .icon { width:20px; height:20px; }
.theme-toggle[aria-pressed=true] { color:var(--accent); }
.sidebar-footer .hbtn:hover { background:#30382a; border-color:#626c56; }
.sidebar-footer .hbtn:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.request-review { margin:0 0 16px; padding:12px; border:1px solid var(--line); border-radius:8px; background:var(--paper); }
.request-review > summary { font-weight:700; cursor:pointer; }
.review-tools { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.review-tools > :is(select,button) { min-width:0; flex:1 1 180px; }
.review-mismatch { padding:12px; border:1px solid #b54b3b; background:#fff0ed; color:#8d3026; border-radius:8px; }
.review-table details pre { max-height:260px; max-width:100%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; font-size:10px; }
.review-table td > button { width:100%; margin-top:8px; }
.review-description_only,.review-not_supplied { background:#f0eef9; color:#59447c; }
.request-review > select { margin:0 0 8px; max-width:100%; }
.review-scroll { max-height:340px; overflow:auto; margin-top:8px; }
.review-table { min-width:650px; table-layout:fixed; width:100%; }
.review-table th,.review-table td { width:33.333%; white-space:normal; overflow-wrap:anywhere; vertical-align:top; padding:10px; }
.review-table input:not([type=checkbox]) { min-width:0; width:100%; }
.review-table small { display:block; color:var(--muted); }
.review-table .candidate-button { display:block; width:100%; margin-top:6px; min-height:36px; }
.review-table .candidate-button[aria-pressed=true] { border-color:var(--accent); background:var(--accent-soft); }
.review-feedback:empty,#autoReviewStatus:empty { display:none; }
.review-feedback { color:var(--accent-ink); margin:6px 0; }
.review-confirmed { background:#e4eee6; color:#244a31; }
.review-ambiguous,.review-check { background:#fff0d4; color:#785307; }
.review-not_found { background:#fce5e2; color:#96382a; }
#mappingPanel { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#mappingPanel > h2,#mappingPanel > .table-scroll,#mappingPanel > button { grid-column:1/-1; }
#mappingPanel label { min-width:0; }
#mappingPanel select,#mappingPanel input { width:100%; min-width:0; }
#mappingPanel input[type=checkbox] { width:16px; min-height:16px; flex-shrink:0; }
#mappingPanel .table-scroll { max-height:260px; }
.sidebar-collapsed .sidebar-footer { display:flex; flex-direction:column; }
.sidebar-collapsed .sidebar-footer #hUser > span { display:none; }
.sidebar-collapsed .language-menu { width:32px; }
.sidebar-collapsed #languageToggle > span { display:none; }
.sidebar-collapsed .sidebar-footer #hUser > button { order:3; }
@media (min-width:701px) {
  .sidebar-collapsed .app-nav { bottom:160px; }
  .language-options { left:calc(var(--sidebar) - 4px); bottom:0; }
}

html[data-theme=dark] { color-scheme:dark; --ink:#e9ece5; --muted:#a8afa1; --line:#3b4439; --paper:#222920; --bg:#171d16; --accent-ink:#f4d365; --accent-soft:#3d351c; }
html[data-theme=dark] body { background:var(--bg); }
html[data-theme=dark] :is(main > section,.profile-section,.app-window,.window-header,.workspace-tools,.page-heading,.document-tabs,.window-menu,.import-panel,.steps,.help-panel,.request-review,.card) { background:var(--paper); color:var(--ink); border-color:var(--line); }
html[data-theme=dark] :is(input,select,textarea,[contenteditable],.btn,main button,.workspace-tools button) { background:#2a323e; color:var(--ink); border-color:#4c5664; }
html[data-theme=dark] :is(th,td,.fld > div,.form-grid,.section-details,.price-explanation,.message-panel,.inbox-list,.inbox-search) { background:transparent; color:var(--ink); border-color:var(--line); }
html[data-theme=dark] :is(.primary,#btnApprove,#build) { background:var(--accent); color:#171815; }
html[data-theme=dark] :is(.inbox-stats > button,.message-list > button,.alert,.badge) { background:#303947; color:var(--ink); }
html[data-theme=dark] :is(.message-list > button[aria-pressed=true],.review-check,.review-ambiguous,.attn,.onreq) { background:#443a1e; color:#f4df9a; }
html[data-theme=dark] .review-not_found,html[data-theme=dark] .error { background:#492d28; color:#ffc1b0; }
html[data-theme=dark] :is(.muted,.note,.quote-subtitle,.message-copy small) { color:var(--muted); }
html[data-theme=dark] :is(.app-nav a,.app-header .hbtn) { color:#e9ece5; }
html[data-theme=dark] .cards .card { background:var(--paper); color:var(--ink); border-color:var(--line); }
html[data-theme=dark] .cards .card.attn { background:#443a1e; }
html[data-theme=dark] .cards .card :is(b,span) { color:var(--ink); }
html[data-theme=dark] .tabs { background:#303947; border-color:var(--line); }
html[data-theme=dark] .document-tabs a { color:var(--muted); }
html[data-theme=dark] .document-tabs a[aria-current=true] { color:#f5d66b; }
html[data-theme=dark] .specification-panel .muted { color:#b7beb1; }
html[data-theme=dark] .review-table .review-not_found { background:#492d28; color:#ffc1b0; }
html[data-theme=dark] .review-table :is(.review-check,.review-ambiguous) { background:#443a1e; color:#f4df9a; }
html[data-theme=dark] .editor-page #btnSave { background:var(--paper); color:var(--ink); border-color:var(--line); }

/* Quote preparation: compact data, explicit steps and readable themes. */
.create-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:0 0 24px; }
.create-option { display:flex; flex-direction:column; gap:12px; padding:24px; border:1px solid var(--line); border-radius:12px; background:var(--paper); color:var(--ink); text-decoration:none; }
.create-option > .icon { width:28px; height:28px; color:var(--accent-ink); }
.create-option strong { font-size:18px; line-height:26px; }
.create-option > span { color:var(--muted); line-height:22px; }
.create-option:hover { border-color:var(--accent-ink); }
.create-stages { display:grid; gap:12px; padding-left:24px; }
.quote-comment-preview { display:flex; gap:4px; align-items:center; max-width:170px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:var(--muted); font-size:10px; line-height:14px; margin-top:4px; }
.quote-comment-preview .icon { flex-shrink:0; width:12px; height:12px; }
.quote-comment { border-top:1px solid var(--line); margin-top:12px; padding-top:12px; }
.quote-comment summary { cursor:pointer; font-size:12px; font-weight:600; }
.quote-comment textarea { width:100%; margin:8px 0; min-height:80px; }
.comment-excerpt { overflow-wrap:anywhere; white-space:pre-wrap; margin:8px 0; font-size:12px; }
.quote-comment:not([open]) .comment-excerpt { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.step-help { color:var(--muted); font-size:13px; line-height:22px; margin:0 0 16px; max-width:70ch; }
.source-text { white-space:pre-wrap; overflow-wrap:anywhere; font:13px/22px system-ui,sans-serif; padding:16px; border:1px solid var(--line); border-radius:8px; background:var(--bg); }
.button-row,.table-options { display:flex; flex-wrap:wrap; gap:8px 20px; margin-bottom:12px; }
.technical-index { display:grid; gap:8px; }
.technical-item { text-align:left; justify-content:flex-start; white-space:normal; overflow-wrap:anywhere; }
.document-tabs a { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; border-bottom-width:2px; transition:color 120ms ease; }
.document-tabs a[aria-current=true] { background:var(--accent-soft); border-radius:6px 6px 0 0; }
.step-pending { display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--accent-soft); color:var(--accent-ink); font-size:10px; }
.step-pending[hidden] { display:none; }
.review-warning { padding:10px 12px; background:var(--accent-soft); color:var(--ink); border-left:3px solid var(--accent); border-radius:6px; font-size:12px; }
.editor-page #tbl:not(.show-pricing) .pricing-column,.editor-page #tbl:not(.show-vat) .vat-column { display:none; }
.editor-page #tbl { min-width:740px; }
.editor-page #tbl.show-pricing,.editor-page #tbl.show-vat { min-width:960px; }
.editor-page #tbl.show-pricing.show-vat { min-width:1160px; }
.editor-page #tbl > thead > tr > th { font-size:11px; white-space:normal; vertical-align:bottom; text-align:right; }
.editor-page #tbl > thead > tr > th:nth-child(2),.editor-page #tbl > thead > tr > th:nth-child(3) { text-align:left; }
.editor-page #tbl > tbody > tr > td { font-size:12px; vertical-align:top; }
.editor-page #tbl > tbody > tr > td > input { width:76px; font-size:12px; }
.editor-page #tbl .product-fields :is(input,td,th) { font-size:12px; }
.editor-page #tbl .controls { min-width:80px; }
.editor-page #tbl .controls button { font-size:11px; min-height:28px; border-radius:6px; }
.editor-page #tbl .controls .specs-toggle { min-width:72px; white-space:nowrap; }
.editor-page #tbl .specbox { display:grid; grid-template-columns:minmax(220px,1fr) minmax(280px,1.4fr); gap:24px; padding:16px; }
.editor-page #tbl .specbox > .product-fields { align-self:start; }
.editor-page #tbl .specbox img { max-width:100%; max-height:160px; object-fit:contain; }
html[data-theme=dark] :is(tbody tr:hover,tbody tr:hover td,.window-header button:hover,.create-option:hover) { background:#333d4b; color:var(--ink); }
html[data-theme=dark] :is(.suggest-list,#acList,#acList .it,.login-form-wrap,.upload-box) { background:var(--paper); color:var(--ink); border-color:var(--line); }
html[data-theme=dark] :is(#acList .it:hover,.suggest-list button:hover,main button:hover,.btn:hover) { background:#3b4758; color:var(--ink); }
html[data-theme=dark] :is(.btn.primary:hover,#btnApprove:hover) { background:#e9c44b; color:#171815; }
html.editor-page[data-theme=dark] #tbl .onreq { background:#443a1e; }
html[data-theme=dark] .step-pending { color:#f4d365; }
html.editor-page[data-theme=dark] #btnSave { background:var(--paper); color:var(--ink); border-color:var(--line); }
@media(max-width:1000px) { .create-options { grid-template-columns:1fr; } .create-option { padding:20px; } }
@media(max-width:700px) { .editor-page #tbl .specbox { grid-template-columns:1fr; } .document-tabs a { font-size:12px; } }

/* Feedback from the quote walkthrough: one workspace, visible step navigation. */
::selection { background:#d8b94b; color:#172016; }
html[data-theme=dark] ::selection { background:#756125; color:#fff9df; }
.editor-page #warnings { display:none; }
.window-body.editor-step-body { display:flex; flex-direction:column; overflow:hidden; padding:0; }
.window-narrow > [data-quote-step] { height:var(--editor-step-height) !important; }
@media(max-width:1000px) { .editor-page [data-quote-step] { height:var(--editor-step-height) !important; } }
.step-scroll { flex:1; min-height:0; overflow:auto; padding:16px; scrollbar-gutter:stable; overscroll-behavior:contain; }
.step-navigation { flex-shrink:0; display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; padding:12px 16px; border-top:1px solid var(--line); background:var(--paper); }
.step-navigation > :last-child { margin-left:auto; }
.step-navigation .btn { min-height:36px; }
.source-update-warning { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.stage-help { padding:10px 12px; margin-bottom:16px; border:1px solid var(--line); border-radius:8px; font-size:12px; background:var(--bg); }
.stage-help summary { cursor:pointer; font-weight:600; }
.stage-help .step-help { margin:10px 0 0; }
.stage-warnings p { margin:8px 0 0; color:var(--muted); font-size:12px; }
.step-status { display:inline-grid; place-items:center; min-width:14px; font-size:14px; line-height:16px; }
.step-status:empty { display:none; }
.step-status[data-state=done] { color:#37814b; }
.step-status[data-state=skipped] { color:#b04738; }
html[data-theme=dark] .step-status[data-state=done] { color:#8ed1a0; }
html[data-theme=dark] .step-status[data-state=skipped] { color:#f3a48d; }
#sourceText { display:block; width:100%; resize:vertical; min-height:180px; }
#sourceText + .button-row { margin-top:12px; }
.original-source { margin:16px 0; }
.original-source summary { cursor:pointer; color:var(--muted); font-size:12px; }
#deliverySuggestion { margin-top:16px; margin-bottom:8px; }
.technical-index { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.technical-editor .specbox { display:grid; align-items:start; grid-template-columns:minmax(180px,1fr) minmax(250px,1.4fr); gap:20px; }
.technical-editor .product-fields { margin:0; table-layout:fixed; }
.technical-editor .product-fields :is(th,td) { padding:10px 8px; vertical-align:middle; text-align:left; }
.technical-editor :is(.product-fields,.spec) { width:100%; min-width:0; }
.technical-editor .product-fields th { width:120px; color:var(--muted); font-size:12px; font-weight:500; white-space:normal; overflow-wrap:anywhere; }
.technical-editor .product-fields td { overflow-wrap:anywhere; }
.technical-editor .product-fields input { width:100%; min-width:0; }
.technical-editor .imgcell img { max-width:100%; height:auto; max-height:220px; object-fit:contain; }
.technical-editor .src { display:inline-block; margin:4px 0; font-size:11px; color:var(--muted); }
.technical-editor .spec td { overflow-wrap:anywhere; padding:8px; }
.technical-editor .spec td[contenteditable] { min-width:60px; }
.technical-editor .drop { white-space:normal; }
.quick-window-reset { width:32px; padding:6px !important; }
.actions-panel #actions > :is(button,a) { display:flex; align-items:center; justify-content:center; gap:8px; }
.actions-panel #actions > :is(button,a) .icon { flex-shrink:0; width:17px; height:17px; }
#commentSection .quote-comment { border:0; margin:0; padding:0; }
#commentSection textarea { min-height:180px; }
@media(prefers-reduced-motion:no-preference) {
  .btn,.create-option,.app-nav a,.window-header button,.workspace-tools button { transition:background-color 160ms ease,border-color 160ms ease,color 160ms ease,box-shadow 180ms ease; }
  .create-option:hover { box-shadow:0 8px 28px #00000014; }
  .create-option .icon { transition:transform 180ms ease; }
  .create-option:hover .icon { transform:translateY(-2px); }
}
@media(max-width:700px) {
  .step-scroll { padding:12px; }
  .step-navigation { padding:10px 12px; }
  .step-navigation .btn { padding:8px 10px; font-size:12px; }
  .technical-editor .specbox { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:700px) {
  body > .app-header:has(.language-options:not([hidden])) { z-index:22; }
  .workspace-tools { margin:0 0 0 auto; width:auto; }
  .page-heading { padding:12px 8px; flex-direction:row; align-items:center; }
  .page-heading > .btn { width:auto; }
  .cards > button.card { padding:8px 10px; min-height:54px; gap:8px; }
  .cards > button.card b,.cards > button.card.attn b { font-size:22px; line-height:28px; }
  .inbox-page main { padding:8px; }
  .inbox-page .page-heading { margin:-8px -8px 0; }
  #mappingPanel { grid-template-columns:1fr; }
  body > .app-header { flex-direction:column; align-items:stretch; gap:10px; }
  .sidebar-brand-row,.sidebar-collapsed .sidebar-brand-row { width:100%; flex:none; }
  .sidebar-footer,.sidebar-collapsed .sidebar-footer { display:grid; grid-template-columns:minmax(0,1fr) auto 32px auto; gap:6px; width:100%; margin:0; padding:8px 0 0; }
  .sidebar-footer #hUser > span,.sidebar-collapsed .sidebar-footer #hUser > span { display:block; grid-column:1; grid-row:1; max-width:100%; font-size:10px; }
  .sidebar-footer #hUser > button { grid-column:4; grid-row:1; }
  .language-menu { grid-column:2; grid-row:1; }
  .sidebar-collapsed .language-menu { width:auto; }
  .sidebar-collapsed #languageToggle > span { display:inline; }
  .sidebar-footer .theme-toggle { grid-column:3; grid-row:1; }
  .language-options { bottom:auto; top:40px; left:auto; right:0; width:180px; }
  .inbox-stats > button { padding:8px 6px; }
  .app-nav a > span { white-space:nowrap; }
}
@media (min-width:701px) and (max-width:1100px) {
  .cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (min-width:701px) and (max-width:1100px) {
  html:not(.sidebar-collapsed) body > .app-header { padding-left:10px; padding-right:10px; }
  html:not(.sidebar-collapsed) .sidebar-brand-row { gap:6px; }
  html:not(.sidebar-collapsed) .sidebar-brand-row .brand { font-size:18px; gap:6px; }
  html:not(.sidebar-collapsed) .sidebar-brand-row .brand svg { width:28px; height:28px; }
  html:not(.sidebar-collapsed) #sidebarToggle { width:30px; min-width:30px; height:32px; }
  .sidebar-footer { gap:8px 4px; grid-template-columns:minmax(0,1fr) 28px auto; }
  .sidebar-footer .hbtn { padding:4px; gap:4px; font-size:10px; }
  .sidebar-footer .theme-toggle { width:28px; }
}
@media (max-width:360px) {
  body > .app-header { padding-left:12px; padding-right:12px; gap:8px; }
  .sidebar-brand-row,.sidebar-collapsed .sidebar-brand-row { gap:4px; }
  .sidebar-brand-row .brand { font-size:16px; gap:6px; }
  .sidebar-brand-row .brand svg { width:24px; height:24px; }
  #sidebarToggle { width:28px; min-width:28px; height:30px; }
  #hUser > span { max-width:104px; }
}
/* Customer review, 24 November: shared geometry and a neutral dark workspace. */
html[data-theme=dark] { --ink:#edf0f4; --muted:#aeb6c2; --line:#3b424d; --paper:#242a33; --bg:#191e25; --accent:#edbd48; --accent-hover:#dfac30; --accent-ink:#f1ca6b; --accent-soft:#3b3323; }
html[data-theme=dark] body > .app-header { background:#141920; }
html[data-theme=dark] :is(input,select,textarea,[contenteditable],.btn,main button,.workspace-tools button) { background:#2a323e; border-color:#4c5664; }
html[data-theme=dark] :is(.primary,#btnApprove,#build) { background:var(--accent); color:#171a20; }
html[data-theme=dark] :is(.tabs,.inbox-stats > button,.message-list > button,.alert,.badge) { background:#303947; color:var(--ink); }
html[data-theme=dark] :is(.btn:hover,main button:hover,.window-header button:hover,.suggest-list button:hover) { background:#3b4758; }
html[data-theme=dark] :is(.primary:hover,#btnApprove:hover) { background:var(--accent-hover); color:#171a20; }
:is(button,.btn,input:not([type=checkbox]),select,textarea,.tabs,.document-tabs,.create-option,.app-window) { border-radius:4px !important; }
#languageToggle { width:auto; border-color:transparent; background:transparent; padding:6px; }
#languageToggle:hover,#languageToggle:focus-visible { border-color:var(--line); background:var(--paper); }
.app-nav { padding-right:0; gap:2px; }
.app-nav a { border-radius:4px 0 0 4px; margin-right:0; transition:background 160ms ease,color 160ms ease; }
.app-nav a[aria-current=page] { background:var(--bg); color:var(--accent-ink); box-shadow:none; }
html[data-theme=dark] .app-nav a[aria-current=page] { background:var(--bg); color:var(--accent); box-shadow:none; }
.app-nav a[aria-current=page]::before { background:var(--accent); }
.page-heading { min-height:36px; margin:0 0 12px; padding:0; background:none; border:0; }
.page-heading h1 { font-size:20px; line-height:28px; }
.create-page .page-heading { display:none; }
.editor-page .page-heading > div:first-child { display:none; }
.tabs { background:transparent !important; border:0; padding:0; border-radius:0; }
.tabs button[aria-pressed=true] { background:transparent !important; border-color:transparent; border-bottom-color:var(--accent); box-shadow:none; }
#allQuotes,#managerQuotes { background:transparent !important; border-color:transparent; box-shadow:none; }
#allQuotes[aria-pressed=true],#managerQuotes[aria-pressed=true] { border-bottom-color:var(--accent); }
.document-tabs a { border-radius:0 !important; }
.filters .switch-label { display:flex; flex:0 0 auto; align-items:center; gap:8px; }
.filters .switch-label input { flex:none; width:18px; min-width:18px; }
.app-dialog { color:var(--ink); background:var(--paper,#fff); border:1px solid var(--line); border-radius:4px; width:min(560px,calc(100vw - 32px)); padding:24px; box-shadow:0 24px 80px #0008; }
.app-dialog::backdrop { background:#10151cb3; }
.dialog-message { margin:0 0 20px; white-space:pre-line; font-size:15px; line-height:24px; max-height:55dvh; overflow:auto; }
.app-dialog input { width:100%; margin:0 0 16px; }
.app-dialog input[type=checkbox] { width:auto; margin:0; }
.dialog-actions { display:flex; gap:12px; justify-content:flex-end; margin-top:20px; flex-wrap:wrap; }
.document-dialog { width:min(1200px,calc(100vw - 32px)); height:92dvh; padding:12px; }
.document-dialog[open] { display:flex; flex-direction:column; gap:12px; }
.document-dialog .dialog-actions { margin:0; }
.document-dialog iframe { width:100%; flex:1; min-height:0; border:0; background:#fff; }
.source-comparison { display:grid; grid-template-columns:minmax(0,var(--source-share,50%)) 10px minmax(0,1fr); gap:8px; height:420px; margin-bottom:16px; }
.source-pane { display:flex; flex-direction:column; min-width:0; min-height:0; }
.source-pane h3,.source-pane label { margin:0 0 8px; font-size:14px; line-height:22px; }
.source-pane .source-text { width:100%; flex:1; min-height:0; margin:0; overflow:auto; resize:none; }
.source-divider { background:var(--line); border-radius:3px; cursor:col-resize; touch-action:none; }
.source-divider:hover,.source-divider:focus-visible { background:var(--accent); }
.source-comparison[data-layout=stack] { height:640px; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,var(--source-share,50%)) 10px minmax(0,1fr); }
.source-comparison[data-layout=stack] .source-divider { cursor:row-resize; }
.technical-workspace { display:grid; grid-template-columns:minmax(150px,220px) minmax(0,1fr); gap:20px; align-items:start; }
.technical-workspace .technical-index { display:flex; flex-direction:column; max-height:60dvh; overflow:auto; gap:4px; margin:0; padding:0 4px 4px 0; }
.technical-editor { min-width:0; }
.quote-context { white-space:pre-line; padding:12px 0; border-bottom:1px solid var(--line); margin-bottom:12px; font-size:14px; line-height:22px; }
.incomplete-field { border-color:#cc9d32 !important; box-shadow:inset 3px 0 #cc9d32; }
.editor-page .step-navigation { background:var(--paper,#fff); padding:12px 16px; border-top:1px solid var(--line); flex-shrink:0; }
.editor-page .step-navigation [data-editor-next] { min-width:160px; min-height:44px; font-size:15px; }
.editor-page .step-navigation [data-editor-next]:last-child { margin-left:auto; }
.source-update-warning,#sourceStatus:not(:empty) { font-size:14px; line-height:22px; padding:12px; background:var(--accent-soft); border-left:3px solid var(--accent); color:var(--ink); }
.table-options { align-items:center; gap:8px 16px; }
.table-options .hint { display:none; }
.operation-time { display:block; color:var(--muted); font-size:14px; white-space:nowrap; }
.registry-panel #tbStore td { font-size:13px; }
.registry-panel #tbStore td:nth-child(3) { max-width:130px; overflow:hidden; text-overflow:ellipsis; }
.registry-panel #tbStore td:last-child { white-space:nowrap; }
.registry-panel #tbStore .row-actions { display:flex; flex-wrap:wrap; gap:4px; }
.position-indicators { display:flex; gap:4px; flex-wrap:wrap; margin-top:6px; }
.position-indicators span { font-size:11px; padding:2px 5px; border:1px solid var(--line); color:var(--accent-ink); }
.editor-page #tbody tr:hover td,.editor-page #tbody tr:has(+ .specs-row:hover) td,.editor-page #tbody tr:hover + .specs-row td { background:var(--accent-soft) !important; }
.editor-page #tbody .pos { font-weight:700; }
.editor-page #tbody .position-indicators { font-weight:400; }
.editor-page #tbody tr:hover .pos,.editor-page #tbody tr:has(+ .specs-row:hover) .pos { color:var(--accent-ink); }
@media(max-width:700px) {
  .source-comparison,.source-comparison[data-layout=stack] { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,var(--source-share,50%)) 8px minmax(0,1fr); height:650px; }
  .source-divider { cursor:row-resize; }
  .technical-workspace { grid-template-columns:minmax(0,1fr); }
  .technical-workspace .technical-index { max-height:180px; }
  .editor-page .step-navigation [data-editor-next] { min-width:140px; }
}
/* Review controls share the same compact surfaces at all viewport sizes. */
.analog-filters { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.analog-filters > :is(select,input) { flex:1 1 130px; min-width:0; }
.editor-loading-card { flex-wrap:wrap; }
.editor-loading-card :is(.operation-time,.operation-progress) { flex-basis:100%; font-size:14px; line-height:22px; }
.technical-editor .product-fields th { width:145px; overflow-wrap:normal; word-break:normal; }
.technical-editor .specbox { grid-template-columns:minmax(0,1fr); }
.registry-panel #tbStore td:nth-child(4) { white-space:nowrap; }
.registry-panel #tbStore .badge { white-space:nowrap; }
.create-page .page-heading { display:block; position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); }
.editor-page .page-heading { padding:0; background:transparent !important; border:0; min-height:0; }
select { appearance:none; padding-right:30px; }
select,html[data-theme=dark] select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23929ca9' stroke-width='1.5'/%3E%3C/svg%3E") !important; background-repeat:no-repeat !important; background-position:right 10px center !important; }
html[data-theme=dark] option { background:var(--paper); color:var(--ink); }
.editor-page #tbody tr:focus-within td,.editor-page #tbody tr:has(+ .specs-row:focus-within) td { background:var(--accent-soft) !important; }
body,main { background:var(--bg); }
body > .app-header { background:#141920; }
.app-nav { padding-right:0; scrollbar-width:none; overflow-x:hidden; }
.app-nav a { width:100%; }
.sidebar-collapsed .app-nav { padding-right:0; }
.app-nav a:hover,#sidebarToggle:hover,.sidebar-footer .hbtn:hover { background:#333d4b; color:#edf0f4; border-color:#4c5664; }
.app-nav a[aria-current=page]:hover { background:var(--bg); color:var(--accent-ink); }
html[data-theme=dark] :is(tbody tr:hover,tbody tr:hover td,.create-option:hover,#acList .it:hover,.suggest-option:hover,.message-list > button:hover) { background:#333d4b; color:var(--ink); }
html[data-theme=dark] :is(.language-options,.window-menu) { background:var(--paper); border-color:var(--line); }
.editor-page #tbody .pos .position-indicators span { font-weight:400; }
/* Page actions live beside the content they affect. Keep the document's identity. */
html main > .page-heading.page-heading-hidden { position:absolute; width:1px; height:1px; min-height:0; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
main > [role=status]:empty { display:none; }
.document-navigation { display:flex; align-items:start; gap:12px; margin-bottom:12px; min-width:0; }
.document-navigation .document-tabs { flex:1; min-width:0; margin:0; scrollbar-width:thin; }
.document-navigation .workspace-tools { margin-top:8px; }
.quote-identity { margin-bottom:16px; }
.quote-identity .document-heading { flex-wrap:wrap; }
.quote-identity h1 { font-size:20px; line-height:28px; }
.quote-identity p { margin:8px 0 0; }
.registry-panel #tbStore .row-actions { flex-wrap:nowrap; align-items:center; }
.registry-panel #tbStore .row-actions > .btn { flex-shrink:0; white-space:nowrap; }
.window-body,.step-scroll,.source-text,.table-scroll,.window-menu,.technical-index,.technical-data-pane { scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
html[data-theme=dark] .cards .card.attn { background:var(--paper); box-shadow:inset 3px 0 var(--accent); }
html[data-theme=dark] :is(main section,.management-card,.rule-filters,.import-summary,.import-notes,.import-file-details,.import-details,.empty,.suggest-option) { background:var(--paper); color:var(--ink); border-color:var(--line); }
html[data-theme=dark] :is(.tabs.rule-kinds button[aria-pressed=true],.inbox-filters button[aria-pressed=true],.inbox-stats > button[aria-pressed=true],.message-list > button[aria-pressed=true],.review-check,.review-ambiguous,.onreq) { background:var(--accent-soft); color:var(--accent-ink); border-color:var(--line); }
html[data-theme=dark] :is(.help-note,p.hint,.note,.product-details > summary,.specification-panel .muted) { color:var(--muted); }
html[data-theme=dark] .help-panel > summary::marker { color:var(--muted); }
html[data-theme=dark] :is(.tabs button,.tabs button[aria-pressed=true],.tabs button[aria-selected=true]) { color:var(--ink); }
html[data-theme=dark] :is(.tabs.rule-kinds button,.rule-filters input,.rule-filters select) { background:#2a323e; border-color:var(--line); }
html[data-theme=dark] .editor-page .totals,html.editor-page[data-theme=dark] .totals { background:var(--bg); color:var(--ink); }
html[data-theme=dark] .totals .grand { border-color:var(--line); }
@media(max-width:700px) {
  .document-navigation { flex-wrap:wrap; gap:4px; }
  .document-navigation .document-tabs { flex-basis:100%; }
  .document-navigation .workspace-tools { margin-top:0; }
  .editor-page .step-navigation { padding:12px; }
  .section-heading { flex-wrap:wrap; gap:12px; }
}

/* Customer feedback, 25 November: controls stay beside their document or field. */
.app-nav,.sidebar-collapsed .app-nav { padding-right:8px; gap:8px; }
.app-nav a { border-radius:8px; }
.app-nav a[aria-current=page] { --tab-color:var(--bg); border-radius:8px 0 0 8px; background:var(--tab-color); }
html[data-theme=dark] .app-nav a[aria-current=page],html[data-theme=dark] .app-nav a[aria-current=page]:hover { --tab-color:var(--bg); background:var(--tab-color); color:#ffe08a; font-weight:700; }
.nav-tab-corners { position:absolute; right:-8px; top:0; bottom:0; width:8px; background:var(--tab-color); pointer-events:none; }
.nav-tab-corners::before,.nav-tab-corners::after { content:''; position:absolute; right:0; width:8px; height:8px; }
.nav-tab-corners::before { top:-8px; background:radial-gradient(circle at top left,transparent 7.5px,var(--tab-color) 8px); }
.nav-tab-corners::after { bottom:-8px; background:radial-gradient(circle at bottom left,transparent 7.5px,var(--tab-color) 8px); }
.app-nav a[aria-current=page]::after { display:none; }
.language-options[popover] { position:fixed; inset:auto; margin:0; max-width:calc(100vw - 24px); }
.language-options button { display:block; width:100%; text-align:left; padding:10px 12px; border-color:transparent; background:transparent; }
.language-options[popover] button:hover,.language-options[popover] button[aria-pressed=true] { background:var(--accent-soft); color:var(--accent-ink); }
.quote-icon-action { display:inline-flex; align-items:center; justify-content:center; width:32px; min-height:32px; padding:6px; }
.quote-icon-action .icon { width:18px; height:18px; }
.quote-delete { color:#b52d32; }
.editor-page #tbl .position-actions {display:flex;align-items:center;gap:8px;white-space:nowrap}
.editor-page #tbl .controls .position-actions button {flex-shrink:0;min-height:32px;margin:0}
.editor-page #tbl .controls .position-actions .specs-toggle {padding:4px 8px}
.editor-page #tbl .controls .position-actions button:not(.specs-toggle) {width:32px;justify-content:center}
html[data-theme=dark] .quote-delete { color:#ff9ca2; }
.specification-issues { font-size:12px; line-height:18px; color:#b52d32; overflow-wrap:anywhere; margin-left:12px; }
html[data-theme=dark] .specification-issues { color:#ffb5bb; }
.window-header:has(.specification-issues) h2 { flex:0 1 auto; }
.window-header .specification-issues { flex:1; min-width:0; }
.editor-page #tbody .position-indicators :is(.missing-image,.missing-specs) { color:#b52d32; border-color:#d79ca0; background:#fff0f1; }
html.editor-page[data-theme=dark] #tbody .position-indicators :is(.missing-image,.missing-specs) { color:#ffb5bb; border-color:#a5535b; background:#442b32; }
#technicalSection .step-scroll { display:flex; flex-direction:column; overflow:hidden; }
#technicalSection .stage-help { flex-shrink:0; max-height:35%; overflow:auto; overscroll-behavior:contain; }
.technical-workspace { flex:1; min-height:0; grid-template-columns:minmax(150px,220px) minmax(0,1fr); grid-template-rows:minmax(0,1fr); align-items:stretch; }
.technical-workspace .technical-index { grid-column:1; grid-row:1; min-height:0; max-height:none; flex-wrap:nowrap; overflow:auto; overscroll-behavior:contain; padding:0 4px 4px 0; position:static; scrollbar-gutter:stable; }
.technical-data-pane { grid-column:2; grid-row:1; min-width:0; min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; padding-right:4px; }
.technical-item { flex-shrink:0; width:100%; text-align:left; overflow-wrap:anywhere; white-space:normal; padding:10px; }
.technical-index .technical-item[aria-pressed=true] { background:var(--accent-soft); border-color:var(--accent); color:var(--accent-ink); }
.review-complete { padding:14px; background:var(--accent-soft); border-left:3px solid var(--accent); font-weight:600; }
.specification-panel .table-scroll { max-height:60dvh; overflow:auto; }
.editor-page #tbl > thead > tr > th { position:sticky; top:0; z-index:3; background:var(--paper); box-shadow:0 1px var(--line); }
.option-with-help { position:relative; display:flex; gap:6px; align-items:center; min-width:0; }
.option-with-help:has(> label[hidden]) { display:none; }
.option-with-help .switch-label { margin:0; }
.field-help { position:static; flex-shrink:0; }
.field-help > button { display:flex; align-items:center; cursor:help; padding:4px; min-height:24px; border:0; border-radius:50%; color:var(--muted); background:transparent; }
.field-help > button:focus-visible { outline:2px solid var(--accent); }
.field-help > p { display:none; position:absolute; top:100%; left:0; z-index:8; width:240px; max-width:70vw; margin:0; padding:12px; background:var(--paper); color:var(--ink); border:1px solid var(--line); border-radius:8px; box-shadow:0 8px 24px #0003; font-size:12px; line-height:20px; }
.field-help:hover > p,.field-help:focus-within > p { display:block; }
.editor-page #tbl.resizable-columns { table-layout:fixed; min-width:0; }
.editor-page #tbl.resizable-columns .product-cell { min-width:0; width:auto; }
.editor-page #tbl.resizable-columns > tbody > tr > td { overflow-wrap:anywhere; }
.editor-page #tbl.resizable-columns .amount { white-space:normal; }
.editor-page #tbl.resizable-columns > tbody > tr > td > input { width:100%; min-width:0; }
.editor-page #tbl .column-resize { position:absolute; top:4px; bottom:4px; right:0; z-index:1; width:9px; min-height:0; padding:0; border:0; border-radius:0; background:transparent; cursor:col-resize; touch-action:none; }
.column-resize::after { content:''; position:absolute; top:0; bottom:0; right:0; width:1px; background:var(--line); }
.column-resize:hover::after,.column-resize:focus-visible::after { width:3px; background:var(--accent); }
.analog-dialog .analog-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.analog-dialog .analog-filters > :is(select,input) { width:100%; margin:0; }
.analog-loading { display:flex; align-items:center; gap:10px; }
.analog-loading::before { content:''; width:16px; height:16px; flex-shrink:0; border:2px solid var(--line); border-top-color:var(--accent); border-radius:50%; animation:analog-spin 900ms linear infinite; }
@keyframes analog-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .analog-loading::before { animation:none; border-color:var(--accent); } }
.operation-error { max-width:600px; }
.operation-error h2 { font-size:22px; margin:0 0 16px; }
.operation-error p { white-space:pre-line; color:#b52d32; overflow-wrap:anywhere; }
html[data-theme=dark] .operation-error p { color:#ffb5bb; }
.approval-dialog { width:min(700px,calc(100vw - 24px)); max-height:90dvh; }
.approval-dialog h2 { font-size:22px; line-height:30px; margin:0 0 12px; }
.approval-issues { max-height:50dvh; overflow:auto; }
.approval-issues details { border:1px solid var(--line); border-radius:8px; margin-top:8px; }
.approval-issues summary { cursor:pointer; padding:12px; font-weight:600; }
.approval-issues p { margin:0; padding:8px 12px; border-top:1px solid var(--line); overflow-wrap:anywhere; font-size:13px; line-height:20px; }
.approval-blocked { color:#b52d32; }
html[data-theme=dark] .approval-blocked { color:#ffb5bb; }
.analog-candidate .analog-select { display:inline-flex; align-items:center; justify-content:center; gap:8px; width:100%; margin-top:16px; min-height:44px; border-radius:8px; }
html.login-page[data-theme=dark] .login-intro { background:#242c38; color:#edf0f4; border:1px solid var(--line); }
html.login-page[data-theme=dark] .login-intro h1 { color:#edf0f4; }
html.login-page[data-theme=dark] .document-back { background:#ac7c2e; }
html.login-page[data-theme=dark] .document-front { background:#f5f6f8; color:#28313f; }
html.login-page[data-theme=dark] .document-top { color:#566273; }
html.login-page[data-theme=dark] .visual-table { color:#566273; }
html.login-page[data-theme=dark] .visual-line,html.login-page[data-theme=dark] .visual-table i { background:#d0d6de; }
html.login-page[data-theme=dark] .visual-total { background:#e7ce88; color:#332c19; }
html.login-page[data-theme=dark] .document-check { color:#211d14; }
html.login-page[data-theme=dark] .intro-footer { color:#b7c0cf; }
html.login-page[data-theme=dark] .login-form-wrap { padding:32px; max-width:464px; border:1px solid var(--line); border-radius:16px; }
@media(max-width:700px) {
  .nav-tab-corners { display:none; }
  .app-nav a[aria-current=page] { border-radius:8px; }
  .technical-workspace { grid-template-columns:minmax(100px,30%) minmax(0,1fr); gap:8px; }
  .technical-item { font-size:11px; padding:8px; }
  .technical-data-pane .product-fields,.technical-data-pane .product-fields :is(tbody,tr,th,td) { display:block; width:auto; }
  .technical-data-pane .product-fields :is(th,td) { padding:6px 0; }
  .registry-panel #tbStore .row-actions { flex-wrap:wrap; }
  html.login-page[data-theme=dark] .login-form-wrap { padding:20px; }
}
@media(min-width:701px) {
  .app-nav { top:116px; padding-top:12px; }
  .sidebar-collapsed .app-nav { top:112px; padding-top:12px; }
}
