*{box-sizing:border-box}
body{margin:0;position:relative;isolation:isolate;background:transparent;color:var(--ink);font-size:14px;line-height:1.45;-webkit-font-smoothing:antialiased;letter-spacing:0;font-feature-settings:normal}
button,select,input{font:inherit}
button,a,select,input{touch-action:manipulation}
button{cursor:pointer;border-radius:calc(8px*var(--rk));padding:7px 13px;font-size:13px;font-weight:500;line-height:1.3;background:var(--fill);color:var(--ink)}
button.text{border:0}
.layout{display:grid}
.sidebar{color:#f8f9f1}
.brand{font-size:20px;letter-spacing:1.5px;font-weight:700;white-space:nowrap}
.brand span{color:#eea951}
.nav-item.active{border-inline-start:3px solid #e9a956;border-inline-start-color:var(--accent)}
.nav-icon{font-size:17px;width:20px;text-align:center}
.topbar .eyebrow{margin:0}
.controls{display:flex;align-items:center}
.control{display:grid}
select,input{max-width:100%;min-width:0}
.demo-banner{line-height:1.7}
.heading{display:flex;justify-content:space-between;gap:15px}
h2{margin:0;font-size:17px;font-weight:700;letter-spacing:-.015em;color:var(--ink)}
h3{margin:0 0 9px;line-height:1.6;font-size:14px;font-weight:600;letter-spacing:-.01em}
.subtitle{margin:0}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
.stat-label{line-height:1.5}
.stat-value{margin-top:13px}
.grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr)}
.panel-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}
.task{display:grid;gap:10px}
.task:first-of-type{border-top:0}
.task-top{display:flex;align-items:start;justify-content:space-between;gap:12px}
.tags{display:flex;flex-wrap:wrap;gap:7px}
.task-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.event{border-inline-start:2px solid #d29a56;padding-inline-start:15px;margin:20px 0;border-inline-start-color:var(--accent)}
.event p{font-size:13px;line-height:1.7;margin:7px 0}
.empty{padding:20px 0;font-size:13px;line-height:1.8}
table{border-collapse:collapse;width:100%;text-align:start;font-size:13px}
th,td{text-align:start;padding:14px 12px;border-bottom:1px solid var(--line);white-space:nowrap}
th{font-size:11px}
.detail{display:grid}
.detail dd{margin:0;overflow-wrap:anywhere}
dialog{padding:0;width:460px;max-width:calc((100vw - 28px)/var(--zoom,1));-webkit-backdrop-filter:none;backdrop-filter:none}
.dialog-inner{padding:26px}
.dialog-inner label{display:grid;gap:8px;margin:18px 0;font-size:13px}
.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}
.error{font-size:13px;line-height:1.6}
.notice{line-height:1.6}
.history-item{font-size:12px;padding:12px 0;border-bottom:1px solid var(--line);line-height:1.8}
bdi{unicode-bidi:isolate}
[dir=rtl] h1{font-size:34px;line-height:1.6;letter-spacing:0;font-family:var(--font)!important}
[dir=rtl] .eyebrow{letter-spacing:0}
.company-logo{display:block;aspect-ratio:2140/534;object-fit:contain}
.mobile-logo{display:none}
.client-dialog{width:840px;max-height:calc((100vh - 32px)/var(--zoom,1));max-height:calc((100dvh - 32px)/var(--zoom,1));overflow:auto}
.client-fieldset{margin:22px 0;padding:18px;min-width:0}
.client-fieldset legend{float:left;width:100%;padding:0;margin:0 0 10px;font-weight:600}
.client-fieldset > :not(legend){clear:both}
.client-fieldset::after{content:'';display:block;clear:both}
.client-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.client-form-grid .client-field{margin:0;min-width:0}
.client-field textarea{font:inherit;background:var(--surface);resize:vertical;min-height:80px}
.client-field textarea:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
@media (max-width:700px){
  .client-form-grid{grid-template-columns:1fr}
  .client-fieldset{padding:12px}
  .client-dialog .dialog-inner{padding:18px}
  .client-dialog{max-height:calc((100vh - 20px)/var(--zoom,1));max-height:calc((100dvh - 20px)/var(--zoom,1))}
}
@media (max-width:700px){
  .mobile-logo{display:block;height:auto;aspect-ratio:2140/534;object-fit:contain}
  .topbar .controls{flex-basis:100%;justify-content:space-between}
  .topbar .mobile-menu{margin-inline-start:auto}
}
@media (max-width:1000px){
  .brand{font-size:16px}
  .grid{grid-template-columns:1fr}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:700px){
  .controls{flex:1}
  .control{max-width:calc(50% - 5px)}
  .task-top{flex-wrap:wrap}
  .topbar>.eyebrow{display:none}
  .heading>button{margin-top:15px}
  [dir=rtl] h1{font-size:29px}
}

