/* Shared look for every page (2026-11-17, Jonathan: "a professional vibe where it looks simple and elegant for office
   use"; "Dark by default with a switch"). Design: docs/superpowers/specs/2026-11-17-new-look-design.md.
   Dark unless the switch says light: the first <script> of each page sets <html data-theme>. */
:root {
  --bg: #141216; --side: #100e12; --panel: #1b181d; --raise: #221e24; --line: #2c272e; --line2: #241f26;
  --ink: #ece7e9; --ink2: #c9c1c4; --muted: #948a8f; --hover: #221e24;
  --accent: #9b4c5a; --accent-ink: #ffffff; --accent-text: #e3a3af; --accent-soft: #2e2027;
  --leaf: #7fbf68; --price: #7fc79a; --star: #f0c25a; --mark: #5a4a1a;
  --ok: #7fc79a; --warn: #e7b65c; --bad: #ef7b6c;
  --radius: 6px; --radius-sm: 4px;
  --shadow: none; --shadow-lift: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f5f4; --side: #faf9f8; --panel: #ffffff; --raise: #f3efee; --line: #e2dddb; --line2: #ece8e6;
  --ink: #1d1b1c; --ink2: #3d3739; --muted: #6b6467; --hover: #f5f1f0;
  --accent: #7b3a46; --accent-ink: #ffffff; --accent-text: #7b3a46; --accent-soft: #f4eaec;
  --leaf: #4f8a3c; --price: #2d7a4b; --star: #c98a00; --mark: #ffe9a8;
  --ok: #2f6b45; --warn: #a86f00; --bad: #b3362b;
  --shadow: none; --shadow-lift: 0 10px 30px rgba(40, 20, 28, .16);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; font: 14.5px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink);
       -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px;
                          transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
button, .btn { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 12px; cursor: pointer; color: inherit;
               text-decoration: none; display: inline-block; font-weight: 500; transition: border-color .15s, background .15s, box-shadow .15s, transform .05s; }
button:hover, .btn:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--hover); }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover, .btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
mark { background: var(--mark); color: inherit; border-radius: 2px; }
a { color: var(--accent-text); }

/* top bar with the logo - solid, no blur (Jonathan 2026-11-04: scrolling was slow on the office PC; a blur behind a
   pinned bar is recomputed on every scroll frame) */
header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--panel) 97%, transparent); border-bottom: 1px solid var(--line); }
.bar { display: flex; gap: 8px; align-items: center; padding: 8px 18px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; padding: 3px 10px; margin-right: 6px; border-radius: 10px; background: #fbf7f6;
         box-shadow: inset 0 0 0 1px rgba(142, 68, 81, .12); flex: none; }
.brand img { height: 46px; width: auto; display: block; }
/* dark mode: the light version of the logo (logo-dark.png) straight on the bar, no light box */
:root:not([data-theme="light"]) .brand { background: transparent; box-shadow: none; }
:root:not([data-theme="light"]) .logo-on-light, :root[data-theme="light"] .logo-on-dark { display: none; }
h1 { font-size: 17px; margin: 0 4px 0 0; white-space: nowrap; font-weight: 700; letter-spacing: -.01em; }
h1 span { color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel); }
.seg button { border: none; border-radius: 0; padding: 6px 11px; background: transparent; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 3px; white-space: nowrap; vertical-align: middle; font-weight: 500;
       background: color-mix(in srgb, var(--muted) 14%, transparent); }
.tag.discontinued { background: #8884; color: var(--muted); }
.tag.deleted { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.tag.edited { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.tag.manual { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.tag.flag { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--bad); font-weight: 600; cursor: help; }
.tag.new { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.tag.update, .tag.changed { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.tag.error { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.tag.unchanged, .tag.uptodate { background: #8882; color: var(--muted); }
.tag.pk { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
/* an order's / quotation's status (Customers, Dashboard, Logistics, Quotations, Warehouse) */
.tag.draft { background: #8882; color: var(--muted); }
.tag.pending { background: color-mix(in srgb, #b25fd0 18%, transparent); color: #9a48b8; }
.tag.confirmed { background: color-mix(in srgb, #2f6fd0 18%, transparent); color: #2f6fd0; }
.tag.production { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.tag.ready { background: color-mix(in srgb, #12908a 18%, transparent); color: #12908a; }
.tag.shipped, .tag.completed { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }

/* panels used across pages get the same soft depth */
.card, .tile, .pallet, .pack { border-radius: var(--radius) !important; }
.grid .card { transition: box-shadow .15s, transform .15s; }
.grid .card:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }

dialog { border: 1px solid var(--line); border-radius: 8px; padding: 0; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lift); }
dialog::backdrop { background: rgba(25, 14, 18, .58); }        /* no blur: cheap to scroll on a weak PC */
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--raise); color: var(--ink); border: 1px solid var(--line); padding: 8px 16px; border-radius: var(--radius-sm);
         font-size: 13px; z-index: 200; opacity: 0; transition: opacity .2s; pointer-events: none; box-shadow: var(--shadow-lift); }
.toast.show { opacity: 1; }
.toast.bad { background: var(--bad); }
.hint { color: var(--muted); font-size: 12px; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

/* a field in a form: its label above its box (2026-11-17: only some pages had it - Stock's and Warehouse's windows
   showed labels beside tiny boxes) */
/* a page's content: centred, 1280 px wide (a page with another width sets only max-width) */
:where(main:not(.shell)) { max-width: 1280px; margin: 0 auto; padding: 16px 18px 80px; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 0; }
label.f input, label.f select, label.f textarea { color: var(--ink); width: 100%; box-sizing: border-box; }
/* a window's form (Stock, Warehouse, Accounting, Audit): padding, the red error line, the buttons at the bottom right */
form.dlg { padding: 18px 20px; box-sizing: border-box; }
form.dlg h3 { margin: 0 0 12px; }
form.dlg .msg { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }
form.dlg .row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* the count next to a tab's name (customer and quotation year tabs) */
.tabs a .n { font-size: 11px; background: #8882; border-radius: 9px; padding: 0 6px; margin-left: 4px; }

/* phones (2026-11-05, iPhone / Android web app): the top bar scrolls away instead of covering a quarter of the screen,
   smaller logo */
@media (max-width: 640px) {
  header { position: static; }
  .bar { padding: 6px 10px; gap: 6px; }
  .brand img { height: 34px !important; }
}

/* ======================================================================== 📱 phones: app-like (2026-11-05)
   bottom tab bar (gsearch.js) + More sheet, slim top bar, iPhone notch / home bar, finger-sized controls, 16 px text in
   boxes (iPhone zooms in on smaller), windows as sheets from the bottom. Desktop / tablet are not touched. */
.tabbar, #moreSheet { display: none; }
@media (max-width: 640px) {
  :root { --tabbar-h: 62px; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
  header { padding-top: env(safe-area-inset-top); }
  .langsw, .flagtop:not(.pg-help):not(.cal-top), .youbtn { display: none !important; }   /* the ? and the calendar stay */
  .bar { padding: 6px 12px; row-gap: 6px; }
  .bar .gs { order: 20; flex: 1 1 100%; margin-left: 0; }
  .bar .gs input { width: 100%; }
  .bar .gs .gsr { left: 0; right: 0; width: auto; }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--panel);
            border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.08);
            padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
              min-height: 52px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.on { color: var(--accent); }
  .tabbar a.on svg { background: var(--accent-soft); border-radius: 10px; padding: 2px 10px; width: 44px; box-sizing: border-box; height: 28px; }
  .tabbar a:active { background: var(--hover); }
  .tabbar .tbadge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
                    background: #d0342c; color: #fff; font-size: 10px; font-style: normal; line-height: 16px; text-align: center; }

  #moreSheet { display: block; }
  #moreSheet:not([open]) { display: none; }
  dialog.sheet .sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 6px; }
  dialog.sheet .sheet-list { display: grid; padding: 4px 12px; }
  /* the pages: a heading per menu group and a grid of tiles under it (2026-11-17) */
  dialog.sheet .sheet-pages { padding: 0 12px 6px; }
  dialog.sheet .sheet-grp { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 12px 4px 6px; }
  dialog.sheet .sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  dialog.sheet .sheet-grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px;
      padding: 8px 4px; border: 1px solid var(--line2); border-radius: 12px; background: var(--raise); color: var(--ink);
      text-decoration: none; font-size: 13px; font-weight: 500; text-align: center; line-height: 1.25; }
  dialog.sheet .sheet-grid a svg.i { width: 22px; height: 22px; color: var(--accent-text); }
  dialog.sheet .sheet-grid a.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 650; }
  dialog.sheet .sheet-list > a, dialog.sheet .sheet-list > button { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 8px;
      font-size: 16px; color: var(--ink); text-decoration: none; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; width: 100%; }
  dialog.sheet .sheet-list > a.on { color: var(--accent); font-weight: 650; }
  dialog.sheet .sheet-list span { flex: 1; }
  dialog.sheet .sheet-n { color: #d0342c; }
  dialog.sheet .sheet-lang { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 8px; font-size: 15px; }
  dialog.sheet .sheet-lang span { flex: 1; color: var(--muted); }
  dialog.sheet .sheet-lang button { min-height: 38px; padding: 0 14px; border-radius: 19px; }
  dialog.sheet .sheet-lang button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  dialog.sheet .sheet-close { display: block; width: calc(100% - 24px); margin: 10px 12px calc(12px + env(safe-area-inset-bottom)); min-height: 48px; font-size: 16px; border-radius: 12px; }

  /* every window: a sheet from the bottom, the whole width */
  dialog[open] { width: 100vw !important; max-width: 100vw !important; max-height: 92dvh !important; margin: auto 0 0 0 !important;
                 border-radius: 18px 18px 0 0 !important; padding-bottom: env(safe-area-inset-bottom); overflow: auto; }
  dialog::backdrop { background: rgba(0,0,0,.45); }

  /* finger-sized, and no zoom when typing on an iPhone */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select { min-height: 40px; }
  .bar button, .actions button, .row > button, .acts button, form button, dialog button { min-height: 40px; }
  /* every other button in the page and the guide: at least a finger (2026-11-17: How it works, row buttons were 24 px);
     the catalog cards' heart keeps its own round size */
  main button:not(.fav), .pguide button { min-height: 38px; min-width: 38px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
  .card { border-radius: 14px; }
  table { -webkit-overflow-scrolling: touch; }
  /* a table wider than the phone scrolls sideways in its own box - never the whole page (customer page, 2026-11-05) */
  table.t:not(.lines), .card > table:not(.lines) { display: block; max-width: 100%; overflow-x: auto; }
  a[data-view], a.sub { display: inline-block; padding: 6px 0; }   /* a REF / "all →" link to tap: finger-sized */
  /* typing: the keyboard takes the bottom of the screen - the tab bar steps aside meanwhile */
  body:has(:is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea):focus) .tabbar { display: none; }
  body:has(:is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea):focus) { padding-bottom: 0; }
  /* the top bar scrolls away on a phone: what was pinned under it scrolls with the page too */
  .quickadd, .search, .side { position: static !important; max-height: none !important; }
}
/* year picker (shared.js yearPicker): the earlier years' drop-down next to the year buttons */
select.yearsel { padding: 5px 10px; border-radius: 18px; color: var(--muted); font-weight: 500; width: auto; }
select.yearsel.on { background: var(--accent); color: #fff; border-color: var(--accent); }
/* a quotation / meeting line's number: click to renumber (notes.js LineDrag) */
.ln { cursor: pointer; border-radius: 6px; padding: 0 3px; } .ln:hover { background: var(--hover); outline: 1px dashed var(--line); }
input.lnin { width: 52px; padding: 2px 4px; text-align: center; font-weight: 700; }

/* ======================================================================== modern look (2026-11-13)
   Jonathan: "Modernize as much the UI as possible, and make it as easily understandable each page as possible".
   :where() keeps these at zero weight, so a page's own rules still win - they only fill in what a page leaves out. */
:where(button, .btn, a, summary, select, input, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(.card) { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
:where(.card) > :where(h2, h3):first-child { letter-spacing: -.01em; }
:where(h2, h3) { font-weight: 650; }
:where(table.t) { border-collapse: collapse; width: 100%; }
:where(table.t) :where(th) { font-size: 12px; color: var(--muted); font-weight: 600;
                              text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
:where(table.t) :where(td) { padding: 10px 12px; border-bottom: 1px solid var(--line2); }
:where(table.t) :where(tbody tr:hover td) { background: var(--hover); }
:where(table.t) :where(.num) { text-align: right; font-variant-numeric: tabular-nums; }
/* a number column's heading over its numbers (2026-11-13: "quotations list is not aligned properly") - real weight, so
   a page's own 'table.t th { text-align: left }' cannot pull it back */
table.t th.num, table.t td.num { text-align: right; }
table.t td.num { font-variant-numeric: tabular-nums; }
:where(.empty) { color: var(--muted); text-align: center; padding: 28px 12px; }
:where(.tag) { line-height: 1.6; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }

/* the page guide (guide.js): what the page is for + "How it works" */
.pguide { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px; }
.pguide .pg-row { display: flex; gap: 12px; align-items: center; }
.pguide .pg-ico { flex: none; color: var(--accent-text); display: inline-flex; } .pguide .pg-ico svg.i { width: 20px; height: 20px; }
.pguide .pg-txt { flex: 1; min-width: 0; display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: baseline; }
.pguide .pg-txt span { color: var(--muted); font-size: 13.5px; }
.pguide .pg-how { flex: none; font-size: 12.5px; padding: 5px 12px; }
.pguide .pg-how::after { content: ' ▾'; } .pguide.open .pg-how::after { content: ' ▴'; }
.pguide .pg-x { flex: none; width: 30px; height: 30px; padding: 0; border-radius: 15px; border-color: transparent; background: transparent; color: var(--muted); font-size: 14px; }
.pguide .pg-x:hover { color: var(--ink); background: var(--hover); }
/* the steps: compact, left, at most ~4 across; "Got it" / "Hide on all pages" on their own short line under them */
.pguide .pg-body { display: none; }
.pguide.open .pg-body { display: block; margin: 8px 0 0 34px; }
.pguide .pg-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 300px)); gap: 6px 28px; margin: 0; padding: 0; list-style: none; counter-reset: st; }
.pguide .pg-steps li { counter-increment: st; display: flex; gap: 8px; font-size: 13px; line-height: 1.45; }
.pguide .pg-steps li::before { content: counter(st); flex: none; width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center;
                               background: var(--raise); color: var(--ink2); font-size: 11.5px; font-weight: 700; margin-top: 1px; }
.pguide .pg-foot { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.pguide .pg-ok { font-size: 12.5px; padding: 5px 14px; }
.pguide .pg-all { font-size: 12.5px; padding: 5px 10px; border-color: transparent; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.pguide .pg-all:hover { color: var(--ink); background: transparent; }
/* ? in the top bar: the guide is hidden - click to show it again */
.pg-help { color: var(--muted); }
@media (max-width: 640px) { .pguide .pg-txt span { font-size: 13px; } .pguide .pg-how { padding: 4px 10px; } .pguide.open .pg-body { margin-left: 0; } }
/* phones (2026-11-19, declutter): the sentence across the full width, How it works under it, no icon */
@media (max-width: 640px) {
  .pguide { padding: 8px 10px 6px 12px; }
  .pguide .pg-row { flex-wrap: wrap; gap: 0 6px; }
  .pguide .pg-ico { display: none; }
  .pguide .pg-txt { order: 1; flex: 1 1 calc(100% - 50px); }
  .pguide .pg-x { order: 2; align-self: flex-start; }
  .pguide .pg-how { order: 3; border-color: transparent; background: transparent; color: var(--accent-text); padding: 2px 0; min-height: 32px; }
}
@media print { .pguide { display: none !important; } }
/* the small container bar (shared.js containerMini) in a quotation's add-item bar, which stays at the top */
.cmini { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; white-space: nowrap; font-size: 12.5px; margin-left: auto; }
.cmini .cm-bars { display: inline-flex; gap: 3px; }
.cmini .cm-bars i { display: inline-block; width: 26px; height: 10px; border-radius: 3px; background: var(--hover); overflow: hidden; outline: 1px solid var(--line); }
.cmini .cm-bars b { display: block; height: 100%; background: var(--accent); }
.cmini .cm-last { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .cmini { margin-left: 0; } .cmini .cm-bars i { width: 16px; } }
/* line icons (static/icons.svg via shared.js icon()) */
svg.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.7;
        stroke-linecap: round; stroke-linejoin: round; }

/* ======================================================================== the frame (2026-11-17, the new look)
   gsearch.js: <aside class="side"> = the left menu; the page's own <header> = the top strip (search, its buttons, counts). */
body.framed { padding-left: 212px; }
aside.side { position: fixed; left: 0; top: 0; bottom: 0; width: 212px; z-index: 30; display: flex; flex-direction: column; gap: 2px;
             padding: 14px 10px 10px; background: var(--side); border-right: 1px solid var(--line2); overflow-y: auto; overflow-x: hidden; }
.side .brand { margin: 0 0 12px 4px; align-self: flex-start; }
.side .brand img { height: 40px; }
.side nav { display: flex; flex-direction: column; gap: 1px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink2);
              text-decoration: none; font-size: 13.5px; white-space: nowrap; }
.side nav a:hover { background: var(--hover); color: var(--ink); }
.side nav a.on { background: var(--accent-soft); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent-text); }
.side nav a.on svg.i { color: var(--accent-text); }
.side .grp { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 14px 10px 5px; }
.side .foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line2); display: grid; gap: 6px; }
.side .foot-row { display: flex; gap: 6px; align-items: center; }
.side .youbtn, .side .themesw { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border-color: transparent;
                                background: transparent; color: var(--ink2); font-size: 13px; font-weight: 500; text-align: left; }
.side .youbtn span, .side .themesw span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .youbtn:hover, .side .themesw:hover { background: var(--hover); border-color: transparent; color: var(--ink); }
.side .themesw { flex: 1; }
.side .youbtn svg.i, .side .themesw svg.i { margin: 0; }
.side .youbtn svg.i:last-child:not(:first-child) { color: var(--warn); }
body.framed header { background: var(--bg); border-bottom: 1px solid var(--line2); }
body.framed header .bar { padding: 9px 20px; }
.strip-right { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.flagtop { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-color: transparent; background: transparent;
           color: var(--muted); font-size: 12.5px; }
.flagtop:hover { border-color: var(--line); }
.flagtop svg.i { margin: 0; }
.flagtop.cnt-flag.has { color: var(--bad); }
.flagtop.cnt-urgent.has { color: var(--warn); }
/* the page header (gsearch.js): section, title, one-line status, the page's own buttons on the right */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
            max-width: 1500px; margin: 0 auto; padding: 22px 24px 10px; }
.pagehead .crumb { color: var(--muted); font-size: 12.5px; }
.pagehead h1 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin: 0; color: var(--ink); }
.pagehead .ph-status { color: var(--muted); font-size: 13px; }
.pagehead .ph-status:empty { display: none; }
.pagehead .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) { .pagehead { padding: 12px 12px 4px; } .pagehead h1 { font-size: 18px; } }
/* tablets: the menu shows only its icons (their names as tooltips) */
@media (min-width: 641px) and (max-width: 1100px) {
  body.framed { padding-left: 60px; }
  aside.side { width: 60px; padding: 12px 8px; }
  .side nav a { justify-content: center; padding: 9px 0; }
  .side nav a span, .side .grp, .side .youbtn span, .side .themesw span { display: none; }
  .side .grp { display: block; height: 1px; padding: 0; margin: 8px 6px; background: var(--line2); font-size: 0; }
  .side .brand { margin: 0 auto 10px; } .side .brand img { height: 26px; }
  .side .foot-row { flex-direction: column; }
  .side .foot-row .langsw { flex-direction: column; }
  .side .foot-row .langsw button { padding: 4px 8px; }
  .side .youbtn, .side .themesw { justify-content: center; padding: 8px 0; }
}
/* the menu folded to its icons by the button at the left of the top strip (gsearch.js, remembered as side.mini) */
@media (min-width: 1101px) {
  body.framed.side-mini { padding-left: 60px; }
  body.side-mini aside.side { width: 60px; padding: 12px 8px; }
  body.side-mini .side nav a { justify-content: center; padding: 9px 0; }
  body.side-mini .side nav a span, body.side-mini .side .grp, body.side-mini .side .youbtn span, body.side-mini .side .themesw span { display: none; }
  body.side-mini .side .grp { display: block; height: 1px; padding: 0; margin: 8px 6px; background: var(--line2); font-size: 0; }
  body.side-mini .side .brand { margin: 0 auto 10px; } body.side-mini .side .brand img { height: 26px; }
  body.side-mini .side .foot-row { flex-direction: column; }
  body.side-mini .side .foot-row .langsw { flex-direction: column; }
  body.side-mini .side .foot-row .langsw button { padding: 4px 8px; }
  body.side-mini .side .youbtn, body.side-mini .side .themesw { justify-content: center; padding: 8px 0; }
}
@media (max-width: 1100px) { .sidefold { display: none; } }   /* tablets: always folded; phones: no menu */
/* phones: no left menu - the bottom tab bar and More sheet do its job */
@media (max-width: 640px) {
  aside.side { display: none; }
  body.framed { padding-left: 0; }
  body.framed header .bar { padding: 8px 12px; }
}
@media print { aside.side, .tabbar { display: none !important; } body.framed { padding-left: 0; } }
/* departments (2026-11-18, gsearch.js): another department's page is read-only - its edit controls are dimmed and do
   nothing (the server refuses the change anyway); links, tabs, search / filters, export and print keep working.
   body.no-money: elements marked data-money are hidden for users without money access */
.ro-banner { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; padding: 8px 12px; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--raise); color: var(--ink2); }
.ro-banner svg { flex: none; color: var(--muted); }
body.readonly .ro-off { opacity: .45; pointer-events: none; cursor: not-allowed; }
body.readonly :is(input, textarea, select).ro-off { opacity: .75; }
body.no-money [data-money] { display: none !important; }
/* Changes panel (shared.js changesPanel, 2026-11-18): a folding History of the record at the bottom of its page */
.chpanel { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.chpanel > summary { cursor: pointer; padding: 8px 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.chpanel > summary .chn { font-weight: 400; }
.chpanel .chbody { padding: 0 12px 10px; max-height: 480px; overflow-y: auto; }
.chpanel .chrow { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 4px 12px; padding: 7px 0;
                  border-top: 1px solid var(--line2); font-size: 13px; }
.chpanel .chwhen { color: var(--muted); white-space: nowrap; }
.chpanel .chcode { color: var(--ink2); }
.chpanel .chwhat > div + div { font-size: 12.5px; overflow-wrap: anywhere; }
.chpanel .chwhat b { font-weight: 600; }
.chpanel .old { color: var(--muted); text-decoration: line-through; }
.chpanel .chfoot { padding-top: 6px; }
@media (max-width: 640px) { .chpanel .chrow { grid-template-columns: 1fr; } .chpanel .chwhen { white-space: normal; } }