/* Same visual language as the approved public website; ERP layout stays intact. */
@font-face{font-family:Montserrat;src:url('/montserrat-400.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:Montserrat;src:url('/montserrat-500.ttf') format('truetype');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:Montserrat;src:url('/montserrat-600.ttf') format('truetype');font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:Montserrat;src:url('/montserrat-700.ttf') format('truetype');font-weight:700;font-style:normal;font-display:swap}
:root{background:#172d21;--green:#172d21;--orange:#f2d5a4;--soft:#253c2e;--error-ink:#ffc4b0;--error-bg:#482c24;color:var(--ink);--ease:cubic-bezier(.25,.1,.25,1);--bg:#11221a;--bg-tint:rgba(255,150,80,.05);--chrome:rgba(20,38,28,.82);--surface:rgba(255,250,241,.04);--fill:rgba(255,250,241,.075);--fill-hover:rgba(255,250,241,.11);--hair:rgba(255,250,241,.08);--line:rgba(255,250,241,.08);--ink:#fffaf1;--muted:rgba(255,250,241,.62);--faint:rgba(255,250,241,.42);--accent:#ff9450;--accent-btn:#ee7430;--accent-soft:rgba(255,148,80,.14);--warning-bg:rgba(255,148,80,.12);--warning-ink:#ffb27e;--dialog:#183026;color-scheme:dark;--good-soft:rgba(99,199,138,.14);--side:var(--chrome);--th-bg:rgba(255,250,241,.05);--tab-line:rgba(255,250,241,.12);--icon-ink:rgba(255,250,241,.78);--pop:#1f3d2b}
body::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:var(--bg)}
.layout{background:transparent}
.brand-filter{position:absolute;pointer-events:none}
.company-logo,.mobile-logo{filter:url('#brand-white-lettering');background:transparent;padding:0;border-radius:0}
.company-logo{width:100%;height:auto;min-height:44px;max-width:180px}
.eyebrow{text-transform:uppercase;font-weight:700;letter-spacing:1.4px;font-size:10px}
.heading .eyebrow::before{content:"";width:25px;height:2px;margin-inline-end:10px;vertical-align:middle;background:var(--accent);display:none}
.stat .stat-value{margin-top:12px}
.count,.tag,.team-row strong,.task-footer,.history-item,.detail dd,table,bdi{font-variant-numeric:lining-nums tabular-nums}
.team-row strong,.count{font-weight:600}
h1,.subtitle,.stat-value,.detail dd,dialog,.nav-item{color:var(--ink)}
.brand small,.nav-icon,.eyebrow,.control,.nav-item.active,button.text{color:var(--accent)}
.nav-item.active,.nav-item:hover,.count,.tag{background:var(--soft);color:var(--ink)}
button,select,input,select option{border-color:var(--line);color-scheme:inherit}
.demo-banner,.stat.alert,.tag.warning{color:var(--warning-ink);border-color:var(--line)}
.error{color:var(--error-ink)}
.notice,.notice.error{border-color:var(--line)}
[data-theme=light] .company-logo,[data-theme=light] .mobile-logo{filter:none}
@media (max-width:700px){
  .topbar .control{flex:1 1 100px;max-width:100%}
}
@media (max-width:700px){
  .mobile-logo{width:180px}
}

/* ===== Calm Apple-style layer (Apple Music reference): flat surfaces, hairlines, one accent, no movement on hover.
   Overrides the rules above; delete this block to roll back. ===== */
:root[data-theme=dark]{--workspace-gradient:linear-gradient(135deg,#10141b,#252c38 55%,#171d26);--soft:#303b4b;--bg:#1b1b1d;--bg-tint:rgba(255,255,255,.025);--chrome:rgba(40,40,42,.82);--surface:rgba(255,255,255,.04);--fill:rgba(255,255,255,.08);--fill-hover:rgba(255,255,255,.12);--hair:rgba(255,255,255,.08);--line:rgba(255,255,255,.08);--ink:#f5f5f7;--muted:rgba(235,235,245,.6);--faint:rgba(235,235,245,.38);--accent:#ff9f43;--accent-btn:#f08a2c;--accent-soft:rgba(255,159,67,.14);--warning-bg:rgba(255,159,67,.12);--warning-ink:#ffbd7a;--dialog:#2a2a2c;background:#1b1b1d;--note-bg:rgba(255,214,150,.09);--note-line:rgba(255,214,150,.34);--note-blank:rgba(255,255,255,.035);--note-shadow:0 2px 10px rgba(0,0,0,.25);--th-bg:rgba(255,255,255,.04);--tab-line:rgba(255,255,255,.1);--icon-ink:rgba(235,235,245,.75);--pop:#2a2a2c;--s-sidebar:rgba(44,44,47,.94);--s-card:rgba(255,255,255,.05);--s-card-line:rgba(255,255,255,.07);--s-shadow:none;--s-pill:var(--accent-btn);--s-pill-ink:#fff;--s-nav:#f5f5f7;--s-nav-ink:#1b1b1d;--s-nav-icon:rgba(0,0,0,.10);--s-sub:rgba(255,159,67,.20);--s-sub-ink:#f5f5f7;--s-chip:rgba(255,159,67,.16);--s-chip-ink:#ffbd7a;--s-input:rgba(255,255,255,.06);--s-badge:#f08a2c;--s-glow:rgba(255,159,67,.08);--s-glow2:rgba(255,255,255,.03);--s-alert:rgba(255,159,67,.12);--s-alert-line:rgba(255,159,67,.25);--s-alert-ink:#ffbd7a;--ch1:#ff9f43;--ch2:#7aa2ff;--ch3:#f5f5f7;--ch4:#4cc38a;--ch5:#ff6b6b;--good:#4cc38a;--bad:#ff6b6b}
:root,body,button,select,input,textarea,[dir=rtl],[dir=rtl] h1{font-family:var(--font)}

/* Chrome: translucent sidebar and toolbar, the only blurred surfaces */
.topbar>.eyebrow{font-size:13px;letter-spacing:0;text-transform:none;font-weight:600;color:var(--ink);opacity:1}
.brand small{display:block;white-space:normal;color:var(--faint);text-transform:none;letter-spacing:0;font-size:11px;font-weight:500;margin-top:10px}
.control{color:var(--faint);font-size:10px;font-weight:500;gap:3px}

/* Sidebar: accent-coloured line icons, grey fill for the current item (Apple Music) */
.nav-item,.nav-item:hover:not(:disabled),.nav-item.active,[data-theme=light] .nav-item.active{border:0;border-radius:7px}
.nav-item .nav-icon{display:grid;place-items:center;box-shadow:none}
.nav-item .nav-icon svg{display:block}

/* Page */
.demo-banner{border:0;border-radius:calc(10px*var(--rk));background:var(--surface);color:var(--muted);font-size:12px}
.demo-banner strong{margin-inline-end:10px;color:var(--ink);font-weight:600}
.heading .eyebrow,[data-theme=brand] .heading .eyebrow{text-transform:none;letter-spacing:0;font-size:13px;font-weight:500}
.subtitle{line-height:1.45;letter-spacing:-.01em;max-width:60ch}

/* Surfaces: flat, faint fill, no shadow, nothing moves */
.stat,.panel{-webkit-backdrop-filter:none;backdrop-filter:none;transform:none}
[data-theme=light] .stat:not(.alert),[data-theme=light] .stat.alert{border-top:0}
.stats{gap:12px;margin-bottom:12px}
.stat{padding:16px 18px 18px;min-height:112px;display:flex;flex-direction:column;justify-content:space-between}
.stat-label,[data-theme=brand] .stat-label{color:var(--muted);font-size:12px;font-weight:500;min-height:0;opacity:1}
.stat-value{font:600 30px/1 var(--font);letter-spacing:-.02em;color:var(--ink)}
.stat.alert{background:var(--surface)}
.stat.alert .stat-value{background:none;-webkit-background-clip:border-box;background-clip:border-box;color:var(--accent)}
.grid{gap:12px;margin-bottom:12px}
.panel-heading,[data-theme=light] .panel-heading{border-bottom:0;padding-bottom:0;margin-bottom:6px}

/* Lists: hairline separators */
.task{border:0;border-top:1px solid var(--hair);padding:14px 0}
.task:first-child{border-top:0}
.task p,.task-footer,.event p,.empty,.history-item,.detail dt,th{color:var(--muted)}
.task p{font-size:13px;line-height:1.5;margin:4px 0}
.task-footer{font-size:12px;color:var(--faint)}
.event{border:0;border-top:1px solid var(--hair);padding:12px 0}
.event:first-child{border-top:0;padding-top:2px}
.team-row,.history-item,th,td{border-color:var(--hair)}
.count,.tag{padding:2px 7px;font-size:11px;font-weight:600}

/* Controls: same size in every state; hover only changes the fill */
button,button:hover:not(:disabled),button:active:not(:disabled){border:0;transform:none;box-shadow:none}
button:hover:not(:disabled){background:var(--fill-hover)}
button:active:not(:disabled){opacity:.75}
button.primary:hover:not(:disabled){filter:brightness(1.07)}
button.text,button.text:hover:not(:disabled){background:transparent;color:var(--accent);padding:7px 2px;font-weight:500;text-decoration:none}
button.text:hover:not(:disabled){opacity:.75}
button:disabled{cursor:not-allowed;background:var(--fill);color:var(--faint);opacity:1}
select,input,.client-field textarea,[data-theme=light] select,[data-theme=light] input{border:0;border-radius:7px;background-color:var(--fill);color:var(--ink);padding:6px 10px;font-size:12px;font-weight:500}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
dialog[open]{animation:appear .18s var(--ease)}
dialog::backdrop{background:rgba(0,0,0,.35)}
.client-fieldset{border:0;border-radius:calc(10px*var(--rk));background:var(--surface)}
.notice{border:0}

/* Motion: a short fade when the screen changes; nothing on hover */
@keyframes fade{from{opacity:0}to{opacity:1}}
/* a fade only: a transform on a window would pin a fixed cross to the window instead of the screen */
@keyframes appear{from{opacity:0}to{opacity:1}}
html[data-enter] .main{animation:fade .22s var(--ease)}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
}
@media (max-width:700px){
  .stat{padding:14px;min-height:96px}
  .stat-value{font-size:26px}
}

/* Stable layout: scrollbar space is always reserved, selection never changes element size */
html{scrollbar-gutter:stable}

/* Dialog header with a close button in the top corner (top-left in RTL via logical layout) */
.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}
.dialog-head h2{margin:0}
button.dialog-close,button.dialog-close:hover:not(:disabled){flex:none;display:grid;place-items:center;width:30px;height:30px;padding:0;border-radius:50%;color:var(--muted)}
button.dialog-close:hover:not(:disabled){color:var(--ink)}

/* Selected client still reacts to hover, without changing size */
.client-dialog .dialog-head{position:static;margin-top:0}

/* ===== Workspace components: search, segmented controls, switches, chips, tables, tracks, master-detail ===== */
.icon{display:inline-grid;place-items:center;flex:none}
.icon.muted{color:var(--faint)}
[dir=rtl] .flip{transform:scaleX(-1)}
kbd{font:500 10px/1 var(--font);color:var(--faint);border:1px solid var(--hair);border-radius:5px;padding:3px 5px;white-space:nowrap}

/* Sidebar: search trigger and account block */
button.search-trigger,button.search-trigger:hover:not(:disabled){display:flex;align-items:center;gap:8px;width:100%;padding:7px 10px;border-radius:calc(8px*var(--rk));color:var(--muted);font-weight:400;text-align:start}
.search-trigger span:not(.icon){flex:1}
.account{margin-top:auto;padding-top:14px;border-top:1px solid var(--hair)}
.account .control{display:grid;gap:5px}
.account select{width:100%}

/* Toolbar */
.controls{gap:10px;flex-wrap:nowrap}
button.mobile-menu,button.mobile-menu:hover:not(:disabled){display:none;padding:6px;line-height:0}
.seg{display:inline-flex;gap:2px;padding:2px;border-radius:calc(9px*var(--rk));background:var(--fill)}
.seg button,.seg button:hover:not(:disabled){min-width:34px;height:26px;padding:0 9px;border-radius:7px;background:transparent;color:var(--muted);font-size:11px;font-weight:600;display:inline-grid;place-items:center}
.seg button:hover:not(:disabled){color:var(--ink)}

/* Demo strip */
.demo-banner{align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:6px 14px;margin-bottom:24px}
dialog .demo-banner{display:block;padding:10px 14px}

/* Headings */
.heading-actions{display:flex;gap:8px;flex:none;flex-wrap:wrap}
button.back,button.back:hover:not(:disabled){display:inline-flex;align-items:center;background:transparent;color:var(--accent);margin-bottom:10px;font-weight:500}
button.back:hover:not(:disabled){opacity:.75}
.note{color:var(--faint);font-size:12px;margin:0 0 12px}

/* KPI tiles are buttons: same box in every state */
button.stat,button.stat:hover:not(:disabled){display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;text-align:start;border-radius:calc(12px*var(--rk));padding:16px 18px 18px;min-height:112px;font-weight:400}
button.stat{background:var(--surface)}
button.stat:hover:not(:disabled){background:var(--fill)}
.stat-value bdi{font:inherit}

/* Chips and switch */
.chips{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 4px}
button.chip,button.chip:hover:not(:disabled){display:inline-flex;align-items:center;gap:6px}
button.chip.on,button.chip.on:hover:not(:disabled){background:var(--accent-soft);color:var(--accent)}
.chip-count{font-size:11px;opacity:.75}
button.switch,button.switch:hover:not(:disabled){display:inline-flex;align-items:center;gap:8px;background:transparent;padding:0;color:var(--muted);font-size:12px;font-weight:500}
.switch-track{position:relative;flex:none;width:34px;height:20px;border-radius:var(--r-pill);background:var(--fill-hover);transition:background-color .17s var(--ease)}
.switch-track::after{content:"";position:absolute;top:2px;inset-inline-start:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.3);transition:transform .17s var(--ease)}
.switch[aria-checked=true] .switch-track{background:var(--accent-btn)}
.switch[aria-checked=true] .switch-track::after{transform:translateX(14px)}
[dir=rtl] .switch[aria-checked=true] .switch-track::after{transform:translateX(-14px)}

/* Tags */

/* Data tables */
table.data .num{text-align:end;font-variant-numeric:tabular-nums}
table.data tr.clickable{cursor:pointer}
table.data tr.clickable td:first-child{border-start-start-radius:8px;border-end-start-radius:8px}
table.data tr.clickable td:last-child{border-start-end-radius:8px;border-end-end-radius:8px}
.stage-cell{display:flex;align-items:center;gap:10px}
.paid-cell{display:grid;gap:5px;justify-items:end;min-width:110px}
.paid-cell .bar{width:100%}

/* Stage track */
.track{display:inline-flex;gap:3px;flex:none}
.track .step{width:14px;height:4px;border-radius:2px;background:var(--fill-hover)}
.track .step.done{background:color-mix(in srgb,var(--accent) 55%,transparent)}
.track .step.now{background:var(--accent)}
.track-labels{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;width:100%}
.track-labels .step{width:auto;height:auto;display:grid;gap:8px}
.track-labels .step i{display:block;height:5px;border-radius:3px;background:var(--fill-hover)}
.track-labels .step.done i{background:color-mix(in srgb,var(--accent) 55%,transparent)}
.track-labels .step.now i{background:var(--accent)}
.track-labels small{font-size:11px;color:var(--faint);overflow-wrap:anywhere}
.track-labels .step.done small{color:var(--muted)}
.track-labels .step.now small{color:var(--ink);font-weight:600}

/* Bars */
.bar{display:block;height:4px;border-radius:2px;background:var(--fill-hover);overflow:hidden}
.bar i{display:block;height:100%;border-radius:2px;background:var(--accent)}
.bars{display:grid;gap:10px;padding-top:6px}
.bar-row{display:grid;grid-template-columns:minmax(84px,34%) 1fr 20px;align-items:center;gap:10px;font-size:12px;color:var(--muted)}
.bar-row strong{color:var(--ink);text-align:end;font-weight:600}

/* Row lists */
.rows{display:grid;gap:1px}
button.row,button.row:hover:not(:disabled),button.md-row,button.md-row:hover:not(:disabled),button.team-row,button.team-row:hover:not(:disabled){display:flex;align-items:center;gap:12px;width:100%;text-align:start;background:transparent;border-radius:calc(8px*var(--rk));padding:8px;font-weight:400}
button.row:hover:not(:disabled),button.md-row:hover:not(:disabled),button.team-row:hover:not(:disabled){background:var(--fill)}
.row-date{flex:none;width:52px;font-size:12px;font-weight:600;color:var(--accent)}
.row-date.unknown{color:var(--faint);font-weight:500}
.row-text{display:grid;gap:1px;min-width:0;flex:1}
.row-text strong{font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-text small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
button.team-row,button.team-row:hover:not(:disabled){justify-content:space-between;border-bottom:0;font-size:13px}
.team-count{display:inline-flex;align-items:center;gap:8px}

/* Money */
.money-list{display:grid;gap:12px;margin-bottom:6px}
.money-row{display:flex;align-items:end;justify-content:space-between;gap:10px;flex-wrap:wrap}
.money-row small,.fin-card>small{font-size:12px;color:var(--muted)}
.money-value{margin:2px 0 0;font:600 22px/1.15 var(--font);letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.money-value.big{font-size:30px;margin:4px 0 14px}
.line-sums{margin:8px 0 0;font:600 13px/1.6 var(--font);color:var(--ink);font-variant-numeric:lining-nums tabular-nums}
.fin-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;margin-bottom:12px}
.fin-card{margin-bottom:0}
.fin-lines{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:14px 0 0}
.fin-lines dt{font-size:11px;color:var(--faint);margin-bottom:3px}
.fin-lines dd{margin:0;font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}
.fin-lines dd.warn{color:var(--warning-ink)}

/* Master-detail (clients) */
.md{display:grid;gap:12px;align-items:start}
.md-list{padding:10px;margin-bottom:0;position:sticky;top:68px}
.md-search{width:100%;margin-bottom:8px}
.md-rows{display:grid;gap:1px}
button.md-row.active,button.md-row.active:hover:not(:disabled){background:var(--fill-hover)}
.avatar{letter-spacing:.02em}
.avatar.big{width:52px;height:52px;font-size:16px}
.client-head{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.client-head h2{font-size:20px;margin:0 0 2px}
.client-head .subtitle{font-size:13px}
.md-detail .stats{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.md-detail .panel,.md-detail .stats{margin-bottom:12px}
.client-section-title{margin:18px 0 10px;font-size:12px;font-weight:600;color:var(--faint)}
.detail{gap:14px 20px}
.detail dt{font-size:12px;margin-bottom:3px}
.detail dd{font-size:14px}

/* Planned modules */
.soon{display:grid;justify-items:start;gap:10px;padding:32px 28px}
.soon p{margin:0;max-width:62ch;color:var(--muted);font-size:14px;line-height:1.5}
.soon-icon{color:var(--accent)}

/* Quick search */
dialog.palette{width:560px;max-width:calc(100vw - 24px);margin-top:12vh;padding:0;overflow:hidden}
.palette-input{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--hair);color:var(--muted)}
.palette-input input,.palette-input input:focus-visible{flex:1;background:transparent;padding:4px 0;font-size:16px;font-weight:400;outline:0}
.palette-list{max-height:min(52vh,420px);overflow-y:auto;padding:6px}
.palette-group{padding:10px 10px 4px;font-size:11px;font-weight:600;color:var(--faint)}
.palette-item{display:flex;align-items:center;gap:12px;padding:8px 10px;border-radius:calc(8px*var(--rk));cursor:pointer;color:var(--ink)}
.palette-item .icon{color:var(--accent)}
.palette-item.on{background:var(--fill-hover)}
.palette .empty{padding:18px 12px}
.notice{color:var(--muted);padding:10px 14px;margin-bottom:12px;font-size:13px}
.notice strong{color:var(--ink)}
.notice.error{background:var(--warning-bg);color:var(--warning-ink)}
@media (max-width:700px){
  button.mobile-menu,button.mobile-menu:hover:not(:disabled){display:inline-grid;margin-inline-start:0}
  .controls{flex-basis:100%;justify-content:space-between}
  .account{margin-top:8px}
  .md-list{position:static}
  .md-rows{max-height:216px;overflow-y:auto}
  .fin-lines{grid-template-columns:1fr 1fr}
  .track-labels small{font-size:10px}
  .heading{display:flex;flex-wrap:wrap;gap:12px}
  /* tables become cards */
  table.data thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  table.data,table.data tbody,table.data tr,table.data td{display:block;width:100%}
  table.data tr{padding:10px 0;border-bottom:1px solid var(--hair)}
  table.data tr:last-child{border-bottom:0}
  table.data td,table.data .num{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:4px 0;border:0;text-align:end;white-space:normal}
  table.data td::before{content:attr(data-label);color:var(--faint);font-size:12px;text-align:start;flex:none}
  table.data td:first-child::before{display:none}
  .paid-cell{min-width:0}
}
.track-labels .step,.track-labels .step.done,.track-labels .step.now{background:none}
.stage-cell{flex-wrap:wrap;row-gap:4px}
@media (max-width:700px){
  .stage-cell{justify-content:flex-end}
  .demo-banner{font-size:11px}
}

/* ===== Working mode (company server): sign-in, editable lists ===== */
.login{min-height:calc(100vh/var(--zoom,1));display:grid;place-content:center;justify-items:center;gap:22px;padding:32px 16px}
.login .company-logo{width:200px}
.login-card{width:min(420px,calc(100vw - 32px));display:grid;gap:4px}
.login-card h1{font-size:1.6rem;margin:0 0 6px}
.login-card .subtitle{font-size:13px;margin-bottom:8px}
.login-card .client-field{display:grid;gap:6px;margin:8px 0}
.login-card input{width:100%}
.login-card button[type=submit]{margin-top:10px;justify-self:stretch}
.login-card .dialog-actions{justify-content:space-between}
.login .controls{justify-content:center}
.repeat-list{display:grid;gap:10px}
.repeat-row{display:grid;gap:6px;padding:12px;border-radius:calc(10px*var(--rk));background:var(--surface)}
.repeat-row>button.text{justify-self:end}
button.add-row{margin-top:8px}
.client-field select,.client-field input,.client-field textarea{width:100%}
.demo-banner.working strong{color:var(--accent)}
.detail.bank{padding:10px 0;border-top:1px solid var(--hair)}
.detail.bank:first-child{border-top:0}
.account .row-text strong{font-size:13px}
.check-me{position:relative;outline:1px dashed var(--accent);outline-offset:4px;border-radius:calc(8px*var(--rk))}
.check-me::after{content:attr(data-check);position:absolute;top:-2px;inset-inline-end:4px;font-size:10px;font-weight:600;color:var(--accent)}
a.doc-row{display:flex;align-items:center;gap:12px;padding:8px;border-radius:calc(8px*var(--rk));color:var(--ink);text-decoration:none}
a.doc-row:hover{background:var(--fill)}
.settings-ai form{max-width:520px;margin-top:12px}
.settings-ai .client-field{display:grid;gap:6px}
.contact-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 0;border-top:1px solid var(--hair)}
.contact-row:first-child{border-top:0}
.contact-row .row-text small{white-space:normal}
.contact-actions{display:flex;flex-wrap:wrap}
a.chip-link{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:calc(8px*var(--rk));background:var(--fill);color:var(--ink);font-size:12px;font-weight:500;text-decoration:none;transition:background-color .15s var(--ease)}
a.chip-link:hover{background:var(--fill-hover)}
a.chip-link .icon{color:var(--accent)}
.book{display:grid;margin-top:12px;gap:8px}
.book-search{max-width:520px}
.book-group{margin-bottom:0}
.book-group .contact-row:nth-child(2){border-top:0}
.docs .note{margin:0 0 8px}
h3.doc-group{font-size:13px;font-weight:600;color:var(--muted);margin:16px 0 4px}
.doc-line{display:flex;align-items:center;gap:4px}
.doc-line a.doc-row{flex:1;min-width:0}
.doc-line .row-text small{white-space:normal}
button.icon-button{display:inline-grid;place-items:center;width:34px;height:34px;padding:0;border-radius:calc(8px*var(--rk));background:transparent;color:var(--muted)}
button.icon-button:hover:not(:disabled){background:var(--fill);color:var(--ink)}
button.with-icon{display:inline-flex;align-items:center;gap:6px}
button.with-icon .icon{order:-1}
.choice-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:8px}
button.choice-card,button.choice-card:hover:not(:disabled){display:grid;align-content:start;gap:8px;text-align:start;padding:20px;border-radius:calc(14px*var(--rk));background:var(--fill);color:var(--ink);font-weight:400;white-space:normal;line-height:1.45}
button.choice-card:hover:not(:disabled){background:var(--fill-hover)}
button.choice-card strong{font-size:16px}
button.choice-card span:last-child{color:var(--muted);font-size:13px}
button.choice-card .choice-icon{color:var(--accent)}
button.choice-card:disabled{opacity:.55;cursor:not-allowed}
.translate-note{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:0 0 12px;padding:10px 14px;border-radius:calc(10px*var(--rk));background:var(--fill);font-size:13px;color:var(--muted)}
button.row.doc-row,button.row.doc-row:hover:not(:disabled){display:flex;align-items:center;gap:12px;width:100%;padding:8px;border:0;border-radius:calc(8px*var(--rk));background:transparent;color:var(--ink);text-align:start;font-weight:400}
button.row.doc-row:hover:not(:disabled){background:var(--fill)}
a.icon-button{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:calc(8px*var(--rk));color:var(--muted);text-decoration:none}
a.icon-button:hover{background:var(--fill);color:var(--ink)}
.file-badge{flex:none;display:inline-grid;place-items:center;width:34px;height:24px;border-radius:6px;font-size:9px;font-weight:700;letter-spacing:.5px;color:#fff;background:#8a8f8c}
.file-badge.pdf{background:#c2412d}
.file-badge.doc{background:#2b5fb4}
.file-badge.xls{background:#1f7a46}
.file-badge.img{background:#7a5bb0}
.file-badge.big{width:64px;height:44px;font-size:14px}
dialog.viewer{width:min(1100px,calc((100vw - 32px)/var(--zoom,1)));max-width:none;height:calc((100dvh - 32px)/var(--zoom,1));max-height:none;padding:0;overflow:hidden}
dialog.viewer[open]{display:grid;grid-template-rows:auto minmax(0,1fr)}
.viewer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid var(--hair)}
.viewer-head .row-text{min-width:0}
.viewer-head strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.viewer-tools{display:flex;align-items:center;gap:2px;flex:none}
.zoom-value{min-width:46px;text-align:center;font-size:12px;color:var(--muted)}
.viewer-body{overflow:auto;background:var(--fill);padding:16px}
.viewer-status{text-align:center;margin:0 0 12px}
.viewer-pages{display:grid;justify-items:center;gap:12px}
.viewer-page{background:#fff;box-shadow:0 1px 6px rgba(0,0,0,.18);max-width:none}
.viewer-mates{display:inline-flex;align-items:center;gap:2px;margin-inline-end:6px}
.viewer-turn{font-size:20px;line-height:1;font-weight:500}
.viewer-page{position:relative}
.viewer-page canvas{display:block;width:100%;height:100%}
/* the text of a PDF page over its picture: unseen, selected and copied (the rules PDF.js gives for its text layer) */
.viewer-page .textLayer{position:absolute;inset:0;overflow:clip;opacity:1;line-height:1;text-align:initial;-webkit-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;caret-color:CanvasText;z-index:1;--min-font-size:1;--text-scale-factor:calc(var(--total-scale-factor) * var(--min-font-size));--min-font-size-inv:calc(1 / var(--min-font-size))}
.viewer-page .textLayer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%}
.viewer-page .textLayer>:not(.markedContent),.viewer-page .textLayer .markedContent span:not(.markedContent){z-index:1;--font-height:0;font-size:calc(var(--text-scale-factor) * var(--font-height));--scale-x:1;--rotate:0deg;transform:rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv))}
.viewer-page .textLayer .markedContent{display:contents}
.viewer-page .textLayer span[role=img]{user-select:none;cursor:default}
.viewer-page .textLayer ::selection{background:rgba(0,90,255,.28)}
.viewer-page .textLayer br::selection{background:transparent}
.viewer-page .textLayer .endOfContent{display:block;position:absolute;inset:100% 0 0;z-index:0;cursor:default;user-select:none}
.viewer-image{display:block;max-width:100%;margin:auto;background:#fff}
.viewer-office{display:grid;justify-items:center;gap:16px;max-width:460px;margin:12vh auto 0;text-align:center;line-height:1.6;color:var(--muted)}
a.button{display:inline-block;padding:10px 16px;border-radius:calc(9px*var(--rk));text-decoration:none;font-weight:600}
a.button.primary{background:var(--accent);color:#fff}
@media (max-width:700px){
  dialog.viewer{width:calc(100vw/var(--zoom,1));height:calc(100dvh/var(--zoom,1));border-radius:0}
  .viewer-head{padding:8px 10px}
  .viewer-body{padding:8px}
}
button.row.contract-row,button.row.contract-row:hover:not(:disabled){display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;width:100%;padding:10px 8px;border:0;border-radius:calc(8px*var(--rk));background:transparent;color:var(--ink);text-align:start;font-weight:400}
button.row.contract-row:hover:not(:disabled){background:var(--fill)}
.contract-row .row-text small{white-space:normal}
.tag.good{white-space:normal}
label.check-field{display:flex;align-items:center;gap:10px;margin:14px 0 4px;font-size:13px}
label.check-field input{width:18px;height:18px;accent-color:var(--accent)}
details.panel.book-group{padding:0;margin:0}
summary.book-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;cursor:pointer;list-style:none;border-radius:calc(14px*var(--rk))}
summary.book-summary::-webkit-details-marker{display:none}
summary.book-summary:hover{background:var(--fill)}
summary.book-summary strong{display:block;font-size:15px}
summary.book-summary small{color:var(--muted)}
summary.book-summary .chevron{flex:none;color:var(--muted);transition:transform .15s var(--ease)}
details[open]>summary.book-summary .chevron{transform:rotate(90deg)}
[dir=rtl] summary.book-summary .chevron{transform:scaleX(-1)}
[dir=rtl] details[open]>summary.book-summary .chevron{transform:rotate(90deg)}
.book-people{padding:0 18px 12px}
.book-people .contact-row:first-child{border-top:1px solid var(--hair)}
.book-foot{padding-top:8px}
.viewer-body.editing{padding:0;background:var(--dialog)}
.office-holder{width:100%;height:100%}
.viewer-body.editing .viewer-status,.viewer-body.editing .notice{margin:16px}
button.edit-button,button.edit-button:hover:not(:disabled){margin-inline-end:6px;padding:7px 12px;border-radius:calc(8px*var(--rk));background:var(--fill);color:var(--ink);font-size:13px;font-weight:600}
button.edit-button:hover:not(:disabled){background:var(--fill-hover)}
dialog.journal-dialog{width:720px;max-width:calc((100vw - 28px)/var(--zoom,1));max-height:calc((100vh - 32px)/var(--zoom,1));max-height:calc((100dvh - 32px)/var(--zoom,1));overflow:auto}
.journal-item strong{color:var(--ink)}
.journal-item .fingerprint{display:block;color:var(--muted);font-size:11px}
.kyc-row{display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px;margin:10px 0 14px}
.kyc-row label.client-field{margin:0;min-width:200px}
.kyc-row button.primary{align-self:flex-end}
.list-tools{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 14px;margin-bottom:14px}
.list-tools .md-search{flex:1 1 260px;min-width:200px}
.list-tools label.client-field{margin:0;min-width:150px}
.list-tools .list-count{color:var(--muted);font-size:12px;margin-inline-start:auto}
button.th-sort,button.th-sort:hover:not(:disabled){padding:0;border:0;background:transparent;color:var(--muted);font-size:11px;font-weight:600;text-transform:inherit;cursor:pointer}
button.th-sort.on{color:var(--ink)}
.sort-arrow{font-size:10px}
.group-head{margin:18px 0 6px;font-size:14px}
.group-head span{color:var(--muted)}
.group-head+.table-wrap{margin-bottom:8px}
.contact-note{display:block;white-space:normal;color:var(--muted);margin-top:2px}
.task-row{display:flex;align-items:flex-start;gap:12px;padding:10px 0;border-top:1px solid var(--hair)}
.task-row:first-child{border-top:0}
.task-row input[type=checkbox]{width:18px;height:18px;margin-top:3px;accent-color:var(--accent);flex:none}
button.task-text,button.task-text:hover:not(:disabled){flex:1;display:grid;gap:2px;text-align:start;padding:0;border:0;background:transparent;color:var(--ink);font-weight:400;white-space:normal}
button.task-text small{color:var(--muted)}
.task-row.done strong{text-decoration:line-through;color:var(--muted)}
.task-row.overdue small{color:var(--warning-ink)}
.notes-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}
.note-card{display:grid;gap:8px;padding:14px;margin:0}
.note-text{width:100%;min-height:140px;resize:vertical;font:inherit;line-height:1.5;background:transparent;border:0;outline:0;padding:4px}
.note-foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.note-status{color:var(--muted);margin-inline-start:auto}
.note-suggestions label.check-field{align-items:flex-start;margin:6px 0}
.note-suggestions small{display:block;color:var(--muted)}
.cal-grid{display:grid;grid-template-columns:34px repeat(7,minmax(0,1fr));gap:4px}
.cal-head{font-size:11px;color:var(--muted);text-align:center;padding:4px 0}
.cal-week{font-size:11px;color:var(--muted);display:grid;place-items:center;background:var(--fill);border-radius:calc(8px*var(--rk))}
.cal-day{min-height:92px;border-radius:calc(10px*var(--rk));background:var(--fill);padding:4px;display:grid;align-content:start;gap:3px}
.cal-day.other{opacity:.45}
.cal-day.today{outline:2px solid var(--accent);outline-offset:-2px}
button.cal-num,button.cal-num:hover:not(:disabled){justify-self:end;width:26px;height:26px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted);font-size:12px}
button.cal-num:hover:not(:disabled){background:var(--fill-hover);color:var(--ink)}
button.cal-item,button.cal-item:hover:not(:disabled){display:flex;gap:4px;width:100%;padding:3px 6px;border:0;border-radius:6px;font-size:11px;line-height:1.3;text-align:start;white-space:normal;background:var(--surface);color:var(--ink);border-inline-start:3px solid var(--accent)}
button.cal-item.meeting{border-color:#2b5fb4}
button.cal-item.reminder{border-color:#7a5bb0}
button.cal-item.notice,button.cal-item.contractEnd,button.cal-item.expiry{border-color:#c2412d}
button.cal-item.done{opacity:.5;text-decoration:line-through}
.cal-time{font-weight:600;flex:none}
.cal-list{display:none}
.cal-list-day{padding:8px 0;border-top:1px solid var(--hair)}
.cal-list-day strong{display:block;margin-bottom:4px}
@media (max-width:700px){
  .cal-grid{display:none}
  .cal-list{display:block}
}
.kyc-other-note{margin-top:4px}
.nav-badge,.fab-count{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:calc(9px*var(--rk));background:var(--accent);color:#fff;font-size:11px;font-weight:700;margin-inline-start:auto}
button.chat-fab,button.chat-fab:hover:not(:disabled){position:fixed;inset-inline-end:22px;bottom:22px;width:52px;height:52px;padding:0;border:0;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;box-shadow:0 8px 24px rgba(0,0,0,.25);z-index:5}
button.chat-fab .fab-count{position:absolute;top:-4px;inset-inline-end:-4px;background:#c2412d}
.md.chat{align-items:stretch}
.chat-panel{display:flex;flex-direction:column;min-height:min(70vh,640px);padding:0;overflow:hidden}
.chat-pane{display:flex;flex-direction:column;flex:1;min-height:0}
.chat-title{padding:14px 18px;font-weight:600;border-bottom:1px solid var(--hair)}
.chat-messages{flex:1;overflow:auto;padding:14px 18px;display:flex;flex-direction:column;gap:8px}
.bubble{max-width:78%;padding:9px 12px;border-radius:calc(14px*var(--rk));background:var(--fill);align-self:flex-start;font-size:14px;line-height:1.45}
.bubble.own{align-self:flex-end;background:var(--accent);color:#fff}
.bubble.own .bubble-time,.bubble.own .chip-link{color:#fff;opacity:.9}
.bubble.own .chip-link{background:rgba(255,255,255,.18)}
.bubble-who{display:block;font-weight:600;color:var(--muted);margin-bottom:2px}
.bubble-text{white-space:pre-wrap;overflow-wrap:anywhere}
.bubble-time{display:block;font-size:10px;color:var(--muted);margin-top:4px;text-align:end}
.chat-compose{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--hair)}
.chat-compose textarea{flex:1;resize:none;font:inherit;padding:9px 10px;border:1px solid var(--line);border-radius:calc(10px*var(--rk));background:var(--surface);color:var(--ink);max-height:160px}
.chat-compose select{max-width:160px}
button.send,button.send:hover:not(:disabled){width:38px;height:38px;border-radius:50%;background:var(--accent);color:#fff;border:0;display:grid;place-items:center;padding:0}
@media (max-width:700px){
  .chat-panel{min-height:60vh}
  .bubble{max-width:90%}
  .chat-compose select{display:none}
}
.nav-badge[hidden],.fab-count[hidden]{display:none}
.role-chips{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 10px}
button.chip,button.chip:hover:not(:disabled){padding:5px 10px;border:0;border-radius:var(--r-pill);background:var(--fill);color:var(--muted);font-size:12px;font-weight:600}
button.chip.on{background:var(--accent);color:#fff}
.roles-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin:6px 0 14px}
.roles-label{font-size:13px;color:var(--muted)}
label.check-field.inline{margin:0}
.client-head .tag{margin-inline-start:6px}
.stats.small{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:12px}
.stats.small .stat{padding:12px 14px}
.stats.small .stat-value{font-size:22px;margin-top:4px}
.stage-chain{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px}
.stage{padding:10px;border-radius:calc(10px*var(--rk));background:var(--fill);display:grid;gap:4px;align-content:start}
.stage strong{font-size:13px}
.stage small{color:var(--muted);white-space:normal}
.stage.done{opacity:.6}
.stage.current{outline:2px solid var(--accent);outline-offset:-2px}
button.primary.small{padding:6px 10px;font-size:12px;border-radius:calc(8px*var(--rk));justify-self:start}
button.cal-item.ship{border-color:#1f7a46}
.muted-inline{color:var(--muted);font-weight:400}
tr.inactive{opacity:.5}
.stat-value.money{font-size:20px;line-height:1.3}
.contact-row.overdue strong{color:var(--warning-ink)}
.funnel{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(200px,1fr);gap:10px;overflow-x:auto;padding-bottom:6px}
.funnel-col{display:grid;align-content:start;gap:8px;background:var(--fill);border-radius:calc(12px*var(--rk));padding:10px;min-height:160px}
.funnel-head strong{display:block;font-size:13px}
.funnel-head small{color:var(--muted)}
button.deal-card,button.deal-card:hover:not(:disabled){display:grid;gap:3px;text-align:start;padding:10px;border:0;border-radius:calc(10px*var(--rk));background:var(--surface);color:var(--ink);font-weight:400;white-space:normal;box-shadow:0 1px 3px rgba(0,0,0,.08)}
button.deal-card small{color:var(--muted)}
button.deal-card.overdue .deal-next{color:var(--warning-ink)}
.won-box{display:grid;gap:8px;padding:12px;border-radius:calc(10px*var(--rk));background:var(--fill);margin:8px 0}
.log-compose{display:grid;grid-template-columns:140px 1fr auto;gap:8px;align-items:start;margin-top:10px}
.log-compose textarea{width:100%}
@media (max-width:700px){
  .funnel{grid-auto-columns:minmax(240px,80vw)}
  .log-compose{grid-template-columns:1fr}
}
.nav-caret{margin-inline-start:auto;color:var(--muted);transition:transform .15s var(--ease)}
.journal-month{margin:6px 0}
.journal-month summary{cursor:pointer;padding:6px 0}
@media (max-width:700px){
  .sidebar nav{grid-template-columns:1fr}
}
button.row.mail-row,button.row.mail-row:hover:not(:disabled){display:block;width:100%;text-align:start;padding:10px 12px;border:0;border-radius:calc(8px*var(--rk));background:transparent;color:var(--ink);font-weight:400;white-space:normal}
button.row.mail-row:hover:not(:disabled),button.row.mail-row.active{background:var(--fill)}
button.row.mail-row.unread strong{font-weight:700}
button.row.mail-row.unread::before{width:7px;height:7px;border-radius:50%;background:var(--accent);margin-inline-end:6px;vertical-align:middle;content:none;display:none}
.mail-subject{display:block;font-size:14px;margin:2px 0}
.mail-row small{color:var(--muted);display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mail-body{white-space:pre-wrap;font:inherit;line-height:1.5;margin:14px 0;overflow-wrap:anywhere}

/* ===== 2026-10-07: brand theme in the colours of primegrowers.org, compact cabinet, clear notes, chat button ===== */

/* brand theme: the site's forest green, cream type, beige eyebrows, citrus orange; serif page titles like the site */
:root:not([data-theme=dark]):not([data-theme=light]){--bg:#1e3a2a;--bg-tint:rgba(245,138,63,.10);--chrome:rgba(20,42,29,.86);--surface:rgba(255,250,241,.065);--fill:rgba(255,250,241,.09);--fill-hover:rgba(255,250,241,.14);--hair:rgba(255,250,241,.12);--line:rgba(255,250,241,.12);--ink:#fffaf1;--muted:rgba(255,250,241,.72);--faint:rgba(255,250,241,.5);--accent:#f58a3f;--accent-btn:#d9641e;--accent-soft:rgba(245,138,63,.16);--warning-bg:rgba(245,138,63,.16);--warning-ink:#ffbf8f;--dialog:#21402e;--note-bg:rgba(242,213,164,.12);--note-line:rgba(242,213,164,.45);--note-blank:rgba(255,250,241,.05);--note-shadow:0 2px 10px rgba(0,0,0,.18)}
:root:not([data-theme=dark]):not([data-theme=light]) .heading .eyebrow,:root:not([data-theme=dark]):not([data-theme=light]) .brand small{color:#f2d5a4}

/* notes: paper-like cards that stand out in every theme */
.note-text{font-size:14px;color:var(--ink)}
.note-text::placeholder{color:var(--muted);opacity:1}

/* chat button: always the brand orange; when the chat is open it shows a cross to close it */
button.chat-fab.on,button.chat-fab.on:hover:not(:disabled){background:var(--accent-btn);color:#fff;box-shadow:0 0 0 4px var(--accent-soft),0 8px 24px rgba(0,0,0,.25)}

/* cabinet: one compact row of figures, then two columns */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
button.kpi,button.kpi:hover:not(:disabled){display:flex;align-items:baseline;justify-content:space-between;gap:10px;border:0;background:var(--surface);color:var(--ink);text-align:start;font-weight:400;min-height:0;padding:14px 18px;border-radius:calc(14px*var(--rk))}
button.kpi:hover:not(:disabled){background:var(--fill)}
.kpi-label{font-size:12px;color:var(--muted);line-height:1.3}
.kpi-value{font-variant-numeric:tabular-nums;color:var(--ink)}
button.kpi.alert .kpi-value{color:var(--accent)}
.cabinet{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);align-items:start;gap:18px}
.cabinet .panel .subtitle,.cabinet .panel .note{font-size:12px;margin:0 0 6px}
.cabinet .empty{padding:6px 0}
@media (max-width:1000px){
  .cabinet{grid-template-columns:1fr}
}
.cabinet button.row,.cabinet button.row:hover:not(:disabled){flex-wrap:wrap;row-gap:6px}
.cabinet button.row .row-text{flex:1 1 100%;min-width:0}
.cabinet button.row .row-text strong{white-space:normal}
.cabinet button.row>.tag{white-space:normal;text-align:start}

/* ===== 2026-10-07: modern Apple look - colour tiles for sections, airy spacing, Apple light theme ===== */

/* airy layout for every theme */
.panel{min-width:0;margin-bottom:18px}
.panel-heading{margin-bottom:16px}
.cabinet>div>.panel{padding:22px 24px;margin-bottom:18px}
.kpis{gap:10px;margin-bottom:22px}
button.primary,button.primary:hover:not(:disabled),.heading-actions button,.dialog-actions button{border-radius:var(--r-pill);padding:9px 18px}

/* Apple light theme: soft grey canvas, white cards with a gentle shadow, frosted sidebar */
:root[data-theme=light] button.kpi:hover:not(:disabled){background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.05),0 8px 28px rgba(0,0,0,.08)}
:root[data-theme=light] .demo-banner{background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.04)}
:root[data-theme=light] .panel .panel{box-shadow:none;background:#f5f5f7}

/* counterparty histories */
.history-blocks{display:grid;grid-template-columns:minmax(0,1fr);gap:18px}
.history-block-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px}
.history-block-head h3{margin:0}
div.kpi{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:12px 16px;border-radius:calc(14px*var(--rk));background:var(--fill)}
table.data.mini th,table.data.mini td{padding:9px 10px;font-size:12.5px}
.md-list .list-count{margin:6px 2px 8px;font-size:12px;color:var(--muted)}

/* ===== 2026-10-07: clean SaaS shell (Knack / modern ERP reference) =====
   sidebar with sections and thin monochrome icons, tabs for sub-sections, top bar with search and the user */

/* sidebar */
.brand{padding:4px 8px 6px}
.nav-item,.nav-item:hover:not(:disabled),.nav-item.active{display:flex;align-items:center;gap:12px;padding:9px 12px;border:0;border-radius:calc(8px*var(--rk));font-size:14.5px;width:100%;text-align:start}
.nav-item .nav-badge{margin-inline-start:auto}

/* top bar */
.topbar{justify-content:space-between;flex-wrap:nowrap;display:flex;align-items:center}
.global-search{position:relative}
.global-search input{width:100%;padding:10px 14px 10px 40px;font-size:14px;color:var(--ink)}
.global-search input:focus{outline:0;box-shadow:0 0 0 3px var(--accent-soft)}
[dir=rtl] .global-search input{padding:10px 40px 10px 14px}
.global-search .search-icon{position:absolute;inset-inline-start:13px;top:50%;transform:translateY(-50%);color:var(--faint);pointer-events:none;display:grid}
.search-results,.popover{position:absolute;top:calc(100% + 8px);z-index:30;background:var(--pop);border:1px solid var(--hair);border-radius:calc(12px*var(--rk));box-shadow:0 12px 40px rgba(0,0,0,.16);padding:8px;max-height:70vh;overflow:auto}
.search-results[hidden],.popover[hidden]{display:none}
.search-results{inset-inline:0}
.search-group,.pop-title{font-size:11px;font-weight:600;color:var(--faint);text-transform:uppercase;letter-spacing:.04em;padding:8px 10px 4px}
button.search-hit,button.search-hit:hover:not(:disabled),button.pop-item,button.pop-item:hover:not(:disabled){display:block;width:100%;text-align:start;border:0;background:transparent;color:var(--ink);padding:8px 10px;border-radius:calc(8px*var(--rk));font-weight:400;font-size:14px;white-space:normal}
button.search-hit:hover:not(:disabled),button.pop-item:hover:not(:disabled){background:var(--fill)}
button.search-hit strong{display:block;font-weight:600;font-size:14px}
button.search-hit small{display:block;color:var(--muted);font-size:12px}
.search-empty{color:var(--muted);font-size:13px;padding:10px}
.top-controls{display:flex;align-items:center}
select.lang-select{padding:7px 8px;font-size:12.5px;font-weight:600;color:var(--ink);width:auto}
button.top-icon,button.top-icon:hover:not(:disabled){position:relative;display:grid;place-items:center;width:38px;height:38px;padding:0;border:0;border-radius:calc(10px*var(--rk));background:transparent;color:var(--icon-ink)}
button.top-icon:hover:not(:disabled){background:var(--fill)}
.bell-count{position:absolute;top:4px;inset-inline-end:3px;min-width:16px;height:16px;padding:0 4px;border-radius:calc(8px*var(--rk));background:#e5484d;color:#fff;font-size:10px;font-weight:700;display:grid;place-items:center}
.bell-count[hidden]{display:none}
.pop-wrap{position:relative}
.pop-wrap .popover{inset-inline-end:0;width:min(420px,90vw)}
.popover .panel{padding:0;margin:0;background:none!important;box-shadow:none!important;border:0!important}
.popover .panel-heading{display:none}
button.user-chip,button.user-chip:hover:not(:disabled){display:flex;align-items:center;gap:10px;padding:5px 8px 5px 5px;border:0;border-radius:calc(24px*var(--rk));background:transparent;color:var(--ink);font-weight:400}
button.user-chip:hover:not(:disabled){background:var(--fill)}
.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--accent-btn);color:#fff;font-weight:700;font-size:13px;flex:none}
.user-text{display:grid;text-align:start;line-height:1.2}
.user-text strong{font-size:13.5px;font-weight:600}
.user-text small{font-size:11.5px;color:var(--muted)}
.pop-user{display:grid;padding:8px 10px 10px;border-bottom:1px solid var(--hair);margin-bottom:6px}
.pop-user small{color:var(--muted)}
.pop-wrap:has(.user-chip) .popover{width:240px}

/* page */
.tab-soon{font-size:10.5px;padding:1px 6px;border-radius:6px;background:var(--fill);color:var(--muted)}
h1,:root:not([data-theme=dark]):not([data-theme=light]) h1{font:600 28px/1.2 var(--font-head,var(--font));letter-spacing:-.02em;margin:0 0 6px}
.heading{align-items:center}
.subtitle{font-size:14px}

/* cards and tables */
:root[data-theme=light] .panel:not(.note-card),:root[data-theme=light] .stat,:root[data-theme=light] button.kpi,:root[data-theme=light] .md-list{background:#fff;border:1px solid #e7e9ee;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.table-wrap{border:1px solid var(--hair);border-radius:calc(12px*var(--rk));overflow:auto}
table.data{font-size:13px;border-collapse:separate;border-spacing:0;width:100%}
table.data th{background:var(--th-bg);color:var(--muted);font-size:12.5px;font-weight:500;text-transform:none;letter-spacing:0;padding:11px 14px;border-bottom:1px solid var(--hair)}
table.data td{vertical-align:middle;padding:12px 14px;font-size:14px;border-bottom:1px solid var(--hair)}
table.data tr:last-child td{border-bottom:0}
table.data tr.clickable:hover td{background:var(--fill)}
.demo-banner{display:none}
@media (max-width:1000px){
  .user-text{display:none}
}
@media (max-width:700px){
  .topbar{flex-wrap:wrap}
  .global-search{order:3}
}

/* ===== 2026-10-07: use the whole width of large desktop monitors ===== */
.main{max-width:none;margin:0}
.detail{grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
.md{grid-template-columns:320px minmax(0,1fr)}
@media (min-width:1800px){
  .md{grid-template-columns:360px minmax(0,1fr)}
  .cabinet{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)}
  .cabinet>div:first-child{grid-column:span 2}
}
/* how much larger the page is drawn than its own size (zoom on the body): a viewport unit is not scaled with it, so every size taken from the viewport is divided by --zoom (set beside each zoom rule, this default first) */
:root{--zoom:1}
@media (min-width:2200px){
  :root{--zoom:1.15}
  body{zoom:1.15}
}
.popover.quick-note{width:min(440px,90vw)}
.popover.quick-note textarea{width:100%;margin:4px 0 8px;resize:vertical}
.quick-note-foot{display:flex;align-items:center;gap:8px}
.quick-note-foot .note-status{margin-inline-end:auto;color:var(--muted)}

/* ===== 2026-10-07: sub-sections back in the left menu as a tree; clickable values ===== */
.nav-item .nav-caret{margin-inline-start:auto;color:var(--faint);display:grid;transition:transform .15s var(--ease)}
.nav-item.open .nav-caret{transform:rotate(180deg)}
.nav-subs{display:grid;gap:1px;margin:2px 0 6px}
button.nav-sub,button.nav-sub:hover:not(:disabled){display:flex;align-items:center;gap:8px;width:100%;text-align:start}
button.nav-sub:disabled{opacity:.6}
.nav-sub .nav-badge{margin-inline-start:auto}
a.value-link,button.value-link,button.value-link:hover:not(:disabled){color:var(--accent);text-decoration:none;background:none;border:0;padding:0;font:inherit;font-weight:500;cursor:pointer;text-align:start;white-space:normal}
a.value-link:hover,button.value-link:hover:not(:disabled){text-decoration:underline}
.terms-line{margin:0 0 4px;font-size:15px}
.muted-block{display:block;color:var(--muted);margin-bottom:8px}
.terms-preview-box{padding:10px 12px;border-radius:calc(10px*var(--rk));background:var(--fill);margin:8px 0}
.terms-preview-box small{color:var(--muted)}
.terms-preview{margin:4px 0 0;font-weight:600}

/* dialogs are always solid, in every theme */
dialog,dialog[open]{background:var(--dialog,#fff)!important;color:var(--ink)}
:root[data-theme=light] dialog{background:#fff!important}
.terms-quote{margin:8px 0;padding:10px 14px;border-inline-start:3px solid var(--accent);background:var(--fill);border-radius:calc(8px*var(--rk))}
.terms-quote small{color:var(--muted)}
.terms-quote p{margin:4px 0 0;line-height:1.5}
.terms-review{display:flex;align-items:center;gap:12px;flex-wrap:wrap}

/* ===== how we work ===== */
.process-principles{display:grid;gap:8px}
.process-principle{display:flex;gap:10px;align-items:flex-start;margin:0;font-weight:500}
.process-principle .icon{color:var(--accent);flex:none;margin-top:1px}
.process-filter{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:6px 0 16px}
.process-roles{display:flex;gap:6px;flex-wrap:wrap}
.process-flow{display:grid;gap:18px;margin-bottom:22px}
.process-phase{background:var(--surface);border:1px solid var(--hair);border-radius:calc(16px*var(--rk));padding:18px 20px;overflow:hidden}
.process-phase-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.process-phase-head h2{margin:0}
.process-phase-n{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--accent-btn);color:#fff;font-weight:700;font-size:13px}
.process-row{display:flex;align-items:stretch;gap:10px;overflow-x:auto;padding-bottom:4px}
.process-card{flex:1 1 0;min-width:240px;display:grid;align-content:start;gap:8px;padding:14px 16px;border-radius:calc(14px*var(--rk));background:var(--fill);border:1px solid var(--hair);transition:opacity .15s}
.process-card.dim{opacity:.35}
.process-card-head{display:flex;align-items:baseline;gap:8px}
.process-card-head h3{margin:0;font-size:15px}
.process-n{font-weight:700;color:var(--accent);font-variant-numeric:tabular-nums}
.process-who{display:flex;flex-wrap:wrap;gap:5px}
.process-does{margin:0;line-height:1.5;font-size:13.5px}
.process-meta{margin:0;font-size:12.5px;color:var(--muted);line-height:1.45}
.process-meta strong{color:var(--ink);font-weight:600}
.process-meta.erp{border-top:1px dashed var(--hair);padding-top:6px}
.process-arrow{align-self:center;color:var(--faint);font-size:20px;flex:none}
.role-pill{display:inline-block;padding:2px 9px;border-radius:var(--r-pill);font-size:11.5px;font-weight:600;white-space:nowrap;color:#fff}
.role-director{background:#8a5a2b}
.role-manager{background:#2f7cf6}
.role-logistics{background:#5e5ce6}
.role-quality{background:#16a06a}
.role-accountant{background:#9d46d6}
.role-station{background:#a7835a}
.role-purchaser{background:#d9822b}
.process-role-list{display:grid;gap:10px}
.process-role{display:grid;grid-template-columns:220px 1fr auto;gap:12px;align-items:center}
.process-flow,.process-flow>*{min-width:0}

/* ===== delivery file ===== */
.stage-strip{display:flex;gap:8px;padding:2px 0 14px;margin-bottom:6px}
button.stage-chip,button.stage-chip:hover:not(:disabled){flex:none;display:flex;align-items:center;gap:8px;padding:8px;padding-inline-end:12px;border-radius:calc(12px*var(--rk));border:1px solid var(--hair);background:var(--surface);color:var(--ink);text-align:start;font-weight:400}
button.stage-chip:hover:not(:disabled){background:var(--fill)}
.stage-dot{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;font-size:12px;font-weight:700;background:var(--fill-hover);color:var(--muted);flex:none}
.stage-chip.done .stage-dot{background:#1f9d55;color:#fff}
.stage-chip.attention .stage-dot{background:#e5671f;color:#fff}
.stage-chip.active .stage-dot{background:#2f7cf6}
.stage-chip.attention{border-color:rgba(229,103,31,.45)}
.stage-text{display:grid;line-height:1.2}
.stage-text strong{font-size:13px}
.stage-text small{font-size:11px;color:var(--muted)}
.doc-check .doc-check-mark{color:var(--muted)}
.doc-check.done .doc-check-mark{color:#1f9d55}
.doc-check-files{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:12.5px}
.calc-table td.num{text-align:end;font-variant-numeric:tabular-nums;white-space:nowrap}
.calc-table tr.minus td{color:var(--muted)}
.calc-table tr.calc-total td{font-weight:700;border-top:2px solid var(--hair)}
.calc-kpis{margin:12px 0}
.calc-inputs{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-top:10px}
.calc-inputs label{max-width:160px}
.stack{display:grid;gap:6px}
.qc-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px;margin:8px 0}
button.qc-photo,button.qc-photo:hover:not(:disabled){padding:0;border:1px solid var(--hair);border-radius:calc(10px*var(--rk));overflow:hidden;background:var(--fill);aspect-ratio:4/3}
.qc-photo img{width:100%;height:100%;object-fit:cover;display:block}
.cal-cycle{display:block;font-size:10.5px;color:var(--faint);margin:-2px 0 3px;text-transform:lowercase}
.cal-cycle.cycleOffers{color:#2f7cf6}
.cal-cycle.cyclePlan{color:#16a06a}
button.cal-item.tender{border-inline-start:3px solid #e5671f}
.cal-their{color:var(--muted)}
.weekday-picks{display:flex;flex-wrap:wrap;gap:6px 14px}
.report-card h2{margin:0}
.qty-low{color:#d9480f;font-weight:600}
tr.low td:first-child{box-shadow:inset 3px 0 0 #e5671f}

/* the sandbox's warning across the top of every screen (scripts/sandbox.cjs only) */
.sandbox-bar{position:fixed;left:50%;bottom:10px;transform:translateX(-50%);z-index:65;display:flex;align-items:center;gap:7px;padding:5px 11px 5px 9px;border-radius:999px;background:rgba(198,40,40,.92);color:#fff;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;line-height:1.2;box-shadow:0 6px 18px -8px rgba(0,0,0,.5);cursor:help}
.sandbox-bar::before{content:'';width:8px;height:8px;border-radius:50%;background:#fff;box-shadow:0 0 0 3px rgba(255,255,255,.25)}
.sd-lines{display:grid;gap:8px}
.sd-line{display:grid;grid-template-columns:minmax(200px,2fr) 110px 110px 80px 1fr auto;gap:8px;align-items:center}
.sd-line select,.sd-line input{width:100%}

/* a stock document line on a phone: the material across, the figures two by two under it */
@media (max-width:760px){
  .sd-line{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .sd-line>select:first-child{grid-column:1/-1}
}
input.count-input{max-width:120px}
.empty-state{display:grid;gap:12px;justify-items:start}
.drop-zone{display:grid;justify-items:center;gap:6px;padding:28px;border:2px dashed var(--hair);border-radius:calc(16px*var(--rk));background:var(--surface);color:var(--muted);cursor:pointer;margin-bottom:18px;text-align:center}
.drop-zone strong{color:var(--ink)}
.drop-zone.over{border-color:var(--accent);background:var(--accent-soft)}
.drop-zone .icon{color:var(--accent)}
.tray-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}
.tray-card{display:grid;gap:8px;margin:0;align-content:start}
button.tray-thumb,button.tray-thumb:hover:not(:disabled){display:grid;place-items:center;gap:4px;aspect-ratio:4/3;padding:0;border:1px solid var(--hair);border-radius:calc(10px*var(--rk));background:var(--fill);overflow:hidden;color:var(--muted)}
.tray-thumb img{width:100%;height:100%;object-fit:cover}
.tray-name{overflow-wrap:anywhere}

/* ===== Shoplytix layer (owner's reference, Behance "Shoplytixs"): Outfit type, rounded white-style cards, a floating
   sidebar of round icons, pill buttons. The SAME shapes in all three themes; each theme keeps its own colours
   (tokens --s-*). Nothing moves or jumps on hover. Delete this block to roll back. ===== */
@font-face{font-family:Outfit;src:url(outfit-variable.ttf) format("truetype");font-weight:100 900;font-style:normal;font-display:swap}
:root{--font:Outfit,"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,Arial,sans-serif;font-size:15px;--rk:1;--r-pill:999px;--ch1:#ff9450;--ch2:#f2d5a4;--ch3:#9fd3a8;--ch4:#7fc8a0;--ch5:#ff8a7a;--good:#7fd6a0;--bad:#ff9a8a}
h1{color:var(--ink);font-weight:600;letter-spacing:-.025em}

/* per-theme colours of the new shapes */
:root[data-theme=light]{--workspace-gradient:linear-gradient(135deg,#d7ded5,#e4ded2 55%,#ccd8ce);--soft:#ccd9cc;--error-ink:#843321;--error-bg:#ead4cb;--good-soft:rgba(31,122,69,.10);--note-bg:#fff6e2;--note-line:#e2c387;--note-blank:#fffdf7;--note-shadow:0 1px 4px rgba(120,80,20,.14);--side:#ffffff;--icon-ink:#4b5563;--th-bg:#f8f9fb;--tab-line:#e7e9ee;--pop:#ffffff;--bg:#e9eaef;--bg-tint:rgba(176,156,250,.38);--chrome:transparent;--surface:#fbfbfd;--fill:#f0f0f5;--fill-hover:#e6e6ee;--hair:#e1e1e9;--line:#e1e1e9;--ink:#0d0d16;--muted:#6a6a78;--faint:#9a9aa8;--accent:#6b4ee0;--accent-btn:#0d0d16;--accent-soft:rgba(140,112,246,.14);--warning-bg:#fff3cf;--warning-ink:#8a5a00;--dialog:#fbfbfd;color-scheme:light;background:#e9eaef;--s-sidebar:#fbfbfd;--s-card:#fbfbfd;--s-card-line:rgba(40,30,90,.05);--s-shadow:0 8px 30px rgba(60,50,120,.05);--s-pill:#0d0d16;--s-pill-ink:#fff;--s-nav:#0d0d16;--s-nav-ink:#fff;--s-nav-icon:rgba(255,255,255,.16);--s-sub:#c9bdfc;--s-sub-ink:#0d0d16;--s-chip:rgba(140,112,246,.14);--s-chip-ink:#4e36b4;--s-input:#fff;--s-badge:#a998f6;--s-glow:rgba(176,156,250,.38);--s-glow2:rgba(176,156,250,.16);--s-alert:#fff7dc;--s-alert-line:#f1dfa3;--s-alert-ink:#9a6200;--ch1:#8b6cf6;--ch2:#f2b705;--ch3:#0d0d16;--ch4:#2fa66a;--ch5:#e5484d;--good:#1f9d5c;--bad:#d93d42}
:root[data-theme=brand]{--s-sidebar:rgba(40,74,56,.95);--s-card:rgba(255,250,241,.085);--s-card-line:rgba(255,250,241,.11);--s-shadow:none;--s-pill:var(--accent-btn);--s-pill-ink:#fff;--s-nav:#fffaf1;--s-nav-ink:#11221a;--s-nav-icon:rgba(17,34,26,.10);--s-sub:rgba(255,148,80,.22);--s-sub-ink:#fffaf1;--s-chip:rgba(255,148,80,.16);--s-chip-ink:#ffb27e;--s-input:rgba(255,250,241,.06);--s-badge:#ee7430;--s-glow:rgba(255,150,80,.12);--s-glow2:rgba(96,170,120,.30);--s-alert:rgba(255,148,80,.12);--s-alert-line:rgba(255,148,80,.28);--s-alert-ink:#ffb27e}

/* canvas */

/* floating sidebar of round icons */
:root[data-theme][data-theme] .nav-badge{background:var(--s-badge);color:#fff}
:root[data-theme=light][data-theme] .sidebar .company-logo{filter:none}

/* top bar: pills and round buttons on the canvas */
:root[data-theme][data-theme] .lang-select{background:var(--s-card)}
:root[data-theme][data-theme] .user-chip .avatar{background:var(--s-nav);color:var(--s-nav-ink)}

/* cards */
:root[data-theme][data-theme] .panel,:root[data-theme][data-theme] .stat,:root[data-theme][data-theme] .kpi,:root[data-theme][data-theme] dialog{background:var(--s-card);border:1px solid var(--s-card-line);border-radius:calc(26px*var(--rk));box-shadow:var(--s-shadow)}
:root[data-theme][data-theme] .panel{padding:24px 26px}
:root[data-theme][data-theme] .kpi{padding:18px 20px}
:root[data-theme][data-theme] .kpi-value{font-weight:600;font-size:1.7rem;letter-spacing:-.02em}
:root[data-theme][data-theme] .kpi.alert{background:var(--s-alert);border-color:var(--s-alert-line)}
:root[data-theme][data-theme] .kpi.alert .kpi-value{color:var(--s-alert-ink)}
:root[data-theme][data-theme] .panel-heading h2{font-weight:600;font-size:1.15rem}
:root[data-theme][data-theme] .row,:root[data-theme][data-theme] .history-item{border-color:var(--hair)}

/* buttons and chips: pills */
:root[data-theme][data-theme] button.primary,:root[data-theme][data-theme] button.primary:hover:not(:disabled){background:var(--s-pill);color:var(--s-pill-ink);border:0;border-radius:var(--r-pill);padding:10px 20px;font-weight:500}
button:not(.primary):not(.text):not(.nav-item):not(.nav-sub):not(.icon-button):not(.row):not(.kpi):not(.user-chip):not(.th-sort){border-radius:var(--r-pill);border:1px solid var(--hair);background:var(--s-card);color:var(--ink)}
:root[data-theme][data-theme] button.text{color:var(--accent)}
:root[data-theme][data-theme] .tag,:root[data-theme][data-theme] .count{background:var(--s-chip);color:var(--s-chip-ink);border-radius:var(--r-pill)}
:root[data-theme][data-theme] select,:root[data-theme][data-theme] input,:root[data-theme][data-theme] textarea{background:var(--s-input);border:1px solid var(--hair);border-radius:calc(14px*var(--rk))}
:root[data-theme][data-theme] th{color:var(--faint);font-weight:500}
:root[data-theme][data-theme] .notice{background:var(--accent-soft);border-color:transparent;border-radius:calc(16px*var(--rk))}
:root[data-theme][data-theme] .heading .eyebrow{color:var(--faint)}
:root[data-theme][data-theme] .subtitle{color:var(--muted)}

/* calm hover: colours may change, nothing moves, grows or jumps */
button,a,select,input,.nav-item,.nav-sub,.kpi,.row,.panel,.stat{transition:background-color .12s ease,color .12s ease,border-color .12s ease!important}
button:hover,button:active,a:hover,.nav-item:hover,.nav-sub:hover,.kpi:hover,.row:hover,.panel:hover,.stat:hover,.icon-button:hover{transform:none!important;animation:none!important}
:root[data-theme][data-theme] .nav-sub.active,:root[data-theme][data-theme] .nav-sub.active:hover{border:0!important;box-shadow:none}

/* ===== Finance board: toolbar, KPI cards, SVG charts, bars, insights ===== */
.fin-toolbar{display:flex;flex-wrap:wrap;align-items:end;gap:14px 20px;margin:-8px 0 22px}
.fin-toolbar .client-field{margin:0;min-width:180px}
.fin-custom{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.fin-custom[hidden]{display:none}
.fin-cur{display:grid;gap:6px}
.fin-cur-label{font-size:12px;color:var(--muted)}
.fin-range{color:var(--muted);font-size:13px;margin-inline-start:auto;padding-bottom:8px}
.fin-stats{grid-template-columns:repeat(auto-fit,minmax(190px,1fr));margin-bottom:4px}
.fin-kpi{display:flex;flex-direction:column;gap:6px}
.fin-kpi .stat-value{font-size:1.45rem;font-weight:600;letter-spacing:-.02em;margin-top:2px}
.fin-kpi .fin-sub{color:var(--muted);font-size:12px;line-height:1.4}
.fin-delta{font-size:12px;font-weight:500}
.fin-delta.good{color:var(--good)}
.fin-delta.bad{color:var(--bad)}
.fin-delta.flat{color:var(--faint)}
.fin-kpi.alert .stat-value{color:var(--bad)}
.fin-grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}
.fin-grid2.tight{gap:28px}
@media (max-width:1100px){
  .fin-grid2{grid-template-columns:minmax(0,1fr)}
}
.fin-h3{font-size:14px;font-weight:600;margin:18px 0 8px}
.fin-chart-wrap{width:100%}
.fin-chart{width:100%;height:auto;display:block;overflow:visible}
.fin-grid{stroke:var(--hair);stroke-width:1}
.fin-zero{stroke:var(--faint);stroke-width:1}
.fin-axis{fill:var(--faint);font-size:11px;font-family:var(--font)}
.fin-line{fill:none;stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.fin-dot{stroke:var(--s-card,#fff);stroke-width:2}
.fin-line.c1{stroke:var(--ch1)}
.fin-line.c2{stroke:var(--ch2)}
.fin-line.c3{stroke:var(--ch3)}
.fin-line.c4{stroke:var(--ch4)}
.fin-line.c5{stroke:var(--ch5)}
.fin-dot.c1,.fin-bar.c1{fill:var(--ch1)}
.fin-dot.c2,.fin-bar.c2{fill:var(--ch2)}
.fin-dot.c3,.fin-bar.c3{fill:var(--ch3)}
.fin-dot.c4,.fin-bar.c4{fill:var(--ch4)}
.fin-dot.c5,.fin-bar.c5{fill:var(--ch5)}
.fin-bar{opacity:.85}
.fin-legend{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:10px;font-size:12px;color:var(--muted)}
.fin-legend span{display:inline-flex;align-items:center;gap:7px}
.fin-legend i{width:10px;height:10px;border-radius:50%;display:inline-block}
.fin-legend i.c1{background:var(--ch1)}
.fin-legend i.c2{background:var(--ch2)}
.fin-legend i.c3{background:var(--ch3)}
.fin-legend i.c4{background:var(--ch4)}
.fin-legend i.c5{background:var(--ch5)}
.fin-picks{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin-bottom:12px}
.fin-pick{display:inline-flex;align-items:center;gap:6px;font-size:13px;padding:6px 12px;border:1px solid var(--hair);border-radius:var(--r-pill);cursor:pointer}
.fin-hbars{display:grid;gap:10px}
.fin-hrow{display:grid;grid-template-columns:minmax(120px,1.2fr) minmax(80px,2fr) auto;gap:12px;align-items:center;font-size:13px}
.fin-hname{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fin-htrack{height:10px;border-radius:var(--r-pill);background:var(--fill);overflow:hidden}
.fin-hbar{display:block;height:100%;border-radius:var(--r-pill);background:var(--ch1)}
.fin-hval{white-space:nowrap;color:var(--muted)}
.fin-insights{margin:0;padding-inline-start:18px;display:grid;gap:8px;font-size:13px;line-height:1.5}
.fin-col.drops .fin-h3{color:var(--bad)}
.fin-col.growth .fin-h3{color:var(--good)}
.fin-table td.num,.fin-table th.num{text-align:end}
.fin-table tr.fin-sub td{font-weight:600}
.fin-table tr.strong td{font-weight:700;border-top:1px solid var(--line)}
.fin-table tr.clickable{cursor:pointer}
.fin-table tr.muted td{opacity:.55}
.fin-schedule{margin-top:14px}
.fin-schedule summary{cursor:pointer;color:var(--accent);font-size:13px}
.fin-settings .panel{margin-bottom:18px}

/* the toolbar stays readable over content when the page scrolls */

/* selects: our own chevron with room on the side, so it never sits on the rounded edge (all themes, RTL mirrored) */
:root[data-theme][data-theme] select:not([multiple]){-webkit-appearance:none;appearance:none;padding-inline-end:40px;padding-inline-start:16px;background-repeat:no-repeat;background-size:14px 14px;background-position:right 16px center;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f7' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")}
:root[data-theme=light][data-theme] select:not([multiple]){background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d0d16' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")}
:root[dir=rtl][data-theme][data-theme] select:not([multiple]){background-position:left 16px center}
:root[data-theme][data-theme] select.lang-select:not([multiple]){padding-inline-end:34px;padding-inline-start:14px;background-position:right 12px center}
:root[dir=rtl][data-theme][data-theme] select.lang-select:not([multiple]){background-position:left 12px center}
:root[data-theme][data-theme] select option{color:#0d0d16;background:#fff}

/* the floating sidebar keeps every opened sub-item inside its panel: the panel scrolls, the page does not spill out of it */
.sidebar::-webkit-scrollbar{width:6px}
.sidebar::-webkit-scrollbar-thumb{background:var(--hair);border-radius:3px}

/* ===== assistant: a pill in the top bar and a side panel ===== */
.assistant-pill{display:inline-flex;align-items:center;gap:8px;font-weight:500;white-space:nowrap}
.assistant-pill .icon{color:var(--ch1)}
@media (max-width:900px){
  .assistant-pill span:not(.icon){display:none}
}
.assistant-panel{position:fixed;top:16px;bottom:16px;inset-inline-end:16px;width:min(440px,calc(100vw - 32px));z-index:60;display:flex;flex-direction:column;background:var(--dialog,var(--s-card));color:var(--ink);border:1px solid var(--s-card-line,var(--hair));border-radius:calc(26px*var(--rk));box-shadow:0 24px 70px rgba(30,20,70,.22);overflow:hidden}
.assistant-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 18px;border-bottom:1px solid var(--hair)}
.assistant-head>div{display:flex;align-items:center;gap:8px}
.assistant-title .icon{color:var(--ch1)}
.assistant-log{flex:1;overflow-y:auto;padding:16px 18px;display:flex;flex-direction:column;gap:12px}
.assistant-examples{display:flex;flex-wrap:wrap;gap:8px}
.assistant-examples .chip{text-align:start;white-space:normal;font-size:13px;padding:8px 12px}
.assistant-msg{max-width:92%;padding:11px 14px;border-radius:calc(18px*var(--rk));line-height:1.5;font-size:14px;display:flex;flex-direction:column;gap:8px}
.assistant-msg.user{align-self:flex-end;background:var(--s-nav,#0d0d16);color:var(--s-nav-ink,#fff);border-end-end-radius:6px}
.assistant-msg.assistant{align-self:flex-start;background:var(--fill);border-end-start-radius:6px}
.assistant-msg.thinking{color:var(--muted);font-style:italic}
.assistant-text{white-space:pre-wrap;overflow-wrap:anywhere}
.assistant-card{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border-radius:calc(14px*var(--rk));background:var(--s-card,var(--surface));border:1px solid var(--hair)}
.assistant-card small{color:var(--muted)}
.assistant-card button{align-self:flex-start}
.assistant-open{align-self:flex-start}
.assistant-cost{color:var(--faint);font-size:11px}
.assistant-input{align-items:flex-end;gap:8px;border-top:1px solid var(--hair);display:block!important;padding:12px 14px 6px!important}
.assistant-input textarea{flex:1;resize:none;border-radius:calc(16px*var(--rk));min-height:44px;max-height:140px}
.assistant-input .icon-button{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;flex:none}
.assistant-input .icon-button.primary{background:var(--s-pill,var(--accent-btn));color:var(--s-pill-ink,#fff);border:0}
.assistant-input .mic.on{background:var(--ch5);color:#fff;border-color:transparent}
.assistant-foot{display:block;padding:0 16px 12px;color:var(--faint);font-size:11px;line-height:1.4}

/* ===== reports: cards, viewer, builder ===== */
.report-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:18px}
.report-card{align-content:start;display:flex;flex-direction:column;gap:10px;margin:0}
.report-card .note{flex:1}
.report-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.rb-layout{display:grid;grid-template-columns:minmax(300px,380px) minmax(0,1fr);gap:22px;align-items:start}
@media (max-width:1100px){
  .rb-layout{grid-template-columns:minmax(0,1fr)}
}
.rb-side .panel{margin-bottom:14px;padding:18px 20px}
.rb-side .panel-heading{margin-bottom:10px}
.rb-side .panel-heading h2{font-size:14px}
.rb-cols{display:flex;flex-wrap:wrap;gap:8px}
.rb-filters{display:grid;gap:10px;margin-bottom:8px}
.rb-filter{display:grid;grid-template-columns:1fr 1fr;gap:6px;align-items:center;padding:10px;border:1px solid var(--hair);border-radius:calc(16px*var(--rk))}
.rb-filter input[hidden]{display:none}
.rb-filter .chip-link{justify-self:end}
.rb-preview{position:sticky;top:90px;min-width:0}
.rb-table tr.rb-group td{font-weight:600;background:var(--fill)}
.rb-attachment{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:var(--r-pill);background:var(--fill);font-size:13px;margin-top:6px}

/* the page title gets focus after each screen change (for screen readers): no visible frame around it */
h1[tabindex="-1"]:focus,h1[tabindex="-1"]:focus-visible,[tabindex="-1"]:focus:not(:focus-visible){outline:none;box-shadow:none}

/* pills only for one-line buttons: cards, rows and any button holding a title + text get soft corners, so text never runs over the edge */
:root[data-theme][data-theme] button:is(.choice-card,.task-text,.stat,.kpi,.doc-row,.qc-photo,.value-link,.search-hit,.cal-num,.row),:root[data-theme][data-theme] button:has(strong,small,p,h3,img,.row-text,.stat-label,.kpi-label){border-radius:calc(20px*var(--rk))!important}
:root[data-theme][data-theme] button.pop-item{border-radius:calc(12px*var(--rk))!important}
:root[data-theme][data-theme] .choice-card{padding:22px 24px;text-align:start}

/* an open list shows the page behind it slightly; a thick focus ring there looked like stripes - a calm border instead */
:root[data-theme][data-theme] select:focus,:root[data-theme][data-theme] select:focus-visible{outline:none;box-shadow:none;border-color:var(--accent)}

/* a caption always sits above its field (never squeezed against a rounded field), and button rows keep air under the fields */
:root[data-theme][data-theme] label.client-field{display:grid;gap:6px;align-content:start}
:root[data-theme][data-theme] .list-tools + .contact-actions,:root[data-theme][data-theme] .list-tools + .report-actions{margin:2px 0 14px;display:flex;flex-wrap:wrap;gap:8px}
:root[data-theme][data-theme] .contact-actions{gap:8px}
:root[data-theme][data-theme] button.cal-item{border-radius:calc(10px*var(--rk))!important;text-align:start}

/* ===== composers (assistant, chat): one rounded field with the buttons inside; send = a round arrow ===== */
:root[data-theme][data-theme] .composer{display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 16px;border:1px solid var(--hair);border-radius:calc(24px*var(--rk));background:var(--s-input,#fff);transition:border-color .12s ease}
:root[data-theme][data-theme] .composer:focus-within{border-color:var(--accent)}
:root[data-theme][data-theme] .composer textarea{flex:1;min-width:0;border:0;background:transparent;box-shadow:none;outline:none;padding:9px 0;min-height:24px;max-height:140px;resize:none;border-radius:0;font:inherit;color:var(--ink)}
:root[data-theme][data-theme] .composer textarea:focus,:root[data-theme][data-theme] .composer textarea:focus-visible{outline:none;box-shadow:none}
:root[data-theme][data-theme] .composer .icon-button{flex:none;width:38px;height:38px;border-radius:50%!important;border:0;background:transparent;color:var(--muted);display:grid;place-items:center;padding:0}
:root[data-theme][data-theme] .composer .icon-button:hover:not(:disabled){background:var(--fill);color:var(--ink)}
:root[data-theme][data-theme] .composer .icon-button.send,:root[data-theme][data-theme] .composer .icon-button.send:hover:not(:disabled){background:var(--ch1);color:#fff}
:root[data-theme][data-theme] .composer .icon-button.mic.on{background:var(--ch5);color:#fff}
:root[data-theme][data-theme] .composer select{flex:none;max-width:160px;height:38px;font-size:12px;padding-block:0}
:root[data-theme][data-theme] .chat-compose.composer{margin:10px 12px;border-top:1px solid var(--hair)}
.tag{white-space:nowrap}

/* process analysis: the chain of a delivery with the real days on each arrow (all themes; vertical on a phone) */
.pm-chain{display:flex;flex-wrap:wrap;align-items:center;gap:12px 8px;margin:8px 0 6px}
.pm-node{padding:10px 14px;border-radius:calc(14px*var(--rk));background:var(--fill);border:1px solid var(--hair);font-size:13px;font-weight:600;line-height:1.3;white-space:nowrap}
.pm-node.small{padding:7px 12px;border-radius:calc(12px*var(--rk));font-size:12px;font-weight:500}
.pm-arrow{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:112px;padding:0 4px;text-align:center;line-height:1.25;color:var(--faint)}
.pm-arrow.ok{color:var(--good)}
.pm-arrow.over{color:var(--bad)}
.pm-arrow strong{font-size:14px;font-weight:600;white-space:nowrap}
.pm-arrow small{order:2;font-size:11px;color:var(--muted);white-space:nowrap}
.pm-arrow::before{content:'';order:1;align-self:stretch;height:10px;background:currentColor;clip-path:polygon(0 4px,calc(100% - 9px) 4px,calc(100% - 9px) 0,100% 50%,calc(100% - 9px) 100%,calc(100% - 9px) 6px,0 6px)}
[dir=rtl] .pm-arrow::before{transform:scaleX(-1)}
.pm-side{display:grid;grid-template-columns:repeat(auto-fill,minmax(420px,1fr));gap:12px 28px}
@media (max-width:760px){
  .pm-side{grid-template-columns:minmax(0,1fr)}
}
.pm-side-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.pm-bottleneck{margin:16px 0 0;padding:12px 16px;border-radius:calc(14px*var(--rk));background:var(--warning-bg);color:var(--warning-ink);font-size:13px;line-height:1.5}
.pm-dev{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 14px;align-items:center;padding:12px 0;border-top:1px solid var(--hair)}
.pm-dev:first-child{border-top:0}
.pm-dev .row-text{display:grid;gap:3px}
.pm-dev .row-text small{color:var(--muted);font-size:12px;line-height:1.45;white-space:normal}
.pm-dev-orders{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px}
@media (max-width:760px){
  .pm-chain{flex-direction:column;align-items:flex-start;gap:6px}
  .pm-chain .pm-arrow{flex-direction:row;align-items:center;gap:10px;min-width:0;margin-inline-start:16px;text-align:start}
  .pm-chain .pm-arrow::before{order:-1;align-self:auto;width:10px;height:30px;flex:none;clip-path:polygon(4px 0,6px 0,6px calc(100% - 9px),100% calc(100% - 9px),50% 100%,0 calc(100% - 9px),4px calc(100% - 9px))}
  [dir=rtl] .pm-chain .pm-arrow::before{transform:none}
  .pm-node{white-space:normal}
}

/* the company map */
.cm-flow{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.cm-arrow{color:var(--faint);font-size:16px;line-height:1}
[dir=rtl] .cm-arrow{display:inline-block;transform:scaleX(-1)}
.cm-roles{color:var(--accent);font-size:12px;font-weight:500}
.cm-io{margin:0;padding:10px 12px;border-radius:calc(12px*var(--rk));background:var(--fill);font-size:13px;line-height:1.5}
.cm-kpis{display:flex;flex-wrap:wrap;gap:6px}

/* requests */
.seg.seg-tabs{display:flex;flex-wrap:wrap;gap:4px;padding:4px;border-radius:calc(14px*var(--rk));margin:4px 0 14px;width:fit-content;max-width:100%}
.seg.seg-tabs button,.seg.seg-tabs button:hover:not(:disabled){height:34px;padding:0 14px;border-radius:calc(10px*var(--rk));font-size:13px;font-weight:500;white-space:nowrap}
.request-row{align-items:flex-start}
.request-row .row-text{display:grid;gap:4px;min-width:0;flex:1 1 420px}
.request-row .row-text small{display:block;white-space:normal;line-height:1.45;color:var(--muted)}
.request-row .contact-actions{align-items:center;justify-content:flex-end;flex:0 1 auto;margin-inline-start:auto}
.request-row .money{white-space:nowrap;font-weight:600;margin-inline-end:4px}

/* the chosen filter tab looks like the chosen item of the side menu (beats the generic button colours) */
:root[data-theme][data-theme] .seg button.on,:root[data-theme][data-theme] .seg button.on:hover:not(:disabled){background:var(--s-sub)!important;color:var(--s-sub-ink)!important;box-shadow:none;font-weight:600}
:root[data-theme][data-theme] .seg button:not(.on){background:transparent!important;color:var(--muted)!important}
:root[data-theme][data-theme] .seg button:not(.on):hover{color:var(--ink)!important}

/* anything marked hidden stays hidden, whatever display a component sets */
[hidden]{display:none!important}

/* quality */
.stats.qc-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:900px){
  .stats.qc-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
table.data td .tag{white-space:nowrap}
.qc-limits{margin:4px 0 0}
.qc-checklist{display:grid;gap:8px;margin:16px 0 4px;padding:14px 16px;border-radius:calc(16px*var(--rk));background:var(--fill)}
.qc-check-title{font-size:13px;font-weight:600;margin-bottom:2px}
.qc-check,label.qc-check{display:grid;grid-template-columns:minmax(0,1fr) 160px;align-items:center;gap:12px;font-size:13px;margin:0}
.qc-checklist.view .qc-check{grid-template-columns:minmax(0,1fr) auto}
.qc-std-list{margin:0;padding-inline-start:18px;display:grid;gap:4px;font-size:13px;line-height:1.45}
@media (max-width:600px){
  .qc-check,label.qc-check{grid-template-columns:minmax(0,1fr)}
}

/* status tags keep their meaning in every theme: green = fine (approved, paid, within standard), amber = needs attention */
:root[data-theme][data-theme] .tag.good{background:var(--good-soft);color:var(--good)}
:root[data-theme][data-theme] .tag.warning{background:var(--warning-bg);color:var(--warning-ink)}
:root[data-theme][data-theme] .tag.accent{background:var(--accent-soft);color:var(--accent)}
:root[data-theme=brand][data-theme=brand] .tag:not(.good):not(.warning):not(.accent){background:rgba(255,250,241,.10);color:#fffaf1}
:root[data-theme=dark][data-theme=dark] .tag:not(.good):not(.warning):not(.accent){background:rgba(255,255,255,.10);color:#f5f5f7}

/* tasks */
.stats.task-kpis{grid-template-columns:repeat(5,minmax(0,1fr))}
@media (max-width:1000px){
  .stats.task-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:600px){
  .stats.task-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
:root[data-theme][data-theme] button.stat.task-kpi{display:flex;flex-direction:column;align-items:flex-start;gap:10px;text-align:start;cursor:pointer}
:root[data-theme][data-theme] button.stat.task-kpi .stat-value{font-size:1.6rem;font-weight:600}
:root[data-theme][data-theme] button.stat.task-kpi.alert .stat-value{color:var(--bad)}
button.stat.task-kpi.on{outline:2px solid var(--accent);outline-offset:-2px}
.quick-panel{padding:14px 16px}
.quick-add{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.quick-add .quick-task{flex:1 1 320px;min-width:0}
.quick-add select{flex:0 1 200px}
.tk-filter{display:inline-flex;align-items:center;gap:4px;font-size:13px;color:var(--muted)}
.task-board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;align-items:start}
@media (max-width:1200px){
  .task-board{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:700px){
  .task-board{grid-template-columns:minmax(0,1fr)}
}
.task-col{display:grid;gap:8px;padding:12px;border-radius:calc(18px*var(--rk));background:var(--fill);min-width:0}
.task-col.alert .task-col-head strong{color:var(--bad)}
.task-col-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 4px 4px}
.task-col .empty{padding:8px 4px}
.task-card{padding:10px 12px;border-radius:calc(14px*var(--rk));background:var(--s-card,var(--surface));min-width:0}
.task-card .task-row{border-top:0;padding:0}
.task-card button.task-text strong{overflow-wrap:anywhere}
:root[data-theme][data-theme] .task-card button.task-text,:root[data-theme][data-theme] .task-card button.task-text:hover:not(:disabled){background:transparent!important;padding:0!important;box-shadow:none;border:0}

/* mail client */
button.row.mail-row .row-text{display:grid;gap:3px;min-width:0}
.mail-line{display:flex;align-items:baseline;justify-content:space-between;gap:10px;min-width:0}
.mail-who{display:inline-flex;align-items:center;gap:6px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.mail-row.unread .mail-who,.mail-row.unread .mail-subject{font-weight:700}
.mail-when{flex:none;color:var(--muted);font-size:11px}
.mail-count{flex:none;font-size:11px;font-weight:600;padding:0 6px;border-radius:var(--r-pill);background:var(--fill);color:var(--muted)}
.mail-line .mail-subject{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}
.mail-marks{flex:none;display:inline-flex;align-items:center;gap:4px;color:var(--muted)}
.mail-star{color:#f2b705}
.mail-snippet{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mail-tags{display:flex;flex-wrap:wrap;gap:6px;align-items:center}

/* the "back" pill above a title: room on both sides of its text */
:root[data-theme][data-theme] button.back,:root[data-theme][data-theme] button.back:hover:not(:disabled){padding:7px 16px 7px 10px;gap:6px;border-radius:var(--r-pill)}
.mail-row.unread .mail-who::before{content:"";flex:none;width:7px;height:7px;border-radius:50%;background:var(--accent)}
:root[data-theme][data-theme] button.row.mail-row{padding:10px 12px;border-radius:calc(14px*var(--rk))}
.md-detail{min-width:0}

/* a value that opens something (e-mail, order number, client) reads as a link, not as a pill */
:root[data-theme][data-theme] button.value-link,:root[data-theme][data-theme] button.value-link:hover:not(:disabled){background:transparent!important;padding:0;border-radius:4px!important;color:var(--accent);font-weight:500;text-align:start}
button.value-link:hover:not(:disabled){text-decoration:underline}
:root[data-theme][data-theme] button.link,:root[data-theme][data-theme] button.link:hover:not(:disabled){background:transparent!important;padding:0;border-radius:4px!important;color:var(--ink);font-weight:600;text-align:start}
:root[data-theme][data-theme] button.link:hover:not(:disabled){color:var(--accent)}

/* calendar chips: time on top, then the text; the buyer's own time on its own line - nothing leaves the chip */
:root[data-theme][data-theme] button.cal-item{display:block;overflow:hidden;overflow-wrap:anywhere;padding:5px 8px}
button.cal-item .cal-time{display:block;font-weight:600;font-variant-numeric:tabular-nums}
button.cal-item .cal-their{display:block}

/* status tags: a little more room inside the rounded edge */
:root[data-theme][data-theme] .tag{padding:3px 10px}

/* list + card screens stack on a phone: the list first, the card under it (a later wide-screen rule had kept two columns) */
@media (max-width:760px){
  .md{grid-template-columns:minmax(0,1fr)}
  .md-list{position:static}
  .md-detail,.md>*{min-width:0}
}
@media (max-width:760px){
  .panel-heading{flex-wrap:wrap}
  :root[data-theme][data-theme] .tag{white-space:normal;text-align:start}
  button.row,button.row:hover:not(:disabled),.contact-row{flex-wrap:wrap}
  button.row .row-text,.contact-row .row-text{min-width:0;flex:1 1 220px}
}

/* mail settings: the Google guide */
.mail-guide{margin:4px 0 14px;padding:14px 16px;border-radius:calc(16px*var(--rk));background:var(--fill)}
.mail-guide summary{cursor:pointer;font-weight:600;font-size:14px}
.mail-steps{margin:8px 0;padding-inline-start:20px;display:grid;gap:8px;font-size:13px;line-height:1.5}
.mail-uri{display:inline-block;padding:4px 10px;border-radius:calc(8px*var(--rk));background:var(--surface);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;overflow-wrap:anywhere;margin-inline-end:8px}
.mail-reg-title{margin:0 0 6px;font-weight:600;font-size:14px}
.mail-reg-done{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0;font-size:13px}
.mail-other summary{cursor:pointer;font-size:14px;font-weight:600}
.mail-other form{margin-top:12px}

/* mail: a filter row, the list and the letter scroll on their own, a border that can be dragged */
.md.resizable{gap:0}
.split-handle{cursor:col-resize;align-self:stretch;justify-self:stretch;position:relative;touch-action:none;outline:none}
/* the border between two zones is seen (a faint line) and lights up under the hand: people did not find it when it was invisible */
.split-handle::after{content:'';position:absolute;inset:0 5px;border-radius:2px;background:var(--hair);transition:background .15s}
.split-handle:hover::after,.split-handle:focus-visible::after,.resizing .split-handle::after{background:var(--accent)}
.split-handle.rows{cursor:row-resize}
.split-handle.rows::after{inset:5px 0}
.md.resizing,.mx-main.resizing{user-select:none;cursor:col-resize}
.mx-main.stack.resizing{cursor:row-resize}
/* own folders and rules */
.folder-colors{display:flex;flex-wrap:wrap;gap:8px}
:root[data-theme][data-theme] .folder-colors button.swatch{width:28px;height:28px;padding:0!important;border-radius:50%!important;border:2px solid transparent!important;background:var(--swatch,var(--fill))!important}
:root[data-theme][data-theme] .folder-colors button.swatch.on{border-color:var(--accent)!important}
.rule-conds{display:grid;gap:6px;margin:4px 0 8px}
.rule-cond{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.4fr) auto;gap:6px;align-items:center}
:root[data-theme][data-theme] .mail-app button.mx-folder-new{color:var(--muted)!important}
.mx-person-all .icon{flex:none;color:var(--muted);margin-inline:-2px 1px}
.rcpt[draggable=true]{cursor:grab}
.rcpt.dragging{opacity:.45}
.rcpt-field.drop{outline:2px dashed var(--accent);outline-offset:2px;border-radius:calc(10px*var(--rk));background:var(--fill)}
/* (while an address is dragged every line of addresses is a place to drop it - an empty one too) */
body.rcpt-dragging .rcpt-field{min-height:34px;outline:1px dashed var(--hair);outline-offset:2px;border-radius:calc(10px*var(--rk))}
body.rcpt-dragging .rcpt-field.drop{outline:2px dashed var(--accent)}
/* a letter in a window of its own (a double click on its row): over the mail, under the compose window */
.mx-window-back{position:fixed;inset:0;z-index:48;background:rgba(0,0,0,.38)}
.mx-window{position:fixed;inset:3vh 4vw;z-index:49;display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--mx-read);border-radius:calc(18px*var(--rk));box-shadow:0 30px 80px rgba(0,0,0,.4);overflow:hidden}
/* the window's own cross stands in the corner; the toolbar keeps a free place for it under every look and style, so the
   settings gear never lies under the cross (owner, 18 Nov 2026: "settings and close have merged into one") */
.mx-window .mx-bar{min-height:52px!important;padding-block:6px!important;padding-inline:14px 106px!important}
.mx-window .mx-bar .mx-gear-top{position:absolute;top:6px;inset-inline-end:56px}
.mx-window .mx-bar .mx-bar-space{display:none}
.mx-window .mx-article{max-width:none;width:100%}
.mx-window .mx-window-x{position:absolute;top:6px;inset-inline-end:12px;z-index:3}
@media (max-width:760px){.mx-window{inset:0;border-radius:0}}
/* the mail as a table (the look of a classic mail program): the letters as rows of columns on top, the letter below, the
   assistant's hints in a column of their own on the right */
.mail-app.has-hints{grid-template-columns:272px minmax(0,1fr) 340px}
.mx-hints{min-width:0;min-height:0;overflow-y:auto;padding:14px 12px;background:var(--mx-list);border-inline-start:1px solid var(--hair)}
.mx-hints .watch-panel{margin:0;padding:12px 12px 14px;border-radius:calc(14px*var(--rk))}
.mx-hints .watch-panel .panel-heading h2{font-size:14px}
.mx-hints .watch-card{padding:10px 12px}
.mx-hints-none{color:var(--muted);font-size:13px;padding:8px 6px}
.look-table .mx-list-head{padding:10px 12px 8px}
.look-table .mx-rows{padding-bottom:0;background:var(--mx-read)}
.look-table .mx-thead,.look-table .mx-trow{display:grid;grid-template-columns:22px 20px minmax(0,2.4fr) minmax(0,1fr) 132px minmax(0,1.5fr);column-gap:10px;align-items:center;width:100%;text-align:start}
.look-table .mx-thead{position:sticky;top:0;z-index:2;padding:6px 12px;background:var(--mx-list);border-bottom:1px solid var(--line);font-size:11.5px;color:var(--muted);font-weight:600}
:root[data-theme][data-theme] .mail-app.look-table button.mx-trow{display:grid!important;grid-template-columns:22px 20px minmax(0,2.4fr) minmax(0,1fr) 132px minmax(0,1.5fr)!important;column-gap:10px!important;align-items:center!important;justify-content:stretch!important;gap:0 10px!important;width:100%!important;text-align:start!important;padding:0 12px!important;min-height:25px;height:25px;border-radius:0!important;border:0!important;border-bottom:1px solid var(--hair)!important;background:transparent!important;font-size:12.5px;font-weight:400;color:var(--ink)!important;box-shadow:none!important}
:root[data-theme][data-theme] .mail-app.look-table button.mx-trow:hover{background:var(--fill)!important}
:root[data-theme][data-theme] .mail-app.look-table button.mx-trow.unread{font-weight:700}
:root[data-theme][data-theme] .mail-app.look-table button.mx-trow.on{background:var(--accent)!important;color:#fff!important}
.look-table .mx-trow.on .mx-tag,.look-table .mx-trow.on .mx-tstar,.look-table .mx-trow.on .icon{color:#fff}
.look-table .mx-trow.on .mx-tag{background:rgba(255,255,255,.22)!important;border-color:transparent!important}
.look-table .mx-trow .mx-quick{display:none!important}
.look-table .mx-tcell{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.look-table .mx-tsubj{display:flex;align-items:center;gap:6px}
.look-table .mx-tsubj>span:not(.mx-thread-n):not(.mx-tout){min-width:0;overflow:hidden;text-overflow:ellipsis}
.look-table .mx-tout{color:var(--muted);flex:none}
.look-table .mx-tstar{cursor:pointer;color:var(--faint);text-align:center;font-size:13px;line-height:1}
.look-table .mx-tstar.on{color:#e8a200}
.look-table .mx-tclip{color:var(--muted);display:flex;align-items:center}
.look-table .mx-twhen{font-variant-numeric:tabular-nums;color:inherit;opacity:.85}
.look-table .mx-tbetween{display:flex;align-items:center;gap:6px;opacity:.85}
.look-table .mx-tbetween>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis}
.look-table .mx-tbetween .mx-tag{flex:none;font-size:11px;padding:1px 7px}
.look-table .mx-trow .mx-thread-n{flex:none;font-size:10.5px}
.look-table .mx-main.stack{border-inline-end:0}
.look-table .mx-read .mx-subject{margin:10px 0 8px;font-size:20px}
/* (owner, 18 Nov 2026: "the letter's area below is only half the width - make it whole") the letter takes all the width under the table */
.look-table .mx-article{max-width:none;width:100%}
.look-table .mx-letter{padding:14px 22px 28px}
.look-table .mx-bar{min-height:46px;padding:6px 14px}
@media (max-width:1180px){.mail-app.has-hints{grid-template-columns:230px minmax(0,1fr)}.mx-hints{display:none}}
@media (max-width:900px){.look-table .mx-thead,:root[data-theme][data-theme] .mail-app.look-table button.mx-trow{grid-template-columns:22px 20px minmax(0,2fr) minmax(0,1fr) 118px!important}.look-table .mx-tbetween,.look-table .mx-thead .mx-tcell:last-child{display:none}}
/* the mail's list over the letter instead of beside it */
.mx-main.stack{grid-template-columns:minmax(0,1fr)}
@media (max-width:760px){.mx-main.stack{grid-template-rows:none!important}}
@media (max-width:760px){
  .split-handle{display:none}
}

/* ===== the compose window (after Spark and Thunderbird): docked at the bottom, folds into a bar, opens wide ===== */

/* (left of the round chat button in the corner, which stays usable) */
.compose-dock{position:fixed;inset-inline-end:88px;bottom:0;z-index:60;display:flex;flex-direction:row-reverse;align-items:flex-end;gap:12px;pointer-events:none;max-width:calc(100vw - 108px)}
.compose-dock>*{pointer-events:auto}
.mail-composer{position:relative;display:flex;flex-direction:column;align-items:stretch;width:700px;max-width:calc((100vw - 108px)/var(--zoom,1));height:min(700px,calc((100dvh - 80px)/var(--zoom,1)));background:var(--dialog);color:var(--ink);border:1px solid var(--hair);border-bottom:0;border-radius:calc(18px*var(--rk)) calc(18px*var(--rk)) 0 0;box-shadow:0 18px 60px rgba(0,0,0,.38)}
.mail-composer[data-state=min]{width:300px;height:auto}
.mail-composer[data-state=min] .composer-body,.mail-composer[data-state=min] .composer-foot,.mail-composer[data-state=min] .composer-error,.mail-composer[data-state=min] .composer-drop{display:none!important}
.mail-composer[data-state=max]{position:fixed;inset:4vh max(16px,6vw);width:auto;height:auto;max-width:none;border-radius:calc(18px*var(--rk));border-bottom:1px solid var(--hair);z-index:61}
body.composer-wide::after{content:'';position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:59}
.composer-head{display:flex;align-items:center;gap:8px;padding:8px 8px 8px 18px;border-bottom:1px solid var(--hair);user-select:none}
.mail-composer[data-state=min] .composer-head{cursor:pointer;border-bottom:0}
.composer-title{flex:1;min-width:0;font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.composer-hbtns{display:flex;gap:2px}
:root[data-theme][data-theme] .mail-composer button.composer-hbtn,:root[data-theme][data-theme] .mail-composer button.tb-btn,:root[data-theme][data-theme] button.rcpt-x{display:inline-grid;place-items:center;padding:0!important;border:0!important;background:transparent!important;border-radius:calc(8px*var(--rk))!important;color:var(--muted)!important;box-shadow:none;flex:none}
:root[data-theme][data-theme] .mail-composer button.composer-hbtn{width:32px;height:32px}
:root[data-theme][data-theme] .mail-composer button.tb-btn{width:31px;height:32px}
:root[data-theme][data-theme] button.rcpt-x{width:20px;height:20px;border-radius:50%!important}
:root[data-theme][data-theme] .mail-composer button.composer-hbtn:hover:not(:disabled),:root[data-theme][data-theme] .mail-composer button.tb-btn:hover:not(:disabled),:root[data-theme][data-theme] button.rcpt-x:hover:not(:disabled){background:var(--fill-hover)!important;color:var(--ink)!important}
:root[data-theme][data-theme] .mail-composer button.tb-btn.on{background:var(--accent-soft)!important;color:var(--accent)!important}
:root[data-theme][data-theme] .mail-composer button.composer-link,:root[data-theme][data-theme] .mail-composer button.composer-link:hover:not(:disabled),:root[data-theme][data-theme] .compose-sending button.composer-link{background:transparent!important;border:0!important;padding:4px 8px!important;border-radius:calc(8px*var(--rk))!important;color:var(--accent)!important;font-size:13px;font-weight:600;box-shadow:none}
:root[data-theme][data-theme] .mail-composer button.composer-link:hover:not(:disabled),:root[data-theme][data-theme] .compose-sending button.composer-link:hover:not(:disabled){background:var(--accent-soft)!important}
.composer-body{flex:1;min-height:0;overflow-y:auto;padding:2px 14px 8px;display:flex;flex-direction:column}
/* the address rows sit close (owner, 8 Oct: "take the gaps out, a more compact letter") */
.composer-row{display:flex;align-items:center;gap:10px;min-height:34px;border-bottom:1px solid var(--hair);padding:1px 0}
.composer-label{flex:0 0 84px;color:var(--muted);font-size:13px}
.composer-from{font-size:13px;color:var(--muted);overflow-wrap:anywhere}
.composer-toggles{display:flex;gap:2px;margin-inline-start:auto;align-self:flex-start;padding-top:5px}
:root[data-theme][data-theme] .mail-composer input.composer-subject{flex:1;min-width:0;border:0!important;background:transparent!important;border-radius:0!important;padding:8px 0!important;font-size:15px;font-weight:600;color:var(--ink);box-shadow:none!important;outline:none}
:root[data-theme][data-theme] .mail-composer select.composer-client{flex:0 1 auto;min-width:0;max-width:100%;padding-top:6px;padding-bottom:6px;font-size:13px}

/* addresses as chips */
.rcpt-field{position:relative;flex:1;min-width:0;display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;cursor:text;padding:2px 0}
.rcpt-list{display:contents}
.rcpt{display:inline-flex;align-items:center;gap:2px;max-width:100%;padding:3px 3px 3px 10px;border-radius:var(--r-pill);background:var(--accent-soft);color:var(--ink);font-size:13px;line-height:1.35;cursor:default}
.rcpt.bad{background:transparent;color:var(--error-ink);outline:1px dashed currentColor;outline-offset:-1px}
.rcpt-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
:root[data-theme][data-theme] .mail-composer input.rcpt-input{flex:1 1 140px;min-width:120px;border:0!important;background:transparent!important;padding:6px 0!important;border-radius:0!important;box-shadow:none!important;outline:none;font-size:14px}
.rcpt-menu{position:absolute;top:calc(100% + 4px);inset-inline-start:0;z-index:5;width:min(420px,100%);max-height:290px;overflow:auto;background:var(--dialog);border:1px solid var(--hair);border-radius:calc(14px*var(--rk));box-shadow:0 14px 40px rgba(0,0,0,.32);padding:6px}
.rcpt-opt{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 10px;padding:7px 10px;border-radius:calc(10px*var(--rk));cursor:pointer}
.rcpt-opt strong{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rcpt-opt small{grid-column:1;color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rcpt-client{grid-column:2;grid-row:1/span 2;align-self:center;font-size:11px;padding:2px 8px;border-radius:var(--r-pill);background:var(--fill);color:var(--muted);white-space:nowrap;max-width:150px;overflow:hidden;text-overflow:ellipsis}
.rcpt-opt.active,.rcpt-opt:hover{background:var(--fill-hover)}

/* the toolbar stays on top while the text scrolls */
.composer-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:2px;padding:6px 0;border-bottom:1px solid var(--hair);position:sticky;top:-2px;background:var(--dialog);z-index:3}
:root[data-theme][data-theme] .mail-composer select.tb-select{height:32px;padding:0 22px 0 8px!important;font-size:12.5px;border:0!important;border-radius:calc(8px*var(--rk))!important;background-color:transparent!important;background-position:right 6px center!important;background-size:11px 11px!important;color:var(--ink);width:auto;min-width:0;flex:none}
:root[data-theme][data-theme] .mail-composer select.tb-select:hover{background-color:var(--fill-hover)!important}
.tb-sep{width:1px;height:20px;background:var(--hair);margin:0 4px}

/* the sheet: text, signature, original */
.composer-sheet{flex:1 0 auto;display:flex;flex-direction:column;padding:8px 0 4px;cursor:text}
.composer-editor{position:relative;min-height:140px;outline:none;font-size:14px;line-height:1.5;color:var(--ink);overflow-wrap:anywhere;cursor:text}
.composer-editor.is-empty::before{content:attr(data-placeholder);position:absolute;top:0;inset-inline-start:0;color:var(--faint);pointer-events:none}
.composer-editor blockquote{margin:6px 0;padding-inline-start:12px;border-inline-start:3px solid var(--hair);color:var(--muted)}
.composer-editor ul,.composer-editor ol{margin:4px 0;padding-inline-start:26px}
.composer-editor h2{font-size:20px;line-height:1.3;margin:10px 0 4px;font-weight:600}
.composer-editor h3{font-size:16px;line-height:1.35;margin:8px 0 2px;font-weight:600}
.composer-editor pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;white-space:pre-wrap;background:var(--fill);padding:8px 10px;border-radius:calc(8px*var(--rk));margin:6px 0}
.composer-editor p{margin:0 0 .8em}
.composer-editor a{color:var(--accent);text-decoration:underline}
.composer-editor img{max-width:100%;height:auto;border-radius:6px;vertical-align:bottom;cursor:pointer}
.composer-editor img.img-picked{outline:2px solid var(--accent,#5b4bd6);outline-offset:1px}
.img-size-bar{position:fixed;z-index:1200;display:flex;gap:2px;padding:4px;border-radius:calc(10px*var(--rk,1));background:var(--card,#fff);border:1px solid var(--hair,#ddd);box-shadow:0 4px 18px rgba(0,0,0,.18)}
.img-size-bar button.img-size-btn{padding:3px 9px;font-size:12px;min-width:28px;border-radius:calc(7px*var(--rk,1));background:transparent;border:0;color:inherit}
.img-size-bar button.img-size-btn:hover{background:var(--fill,#f1f1f1)}
.img-size-grip{position:fixed;z-index:1200;width:16px;height:16px;border-radius:4px;background:var(--accent,#5b4bd6);border:2px solid #fff;cursor:nwse-resize;touch-action:none;box-shadow:0 1px 4px rgba(0,0,0,.3)}
.composer-editor table{border-collapse:collapse;margin:6px 0}
.composer-editor td,.composer-editor th{border:1px solid var(--hair);padding:4px 8px}
.composer-sig{margin-top:18px}
.composer-sig-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:28px;color:var(--faint);font-size:12px}
:root[data-theme][data-theme] .mail-composer textarea.composer-sig-text{display:block;width:100%;resize:none;overflow:hidden;border:0!important;background:transparent!important;padding:2px 0!important;border-radius:0!important;color:var(--muted);font-size:13px;line-height:1.55;box-shadow:none!important;outline:none;min-height:24px}
:root[data-theme][data-theme] .mail-composer textarea.composer-sig-text:focus{color:var(--ink)}
.composer-quote{margin-top:12px}
.composer-quote summary{cursor:pointer;font-size:12.5px;color:var(--muted);padding:4px 0;width:max-content;max-width:100%}
.composer-quote .mail-body{max-height:260px;overflow:auto;font-size:12px;color:var(--muted);border-inline-start:3px solid var(--hair);padding-inline-start:12px;margin:6px 0 0}

/* the attachment reminder, the files */
.composer-remind{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0 0;padding:6px 6px 6px 12px;border-radius:calc(12px*var(--rk));background:var(--warning-bg);color:var(--warning-ink);font-size:13px}
.composer-remind>span:nth-child(2){flex:1;min-width:160px}
.composer-files{margin-top:10px;padding-top:10px;border-top:1px solid var(--hair)}
.composer-files-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12.5px;color:var(--muted);margin-bottom:8px}
.composer-files-head.over{color:var(--error-ink)}
.file-chips{display:flex;flex-wrap:wrap;gap:8px}
.file-chip{position:relative;display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:6px 6px 6px 10px;border-radius:calc(12px*var(--rk));background:var(--fill);font-size:13px;overflow:hidden}
.file-chip .icon{color:var(--muted);flex:none}
.file-chip .file-name{max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);text-decoration:none}
.file-chip a.file-name:hover{text-decoration:underline}
.file-chip button.file-open,.file-chip button.file-open:hover:not(:disabled){background:transparent;border:0;padding:0;font:inherit;font-weight:500;color:var(--accent);cursor:pointer;border-radius:0;height:auto;min-height:0}
.file-chip button.file-open:hover:not(:disabled){text-decoration:underline}
.file-chip small{color:var(--muted);white-space:nowrap}
.file-chip.off{opacity:.55}
.file-chip.off .file-name{text-decoration:line-through}
.file-chip.bad small{color:var(--error-ink);white-space:normal}
.file-tag{font-size:10px;font-weight:700;letter-spacing:.04em;padding:1px 6px;border-radius:6px;background:var(--accent-soft);color:var(--accent)}
.file-bar{position:absolute;inset:auto 0 0 0;height:3px;background:var(--accent);transform-origin:left center;transform:scaleX(var(--p,0))}

/* the bottom bar */
.composer-foot{display:flex;align-items:center;gap:4px;padding:10px 14px;border-top:1px solid var(--hair)}
:root[data-theme][data-theme] .mail-composer button.composer-send{display:inline-flex;align-items:center;gap:8px;padding:9px 18px;margin-inline-end:8px}
.composer-state{flex:1;min-width:0;text-align:end;color:var(--faint);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 6px}
.composer-error{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:0;padding:8px 18px 0;font-size:13px}
.composer-error:empty{display:none}

/* dragging files onto the window */
.composer-drop{display:none;position:absolute;inset:6px;border:2px dashed var(--accent);border-radius:calc(14px*var(--rk));background:var(--dialog);opacity:.96;z-index:6;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--accent);pointer-events:none;text-align:center;padding:20px}
.mail-composer.dropping .composer-drop{display:flex}
/* a letter of the list is being dragged: the letters being written and the button "Write" show where it can be dropped */
body.letter-dragging .mail-composer{outline:2px dashed var(--accent);outline-offset:-2px}
body.letter-dragging .mx-compose{outline:2px dashed var(--accent);outline-offset:2px}
.mx-compose.drop{filter:brightness(1.12)}
.mx-row[draggable=true]{-webkit-user-drag:element}
.composer-drop strong{font-size:16px}
.composer-drop span{color:var(--muted);font-size:13px}

/* menus of the toolbar (colour, link, templates) */
.pop{position:absolute;z-index:8;min-width:230px;max-width:min(340px,calc(100% - 16px));max-height:330px;overflow:auto;background:var(--dialog);border:1px solid var(--hair);border-radius:calc(14px*var(--rk));box-shadow:0 14px 40px rgba(0,0,0,.35);padding:6px}
.pop input{width:100%}
.pop-label{display:block;font-size:12px;color:var(--muted);margin:4px 4px 6px}
.pop-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:8px}
.pop-hint{margin:4px 4px 8px;font-size:12.5px;line-height:1.45;color:var(--muted)}
.pop-hint:empty{display:none}
/* the "View" menu of the top bar */
.popover.pop-view{min-width:260px;padding:8px 10px 12px}
.pop-view .seg{display:flex;margin:2px 4px 6px}
/* (the icon stands before the word on one line: it used to drop under it) */
.pop-view .seg button{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
.pop-view .seg button .icon{order:-1;display:inline-flex}
/* the translator of the compose window */
.pop.pop-translate{min-width:300px;max-width:min(440px,calc(100% - 16px));max-height:min(520px,calc(100% - 24px))}
.translate-langs{display:flex;flex-wrap:wrap;gap:6px;margin:0 4px 6px}
.translate-result{margin:6px 4px 0;padding:10px 12px;border-radius:calc(10px*var(--rk));background:var(--fill);font-size:13.5px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;overflow:auto}
.pop.pop-colors{display:grid;grid-template-columns:repeat(6,28px);gap:8px;min-width:0;padding:12px}
.pop.pop-colors button.pop-item{grid-column:1/-1}
:root[data-theme][data-theme] .pop button.swatch{width:28px;height:28px;padding:0!important;border-radius:50%!important;border:2px solid var(--dialog)!important;background:var(--swatch)!important;box-shadow:0 0 0 1px var(--hair)}
:root[data-theme][data-theme] .pop button.pop-item{border:0!important;background:transparent!important;border-radius:calc(8px*var(--rk))!important;padding:8px 10px!important;color:var(--ink)!important;text-align:start;width:100%;font-size:13.5px}
:root[data-theme][data-theme] .pop button.pop-item:hover:not(:disabled){background:var(--fill-hover)!important}
.pop-row{display:flex;align-items:center;gap:4px}
.pop-row button.pop-item{flex:1;display:flex!important;justify-content:space-between;align-items:center;gap:8px}
.pop-item small{color:var(--muted);font-size:11.5px;white-space:nowrap}
.pop hr{border:0;border-top:1px solid var(--hair);margin:6px 0}
.pop .note{margin:6px 8px;font-size:12.5px}

/* "the letter goes in 5 s - Undo" */
.compose-sending{display:flex;align-items:center;gap:12px;padding:12px 12px 12px 18px;margin-bottom:16px;border-radius:calc(14px*var(--rk));background:var(--dialog);border:1px solid var(--hair);box-shadow:0 12px 40px rgba(0,0,0,.35);font-size:13.5px;color:var(--ink)}
.doc-pick{max-height:50vh;overflow:auto;margin:10px 0}
@media (max-width:760px){
  .compose-dock{inset-inline:0;max-width:none;flex-direction:column-reverse;align-items:stretch;gap:0}
  .mail-composer{width:100%;max-width:none}
  .mail-composer[data-state=normal],.mail-composer[data-state=max]{position:fixed;inset:0;height:auto;border-radius:0;border:0}
  .mail-composer[data-state=min]{width:100%;border-radius:calc(14px*var(--rk)) calc(14px*var(--rk)) 0 0}
  .composer-body{padding:2px 14px 12px}
  .composer-label{flex-basis:62px}
  .composer-toolbar{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .file-chip .file-name{max-width:150px}
  .compose-sending{margin:0 12px 12px}
  /* the folded letters sit across the bottom: the chat button moves above them */
  body:has(.compose-dock .mail-composer) button.chat-fab{bottom:calc(22px + 56px * var(--bars,1))}
}

/* ===== the mail program: folders | letters | the letter, over the whole window (after the owner's sample) ===== */
.mail-app{position:fixed;inset:0;z-index:1;display:grid;grid-template-columns:272px minmax(0,1fr);grid-template-rows:minmax(0,1fr);background:var(--bg);color:var(--ink);--mx-list:var(--fill);--mx-read:var(--dialog)}
.mail-app.arrive .mx-side{animation:mx-slide .34s cubic-bezier(.2,.8,.2,1) both}
.mail-app.arrive .mx-main{animation:mx-fade .34s .05s ease both}
[dir=rtl] .mail-app.arrive .mx-side{animation-name:mx-slide-rtl}
@keyframes mx-slide{from{transform:translateX(-32px);opacity:0}to{transform:none;opacity:1}}
@keyframes mx-slide-rtl{from{transform:translateX(32px);opacity:0}to{transform:none;opacity:1}}
@keyframes mx-fade{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:reduce){
  .mail-app.arrive .mx-side,.mail-app.arrive .mx-main{animation:none}
}
:root[data-theme][data-theme] .mail-app button.mx-plain,.pop button.mx-plain{background:transparent!important;border:0!important;border-radius:calc(10px*var(--rk))!important;padding:0!important;color:inherit!important;box-shadow:none;text-align:start;min-height:0;height:auto;width:auto;font-weight:inherit;font-size:inherit}

/* the left panel */
.mx-side{display:flex;flex-direction:column;gap:4px;min-height:0;padding:18px 16px 14px;overflow-y:auto;border-inline-end:1px solid var(--hair)}
.mx-side-top{display:flex;align-items:center;margin-bottom:8px}
:root[data-theme][data-theme] .mail-app button.mx-back{display:inline-flex;align-items:center;gap:6px;padding:7px 14px 7px 10px!important;border:1px solid var(--hair)!important;border-radius:var(--r-pill)!important;color:var(--muted)!important;font-size:13px;font-weight:600}
:root[data-theme][data-theme] .mail-app button.mx-back:hover:not(:disabled){color:var(--ink)!important;background:var(--fill-hover)!important}
.mx-me{display:flex;align-items:center;gap:12px;padding:10px 6px 14px}
.mx-avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--accent-soft);color:var(--accent);font-weight:700;font-size:15px;letter-spacing:.02em}
.mx-avatar.big{width:50px;height:50px;font-size:17px}
.mx-me-text{display:grid;min-width:0}
.mx-me-text strong{font-size:17px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mx-me-text small{color:var(--muted);font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
:root[data-theme][data-theme] .mail-app button.mx-compose{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 16px!important;margin:0 0 12px;border-radius:calc(14px*var(--rk))!important;background:var(--accent-btn)!important;color:#fff!important;font-weight:600;font-size:14.5px}
.mail-app button.mx-compose:hover:not(:disabled){filter:brightness(1.06)}
.mx-folders{display:grid;gap:2px}
:root[data-theme][data-theme] .mail-app button.mx-folder{display:flex;align-items:center;gap:14px;padding:10px 12px!important;font-size:15.5px;color:var(--ink)!important}
.mx-folder .icon{color:var(--muted)}
:root[data-theme][data-theme] .mail-app button.mx-folder.on{color:var(--accent)!important;background:var(--accent-soft)!important;font-weight:600}
.mx-folder.on .icon{color:var(--accent)}
.mx-count{font-weight:600}
.mx-group{margin-top:20px}
.mx-group h3{margin:0 0 6px;padding:0 12px 9px;font-size:12.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink);border-bottom:1px solid var(--hair)}
.mx-group-list{display:grid;gap:1px}
:root[data-theme][data-theme] .mail-app button.mx-person,:root[data-theme][data-theme] .mail-app button.mx-label{display:flex;align-items:center;gap:10px;padding:8px 12px!important;font-size:14.5px;color:var(--ink)!important}
.mx-person-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
:root[data-theme][data-theme] .mail-app button.mx-person.on,:root[data-theme][data-theme] .mail-app button.mx-label.on{background:var(--accent-soft)!important;font-weight:600}
:root[data-theme][data-theme] .mail-app button.mx-folder:hover:not(.on),:root[data-theme][data-theme] .mail-app button.mx-person:hover:not(.on),:root[data-theme][data-theme] .mail-app button.mx-label:hover:not(.on),:root[data-theme][data-theme] .mail-app button.mx-gear:hover{background:var(--fill-hover)!important}
.mx-badge{min-width:20px;padding:0 6px;border-radius:var(--r-pill);background:var(--accent-btn);color:#fff;font-size:11px;font-weight:700;text-align:center;line-height:19px}
.mx-dot{width:9px;height:9px;border-radius:50%;flex:none;background:var(--faint)}
.mx-dot.r-buyer{background:#ef7d2d}
.mx-dot.r-supplier{background:#2fa66a}
.mx-dot.r-logistics{background:#3b82f6}
.mx-dot.r-service{background:#c04fd0}
.mx-dot.r-none{background:var(--faint)}
.mx-hint{color:var(--faint);font-size:12.5px;padding:4px 12px;margin:0}
.mx-side-foot{margin-top:auto;padding-top:14px}
:root[data-theme][data-theme] .mail-app button.mx-gear{display:flex;align-items:center;gap:10px;padding:10px 12px!important;color:var(--muted)!important;font-size:14px;width:100%}

/* the list */
/* (as high as the mail screen itself, not as the viewport: a viewport height is scaled with the "compact"/"large" size and left a gap) */
.mx-main{display:grid;grid-template-columns:400px minmax(0,1fr);min-width:0;min-height:0;height:auto;background:var(--mx-read)}
.mx-main.resizable .split-handle{background:var(--mx-read)}
.mx-list{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--mx-list)}
.mx-list-head{display:flex;align-items:center;gap:8px;padding:18px 16px 12px 18px}
.mx-search-box{flex:1;min-width:0;display:flex;align-items:center;gap:8px;height:44px;padding:0 14px;border:1px solid var(--hair);border-radius:calc(12px*var(--rk));background:var(--mx-read);color:var(--muted)}
.mx-search-box:focus-within{border-color:var(--accent)}
:root[data-theme][data-theme] .mail-app input.mx-search{flex:1;min-width:0;height:100%;border:0!important;background:transparent!important;padding:0!important;border-radius:0!important;box-shadow:none!important;outline:none;font-size:14.5px;color:var(--ink)}
:root[data-theme][data-theme] .mail-app button.mx-icon{display:inline-grid;place-items:center;width:40px;height:40px;flex:none;border-radius:calc(10px*var(--rk))!important;color:var(--accent)!important}
:root[data-theme][data-theme] .mail-app button.mx-icon:hover:not(:disabled){background:var(--fill-hover)!important}
:root[data-theme][data-theme] .mail-app button.mx-filter.on{background:var(--accent-soft)!important}
:root[data-theme][data-theme] .mail-app button.mx-side-toggle,:root[data-theme][data-theme] .mail-app button.mx-to-list{display:none}
.mx-chips{display:flex;flex-wrap:wrap;gap:6px;padding:0 18px 10px}
.mx-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 4px 3px 11px;border-radius:var(--r-pill);background:var(--accent-soft);font-size:12.5px;color:var(--ink)}
:root[data-theme][data-theme] .mail-app button.mx-chip-x{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%!important;color:var(--muted)!important}
.mx-rows{flex:1;min-height:0;overflow-y:auto;padding-bottom:12px}
:root[data-theme][data-theme] .mail-app button.mx-row{position:relative;display:flex;width:100%;padding:16px 18px 16px 0!important;border-radius:0!important;color:var(--ink)!important}
.mx-row::after{content:'';position:absolute;inset:auto 18px 0 46px;height:1px;background:var(--hair)}
:root[data-theme][data-theme] .mail-app button.mx-row:hover:not(:disabled){background:var(--fill-hover)!important}
:root[data-theme][data-theme] .mail-app button.mx-row.on{background:var(--mx-read)!important}
.mx-row.on::after{display:none}
.mx-gutter{flex:0 0 46px;display:flex;justify-content:center;padding-top:6px;color:var(--muted)}
.mx-new{font-size:10px;font-weight:700;color:var(--accent);line-height:1;letter-spacing:.01em}
.mx-gutter .mx-dot{margin-top:2px}
.mx-row-body{flex:1;min-width:0;display:grid;gap:4px}
.mx-row-top{display:flex;align-items:baseline;gap:8px;min-width:0}
.mx-who{flex:1;min-width:0;display:flex;align-items:baseline;gap:6px;font-size:16px;font-weight:500;white-space:nowrap}
.mx-who>span:first-child{overflow:hidden;text-overflow:ellipsis}
.mx-row.unread .mx-who{font-weight:700}
.mx-thread-n{flex:none;padding:0 6px;border-radius:var(--r-pill);background:var(--fill);color:var(--muted);font-size:11px;font-weight:600}
.mx-star{color:#e8a10a}
.mx-star svg{fill:currentColor}
.mx-ago{flex:none;color:var(--muted);font-size:12.5px;white-space:nowrap}
.mx-subj{display:flex;align-items:center;gap:6px;min-width:0;font-size:14.5px;color:var(--ink)}
.mx-subj>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mx-subj .icon{color:var(--muted);flex:none}
.mx-row.unread .mx-subj{font-weight:600}
.mx-snip{font-size:13.5px;line-height:1.45;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.mx-row-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:3px}
.mx-tag{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:2px 10px;border-radius:var(--r-pill);background:var(--fill);font-size:12px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
:root[data-theme][data-theme] .mail-app button.mx-tag.link{display:inline-flex;padding:5px 12px!important;border-radius:var(--r-pill)!important;background:var(--fill)!important;font-size:13px;font-weight:500}
:root[data-theme][data-theme] .mail-app button.mx-tag.link:hover:not(:disabled){background:var(--fill-hover)!important}
:root[data-theme][data-theme] .mail-app button.mx-more{display:block;margin:14px auto!important;padding:8px 18px!important;border:1px solid var(--hair)!important;border-radius:var(--r-pill)!important;color:var(--accent)!important;font-size:13px;font-weight:600}
.mx-list-note{margin:0;padding:8px 18px 12px;font-size:12px;color:var(--faint);border-top:1px solid var(--hair)}
.mx-list-note:empty{display:none}
.mx-empty{margin:0;padding:44px 24px;text-align:center;color:var(--muted)}

/* the letter */
.mx-read{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--mx-read);container-type:inline-size}

/* a narrow letter pane keeps the main actions with words, the rest as icons (their names show on hover) */
@container (max-width:880px){
  .mx-tool.k-all .mx-tool-label,.mx-tool.k-star .mx-tool-label,.mx-tool.k-more .mx-tool-label{display:none}
}
@container (max-width:620px){
  .mx-tool .mx-tool-label{display:none}
}
.mx-bar{position:relative;z-index:1;display:flex;flex-wrap:wrap;align-items:center;gap:2px 4px;min-height:72px;padding:12px 22px;border-bottom:1px solid var(--hair);box-shadow:0 8px 18px -14px rgba(0,0,0,.3)}
:root[data-theme][data-theme] .mail-app button.mx-tool{display:inline-flex;align-items:center;gap:8px;padding:9px 11px!important;font-size:15px;color:var(--ink)!important;white-space:nowrap}
.mx-tool .icon{color:var(--muted)}
:root[data-theme][data-theme] .mail-app button.mx-tool:hover:not(:disabled){background:var(--fill-hover)!important}
.mx-tool.on .icon{color:#e8a10a}
.mx-tool.on svg{fill:currentColor}
.mx-bar-space{flex:1}
.mx-bar-title{font-size:15px;padding:9px 12px}
.mx-letter{flex:1;min-height:0;overflow-y:auto;padding:30px 44px 48px}
.mx-article{max-width:920px}
.mx-sender{display:flex;align-items:center;gap:14px}
.mx-sender-text{flex:1;min-width:0}
.mx-sender-text h2{margin:0;font-size:23px;font-weight:600;line-height:1.25;overflow-wrap:anywhere}
.mx-sender-text small{color:var(--muted);font-size:14px;overflow-wrap:anywhere}
.mx-when{align-self:flex-start;color:var(--muted);font-size:13px;white-space:nowrap}
.mail-app .mx-subject{margin:24px 0 14px;font:700 34px/1.2 var(--font);letter-spacing:-.02em;color:var(--ink);overflow-wrap:anywhere}
.mx-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:24px}
.mx-assign{display:inline-flex;align-items:center;gap:8px;margin-inline-start:auto;font-size:12.5px;color:var(--muted)}
:root[data-theme][data-theme] .mail-app .mx-assign select{padding-top:6px;padding-bottom:6px;font-size:13px}
.mx-muted{color:var(--muted);font-size:13px}
.mx-cc{margin:-12px 0 18px}
.mx-body{margin:0 0 26px;white-space:pre-wrap;overflow-wrap:anywhere;font:400 16px/1.7 var(--font);color:var(--ink)}
.mx-body.small{margin:10px 0;font-size:14px}
.mx-files{display:flex;flex-wrap:wrap;gap:12px;margin:6px 0 28px}
.mx-file-wrap{display:inline-flex;align-items:center;gap:2px;max-width:100%}
.mx-file{--k:#5f6368;display:inline-flex;align-items:center;gap:10px;max-width:420px;min-width:0;padding:12px 18px;border-radius:calc(12px*var(--rk));font-weight:600;font-size:15px;text-decoration:none;color:color-mix(in srgb,var(--k) 80%,var(--ink));background:color-mix(in srgb,var(--k) 15%,transparent)}
.mx-file:hover{background:color-mix(in srgb,var(--k) 24%,transparent)}
.mx-file .mx-file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mx-file small{font-weight:500;opacity:.75;white-space:nowrap}
.mx-file.k-doc{--k:#2b6fd6}
.mx-file.k-xls{--k:#1f8a4c}
.mx-file.k-pdf{--k:#d93025}
.mx-file.k-ppt{--k:#e2580e}
.mx-file.k-img{--k:#9b3fbf}
:root[data-theme][data-theme] .mail-app button.mx-file-save{width:36px;height:36px;color:var(--muted)!important}
.mx-earlier-box{margin-top:8px;padding-top:16px;border-top:1px solid var(--hair)}
.mx-earlier{margin:8px 0;padding:10px 14px;border:1px solid var(--hair);border-radius:calc(12px*var(--rk));background:var(--surface)}
.mx-earlier.ours{border-inline-start:3px solid var(--accent-soft)}
.mx-earlier summary{cursor:pointer;display:flex;align-items:baseline;gap:10px;min-width:0}
.mx-earlier summary strong{white-space:nowrap}
.mx-earlier summary small{color:var(--muted);white-space:nowrap}
.mx-earlier summary .mx-snip{flex:1;min-width:0;-webkit-line-clamp:1}
.mx-pick{min-height:60vh;display:grid;place-content:center;justify-items:center;gap:12px;color:var(--faint);text-align:center}
.mx-pick p{margin:0;font-size:15px}
.mx-setup{max-width:780px}

/* menus over the mail program, short notices */
.pop.mx-filters-pop{display:grid;gap:10px;width:300px;padding:14px}
.pop.mx-filters-pop .client-field{margin:0}
.pop.pop-list{min-width:220px}
.mx-tpl-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--hair)}
.mx-tpl-row>div{display:grid;min-width:0}
.notice.toast.undo{display:flex;align-items:center;gap:14px;z-index:80;color:var(--ink)}
.notice.toast.undo span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.notice.toast.undo button{flex:none;white-space:nowrap}
.watch-hidden{margin-top:10px}
.watch-hidden summary{cursor:pointer;color:var(--muted);font-size:13px}
.watch-hidden-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;border-top:1px solid var(--hair)}
.watch-hidden-row .row-text strong{white-space:normal;font-weight:500}
.mx-tr-subject{margin:6px 0 8px;font-size:16px}
.mx-tr-body{white-space:pre-wrap;line-height:1.55;font-size:14px;max-height:52vh;overflow:auto;padding:12px 14px;border-radius:calc(12px*var(--rk));background:var(--surface)}
.mx-tr-original{margin-top:12px}
.mx-tr-original summary{cursor:pointer;color:var(--accent);font-size:13px}
.notice.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:70;max-width:min(560px,calc(100vw - 32px));margin:0;box-shadow:0 12px 40px rgba(0,0,0,.3);background:var(--dialog)}
@media (max-width:1100px){
  .mail-app{grid-template-columns:230px minmax(0,1fr)}
  .mx-letter{padding:24px 28px 40px}
  .mail-app .mx-subject{font-size:28px}
}
@media (max-width:760px){
  .mail-app{grid-template-columns:minmax(0,1fr)}
  .mx-side{display:none;position:fixed;inset-block:0;inset-inline-start:0;width:min(300px,86vw);z-index:6;background:var(--bg);box-shadow:0 0 40px rgba(0,0,0,.35)}
  .mail-app.side-open .mx-side{display:flex}
  .mail-app.side-open::after{content:'';position:fixed;inset:0;z-index:5;background:rgba(0,0,0,.4)}
  :root[data-theme][data-theme] .mail-app button.mx-side-toggle,:root[data-theme][data-theme] .mail-app button.mx-to-list{display:inline-grid}
  .mx-main{grid-template-columns:minmax(0,1fr)!important}
  .mail-app.reading .mx-list,.mail-app:not(.reading) .mx-read{display:none}
  .mx-list-head{padding:12px 10px 10px}
  .mx-tool .mx-tool-label{display:none}
  .mx-bar{min-height:56px;padding:6px 8px}
  .mx-letter{padding:18px 16px 32px}
  .mail-app .mx-subject{font-size:24px;margin-top:18px}
  .mx-assign{margin-inline-start:0}
  .mx-file{max-width:calc(100vw - 80px)}
  /* (owner, 21 Nov 2026, a phone screenshot: the letters took half the screen, the sender and the subject one letter each.)
     The assistant's column of the table look kept its desktop grid here and squeezed the list to the left: on a phone it goes.
     The table turns into two-line rows, as in Gmail: sender and date on top, the subject under them. */
  .mail-app.has-hints{grid-template-columns:minmax(0,1fr)}
  .mx-hints{display:none}
  .look-table .mx-thead{display:none}
  :root[data-theme][data-theme] .mail-app.look-table button.mx-trow{grid-template-columns:22px minmax(0,1fr) auto!important;grid-template-areas:"star who when" "star subj clip";row-gap:2px!important;height:auto;min-height:58px;padding:8px 12px 8px 6px!important;font-size:14.5px}
  .look-table .mx-tstar{grid-area:star;align-self:start;padding-top:2px;font-size:16px}
  .look-table .mx-twho{grid-area:who}
  .look-table .mx-twhen{grid-area:when;font-size:12.5px}
  .look-table .mx-tsubj{grid-area:subj;font-size:13.5px;color:var(--muted)}
  .look-table .mx-trow.unread .mx-tsubj,.look-table .mx-trow.on .mx-tsubj{color:inherit}
  .look-table .mx-tclip{grid-area:clip;justify-content:flex-end}
  .look-table .mx-tbetween{display:none}
  .look-table .mx-twhen-full{display:none}
  .look-table .mx-twhen-short{display:inline}
}
.mx-twhen-short{display:none}

/* ===== the whole ERP in the look of the mail program (owner, 6 Oct 2026): a flat side panel (who I am, "Create", the menu
   in groups with headings, settings at the bottom), a working area with a bar on top, plain bold titles, flat cards
   with a hairline. Same tokens in every theme. Delete this block to go back to the floating menu. ===== */
.layout{grid-template-columns:272px minmax(0,1fr);min-height:calc(100vh/var(--zoom,1))}
:root[data-theme][data-theme] .sidebar{overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--hair) transparent;position:sticky;top:0;height:calc(100vh/var(--zoom,1));margin:0;display:flex;flex-direction:column;gap:2px;padding:18px 16px 14px;border:0;border-inline-end:1px solid var(--hair);border-radius:0;background:var(--bg);box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none;overflow:hidden}
:root[data-theme][data-theme] .sidebar .brand{flex:none;padding:2px 6px 10px}
.sidebar>.pop-wrap{flex:none}

/* only the menu scrolls; the logo, who I am and "Create" stay where they are */
.sidebar .side-scroll{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--hair) transparent;margin:0 -8px;padding:0 8px 4px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 10px);mask-image:linear-gradient(to bottom,transparent 0,#000 10px)}
.sidebar .company-logo{max-width:150px;min-height:0}

/* who I am, and the account menu under it */
.sidebar .pop-wrap{position:relative}
.sidebar .pop-wrap .popover{inset-inline:0;width:auto}

/* "Create" - the main action, as "Write" in the mail program */
:root[data-theme][data-theme] .sidebar button.side-create,:root[data-theme][data-theme] .sidebar button.side-create:hover:not(:disabled){display:flex;align-items:center;justify-content:center;gap:8px;width:100%;margin:6px 0 12px;padding:12px 16px!important;border:0!important;border-radius:calc(14px*var(--rk))!important;background:var(--accent-btn)!important;color:#fff!important;font-weight:600;font-size:14.5px}
.sidebar button.side-create:hover:not(:disabled){filter:brightness(1.06)}
.popover.create-pop{top:calc(100% - 4px)}

/* the menu: plain items with line icons, the chosen one tinted; groups with an uppercase heading */
:root[data-theme][data-theme] .sidebar nav{display:grid;gap:2px}
.sidebar .nav-group{margin:18px 0 6px;padding:0 12px 9px;font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink);border-bottom:1px solid var(--hair)}
:root[data-theme][data-theme] .nav-item,:root[data-theme][data-theme] .nav-item:hover:not(:disabled){display:flex;align-items:center;gap:14px;width:100%;padding:10px 12px;border:0;border-radius:calc(10px*var(--rk));background:transparent;color:var(--ink);font-size:15px;font-weight:500}
:root[data-theme][data-theme] .nav-item:hover:not(:disabled){background:var(--fill-hover)}
:root[data-theme][data-theme] .nav-item .nav-icon,:root[data-theme][data-theme] .nav-item:hover:not(:disabled) .nav-icon,:root[data-theme][data-theme] .nav-item.active .nav-icon{width:20px;height:20px;border-radius:0;background:none;color:var(--muted)}
:root[data-theme][data-theme] .nav-item .nav-icon svg{width:20px;height:20px;stroke-width:1.6}
:root[data-theme][data-theme] .nav-item.active,:root[data-theme][data-theme] .nav-item.active:hover:not(:disabled){background:var(--accent-soft);color:var(--accent);font-weight:600}
:root[data-theme][data-theme] .nav-item.active.open,:root[data-theme][data-theme] .nav-item.active.open:hover:not(:disabled){background:transparent}
:root[data-theme][data-theme] .nav-item.active .nav-icon{color:var(--accent)}
:root[data-theme][data-theme] button.nav-sub,:root[data-theme][data-theme] button.nav-sub:hover:not(:disabled){padding:8px 12px 8px 46px;border:0;border-radius:calc(10px*var(--rk));background:transparent;color:var(--muted);font-size:14px;font-weight:500;box-shadow:none}
[dir=rtl][data-theme][data-theme] button.nav-sub,[dir=rtl][data-theme][data-theme] button.nav-sub:hover:not(:disabled){padding:8px 46px 8px 12px}
:root[data-theme][data-theme] button.nav-sub:hover:not(:disabled){background:var(--fill-hover);color:var(--ink)}
:root[data-theme][data-theme] button.nav-sub.active,:root[data-theme][data-theme] button.nav-sub.active:hover:not(:disabled){background:var(--accent-soft)!important;color:var(--accent)!important;font-weight:600;box-shadow:none}
.sidebar .side-foot{margin-top:auto;padding-top:14px}
/* "Settings" stays in view under the menu, whatever the height of the window: the menu scrolls, the foot does not */
.sidebar>.side-foot{flex:none;padding-top:10px;border-top:1px solid var(--hair)}
/* how large everything is drawn: the person's choice in the "View" menu of the top bar */
:root[data-density="compact"]{--zoom:.88}
:root[data-density="compact"] body{zoom:.88}
:root[data-density="spacious"]{--zoom:1.12}
:root[data-density="spacious"] body{zoom:1.12}
/* (the menu column is as high as the window: a viewport height is scaled with the rest, so it is divided back) */
/* ---------- the styles of the whole look (the "View" menu): every corner follows --rk, pills follow --r-pill ---------- */
/* "strict": a desktop program - square corners, hairlines instead of shadows, the system font, everything closer together */
:root[data-style="strict"]{--rk:.25;--r-pill:4px;--font:"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,Arial,sans-serif;font-size:14px}
:root[data-style="strict"][data-theme][data-theme] :is(.panel,.stat,.kpi,dialog,.topbar,.mail-composer,.popover,.pop,.assistant-panel,.search-results,.notice.toast){box-shadow:none}
:root[data-style="strict"][data-theme][data-theme] .panel{padding:14px 16px;margin-bottom:12px}
:root[data-style="strict"][data-theme][data-theme] .main{padding:18px 24px 72px}
:root[data-style="strict"][data-theme][data-theme] .topbar{min-height:52px;padding:6px 20px}
:root[data-style="strict"] .layout{grid-template-columns:232px minmax(0,1fr)}
:root[data-style="strict"] .sidebar nav{gap:0}
:root[data-style="strict"] .stat,:root[data-style="strict"] button.stat{min-height:84px;padding:12px 14px}
:root[data-style="strict"] .stat-value{font-size:24px}
:root[data-style="strict"] h1,:root[data-style="strict"]:not([data-theme=dark]):not([data-theme=light]) h1{font-size:22px}
:root[data-style="strict"] h2{font-size:15px}
:root[data-style="strict"] table.data td{padding:7px 10px;font-size:13px}
:root[data-style="strict"] table.data th{padding:7px 10px;font-size:12px}
:root[data-style="strict"][data-theme][data-theme] .mail-app button.mx-row{padding:10px 14px 10px 0!important}
:root[data-style="strict"] .mx-bar{min-height:52px;padding:6px 14px}
/* "soft": a magazine - rounder, more air, deeper shadows, Montserrat headings */
:root[data-style="soft"]{--rk:1.5;--font-head:Montserrat,var(--font)}
:root[data-style="soft"] body{line-height:1.55}
:root[data-style="soft"][data-theme][data-theme] .panel{padding:30px 32px;margin-bottom:24px}
:root[data-style="soft"][data-theme][data-theme] .main{padding:40px 56px 120px}
:root[data-style="soft"][data-theme][data-theme] :is(.panel:not(.note-card),.stat:not(.alert),.kpi){box-shadow:0 14px 40px -20px rgba(0,0,0,.35)}
:root[data-style="soft"] .stat,:root[data-style="soft"] button.stat{min-height:128px;padding:20px 22px 22px}
:root[data-style="soft"] .stat-value{font-size:34px}
:root[data-style="soft"] h1,:root[data-style="soft"]:not([data-theme=dark]):not([data-theme=light]) h1{font-size:34px;letter-spacing:-.01em}
:root[data-style="soft"] h2{font-size:18px}
@media (max-width:1100px){:root[data-style="soft"][data-theme][data-theme] .main{padding:28px 28px 96px}}
/* "glass": frosted translucent cards over a soft gradient, menu icons in tinted tiles (after the owner's sample, 8 Oct 2026);
   its colours follow the theme: blue glass on light, deep blue on dark, the company's green on the brand theme */
:root[data-style="glass"]{--rk:1.3;--glass:rgba(255,255,255,.55);--glass-line:rgba(255,255,255,.7);--glass-bg:linear-gradient(135deg,#dfe9f7,#eef3fb 45%,#d6e2f2);--tile:rgba(79,124,255,.14);--tile-ink:#3b6cf0}
:root[data-style="glass"][data-theme=dark]{--glass:rgba(255,255,255,.07);--glass-line:rgba(255,255,255,.12);--glass-bg:linear-gradient(135deg,#0f1722,#1b2535 55%,#101a28);--tile:rgba(120,160,255,.18);--tile-ink:#9db8ff}
:root[data-style="glass"]:not([data-theme=dark]):not([data-theme=light]){--glass:rgba(255,250,241,.07);--glass-line:rgba(255,250,241,.12);--glass-bg:linear-gradient(135deg,#0f2419,#1d3a2b 55%,#12291e);--tile:rgba(255,148,80,.16);--tile-ink:#ffb27e}
:root[data-style="glass"] body::before{background:var(--glass-bg)}
:root[data-style="glass"][data-theme][data-theme] :is(.panel:not(.note-card),.stat,.kpi,.topbar,.mail-composer,.assistant-panel){background:var(--glass);border:1px solid var(--glass-line);-webkit-backdrop-filter:blur(18px) saturate(1.3);backdrop-filter:blur(18px) saturate(1.3);box-shadow:0 12px 32px -20px rgba(20,40,80,.35)}
/* menus and windows over text stay solid: glass over a page made the words behind show through (owner, 8 Oct) */
:root[data-style="glass"][data-theme][data-theme] :is(dialog,.popover,.pop,.search-results){background:var(--pop,var(--dialog));border:1px solid var(--glass-line);box-shadow:0 18px 50px -20px rgba(20,40,80,.45)}
:root[data-style="glass"][data-theme][data-theme] .sidebar{background:transparent;border-inline-end-color:var(--glass-line)}
:root[data-style="glass"][data-theme][data-theme] .nav-item .nav-icon,:root[data-style="glass"][data-theme][data-theme] .nav-item:hover:not(:disabled) .nav-icon,:root[data-style="glass"][data-theme][data-theme] .nav-item.active .nav-icon{width:32px;height:32px;border-radius:10px;background:var(--tile);color:var(--tile-ink)}
:root[data-style="glass"][data-theme][data-theme] .nav-item .nav-icon svg{width:18px;height:18px;stroke-width:1.8}
:root[data-style="glass"] .stat-value{font-size:32px}
:root[data-style="glass"][data-theme][data-theme] .mail-app{background:var(--glass-bg)}
:root[data-style="glass"][data-theme][data-theme] .mx-side,:root[data-style="glass"][data-theme][data-theme] .mx-list{background:transparent}
:root[data-style="glass"][data-theme][data-theme] .mx-read{background:var(--glass);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}
/* ---------- the compose window moves by its head and resizes by its edges; where it was is kept on this computer ---------- */
.mail-composer[data-state=normal] .composer-head{cursor:move}
.mail-composer[data-free]{position:fixed;max-width:none;border-bottom:1px solid var(--hair);border-radius:calc(18px*var(--rk))}
/* the grab zones reach a little outside the window and are wide enough to find by hand (owner, 8 Oct: "works poorly") */
.composer-edge{position:absolute;z-index:3;touch-action:none}
.composer-edge.edge-n{top:-5px;left:18px;right:18px;height:10px;cursor:ns-resize}
.composer-edge.edge-s{bottom:-5px;left:18px;right:18px;height:10px;cursor:ns-resize}
.composer-edge.edge-e{right:-5px;top:18px;bottom:18px;width:10px;cursor:ew-resize}
.composer-edge.edge-w{left:-5px;top:18px;bottom:18px;width:10px;cursor:ew-resize}
.composer-edge.edge-ne{top:-6px;right:-6px;width:20px;height:20px;cursor:nesw-resize}
.composer-edge.edge-nw{top:-6px;left:-6px;width:20px;height:20px;cursor:nwse-resize}
.composer-edge.edge-se{bottom:-6px;right:-6px;width:20px;height:20px;cursor:nwse-resize}
.composer-edge.edge-sw{bottom:-6px;left:-6px;width:20px;height:20px;cursor:nesw-resize}
.mail-composer[data-state=min] .composer-edge,.mail-composer[data-state=max] .composer-edge{display:none}
/* the shadow of where a dragged window will land; nothing is selected while a window moves or resizes */
.composer-ghost{position:fixed;z-index:59;border:2px solid var(--accent);border-radius:calc(18px*var(--rk));background:var(--accent-soft);pointer-events:none;transition:left .08s,top .08s,width .08s,height .08s}
body.composer-moving{user-select:none;-webkit-user-select:none}
/* the mail list after Spark: letters grouped by day, the sender in a circle of initials, quick actions under the hand */
.mx-day{padding:14px 18px 4px 46px;font-size:11.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--faint)}
.mx-rows>.mx-day:first-child,.mx-tips+.mx-day{padding-top:6px}
.mx-row-avatar{position:relative;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-size:12.5px;font-weight:700;letter-spacing:.02em;color:#fff;background:hsl(var(--h) 42% 46%)}
.mx-row-avatar .mx-new-dot{position:absolute;top:-1px;right:-1px;width:10px;height:10px;border-radius:50%;background:var(--accent);border:2px solid var(--mx-list)}
.mx-row.on .mx-row-avatar .mx-new-dot{border-color:var(--mx-read)}
.mx-quick{position:absolute;top:8px;inset-inline-end:12px;display:none;gap:2px;padding:2px;border-radius:9px;background:var(--mx-list);box-shadow:0 2px 10px -4px rgba(0,0,0,.35)}
.mx-row.on .mx-quick{background:var(--mx-read)}
.mx-row:hover .mx-quick,.mx-row:focus-within .mx-quick{display:flex}
.mx-quick.mx-always{display:flex;top:50%;transform:translateY(-50%);box-shadow:none;background:transparent}
.mx-row:hover .mx-quick.mx-always .mx-qa{color:#a3281f}
.mx-row.mx-gone{display:flex;align-items:center;gap:10px;padding-inline-end:14px;color:var(--muted);cursor:default}
.mx-row.mx-gone .mx-row-body{flex:1;min-width:0}
.mx-row.mx-gone .mx-subj{font-weight:400;font-style:italic}
.mx-row:hover .mx-ago{visibility:hidden}
.mx-qa{display:grid;place-items:center;width:28px;height:28px;border-radius:7px;color:var(--muted);cursor:pointer}
.mx-qa:hover,.mx-qa:focus-visible{background:var(--fill-hover);color:var(--ink);outline:none}
.mx-qa.on{color:#e8a10a}
.mail-app.look-compact .mx-row-avatar{display:none}
.mail-app.look-compact .mx-gutter .mx-new-dot{position:static;width:8px;height:8px;border:0;margin-top:5px}
.mail-app.look-compact .mx-day{padding:10px 18px 2px 14px}
.mail-app.look-compact .mx-quick{top:2px}
@media (max-width:760px){.composer-edge{display:none}.mail-composer[data-state=normal] .composer-head{cursor:default}}

/* the working area: one surface with a bar on top (search, assistant, note, attention, theme, language) */
:root[data-theme][data-theme] .content{min-width:0;background:var(--dialog)}
:root[data-theme][data-theme] .topbar{position:sticky;top:0;z-index:20;min-height:72px;gap:10px;padding:12px 32px;border:0;border-bottom:1px solid var(--hair);background:var(--dialog);box-shadow:0 8px 18px -14px rgba(0,0,0,.3);-webkit-backdrop-filter:none;backdrop-filter:none}
:root[data-theme][data-theme] .global-search{flex:1 1 auto;max-width:560px;margin-inline-start:0}
:root[data-theme][data-theme] .global-search input{height:44px;padding-top:0;padding-bottom:0;border:1px solid transparent;border-radius:calc(12px*var(--rk));background:var(--fill);box-shadow:none}
:root[data-theme][data-theme] .global-search input:focus{border-color:var(--accent);background:var(--dialog)}
:root[data-theme][data-theme] .top-controls{margin-inline-start:auto;gap:4px}
:root[data-theme][data-theme] .icon-button.top-icon,:root[data-theme][data-theme] .icon-button.top-icon:hover:not(:disabled){width:40px;height:40px;border:0;border-radius:calc(10px*var(--rk));background:transparent;color:var(--muted)}
:root[data-theme][data-theme] .icon-button.top-icon:hover:not(:disabled){background:var(--fill-hover);color:var(--ink)}
:root[data-theme][data-theme] .assistant-pill,:root[data-theme][data-theme] .assistant-pill:hover:not(:disabled){height:40px;padding:0 12px!important;border:0!important;border-radius:calc(10px*var(--rk))!important;background:transparent!important;color:var(--ink)!important;font-size:15px}
:root[data-theme][data-theme] .assistant-pill:hover:not(:disabled){background:var(--fill-hover)!important}
:root[data-theme][data-theme] .lang-select{height:40px;border:0;border-radius:calc(10px*var(--rk));background-color:transparent}
:root[data-theme][data-theme] .lang-select:hover{background-color:var(--fill-hover)}

/* pages: plain bold titles, flat cards with a hairline (as the letters in the mail program) */
:root[data-theme][data-theme] .main{padding:30px 40px 96px}
:root[data-theme][data-theme] .main h1{font:700 32px/1.2 var(--font);letter-spacing:-.02em;margin:0 0 8px;color:var(--ink)}
[dir=rtl][data-theme][data-theme] .main h1{font-family:var(--font)}
:root[data-theme][data-theme] .heading{margin-bottom:26px}
:root[data-theme][data-theme] .panel:not(.note-card),:root[data-theme][data-theme] .stat:not(.alert),:root[data-theme][data-theme] .kpi:not(.alert){background:var(--surface);border:1px solid var(--hair);border-radius:calc(16px*var(--rk));box-shadow:none}
:root[data-theme][data-theme] .stat.alert,:root[data-theme][data-theme] .kpi.alert{border-radius:calc(16px*var(--rk));box-shadow:none}
:root[data-theme][data-theme] dialog{border-radius:calc(18px*var(--rk))}
@media (max-width:1000px){
  .layout{grid-template-columns:232px minmax(0,1fr)}
  :root[data-theme][data-theme] .main{padding:24px 24px 80px}
  :root[data-theme][data-theme] .topbar{padding:10px 20px}
}
@media (max-width:700px){
  :root[data-theme][data-theme] .layout{display:block}
  :root[data-theme][data-theme] .sidebar{position:static;height:auto;overflow:visible;border-inline-end:0;border-bottom:1px solid var(--hair)}
  .sidebar .side-scroll{overflow:visible;-webkit-mask-image:none;mask-image:none}
  .sidebar .nav-group{grid-column:1/-1}
  :root[data-theme][data-theme] .topbar{position:static;min-height:0;padding:10px 12px}
  :root[data-theme][data-theme] .main{padding:20px 16px 72px}
  :root[data-theme][data-theme] .main h1{font-size:26px}
}

/* tasks: search and the two switches (whose, board/list) in one row, centred on one line */
.list-tools.tk-tools{align-items:center}
.list-tools.tk-tools .seg{margin:0}
:root[data-theme][data-theme] .list-tools.tk-tools .md-search{height:42px;margin:0;padding-top:0;padding-bottom:0}

/* finishing touches (owner's review, 6 Oct 2026) */

/* text fields: the text never touches a rounded edge */
:root[data-theme][data-theme] textarea{padding:10px 14px;font:inherit;font-size:14px;line-height:1.5}

/* links in tables and cards (order numbers, e-mails) are plain text links - no frame around them */
:root[data-theme][data-theme] button.link,:root[data-theme][data-theme] button.link:hover:not(:disabled),:root[data-theme][data-theme] button.value-link,:root[data-theme][data-theme] button.value-link:hover:not(:disabled){border:0!important;box-shadow:none!important}

/* the menu slides softly under the fixed top of the side panel */

/* filter rows: the search and the lists stand on one line, same height (captions above the lists) */
:root[data-theme][data-theme] .list-tools .md-search{margin:0;height:40px}
:root[data-theme][data-theme] .list-tools select{height:40px;padding-top:0;padding-bottom:0}
:root[data-theme][data-theme] .list-tools .icon-button{height:40px;width:40px;display:inline-grid;place-items:center}
.list-tools .check-field.inline{min-height:40px;display:inline-flex;align-items:center}

/* the stages of a delivery file wrap onto a second line instead of being cut at the edge */
.stage-strip{flex-wrap:wrap;overflow-x:visible}

/* small figures (box cost, margin per box) stay small, and wrap under their label when the tile is narrow */
:root[data-theme][data-theme] .kpi-value.small{font-size:17px}
div.kpi{flex-wrap:wrap;row-gap:2px}
.list-tools .list-count{align-self:flex-end;line-height:40px}

/* notes: paper cards again (the general card rule had made them plain), the text written right on the paper - one frame, not two */
:root[data-theme][data-theme] .panel.note-card{background:var(--note-bg);border:1px solid var(--note-line);border-radius:calc(16px*var(--rk));box-shadow:var(--note-shadow)}
:root[data-theme][data-theme] .panel.note-card.blank{background:var(--note-blank);border:1.5px dashed var(--note-line);box-shadow:none}
:root[data-theme][data-theme] .panel.note-card:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
:root[data-theme][data-theme] .note-card textarea.note-text,:root[data-theme][data-theme] .note-card textarea.note-text:focus{border:0;background:transparent;box-shadow:none;outline:none;padding:4px 2px;border-radius:0;resize:vertical}

/* finance tiles: the label, the sum right under it, then the explanation - every sum on the same line */
.fin-stats .stat.fin-kpi{justify-content:flex-start}
.fin-stats .stat.fin-kpi .stat-value{margin-top:10px}
.fin-stats .stat.fin-kpi .stat-label{min-height:2.7em}
:root[data-theme][data-theme] .fin-toolbar select{height:40px;padding-top:0;padding-bottom:0}
:root[data-theme][data-theme] .fin-toolbar .seg{min-height:40px;display:inline-flex;align-items:center}

/* who I am: at the right end of the top bar (owner, 6 Oct 2026) */
:root[data-theme][data-theme] .topbar button.top-me,:root[data-theme][data-theme] .topbar button.top-me:hover:not(:disabled){display:flex;align-items:center;gap:10px;height:44px;margin-inline-start:6px;padding:4px 10px 4px 4px!important;border:0!important;border-radius:calc(12px*var(--rk))!important;background:transparent!important;color:var(--ink)!important;text-align:start}
:root[data-theme][data-theme] .topbar button.top-me:hover:not(:disabled){background:var(--fill-hover)!important}
:root[data-theme][data-theme] .top-me .avatar{width:36px;height:36px;font-size:13px;background:var(--accent-soft);color:var(--accent)}
.top-me .user-text{display:grid;min-width:0;max-width:180px;line-height:1.2}
.top-me .user-text strong{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-me .user-text small{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-me>.icon{color:var(--faint)}
.topbar .pop-wrap:has(.top-me) .popover{inset-inline-end:0;inset-inline-start:auto;width:250px}
@media (max-width:1100px){
  .top-me .user-text,.top-me>.icon{display:none}
  :root[data-theme][data-theme] .topbar button.top-me{padding:4px!important}
}

/* items of every pop-up menu: plain lines, tinted on hover (as in the mail program) - no frame around each */
:root[data-theme][data-theme] .popover button.pop-item,:root[data-theme][data-theme] .popover button.search-hit,:root[data-theme][data-theme] .search-results button.search-hit{border:0!important;background:transparent!important;border-radius:calc(8px*var(--rk))!important;box-shadow:none}
:root[data-theme][data-theme] .popover button.pop-item:hover:not(:disabled),:root[data-theme][data-theme] .popover button.search-hit:hover:not(:disabled),:root[data-theme][data-theme] .search-results button.search-hit:hover:not(:disabled){background:var(--fill-hover)!important}

/* on a phone the side panel is hidden until the menu button opens it (the new look had kept it always open) */
@media (max-width:700px){
  :root[data-theme][data-theme] .layout:not(.menu-open) .sidebar{display:none}
  :root[data-theme][data-theme] .layout.menu-open .sidebar{display:flex}
}

/* purchasing: the purchase form with its lines, the product catalogue */
dialog.po-dialog{width:min(1000px,calc((100vw - 28px)/var(--zoom,1)))}
/* a button never breaks inside a word: a row that does not fit goes onto a second line */
.dialog-actions{flex-wrap:wrap}
.dialog-actions button,.contact-actions button,.heading-actions button{white-space:nowrap;flex:none}
/* one purchase: the steps in a row, the total under the table, the quiet actions left and the steps right */
.po-steps{list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin:0 0 18px;padding:0}
.po-steps li{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:var(--r-pill);background:var(--fill);color:var(--faint);font-size:12.5px;font-weight:500;white-space:nowrap}
.po-steps li.done{color:var(--muted)}
.po-steps li.done::before{content:'✓';font-weight:700}
.po-steps li.now{background:var(--ink);color:var(--dialog,#fff);font-weight:600}
.po-dialog .money-value{margin:14px 4px 0;font-size:18px;text-align:end}
.po-dialog .sd-desk{margin:20px 0 0}
.po-foot{justify-content:space-between;align-items:center;row-gap:10px}
.po-quiet,.po-next{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.po-quiet{gap:18px}
.po-next{margin-inline-start:auto;justify-content:flex-end}
.sd-desk .rows>button.row{padding:7px 8px}
.sd-desk .rows>button.row .row-text{display:flex;align-items:baseline;justify-content:space-between;gap:14px;width:100%;min-width:0}
.sd-desk .rows>button.row .row-text strong{flex:0 1 auto;min-width:0;font-weight:500}
.sd-desk .rows>button.row .row-text small{flex:none}
@media (max-width:640px){
  .sd-desk .rows>button.row .row-text{display:grid;gap:2px}
  .po-next{margin-inline-start:0;width:100%}
  .po-next button{flex:1 1 auto}
}
.po-lines{display:grid;gap:12px}
.po-line{border:1px solid var(--hair);border-radius:calc(14px*var(--rk));padding:12px 14px;background:var(--surface)}
.po-line-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 12px}
.po-line-grid label.client-field,.po-line-grid div.client-field{margin:0;min-width:0}
.po-line-grid div.client-field{display:grid;gap:6px;align-content:start}
.po-size{position:relative;display:flex;gap:6px}
.po-size>input{flex:1;min-width:0}
button.po-size-open,button.po-size-open:hover:not(:disabled){flex:none;width:38px;padding:0;border-radius:calc(10px*var(--rk))}
.po-size-menu{position:absolute;inset-inline-start:0;top:calc(100% + 6px);z-index:6;min-width:100%;max-height:280px;overflow:auto;display:grid;gap:2px;padding:8px;border:1px solid var(--hair);border-radius:calc(12px*var(--rk));background:var(--dialog,#fff);box-shadow:0 12px 32px rgba(0,0,0,.14)}
.po-size-menu[hidden]{display:none}
.po-size-menu small{color:var(--muted);font-size:11.5px;padding:2px 6px 6px}
dialog label.po-size-opt{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:10px;margin:0;padding:7px 8px;border-radius:calc(8px*var(--rk));font-size:13px;white-space:nowrap;cursor:pointer}
dialog label.po-size-opt:hover{background:var(--fill)}
dialog label.po-size-opt input{width:18px;height:18px;flex:none;margin:0;accent-color:var(--accent)}
button.po-size-open::before{content:'';display:block;width:7px;height:7px;margin:-3px auto 0;border:solid var(--ink);border-width:0 1.6px 1.6px 0;transform:rotate(45deg)}
.po-place-menu{min-width:min(520px,calc(100vw - 80px));inset-inline-start:auto;inset-inline-end:0}
.po-size-menu>button.row.po-station,.po-station-list>button.row.po-station{padding:8px;white-space:normal}
button.row.po-station .row-text{display:grid;gap:2px;min-width:0}
button.row.po-station .row-text strong,button.row.po-station .row-text small{white-space:normal;overflow:visible}
.po-station-list{max-height:min(56vh,520px);overflow:auto;margin-top:10px}
.po-under{display:flex;flex-wrap:wrap;gap:4px 18px}
.client-form-grid div.client-field{display:grid;gap:6px;align-content:start;margin:0;min-width:0}
.po-pay{margin:16px 0}
.po-stages{display:grid;gap:8px}
.po-stage{display:grid;grid-template-columns:110px minmax(0,1fr) 130px 32px;gap:8px;align-items:center}
.po-stage-pct{display:flex;align-items:center;gap:6px}
.po-stage-pct input{min-width:0}
.po-stage-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:6px}
.po-stage-sum{font-weight:600;color:var(--muted)}
.po-stage-sum.warn{color:var(--warning-ink)}
.po-stage-presets{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px}
.po-stage-presets small{color:var(--muted)}
.po-stage-presets button{white-space:nowrap}
@media (max-width:640px){.po-stage{grid-template-columns:90px minmax(0,1fr) 32px}.po-stage>input[type=number]{grid-column:1/3;grid-row:2}}
.st-fill{margin:0 0 10px;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.st-fill button{white-space:nowrap}
.off-nocard{margin:0 0 6px}
.off-nocard[hidden]{display:none}
button.pop-item.pop-offer{font-weight:600;border-bottom:1px solid var(--hair)}
.po-match{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;border-radius:calc(12px*var(--rk));background:var(--surface);color:var(--ink)}
.po-match[hidden]{display:none}
.po-match.warn{background:var(--warning-bg,rgba(255,170,0,.12))}
.po-match-text{flex:1 1 320px;min-width:0}
.po-match-text div{color:var(--muted)}
.po-match-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.po-match-acts button{white-space:nowrap}
.po-product{display:grid;gap:6px}
.po-price{display:flex;gap:6px}
.po-price input{flex:1;min-width:0}
.po-price select{flex:0 0 auto;width:auto}
.po-line-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px}
.po-amount{font-size:15px;font-variant-numeric:tabular-nums}
.po-total{margin:12px 0 0}
@media (max-width:760px){
  .po-line-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:16px}
.product-card .panel-heading{align-items:flex-start;gap:10px}
.product-card .panel-heading small{display:block;margin-top:2px;color:var(--muted)}
.product-head-tags{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.product-row{display:grid;gap:6px;margin:10px 0}
.product-row>small{color:var(--muted);font-size:12px}
.product-chips{display:flex;flex-wrap:wrap;gap:6px}
.product-card.inactive{opacity:.6}
@media (max-width:420px){
  .product-grid{grid-template-columns:minmax(0,1fr)}
}

/* the assistant on duty: the morning summary and its suggestions as cards */
.watch-panel .panel-heading{align-items:center}
.watch-title{display:flex;align-items:center;gap:8px}
.watch-title .icon{color:var(--ch1,var(--accent))}
.watch-brief{margin:0 0 14px;padding:12px 16px;border-radius:calc(14px*var(--rk));background:var(--accent-soft)}
.watch-brief small{color:var(--muted);font-size:12px}
.watch-brief p{margin:6px 0 0;white-space:pre-line;line-height:1.6;font-size:14px}
.watch-list{display:grid;gap:8px}
.watch-card{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid var(--hair);border-radius:calc(14px*var(--rk));background:var(--dialog)}
.watch-dot{flex:none;width:10px;height:10px;margin-top:6px;border-radius:50%;background:var(--faint);position:relative}
.watch-dot .icon{position:absolute;left:12px;top:-4px;color:var(--ch1,var(--accent))}
.watch-card.warning .watch-dot{background:#e8a10a}
.watch-card.critical .watch-dot{background:#d93025}
.watch-card.info .watch-dot{background:#3b82f6}
.watch-card:has(.watch-dot .icon) .watch-body{padding-inline-start:16px}
.watch-body{flex:1;min-width:0;display:grid;gap:4px}
.watch-body strong{font-size:14px;font-weight:600;overflow-wrap:anywhere}
.watch-body small{color:var(--muted);font-size:12.5px;overflow-wrap:anywhere}
.watch-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:6px}
button.watch-more{justify-self:start}
.watch-last{margin:12px 0 0}
.mx-tips{padding:0 12px 6px}
.mx-tips:empty{display:none}
.mail-app.tips-off .mx-tips{display:none}
/* the look of the list, chosen in the gear menu: one line (who and the subject), two lines, or everything (the default) */
.mail-app.look-normal .mx-row-tags{display:none}
.mail-app.look-normal .mx-snip{-webkit-line-clamp:1}
.mail-app.look-compact .mx-snip,.mail-app.look-compact .mx-row-tags{display:none}
:root[data-theme][data-theme] .mail-app.look-compact button.mx-row{padding:9px 18px 9px 0!important}
.mail-app.look-compact .mx-gutter{padding-top:3px}
.mail-app.look-compact .mx-row-body{display:flex;align-items:baseline;gap:10px}
.mail-app.look-compact .mx-row-top{display:contents}
.mail-app.look-compact .mx-who{flex:0 1 34%;min-width:110px;order:0;font-size:14.5px}
.mail-app.look-compact .mx-subj{flex:1;order:1;font-size:14px}
.mail-app.look-compact .mx-star{order:2}
.mail-app.look-compact .mx-ago{order:3}
.mx-tips .watch-panel{padding:12px 14px;margin:0 0 6px;border-radius:calc(14px*var(--rk))}
.mx-tips .watch-panel .panel-heading h2{font-size:14px}
.mx-tips .watch-card{padding:10px 12px}
.mx-sheet{margin:0 0 26px}
.mx-sheet-bar{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;margin:0 0 8px;font-size:13px;color:var(--muted)}
.mx-frame{display:block;width:100%;height:160px;border:0;border-radius:12px;background:#fff;box-shadow:0 0 0 1px var(--line, rgba(0,0,0,.08))}
.csg-preview{height:140px}
.csg-lines{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:0 16px;margin:0 0 6px}
.mx-tpl-row .text{margin-inline-start:auto}
.staff-password{font:600 22px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.06em;margin:6px 0 14px;user-select:all}
.qc-photo-cell{position:relative;display:inline-block}
.qc-photo-x{position:absolute;top:4px;right:4px;width:22px;height:22px;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;display:flex;align-items:center;justify-content:center;border:0;cursor:pointer}
.qc-photo-x:hover{background:rgba(0,0,0,.8)}
.qc-photos-box{margin:10px 0 4px;padding:10px 12px;border:1px dashed var(--line, rgba(0,0,0,.15));border-radius:12px}
.qc-queue{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.qc-queue .chip{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;background:var(--fill);font-size:13px}
.qc-upload{margin:6px 0 0}
/* budgets: the plan cells, the sections and totals, the deviation */
.budget-table th.now{color:var(--accent)}
.budget-table .budget-input{width:88px;min-height:0;padding:4px 6px;text-align:end;font-variant-numeric:tabular-nums}
.budget-table tr.budget-section th{text-align:start;background:var(--fill);font-weight:600}
.budget-table tr.budget-total td,.budget-table tr.budget-result td{font-weight:600}
.budget-table tr.budget-result td{border-top:1px solid var(--line)}
.budget-table td.muted{color:var(--muted);font-size:12px}
.budget-table .warn,.history-item .warn,.budget-table td.warn{color:var(--warning-ink)}
.budget-table tr.budget-fact td{color:var(--muted)}
.budget-table tr.budget-fact td .warn{color:var(--warning-ink)}
/* dialogs: a visible Close, and no line leaves its window */
button.dialog-close,button.dialog-close:hover:not(:disabled){width:auto;height:32px;padding:0 12px 0 8px;border-radius:var(--r-pill);gap:6px;border:1px solid var(--hair);font-size:13px}
.dialog-close-word{color:inherit}
dialog .dialog-inner,dialog .notice,dialog p,dialog h2,dialog dd,dialog .row-text,.watch-body,.watch-body strong,.watch-body small,.contact-row .row-text,.history-item{min-width:0;overflow-wrap:anywhere}
dialog input,dialog textarea,dialog select{max-width:100%;box-sizing:border-box}
/* conversations on records and the task history */
.thread-messages{max-height:320px;min-height:80px;border:1px solid var(--hair);border-radius:calc(12px*var(--rk));margin-bottom:8px}
.thread.compact .thread-messages{max-height:240px}
.thread-compose{display:flex;gap:8px;align-items:flex-end}
.thread-compose textarea{flex:1;min-height:38px}
.task-history .history-item.warn,.task-history .warn{color:var(--warning-ink)}
dialog.overdue-nag{width:640px}
dialog.overdue-nag .task-card{padding:12px 14px;border:1px solid var(--hair);border-radius:calc(12px*var(--rk));display:grid;gap:8px;margin-bottom:10px}
.task-text .count{margin-inline-start:6px}
td.warn{color:var(--warning-ink);font-weight:600}
.td-reason{display:block;color:var(--ink)}
.card-from-docs{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;justify-content:space-between}
/* windows made by dialogShell: the head with Close never scrolls away, only the content under it does */
/* windows made by dialogShell: a cross in the top corner of every window, the head never scrolls away, only the content under it does */
/* the window scrolls as a whole and the head sticks to its top: no grid sizing to depend on the browser (an older Chromium let the content overflow a grid window, and focusing a field then pushed the head out of sight) */
dialog.shell[open]{display:block;overflow:auto;max-height:calc((100vh - 32px)/var(--zoom,1));max-height:calc((100dvh - 32px)/var(--zoom,1))}
dialog.shell .dialog-head{position:sticky;top:0;z-index:3;margin:0;padding:18px 70px 10px 26px;min-width:0;background:inherit}
dialog.shell .dialog-inner{overflow:visible;min-width:0;padding-top:8px}
button.dialog-close,button.dialog-close:hover:not(:disabled){position:absolute;top:10px;inset-inline-end:12px;width:38px;height:38px;padding:0;border-radius:50%;display:grid;place-items:center;border:1px solid var(--hair);background:var(--surface);color:var(--ink);z-index:2}
button.dialog-close:hover:not(:disabled){background:var(--fill)}
button.dialog-close .icon{width:18px;height:18px}
.dialog-close-word{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media (max-width:720px){dialog.shell .dialog-head{padding:14px 60px 0 18px}}
.update-bar{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:70;display:flex;align-items:center;gap:14px;max-width:min(680px,calc(100vw - 32px));padding:12px 16px;border-radius:14px;background:var(--panel);color:var(--ink);border:1px solid var(--hair);box-shadow:0 14px 34px -14px rgba(0,0,0,.45);font-size:14px;line-height:1.35}
.update-bar button{flex:none}
.client-dialog .dialog-head{position:sticky}
.pop-release{display:block;padding:0 10px 8px;color:var(--muted);font-size:12px}
/* no window is ever taller than the screen (a taller one would be centred and cut at the top and the bottom): it scrolls inside instead */
dialog[open]{max-height:calc((100vh - 32px)/var(--zoom,1));max-height:calc((100dvh - 32px)/var(--zoom,1));overflow:auto;box-sizing:border-box}
/* the head of a window is off the visible screen: the cross goes to the corner of the screen instead */
dialog.shell.head-lost button.dialog-close{position:fixed;top:14px;inset-inline-end:18px;z-index:9;box-shadow:0 8px 24px -8px rgba(0,0,0,.6)}
/* the mailboxes in the mail program's side panel: my own, the shared one */
.mx-boxes{display:grid;gap:2px;margin:0 0 10px;padding:0 0 10px;border-bottom:1px solid var(--hair)}
.mx-boxes .mx-folder-name{display:grid;min-width:0;line-height:1.15}
.mx-box-addr{display:block;color:var(--muted);font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mail-app button.mx-box.warn .mx-box-addr{color:var(--warning-ink)}
.mx-box-tag{display:block;color:var(--muted);font-size:11.5px;margin-top:2px}
.mx-card-note{margin:10px 0 0}
.mail-plain{white-space:pre-wrap;font:inherit;margin:12px 0 0}
.mx-ask{display:inline-flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:4px 10px;border-radius:999px;background:var(--warning-bg);color:var(--ink);font-size:13px}
/* the calendar by week and by day */
.cal-week-view{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
.cal-day-view{display:grid;gap:8px}
.cal-span-day{display:grid;align-content:start;gap:6px;padding:10px;border:1px solid var(--hair);border-radius:calc(12px*var(--rk));min-width:0}
.cal-span-day.today{border-color:var(--accent)}
.cal-span-day .empty{margin:0;font-size:12px}
.cal-feed-link{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center}
.prepay-line{display:block;margin-top:4px;color:var(--muted)} .prepay-line.warn{color:var(--warning-ink)}
@media (max-width:900px){.cal-week-view{grid-template-columns:repeat(2,minmax(0,1fr))}} @media (max-width:560px){.cal-week-view{grid-template-columns:minmax(0,1fr)}}

.fx-stage{margin:8px 0;padding:8px;border:1px solid var(--line);border-radius:12px;background:#fff;overflow:auto;text-align:center}
.fx-stage canvas{max-width:100%;height:auto}
.fx-source{cursor:crosshair;touch-action:none}
.sg-stage{position:relative;display:inline-block;margin:8px 0;border:1px solid var(--line);line-height:0;max-width:100%}
.sg-stage canvas{cursor:crosshair;max-width:100%;height:auto}
.sg-mark{position:absolute;transform:translate(-50%,-50%);pointer-events:none;height:auto}
label.check{display:inline-flex;align-items:center;gap:4px;font-size:13px}

.ck-table{margin:6px 0}
.ck-table td,.ck-table th{vertical-align:middle}
.ck-table tr.ck-differs td{background:color-mix(in srgb,var(--warn,#c98a00) 9%,transparent)}
.ck-table td.ck-new{font-weight:600}
.ck-ask{display:flex;flex-wrap:wrap;align-items:center;gap:10px;justify-content:space-between}
.ck-table label.check{margin:0;padding:0}

.of-paper{display:flex;flex-direction:column}
.of-paper .of-more{align-self:flex-start;font-size:12px;margin:-2px 0 6px}
.contact-row.of-old{opacity:.75;padding-inline-start:18px}

.sd-desk{margin-top:14px}
.sd-desk .row{width:100%;text-align:start}

.work-bar{height:6px;border-radius:6px;background:var(--line);overflow:hidden;margin:10px 0}
.work-bar span{display:block;width:35%;height:100%;border-radius:6px;background:var(--accent);animation:work-run 1.4s ease-in-out infinite}
@keyframes work-run{0%{margin-inline-start:-35%}100%{margin-inline-start:100%}}
@media (prefers-reduced-motion:reduce){.work-bar span{animation:none;width:100%;opacity:.5}}
.card-drafts .watch-actions{margin-top:6px}

.watch-group{display:grid;gap:8px}
.watch-group + .watch-group{margin-top:10px;padding-top:12px;border-top:1px solid var(--hair)}
.watch-group-head{display:flex;align-items:center;gap:8px;font-size:13px}
.watch-group.deals .watch-group-head strong{font-size:15px}
.watch-group.deals .watch-card{border-color:#e8a10a;border-inline-start-width:4px}

.mx-file-wrap .mx-file-fill{margin-inline-start:6px}

.ob-table td{vertical-align:top}
.ob-table td small{display:block;color:var(--muted);font-size:12px}
.ob-table td small.ob-ref{word-break:break-all;font-size:11px}
.ob-table tr.ob-week td{background:var(--th-bg);font-size:13px;padding-top:9px;padding-bottom:9px}
.ob-table tr.ob-week.now td{border-inline-start:4px solid var(--accent)}
.ob-table tr.ob-week .ob-left{color:#b26a00;font-weight:600}
.ob-table tr.ob-week.gone td{border-inline-start:4px solid #c0392b}
.ob-table td small.ob-warn{color:#a3281f;font-weight:600}
.client-dialog.cs-dialog{width:min(900px,calc(100vw - 24px));max-width:min(900px,calc(100vw - 24px))}
.client-dialog.doc-pick-dialog{width:min(760px,calc(100vw - 24px));max-width:min(760px,calc(100vw - 24px))}
.doc-pick-row{display:flex;align-items:center;gap:8px;justify-content:space-between;border-bottom:1px solid var(--hair)}
.doc-pick-row .check-field{flex:1 1 auto;min-width:0;margin:0;padding:7px 0}
.doc-pick-row .row-text strong{overflow-wrap:anywhere;font-weight:500}
.doc-pick{max-height:min(50vh,440px);overflow-y:auto}
.cs-rows{max-height:min(52vh,480px);overflow-y:auto;display:flex;flex-direction:column}
.cs-row{padding:9px 0;border-bottom:1px solid var(--hair);display:grid;gap:5px}
.client-dialog.cs-dialog label.cs-order{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;font-size:13px;margin:0}
.cs-order strong{display:flex;flex-wrap:wrap;align-items:center;gap:6px;overflow-wrap:anywhere}
.cs-papers{display:flex;flex-wrap:wrap;gap:4px 14px;padding-inline-start:26px}
.client-dialog.cs-dialog label.cs-paper,.client-dialog.cs-dialog label.cs-kind{display:inline-flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:5px;font-size:12px;color:var(--ink,inherit);margin:0;text-align:start}
.client-dialog.cs-dialog label input[type=checkbox]{width:auto;margin:0;flex:none}
.cs-kinds{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;margin:2px 0 8px;padding:8px 10px;border-radius:calc(10px*var(--rk));background:var(--fill)}
.cs-kinds-word{font-size:12px;color:var(--muted)}
.cs-row small{overflow-wrap:anywhere;padding-inline-start:26px;font-size:11px;color:var(--muted)}
.cs-row small.cs-note{color:var(--warning-ink,var(--bad))}
.cs-state{font-weight:600}
/* our packing list corrected: the lines of the head, the table cell by cell, the total */
.client-dialog.ple-dialog{width:min(1040px,calc(100vw - 24px));max-width:min(1040px,calc(100vw - 24px))}
.ple-dialog h3.ple-part{font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin:18px 0 8px}
.ple-dialog input{font-size:13px;padding:7px 9px;min-height:0;height:auto;width:100%;box-sizing:border-box}
.ple-dialog input.ple-title{font-weight:600;max-width:420px;margin-bottom:8px}
.ple-invoice{font-size:13px;margin:6px 0}
.ple-pairs,.ple-system{display:flex;flex-direction:column;gap:6px}
.ple-system{margin-top:6px}
.ple-pair{display:grid;grid-template-columns:minmax(150px,240px) minmax(180px,1fr) minmax(120px,220px);gap:8px;align-items:center}
.ple-pair small.ple-was{font-size:11px;color:var(--muted);overflow-wrap:anywhere}
.ple-pair.changed input{border-color:var(--accent)}
.ple-pair.fixed{font-size:13px;color:var(--muted);padding:4px 10px}
.ple-pair.fixed strong{color:var(--ink,inherit);font-weight:500}
.ple-tools{display:flex;gap:14px;margin-top:6px}
.ple-table-wrap{overflow-x:auto;margin:0 0 4px}
.ple-table{border-collapse:collapse;width:100%;min-width:640px}
.ple-table td{padding:2px;border:0}
.ple-table input.ple-cell.num{text-align:right}
.ple-table input.ple-cell.head{font-weight:600;font-size:12px}
.ple-table tfoot input.ple-cell{font-weight:600}
.ple-sum{display:block;font-size:12px;color:var(--bad);min-height:16px}
.ple-state{min-height:18px}
.mx-papers{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin:-14px 0 24px;padding:10px 14px;border-radius:12px;background:var(--accent-soft);color:var(--ink);font-size:13px}
.mx-papers[hidden]{display:none}
.tray-card small.tray-papers{display:block;font-size:12px;color:var(--accent);margin:2px 0}
.journal-item small.journal-edited{display:block;font-size:12px;color:var(--muted);overflow-wrap:anywhere}
@media (max-width:720px){.ple-pair{grid-template-columns:1fr}}
.client-dialog.io-dialog{width:min(940px,calc(100vw - 24px));max-width:min(940px,calc(100vw - 24px))}
.io-list{display:flex;flex-direction:column;max-height:min(56vh,520px);overflow-y:auto;margin:6px 0 10px}
.io-row{display:grid;grid-template-columns:24px minmax(150px,1.1fr) minmax(150px,.9fr) minmax(260px,1.6fr);gap:4px 14px;align-items:start;padding:10px 0;border-bottom:1px solid var(--hair);font-size:13px}
.io-row.quiet{color:var(--muted)}
.io-row small{display:block;font-size:11px;color:var(--muted);overflow-wrap:anywhere}
.io-paper>small:first-child{display:flex;align-items:center;gap:8px}
.io-said{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:2px 0}
.io-said input.io-number{width:120px}
.io-same{font-size:12px;color:var(--good)}
.io-row small.io-note{color:var(--warning-ink,var(--muted))}
.io-row small.io-result{font-size:12px;margin-top:2px}
.io-row small.io-result.good{color:var(--good)}
.io-row small.io-result.bad{color:var(--bad)}
.io-edited{display:flex;gap:8px;align-items:center;font-size:12px;margin:0 0 8px}
.io-state{font-weight:600}
@media (max-width:720px){.io-row{grid-template-columns:24px 1fr}.io-row>div:nth-child(n+3){grid-column:2}}
.client-dialog.oc-dialog{width:min(900px,calc(100vw - 24px));max-width:min(900px,calc(100vw - 24px))}
.oc-table{width:100%;table-layout:fixed;border-collapse:collapse;margin:8px 0 10px;font-size:13px}
.oc-table th:nth-child(n+2),.oc-table td:nth-child(n+2){width:124px}
.oc-table td:first-child{overflow-wrap:anywhere}
.oc-table th{text-align:start;font-weight:500;color:var(--muted);font-size:12px;padding:4px 8px;border-bottom:1px solid var(--hair)}
.oc-table td{padding:6px 8px;border-bottom:1px solid var(--hair);vertical-align:middle}
.oc-table td small{display:block;color:var(--muted);font-size:11px}
.oc-table input.oc-num{width:96px;text-align:end}
.oc-dropped{font-weight:500;color:var(--muted)}
.oc-dropped.some{color:var(--bad)}
.oc-fields{display:flex;flex-wrap:wrap;gap:12px 20px;margin:4px 0 12px}
.oc-fields label{display:grid;gap:4px;font-size:12px;color:var(--muted)}
.oc-fields .oc-basis{flex:1 1 320px}
.oc-fields .oc-basis input{width:100%}
.oc-h{margin:14px 0 2px;font-size:14px}
.oc-po{margin:10px 0 0;font-weight:600;font-size:13px}
.oc-summary{margin:10px 0 4px;font-weight:600;font-size:13px}
.oc-note{background:var(--fill)}
.ob-table td small.ob-carry{font-size:11px;color:var(--muted)}
@media (max-width:640px){.oc-table thead{display:none}.oc-table tr{display:grid;grid-template-columns:1fr 1fr;gap:4px 10px;padding:8px 0;border-bottom:1px solid var(--hair)}.oc-table td{border:0;padding:2px 0}.oc-table td::before{content:attr(data-label);display:block;font-size:11px;color:var(--muted)}.oc-table td:first-child{grid-column:1/-1}}
.os-list{margin:8px 0 10px;padding-inline-start:22px;display:grid;gap:5px}
.os-list strong{overflow-wrap:anywhere}
.os-what{margin:0 0 6px;padding-inline-start:20px;display:grid;gap:4px;color:var(--muted);font-size:13px}
/* shipping papers out of the mail: each paper, what it says, and the order it is for */
.sp-list{display:grid;gap:0;margin:10px 0 6px;border-top:1px solid var(--hair)}
.sp-row{display:grid;grid-template-columns:minmax(150px,1fr) minmax(170px,1.2fr) minmax(220px,1.4fr);gap:6px 14px;align-items:start;padding:10px 0;border-bottom:1px solid var(--hair)}
.sp-row small{display:block;color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.sp-row a.sp-look{display:inline-block;margin-top:4px;font-size:12px;font-weight:600}
.sp-row .sp-follows{color:var(--muted);font-size:12px}
.shl-list{display:grid;gap:0;margin:10px 0 6px;border-top:1px solid var(--hair)}
.shl-lot{padding:12px 0;border-bottom:1px solid var(--hair);display:grid;gap:8px}
.shl-head{display:grid;grid-template-columns:minmax(200px,1fr) minmax(260px,1.3fr);gap:8px 16px;align-items:center}
.shl-name small{display:block;color:var(--muted);font-size:12px}
.shl-head select{width:100%;max-width:100%}
.shl-papers{display:flex;flex-wrap:wrap;gap:6px}
.shl-papers a.shl-paper{font-size:12px;padding:3px 9px;border-radius:999px;background:var(--fill);color:var(--ink);text-decoration:none;overflow-wrap:anywhere}
.shl-papers a.shl-paper:hover{text-decoration:underline}
@media (max-width:700px){.shl-head{grid-template-columns:1fr}}
.sh-waiting{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px}
.ab-search{width:100%;margin-bottom:6px}
.ab-list{max-height:calc(60vh/var(--zoom,1));overflow:auto;border-top:1px solid var(--hair);margin:6px 0}
.ab-group{margin:12px 0 4px;font-size:12px;font-weight:700;color:var(--muted);text-transform:none}
.ab-fold{border-bottom:1px solid var(--hair)}
.ab-fold > summary.ab-group{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0;padding:10px 6px;font-size:14px;color:var(--ink);cursor:pointer;list-style:none}
.ab-fold > summary.ab-group::-webkit-details-marker{display:none}
.ab-fold > summary.ab-group::before{content:'▸';color:var(--muted);margin-inline-end:8px;flex:none}
.ab-fold[open] > summary.ab-group::before{content:'▾'}
.ab-fold > summary.ab-group span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ab-fold > summary.ab-group small{color:var(--muted);font-weight:600;font-variant-numeric:tabular-nums}
.ab-fold > summary.ab-group:hover{background:var(--fill)}
.ab-fold .ab-row{padding-inline-start:26px}
.ab-fold .ab-row:last-child{border-bottom:0}
.ab-section{margin:16px 0 4px;font-size:12px;font-weight:700;color:var(--muted)}
.ab-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 4px;border-bottom:1px solid var(--hair)}
.ab-row:hover{background:var(--fill)}
.ab-who{display:flex;flex-direction:column;min-width:0;cursor:pointer;flex:1}
.ab-who strong{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ab-who small{color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ab-act{display:flex;align-items:center;gap:10px;flex:none}
.ab-done{color:#1c6b36;font-size:12px}
.row-text small.inv-tax{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin-top:4px}
.inv-tax-cur{display:flex;align-items:center;gap:8px;margin:10px 0}
.sp-row .sp-draft{color:#8a5a00;font-weight:600}
.sp-row select{width:100%;max-width:100%}
.sp-row.decided{opacity:.7}
.sp-row .sp-done{color:#1c6b36;font-weight:600;font-size:13px}
@media (max-width:700px){.sp-row{grid-template-columns:1fr}}
/* whose order it is: a colour per buyer (the dot by the name), and the buttons that leave one buyer in the table */
.ob-table td small.ob-client{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin:3px 0 1px;padding:2px 8px 2px 6px;border-radius:999px;background:var(--fill);color:var(--ink);font-size:12px;font-weight:600}
.ob-table td small.ob-client span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:260px}
.ob-dot{flex:none;width:9px;height:9px;border-radius:50%;background:var(--ob-k,#8a8f98)}
.k0{--ob-k:#2f6fde}.k1{--ob-k:#d9822b}.k2{--ob-k:#1f9d6b}.k3{--ob-k:#b0409c}.k4{--ob-k:#c0392b}.k5{--ob-k:#7a6a1a}
.tray-card small.tray-reading{display:block;margin:2px 0;color:#b26a00;font-weight:600}
.seg.seg-tabs.ob-buyers{margin:2px 0 12px}
.seg.seg-tabs.ob-buyers:has(+ .ob-weeks:not([hidden])){margin-bottom:6px}
.seg.seg-tabs.ob-weeks button.ob-week-now .ob-buyer-name{font-weight:700}
.seg.seg-tabs.ob-buyers button{display:inline-flex;align-items:center;gap:7px;max-width:100%}
.ob-buyers .ob-buyer-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px}
.ob-buyers .ob-buyer-n{font-size:11px;opacity:.7;font-variant-numeric:tabular-nums}
.ob-chips{display:flex;flex-wrap:wrap;gap:6px}
.ob-papers{align-items:center;margin-top:7px}
.ob-papers-label{color:var(--muted);font-size:12px;margin-inline-end:2px}
.ob-table tr.ob-under td{padding-top:0;border-top:0}
.ob-table tr:has(+ tr.ob-under) td{border-bottom:0;padding-bottom:6px}
.ob-table{table-layout:auto}
.ob-table td{white-space:normal}
button.ob-chip{font-size:12px;line-height:1.3;padding:4px 9px;border-radius:999px;border:1px solid transparent;cursor:pointer;background:var(--line) !important;color:var(--ink,inherit) !important}
button.ob-chip.ok{background:#e3f4e8 !important;color:#1c6b36 !important;border-color:#bfe3cb !important}
button.ob-chip.part{background:#fff3d6 !important;color:#8a5a00 !important;border-color:#f0d590 !important}
button.ob-chip.todo{background:#fde3e1 !important;color:#a3281f !important;border-color:#f3b9b4 !important;font-weight:600}
button.ob-chip.later{background:transparent !important;color:var(--muted) !important;border-color:var(--hair) !important}
:root[data-theme=dark] button.ob-chip.ok{background:#173a23 !important;color:#9ad9ae !important;border-color:#23573a !important}
:root[data-theme=dark] button.ob-chip.part{background:#3d3110 !important;color:#f0cf7a !important;border-color:#5c4a17 !important}
:root[data-theme=dark] button.ob-chip.todo{background:#4a1c18 !important;color:#f5aaa3 !important;border-color:#6b2a24 !important}

.pk-row{width:100%;text-align:start;display:flex;align-items:center;justify-content:space-between;gap:12px}
.pk-row .pk-code{font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.pk-row.last{outline:2px solid var(--accent);outline-offset:-2px}
.pk-row input[type=checkbox]{flex:0 0 auto;width:20px;height:20px;accent-color:var(--accent)}
.pk-row .row-text{flex:1 1 auto}
.dialog-inner label.pk-row{display:flex;margin:0;padding:10px 12px;cursor:pointer}

.of-refs{margin-top:8px;padding-top:8px;border-top:1px dashed var(--hair)}

.sg-layer{position:absolute;inset:0;pointer-events:none}
.sg-count{display:flex;align-items:center;gap:12px;margin:6px 0}

.sign-button{margin-inline-end:6px}
.viewer-tools .remove-button{margin-inline-end:6px;color:#a3281f}
.viewer-tools .own-list-button{margin-inline-end:6px}
.sw-rows{display:grid;gap:0;margin:8px 0 4px;border:1px solid var(--line,#e6e6ee);border-radius:12px;overflow:hidden}
.sw-row{display:grid;gap:6px;padding:11px 14px;border-bottom:1px solid var(--line,#e6e6ee)}
.sw-row:last-child{border-bottom:0}
.sw-row.said{background:#fff8ec}
:root[data-theme=dark] .sw-row.said{background:#3a2f18}
.sw-row > small.sw-quote{margin-inline-start:28px;font-style:italic;color:#8a5a00}
:root[data-theme=dark] .sw-row > small.sw-quote{color:#f0c36a}
.sw-wrote{margin:6px 0 10px;padding:10px 14px;border-inline-start:3px solid #d9822b;background:var(--fill,#f6f6fa);border-radius:8px;font-size:13px}
.sw-wrote p{margin:4px 0 0;white-space:pre-line}
.sw-main{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.sw-main label.check-field span{font-weight:600}
.sw-row > label.check-field{margin-inline-start:28px;flex-wrap:wrap}
.sw-row > small.muted-block{margin-inline-start:28px}
.sw-pick{display:flex;align-items:center;gap:10px;margin-inline-start:28px;font-size:13px}
.sw-pick select{max-width:340px}
:root[data-theme=dark] .viewer-tools .remove-button{color:#f5aaa3}

dialog.client-dialog.sg-dialog{width:min(96vw,1500px);max-width:96vw}
.sg-wrap{overflow:auto;max-height:64vh;border:1px solid var(--line);margin:8px 0;background:#f4f4f6;text-align:center}
/* the window of signing: the page takes what the screen leaves, and "Sign" stays in sight under it whatever the page's length
   (owner, 17 Nov 2026: the signature and the stamp were put, and the button that saves them lay below the screen) */
dialog.sg-dialog .sg-wrap{max-height:calc((100dvh - 400px)/var(--zoom,1));min-height:240px}
dialog.sg-dialog .dialog-actions{position:sticky;bottom:0;z-index:4;margin:8px -26px 0;padding:12px 26px 14px;background:var(--dialog,#fff);border-top:1px solid var(--line)}
dialog.sg-dialog .dialog-inner{padding-bottom:0}
dialog.sg-dialog .dialog-inner>p.note{margin:4px 0 8px;font-size:12.5px}
.sg-wrap .sg-stage{display:block;border:0;margin:0 auto 14px;max-width:none;background:#fff;box-shadow:0 1px 6px rgba(0,0,0,.18);cursor:crosshair}
.sg-wrap .sg-stage canvas{max-width:none;width:100%;height:100%;display:block}
.sg-sheet{display:inline-block;min-width:100%;padding:10px 10px 4px;box-sizing:border-box;text-align:center}
.sg-page-no{margin:2px 0 6px;font-size:12px;color:#6b6b76;line-height:1.3;text-align:center}
.sg-zooms{display:inline-flex;align-items:center;gap:6px}
.sg-zooms .sg-zoom{min-width:34px;font-size:18px;line-height:1;padding:4px 10px}

.contact-actions .ct-add{border-style:dashed}

/* the letter editor's own menu of a word: how it may be spelt, and cut / copy / paste */
.spell-menu{position:fixed;z-index:90;display:grid;gap:2px;min-width:220px;max-width:320px;padding:8px;background:var(--dialog,#fff);color:var(--ink);border:1px solid var(--hair);border-radius:calc(12px*var(--rk));box-shadow:0 18px 44px -14px rgba(0,0,0,.45);font-size:14px}
.spell-menu .spell-word{padding:2px 8px 0;font-weight:600;overflow-wrap:anywhere}
.spell-menu .spell-state{margin:0;padding:0 8px 4px;color:var(--muted);font-size:12px}
.spell-menu .spell-list{display:grid;gap:2px}
:root[data-theme][data-theme] .spell-menu button.spell-item,:root[data-theme][data-theme] .spell-menu button.spell-item:hover:not(:disabled){display:block;width:100%;text-align:start;padding:7px 10px!important;border:0!important;border-radius:calc(8px*var(--rk))!important;background:transparent!important;color:var(--ink)!important;font-weight:400;box-shadow:none}
:root[data-theme][data-theme] .spell-menu button.spell-item:hover:not(:disabled){background:var(--fill-hover)!important}
:root[data-theme][data-theme] .spell-menu button.spell-fix{font-weight:600;color:var(--accent)!important}
.spell-menu .spell-rule{margin:4px 0;border:0;border-top:1px solid var(--hair)}
.spell-menu .spell-hint{padding:4px 8px 0;color:var(--faint);font-size:11px}

.pk-weights-row{display:grid;grid-template-columns:1fr 1fr;gap:10px 14px}
.pk-weights-row .client-field{margin:0;min-width:0}

/* ---------- the phone (owner, 24 Nov 2026: "check how everything shows in the phone version - the windows are awkward, the menu
   is not clear"). The menu slides over the page; the head is one line and the search; a window takes the whole screen and keeps
   its buttons at the bottom; the orders in work read as cards; the signing window gives the paper the room. ---------- */
:root[data-theme][data-theme] .sidebar button.side-close,:root[data-theme][data-theme] .sidebar button.side-close:hover:not(:disabled){display:none!important}
@media (max-width:700px){
  /* the menu: a drawer from the side over the dimmed page, with a cross; the page under it does not scroll */
  :root[data-theme][data-theme] .layout.menu-open .sidebar{position:fixed;inset-block:0;inset-inline-start:0;z-index:61;width:86%;max-width:calc(330px/var(--zoom,1));height:auto;overflow-y:auto;overscroll-behavior:contain;
    border-bottom:0;border-inline-end:1px solid var(--hair);background:var(--bg);box-shadow:0 0 60px rgba(0,0,0,.45);padding:14px 14px 18px}
  .layout.menu-open::before{content:'';position:fixed;inset:0;z-index:60;background:rgba(0,0,0,.45)}
  body:has(.layout.menu-open){overflow:hidden}
  :root[data-theme][data-theme] .layout.menu-open .sidebar button.side-close,:root[data-theme][data-theme] .layout.menu-open .sidebar button.side-close:hover:not(:disabled){display:grid!important;place-items:center;position:absolute;top:12px;inset-inline-end:12px;z-index:2;width:38px;height:38px;padding:0;border-radius:50%;border:1px solid var(--hair);background:var(--surface);color:var(--ink)}
  .layout.menu-open .sidebar .brand{padding-inline-end:48px}
  .layout.menu-open .sidebar .side-scroll{flex:none}
  /* the head: the menu button and the controls in one line, the search under them (the logo stands in the menu) */
  :root[data-theme][data-theme] .topbar{flex-wrap:wrap;gap:8px 6px;padding:8px 12px}
  .topbar .mobile-logo{display:none}
  .topbar button.mobile-menu,.topbar button.mobile-menu:hover:not(:disabled){order:0;margin-inline-start:0;width:40px;height:40px;place-items:center;border-radius:50%;border:1px solid var(--hair)}
  .topbar .top-controls{order:1;flex:1 1 auto;justify-content:flex-end;margin:0;min-width:0}
  .topbar .global-search{order:2;flex:1 1 100%}
  /* what drops from the head (the view, "needs attention", the quick note, the person's menu) is as wide as
     the screen and hangs under the whole head, not under its own button: tied to a button in the middle of the line it ran off
     the left edge (owner, 25 Nov 2026, iPhone 16 Pro: "it goes behind the screen, I have to drag it to read the text") */
  :root[data-theme][data-theme] .topbar{position:relative;z-index:20}
  :root[data-theme][data-theme] .topbar .pop-wrap{position:static}
  :root[data-theme][data-theme] .topbar .pop-wrap .popover,:root[data-theme][data-theme] .topbar .pop-wrap:has(.top-me) .popover{inset-inline:8px;top:calc(100% + 4px);width:auto;min-width:0;max-width:none;max-height:calc(100vh/var(--zoom,1) - 140px);max-height:calc(100dvh/var(--zoom,1) - 140px);overscroll-behavior:contain}
  .topbar .popover .seg{flex-wrap:wrap}
  /* nothing makes the page wider than the screen (a phone then shows it smaller and one has to drag it sideways): a screen's row
     of buttons folds into lines instead of running on */
  .heading-actions{flex:0 1 auto;min-width:0;max-width:100%}
  /* an opened letter: the day stands under the sender's name, not beside it (beside, it left the name a column of five letters) */
  .mx-letter .mx-sender{flex-wrap:wrap;row-gap:2px}
  .mx-letter .mx-sender .mx-sender-text{flex:1 1 0;min-width:0}
  .mx-letter .mx-sender .mx-when{flex:1 1 100%;text-align:start;padding-inline-start:63px;white-space:normal}
  /* a window takes the whole screen; its buttons stay at the bottom while the form scrolls */
  dialog.shell[open]{width:calc(100vw/var(--zoom,1))!important;max-width:none!important;height:calc(100vh/var(--zoom,1));height:calc(100dvh/var(--zoom,1));max-height:none!important;margin:0;border:0;border-radius:0}
  dialog.shell .dialog-inner>.dialog-actions{position:sticky;bottom:0;z-index:4;margin:16px -18px -18px;padding:10px 18px calc(12px + env(safe-area-inset-bottom,0px));background:var(--dialog,#fff);border-top:1px solid var(--line)}
  dialog.shell .dialog-inner>.dialog-actions button{flex:1 1 auto;justify-content:center;text-align:center}
  /* (a window with many buttons - a purchase's card - keeps them at its end: a bar of four lines would eat the screen) */
  dialog.shell .dialog-inner>.dialog-actions:has(button:nth-of-type(4)),dialog.shell .dialog-inner>.dialog-actions.po-foot{position:static;margin:16px 0 0;padding:0;border-top:0;background:transparent}
  dialog.shell .pk-row .row-text small,dialog.shell .check-field .row-text small{white-space:normal;overflow:visible;text-overflow:clip}
  /* the signing window: the hint is short, the tools are one line, the paper has the room */
  dialog.client-dialog.sg-dialog{width:calc(100vw/var(--zoom,1));max-width:none}
  dialog.sg-dialog .dialog-inner>p.note{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  dialog.sg-dialog .sg-count button{white-space:nowrap;flex:none}
  dialog.sg-dialog .calc-inputs{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;align-items:end}
  dialog.sg-dialog .calc-inputs>*{margin:0;min-width:0}
  dialog.sg-dialog .calc-inputs>*:first-child{grid-column:1/-1}
  dialog.sg-dialog .calc-inputs input[type=range]{width:100%}
  dialog.sg-dialog .sg-wrap{max-height:none;min-height:55vh}
  dialog.sg-dialog .dialog-inner>.dialog-actions{margin:8px -18px 0}
  /* the orders in work: an order is a card - its number and buyer, then the goods, the load and the day, then the states */
  table.ob-table tr{padding:10px 0}
  table.ob-table td,table.ob-table td.num{display:block;text-align:start;padding:2px 0}
  table.ob-table td::before{display:none}
  table.ob-table td[data-label]:not(:first-child){display:flex;justify-content:flex-start;align-items:baseline;flex-wrap:wrap;gap:2px 8px;font-size:13px}
  table.ob-table td[data-label]:not(:first-child)::before{display:inline;content:attr(data-label);color:var(--faint);font-size:12px;flex:none;min-width:64px}
  table.ob-table td small{display:inline}
  table.ob-table td:first-child small{display:block}
  table.ob-table td:first-child small.ob-client{display:inline-flex;width:fit-content}
  table.ob-table td:first-child strong{font-size:16px}
  table.ob-table tr.ob-week{padding:0;border-bottom:0}
  table.ob-table tr.ob-week td{padding:8px 10px;border-radius:calc(8px*var(--rk));line-height:1.5}
  table.ob-table tr.ob-under{padding-top:0}
  table.ob-table tr:has(+ tr.ob-under){border-bottom:0;padding-bottom:4px}
  .ob-table .ob-papers{margin-top:8px}
  .ob-table .ob-papers-label{flex-basis:100%}
}

/* Delete the order: the red button of the two confirmations, and the quiet word under the order's number in the table */
button.danger{background:#fde3e1 !important;color:#a3281f !important;border-color:#f3b9b4 !important;font-weight:600}
button.danger:hover:not(:disabled){filter:brightness(.96)}
button.text.danger-text,button.text.danger-text:hover:not(:disabled){color:#a3281f}
.ob-table td button.text.ob-remove{display:block;padding:2px 0 0;font-size:11px;color:var(--muted);opacity:.6}
.ob-table td button.text.ob-remove:hover:not(:disabled){color:#a3281f;opacity:1}
:root[data-theme=dark] button.danger{background:#4a1c18 !important;color:#f5aaa3 !important;border-color:#6b2a24 !important}
:root[data-theme=dark] button.text.danger-text,:root[data-theme=dark] button.text.danger-text:hover:not(:disabled),:root[data-theme=dark] .ob-table td button.text.ob-remove:hover:not(:disabled){color:#f5aaa3}

/* the open list of orders: every order a line, the field above narrows it */
.order-pick{display:grid;gap:6px}
.order-pick input[type=search]{width:100%}
.order-pick select.order-pick-list{width:100%;min-height:210px;padding:4px;font-size:13px;line-height:1.5;background-image:none !important;height:auto}
.order-pick select.order-pick-list option{padding:5px 8px;border-radius:6px;white-space:normal}

/* the head of the orders in work: the note for the acceptance beside the link to the orders */
.ob-head-actions{display:flex;gap:4px 14px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
/* the acceptance note: its text in a wide window, the week and the client side by side on a computer */
dialog.acc-dialog{width:min(760px,calc((100vw - 28px)/var(--zoom,1)))}
.acc-picks{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}
.acc-text{width:100%;font:inherit;font-size:14px;line-height:1.5;white-space:pre-wrap;resize:vertical;min-height:240px}
@media (max-width:700px){.acc-picks{grid-template-columns:1fr}.acc-text{min-height:200px}}
/* an order's papers sent by WhatsApp: a list of ticks, the head with "tick all" and the count */
dialog.share-dialog{width:min(640px,calc((100vw - 28px)/var(--zoom,1)))}
.share-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:4px 0}
.share-list{display:flex;flex-direction:column;gap:2px;max-height:min(52vh,460px);overflow-y:auto;margin-bottom:12px}
.share-list .doc-group{margin:10px 0 4px;font-size:12px;color:var(--faint)}
label.share-row{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:calc(10px*var(--rk));cursor:pointer;margin:0}
label.share-row:hover{background:var(--fill-hover)}
label.share-row input{width:18px;height:18px;flex:none;margin:0;accent-color:var(--accent)}
label.share-row .row-text{display:flex;flex-direction:column;min-width:0}
label.share-row strong{overflow-wrap:anywhere;font-weight:500}
.share-text{width:100%;resize:vertical}
.ib-tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
dialog.ib-dialog{width:min(820px,calc((100vw - 28px)/var(--zoom,1)))}
label.ib-row{align-items:flex-start}
label.ib-row input{margin-top:3px}
.ib-typed{margin:10px 0}
.ib-typed summary{cursor:pointer;color:var(--accent);font-weight:500;padding:6px 0}
.sp-pick{display:grid;gap:5px;min-width:0}
.sp-pick select,.sp-where select{max-width:100%}
.sp-why{font-size:11px;line-height:1.35;color:var(--muted)}
.sp-why.sp-ask{color:var(--warning-ink,#8a3b2e)}
