/* SPEC114 Y2 (owner 02.10, ledger 129): richer gold for selected states, compact Digital Inbox and Case
   conversations with a prominent Sales entry, the HISTORY / DESKS groups and the Shipping label menu on the
   main screen, and the Invoice opened on the whole screen with BACK. The case form itself (Y1) is not styled here. */

/* 1. Ledger 211 (owner 07.10): champagne / antique gold — the app's own base colour #d7b56d (index.html, v0.15 "quiet
      gold"; the owner's reference shots docs/references/gold-2026-10-07) — replaces the yellow gold that Z4 / Y4 /
      ledger 208 laid over it (#f0c75e / #d9ae4f / #e6c062 / #f7dd98 / #fcf2d4 / #f8e3a3). ONE token family, defined here
      once per theme; every gold of the main screen reads it (signin.css, case_form.css, sidebar.css, production.css…).
        --champ            accent: lines, the gold of a selected / hovered item, icons        #d7b56d   light #c9a45a
        --champ-rgb        the same as r,g,b for translucent fills                            215,181,109
        --champ-text       gold text (Case # badge, titles, today)                            #d7b56d   light #765827
        --champ-ink        caption of a gold button                                           #f2dba6   light #66491f
        --champ-line-rest  line of a resting gold button                                      rgba(215,181,109,.58)  light #ceb37e
        --champ-face       face of a gold button                                              #3e3a32   light #faf5ea
        --champ-sel-bg     fill of the selected row / tile                                    rgba(215,181,109,.15) (= #39362f on the menu)  light #f4ead7
        --champ-hover-*    ledger 212: the ONE hover — fill, 1px line, lighter text, fade    (case_form.css, last section)
      Contrast (WCAG): #d7b56d on the graphite panel #36393e 5.9:1; #f3dca4 on #39362f 9:1; light #765827 on ivory
      6.5:1, #594322 on #f4ead7 7.8:1, #66491f on #faf5ea 7.6:1. */
:root,body{--champ:#d7b56d;--champ-rgb:215,181,109;--champ-deep:#c39f58;--champ-text:#d7b56d;--champ-ink:#f2dba6;--champ-line-rest:rgba(215,181,109,.58);
  --champ-face:#3e3a32;--champ-face-hover:#48423a;--champ-sel-bg:rgba(215,181,109,.15);--champ-sel-ink:#f5db9e;
  --champ-hover-bg:rgba(215,181,109,.15);--champ-hover-line:#d7b56d;--champ-hover-ink:#f3dca4;--champ-hover-ease:.14s ease;
  --champ-menu-bg:#1d2025;--champ-menu-line:#575c64;--champ-row-bg:#282c32;--champ-row-line:#41464e;--champ-row-ink:#dddddd;
  --champ-wordmark:linear-gradient(90deg,#d7b56d 0%,#f2dba6 50%,#d7b56d 100%)}
body[data-theme="light"]{--champ:#c9a45a;--champ-text:#765827;--champ-ink:#66491f;--champ-line-rest:#ceb37e;
  --champ-face:#faf5ea;--champ-face-hover:#f4ead7;--champ-sel-bg:#f4ead7;--champ-sel-ink:#594322;
  --champ-hover-bg:#f4ead7;--champ-hover-line:#c9a45a;--champ-hover-ink:#594322;
  --champ-menu-bg:#fffdf8;--champ-menu-line:#d8d4cb;--champ-row-bg:#ffffff;--champ-row-line:#e1dbcd;--champ-row-ink:#303238;
  --champ-wordmark:linear-gradient(90deg,#765827 0%,#a8874a 50%,#765827 100%)}
/* the older names read the family (custom properties are declared on body too, so the light values take effect) */
:root,body,body[data-accent="orange"]{--gold:var(--champ);--ui-accent:var(--champ);--ui-accent-rgb:var(--champ-rgb);--ui-accent-soft:rgba(var(--champ-rgb),.15);--ui-accent-line:rgba(var(--champ-rgb),.58);--ui-accent-text:var(--champ-hover-ink)}
/* Ledger 208 (owner 07.10): (p.3) one gold button of the main screen — flat (no gradient): dark — a warm face #3e3a32,
   the muted gold line and a light-gold caption; light — an ivory face, the champagne line and dark-gold ink. Ledger 211:
   champagne instead of yellow. (p.2) the side blocks: one neutral frame and one title colour for all five. */
:root,body,body[data-accent="orange"]{--gold-btn-face:var(--champ-face);--gold-btn-line:var(--champ-line-rest);--gold-btn-ink:var(--champ-ink);--gold-btn-face-hover:var(--champ-face-hover);--gold-btn-line-hover:var(--champ-hover-line);--gold-btn-ink-hover:var(--champ-hover-ink);--gold-btn-ring:rgba(var(--champ-rgb),.3);
  --side-line:#4a4f57;--side-shadow:none;--side-title:var(--champ-text);--side-muted:#b8bdc5}
body[data-theme="light"],body[data-theme="light"][data-accent="orange"]{--side-line:#ddd7cc;--side-shadow:0 1px 2px rgba(60,50,30,.05);--side-muted:#6b6d73}
.clinic.active{border-color:rgba(var(--champ-rgb),.7)!important;background:linear-gradient(105deg,rgba(var(--champ-rgb),.18),rgba(10,11,13,.1))!important;box-shadow:inset 3px 0 0 var(--champ),0 10px 28px rgba(0,0,0,.22)!important}
.clinic.active .cn strong{color:var(--champ-hover-ink)!important}
.clinic.active .ci{background:linear-gradient(135deg,#ecd08e 0%,#d7b56d 55%,#c39f58 100%);color:#211a10}
.pl-mini-day.selected{background:var(--champ-sel-bg);border-color:var(--champ)}
.pl-mini-day.today{border-color:var(--champ);color:var(--champ-text)}
.pl-conversation-choice.selected,.pl-inbox-item.focused{border-color:var(--champ);background:var(--champ-sel-bg)}
.search-scope-tab.on,.analytics-period-switch button.on{border-color:var(--champ);background:var(--champ-sel-bg);color:var(--champ-sel-ink)}
.recovery-settings .settings-nav button.on{border-color:var(--champ);background:var(--champ-sel-bg);color:var(--champ-sel-ink)}
.pl-side-heading h2 button,.brand-mark span{color:var(--champ-text)}
body[data-theme="light"] .clinic.active{background:linear-gradient(105deg,#f4ead7,#fff)!important;box-shadow:inset 3px 0 0 var(--champ),0 9px 24px rgba(92,72,43,.12)!important}

/* 2. Side panel (SPEC114 Y2, then Z1 — owner 02.10, ledger 131): top → bottom Studio, Sales, Digital Inbox,
      Case conversations, Traffic Calendar last. Every card except the calendar has the same compact height as
      Digital Inbox (108 px); Studio and Sales are calm cards like the others — no highlighted frame. */
.pl-side-sections{display:flex!important;flex-direction:column;flex:0 0 auto!important;grid-template-rows:none!important;gap:8px!important}
.pl-side-card.pl-compact,.pl-entry-card{flex:0 0 auto!important;height:108px!important;min-height:0;max-height:108px;overflow:hidden}
.pl-calendar-card{flex:1 1 auto!important}
/* SPEC114 Z4 (owner 02.10, ledger 132 p.6) and Y4 (ledger 137 p.3) gave these frames a yellow-gold line with a glow.
   Ledger 208 (owner 07.10, p.2): "too much yellow in the side blocks" — the frame is a calm neutral line (--side-line)
   without a glow; gold stays for the accents only: hover / focus of the card, the selected and today's day. */
.pl-side-card.pl-compact,.pl-entry-card{border:1px solid var(--side-line)!important;box-shadow:var(--side-shadow)}
.pl-side-card.pl-compact .pl-side-heading{min-height:34px;padding:3px 9px}
.pl-side-card.pl-compact .pl-side-content{min-height:34px;max-height:64px;padding:5px 8px}
.pl-side-card.pl-compact .pl-side-empty{margin:0;font-size:10px;line-height:1.4;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.pl-side-card.pl-compact .pl-queue-row{padding:4px 6px}.pl-side-card.pl-compact .pl-queue-row span{display:none}
.pl-side-card.pl-compact .pl-side-footer{min-height:0;padding:5px 7px;gap:5px}
.pl-side-card.pl-compact .pl-side-footer .pl-side-button,.pl-side-card.pl-compact .pl-side-footer a{padding:4px 8px;font-size:10px;text-decoration:none;color:inherit}
.pl-entry-card{margin:0 0 8px!important}
.pl-entry-card .pl-side-heading h2 .pl-entry-title{display:inline-block;padding:4px 0;border:0;background:none;font-size:13px;font-weight:750;color:var(--side-title);text-decoration:none}
.pl-entry-card .pl-side-content{justify-content:center}
.pl-entry-card .pl-side-footer{justify-content:flex-end}
.pl-entry-card .pl-side-footer a:hover{border-color:var(--gold,#d7b56d)}

/* 3. Grouped menus: HISTORY, DESKS and the Shipping label menu share one small dropdown. */
.tool-group{position:relative;min-width:0}
.tool-group>.tool-group-toggle{width:100%}
.tool-group>.tool-group-toggle[aria-expanded="true"]{border-color:var(--gold-btn-line-hover)!important;background:var(--gold-btn-face-hover)!important;color:var(--gold-btn-ink-hover)!important}
.tool-menu{position:absolute;z-index:36;inset-inline-start:0;bottom:calc(100% + 6px);display:grid;gap:5px;min-width:max(100%,210px);padding:6px;border:1px solid var(--champ-menu-line);border-radius:11px;background:var(--champ-menu-bg);box-shadow:0 18px 44px rgba(0,0,0,.46)}
.tool-menu[hidden]{display:none!important}
.tool-menu>button{display:flex!important;width:100%;min-height:36px;height:auto!important;flex-direction:row;flex-wrap:wrap;align-items:center!important;justify-content:flex-start!important;gap:2px 7px;padding:6px 10px!important;text-align:left;white-space:nowrap}
.tool-menu>button>i{margin:0}.tool-menu>button small{flex-basis:100%}
.tool-menu>button[hidden]{display:none!important}
.tool-menu>button small{display:block;font-size:9px;font-weight:500;letter-spacing:0;color:var(--muted,#9ea3aa)}
.tool-menu>button:hover{background:var(--gold-btn-face-hover)!important;color:var(--gold-btn-ink-hover)!important}
.main-toolbar{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.main-toolbar-moved[hidden]{display:none!important}
.summary .label-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.summary .label-actions .tool-group-toggle,.summary .label-actions .tool-menu>button{display:flex;align-items:center;justify-content:center;width:100%;height:34px!important;min-height:34px!important;min-width:0;padding:4px 6px!important;border:1px solid var(--gold-btn-line)!important;border-radius:9px!important;background:var(--gold-btn-face)!important;color:var(--gold-btn-ink)!important;font-size:9px!important;font-weight:800!important;letter-spacing:.025em;line-height:1.2;box-shadow:none!important}
.summary .label-actions .tool-menu>button{height:auto!important;min-height:38px!important;align-items:flex-start!important;justify-content:center!important;flex-direction:column;flex-wrap:nowrap}
.summary .label-actions .tool-menu>button small{flex-basis:auto;order:2}
body[data-theme="light"] .tool-menu{border-color:var(--champ-menu-line);background:var(--champ-menu-bg);box-shadow:0 18px 44px rgba(67,54,36,.22)}

/* 4. One click opens the Invoice on the whole screen inside the program; BACK TO CASE returns everything. */
.invoice-open{margin-inline-start:auto;height:31px;padding:0 11px;border:1px solid var(--gold-btn-line);border-radius:9px;background:var(--gold-btn-face);color:var(--gold-btn-ink);font-size:10px;font-weight:850;letter-spacing:.06em;white-space:nowrap}
.invoice-open:hover{border-color:var(--gold-btn-line-hover);background:var(--gold-btn-face-hover);color:var(--gold-btn-ink-hover)}
.summary-toolbar h2{cursor:pointer}
body[data-invoice-expanded] .invoice-open,body[data-invoice-expanded] .fullscreen-toggle{display:none!important}
body[data-invoice-expanded] .main{overflow:auto}
body[data-invoice-expanded] .workspace>.summary{width:min(1180px,100%);margin:0 auto;height:auto;min-height:calc(100vh - 28px)}
body[data-invoice-expanded] .summary-lines{min-height:260px}
.invoice-back-bar{border-color:rgba(var(--champ-rgb),.58);background:var(--champ-sel-bg)}
.invoice-back-bar>button{height:34px;padding:0 14px;border-color:var(--champ)!important;color:var(--champ-ink)!important;font-weight:850}

/* 5. Settings → Data: the Database manager and Local PDF folders live here now, not on the main screen. */
#y2DataTools .actions{display:flex;flex-wrap:wrap;gap:8px}
#y2DataTools .actions button{min-height:38px;padding:0 14px;border:1px solid var(--ui-accent-line);border-radius:9px;background:var(--ui-accent-soft);color:var(--ui-accent-text);font-weight:800;letter-spacing:.03em}

/* 6. SPEC114 Y4 (owner 03.10, ledger 137 p.3): the brand card at the top of the side column is not grey — the dark plate
      of the sign-in card (signin.css: #141517 on #26272b with the gold wordmark). The markup stays (branding.js fills
      .brand-mark span and .brand-copy strong for the lab edition): "Prime" small and light, then "LAB ADMIN" large in gold
      on one line. Ledger 208 (owner 07.10, p.1): the dark plate is the dark theme's; the light theme has its own light
      plate (section 8) — this replaces "one dark plate in both themes" (Y4 / Y6, ledger 137 / 147). */
.sidebar .brand,body[data-theme="light"] .sidebar .brand{display:flex;align-items:center;gap:12px;padding:12px 14px;margin:0 4px 14px;border-radius:17px}
.sidebar .brand{border:1px solid #26272b;background:#141517!important;background-image:none!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 12px 30px rgba(0,0,0,.28)}
.sidebar .brand::before{background:linear-gradient(90deg,transparent,rgba(var(--champ-rgb),.7),transparent)}
.sidebar .brand::after{background:radial-gradient(circle,rgba(var(--champ-rgb),.12),transparent 69%)}
.sidebar .brand .brand-mark{display:grid;grid-template-rows:auto;justify-items:center}
.sidebar .brand .brand-logo{width:46px;height:46px;filter:drop-shadow(0 7px 14px rgba(var(--champ-rgb),.22))}
.sidebar .brand .brand-mark span{display:none}
/* SPEC114 U.7 (owner 03.10, ledger 146): the owner saw "LAB ADMI" cut off on the right — "move everything to the left".
   The plate is a size container: everything sits at the left edge, the wordmark is sized from the plate's own width
   (100cqi minus the logo and the gap, over the ~6.4 em that "LAB ADMIN" needs), never wraps and never clips at any
   window width or sidebar size. "LAB ADMIN as in the brand book, shimmering, bright … not orange and not ginger" — one
   gradient across both words (background-clip:text); "prime" stays small and light. Ledger 211: the gradient is the
   champagne family (--champ-wordmark: #d7b56d at the sides, the light #f2dba6 in the middle), never yellow. */
.sidebar .brand,body[data-theme="light"] .sidebar .brand{container-type:inline-size;justify-content:flex-start;gap:9px;padding:12px 10px 12px 11px;text-align:left}
.sidebar .brand .brand-mark{flex:none}
.sidebar .brand .brand-copy{display:flex;align-items:baseline;justify-content:flex-start;flex:1 1 auto;flex-wrap:wrap;gap:0 .28em;transform:none;min-width:0;overflow:visible;
  background:var(--champ-wordmark);-webkit-background-clip:text;background-clip:text}
.sidebar .brand .brand-copy::before{content:"Prime";display:block;flex-basis:100%;color:#c9c9cd;-webkit-text-fill-color:#c9c9cd;font-size:11px;font-weight:400;letter-spacing:.04em;text-transform:none;line-height:1;text-align:left}
.sidebar .brand .brand-copy strong,body[data-theme="light"] .sidebar .brand .brand-copy strong,.brand.brand-button:hover .brand-copy strong{margin:0;align-self:baseline;color:var(--champ);-webkit-text-fill-color:transparent;font-size:clamp(12px,calc((100cqi - 55px) / 6.6),21px);line-height:1.1;letter-spacing:.05em;text-shadow:none;white-space:nowrap}
.sidebar .brand .brand-copy strong+strong{font-size:clamp(12px,calc((100cqi - 55px) / 6.6),21px)}

/* 7. SPEC114 Y6 (owner 03.10, ledger 147). (p.8) The dark plate is a soft dark gradient instead of a flat black patch,
      the gold hairline and the gradient wordmark (U.7); "Prime" with a capital letter; a white-label laboratory puts its
      own small name there (branding.js sets data-brand-small) and its own logo. Ledger 208 p.1: dark theme only — the
      light theme draws the light plate of section 8. (p.1) The setup helper bubble at the bottom right. (p.9) The side
      cards are whole buttons of one style; the Traffic Calendar card shares the same frame. */
.sidebar .brand{background-image:linear-gradient(150deg,#2b2e34 0%,#141517 68%)!important;border-color:rgba(var(--champ-rgb),.42)}
.sidebar .brand .brand-copy[data-brand-small]::before{content:attr(data-brand-small);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.sidebar .brand .brand-logo{object-fit:contain}
.brand-plate-card .brand-plate-name{display:block;margin:8px 0 10px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.brand-plate-card .brand-plate-name input{display:block;margin-top:4px;max-width:280px;font-weight:600;letter-spacing:0;text-transform:none}
.helper-bubble{position:fixed;z-index:1200;right:18px;bottom:18px;display:flex;flex-direction:column;align-items:flex-end;gap:10px;font-family:inherit}
.helper-bubble[hidden]{display:none}
.helper-bubble-toggle{width:56px;height:56px;padding:0;border:1px solid rgba(var(--champ-rgb),.7);border-radius:50%;background:linear-gradient(150deg,#2b2e34 0%,#141517 70%);color:var(--champ);cursor:pointer;
  box-shadow:0 10px 26px rgba(0,0,0,.35),0 0 0 1px rgba(var(--champ-rgb),.14);display:grid;place-items:center;transition:transform .15s ease,box-shadow .15s ease}
.helper-bubble-toggle svg{width:28px;height:28px}
.helper-bubble-toggle:hover,.helper-bubble-toggle:focus-visible{transform:translateY(-1px);box-shadow:0 12px 30px rgba(0,0,0,.4),0 0 0 2px rgba(var(--champ-rgb),.35);outline:none}
.helper-bubble.is-open .helper-bubble-toggle{border-color:var(--champ)}
.helper-bubble-panel{position:relative;width:min(300px,calc(100vw - 36px));padding:16px 16px 14px;border:1px solid rgba(var(--champ-rgb),.5);border-radius:16px;background:rgba(20,21,23,.94);color:#f2f2ef;
  box-shadow:0 18px 44px rgba(0,0,0,.42),0 0 0 1px rgba(var(--champ-rgb),.1);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.helper-bubble-panel[hidden]{display:none}
.helper-bubble-panel strong{display:block;margin:0 28px 4px 0;font-size:14px;line-height:1.3;color:var(--champ-text)}
.helper-bubble-panel p{margin:0 0 12px;font-size:12px;line-height:1.45;color:#c9c9cd}
.helper-bubble-action{display:block;width:100%;margin:0 0 7px;padding:0 12px;height:36px;border:1px solid rgba(215,181,109,.62);border-radius:9px;background:rgba(var(--champ-rgb),.14);color:var(--champ-ink);
  font:inherit;font-size:10px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;cursor:pointer;text-align:center}
.helper-bubble-action:hover,.helper-bubble-action:focus-visible{border-color:var(--champ-hover-line);background:var(--champ-hover-bg);color:var(--champ-hover-ink);outline:none}
.helper-bubble-close{position:absolute;top:8px;right:8px;width:26px;height:26px;padding:0;border:1px solid rgba(255,255,255,.14);border-radius:50%;background:transparent;color:#c9c9cd;font:inherit;font-size:16px;line-height:1;cursor:pointer}
.helper-bubble-close:hover{border-color:var(--champ-hover-line);color:var(--champ)}
.helper-bubble-support{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;margin-top:4px;padding-top:10px;border-top:1px solid rgba(255,255,255,.1);font-size:12px}
.helper-bubble-support span{width:100%;font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:#9a9ca3}
.helper-bubble-support a{color:var(--champ-text);text-decoration:none}.helper-bubble-support a:hover{text-decoration:underline}
body[data-theme="light"] .helper-bubble-panel{background:rgba(255,253,248,.94);color:#26272b;border-color:rgba(var(--champ-rgb),.75);box-shadow:0 18px 44px rgba(67,54,36,.24),0 0 0 1px rgba(var(--champ-rgb),.12)}
body[data-theme="light"] .helper-bubble-panel strong{color:var(--champ-text)}body[data-theme="light"] .helper-bubble-panel p{color:#5d5f66}
body[data-theme="light"] .helper-bubble-action{border-color:var(--champ-line-rest);background:var(--champ-face);color:var(--champ-ink)}
body[data-theme="light"] .helper-bubble-close{color:#5d5f66;border-color:rgba(0,0,0,.14)}body[data-theme="light"] .helper-bubble-support{border-top-color:rgba(0,0,0,.1)}
body[data-invoice-expanded] .helper-bubble{display:none}
/* a window of the program (Traffic Manager, desks, history…) is open: the bubble steps aside so it never covers the window's own buttons */
body:has(#modal.modal-backdrop.open) .helper-bubble{display:none}
/* while the circle is on screen the bottom toolbar of the Invoice column leaves it room, so SETTINGS stays reachable */
body[data-helper-bubble] .summary .utility-grid.main-toolbar{padding-inline-end:64px}
@media(max-width:760px){.helper-bubble{right:12px;bottom:12px}}
/* p.9: one card style for Studio, Sales representative, Digital Inbox, Case conversations and Traffic Calendar; the card is the button */
/* ledger 208 p.2: the one frame is neutral (no gold line, no glow) and every title has the Traffic Calendar title's colour */
.pl-side-card.pl-compact,.pl-entry-card,.pl-side-card.pl-calendar-card{border:1px solid var(--side-line)!important;box-shadow:var(--side-shadow)}
body .pl-side-card .pl-side-heading h2 :is(button,.pl-entry-title){color:var(--side-title)!important}
.pl-side-card[role="button"]{cursor:pointer;transition:border-color var(--champ-hover-ease),box-shadow var(--champ-hover-ease)}
.pl-side-card[role="button"]:hover,.pl-side-card[role="button"]:focus-visible{border-color:var(--champ-hover-line)!important;box-shadow:var(--side-shadow);outline:none}
.pl-side-card[role="button"] .pl-side-heading h2 button,.pl-side-card[role="button"] .pl-side-heading h2 .pl-entry-title{cursor:pointer}
.pl-entry-card .pl-side-footer:empty,.pl-side-card.pl-compact .pl-side-footer:empty{display:none}
/* SPEC114 AE.4 (owner 05.10, ledger 160): read-only without a licence. The Hub answers 402 to every write outside its
   allow-list; here the banner on top of the app and the disabled creation / save buttons (body.licence-read-only,
   licence_gate.js). The licence card (promo, VERIFY NOW), Settings, sign-out, updates and backups stay usable. */
.licence-banner{display:flex;align-items:center;gap:14px;flex-wrap:wrap;background:#39362f;color:var(--champ-ink);border:1px solid var(--champ);border-radius:12px;padding:10px 16px;margin:0 0 12px;font-size:14px;line-height:1.4}
body[data-theme="light"] .licence-banner{background:var(--champ-sel-bg);color:var(--champ-ink);border-color:var(--champ)}
.licence-banner-text{flex:1 1 320px;min-width:0}
.licence-banner-reason{opacity:.85}
.licence-banner-open{flex:0 0 auto;border:1px solid var(--champ);background:transparent;color:inherit;border-radius:8px;padding:6px 12px;font-weight:700;cursor:pointer}
.licence-banner-open:hover{background:var(--champ-hover-bg)}
.licence-banner-subscribe{background:var(--champ);color:#141414;margin-right:8px}
.licence-banner-subscribe:hover{background:#ecd08e}
.licence-mode-line{color:var(--champ-text);font-weight:700}
/* Fixes after 133: the banner inside `.app` must not take the first grid cell (the whole screen moved). It is a fixed
   bar across the top; `.app` (box-sizing: border-box, height 100vh) gets its height as top padding — the layout of
   full mode plus the bar (licence_gate.js measures the bar into --licence-banner-h). */
.app>.licence-banner{position:fixed;top:0;left:0;right:0;z-index:15;margin:0;border-radius:0;border-width:0 0 1px;padding:8px 16px}
body.licence-banner-on .app{padding-top:var(--licence-banner-h,52px)}
/* Creation and save buttons of the laboratory screen are inert in read-only mode: the case composer, the invoice column,
   the new-case buttons, labels and sending. Settings (.recovery-settings), the licence card and anything marked
   data-licence-allow keep working — the Hub is the rule, this is only the visible echo. */
body.licence-read-only .app :is(#saveCaseBottom,#saveCase,#newCaseTop,#newCase,#editCaseTop,#labSlip,#technicianPreview,.work-save,.invoice-action,button.primary,[data-licence-write]):not(.recovery-settings *,.settings-v68 *,[data-licence-allow],[data-licence-promo-apply],[data-action="y4-licence-verify"]){pointer-events:none;opacity:.45;filter:grayscale(.6)}

/* SPEC114 AD.1 — Incoming work (partner queue) and the partner block of a Case. */
.partner-queue h1{margin:0 0 .5rem;font-size:1.15rem}
.partner-counts{display:flex;gap:1rem;flex-wrap:wrap;margin:0 0 1rem;font-size:.9rem}
.partner-counts strong{margin-left:.3rem}
.partner-order{border:1px solid var(--line,#444);border-radius:10px;padding:.7rem .9rem;margin:0 0 .7rem}
.partner-order header{display:flex;justify-content:space-between;gap:.6rem;align-items:baseline}
.partner-order ul{margin:.3rem 0;padding-left:1.1rem}
.partner-state{font-size:.85rem;opacity:.85}
.partner-files{display:flex;gap:.4rem;flex-wrap:wrap;margin:.4rem 0}
.partner-empty{opacity:.7;font-size:.9rem}
.partner-case-block{border:1px solid var(--line,#444);border-radius:10px;padding:.6rem .9rem;margin:0 0 .8rem}
.partner-case-block h3{margin:0 0 .3rem;font-size:.95rem}
/* Ledger 206: SUBSCRIBE — «Monthly» and «Annual −10 %» side by side (banner and the licence card). */
.licence-plan-choice{display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px}.licence-plan-label{font-weight:700;font-size:12px;letter-spacing:.04em;opacity:.85}.licence-plan-price{font-weight:500;opacity:.8}.licence-plan-choice .licence-plan-annual{box-shadow:0 0 0 1px var(--champ) inset}
/* Fixes after 133: the licence card offers the plans in their own row under «Subscribe:» — two ordinary buttons
   (no pressed look); TURN ON (laboratory network) and APPLY (promo) are compact like their neighbours; the
   QuickBooks / Xero status line is normal small text. */
.licence-plan-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0 4px}
.licence-plan-row-label{flex:0 0 100%;font-size:12px;font-weight:700;letter-spacing:.03em;opacity:.85}
.licence-plan-row-buttons{display:flex;flex-wrap:wrap;gap:8px}
.licence-plan-row-buttons>button{width:auto;min-width:130px;box-shadow:none}
/* Ledger 217: «Computers: N · tier …» — one small line next to the plan buttons. */
.licence-computers-line{flex:0 0 100%;font-size:12px;opacity:.8}
.actions>button.primary[data-action="an-lan-on"],.actions>button.primary[data-licence-promo-apply]{width:auto;min-width:120px;flex:0 0 auto;justify-self:start;align-self:flex-start}
.settings-card .acc-status-line,.settings-card .acc-status-line strong{font-size:13px;line-height:1.4}
.analytics-licence-closed{margin:24px auto;max-width:520px;padding:18px 20px;border:1px solid var(--champ);border-radius:12px;background:rgba(var(--champ-rgb),.08);color:inherit;text-align:center;font-weight:650}

/* 8. Ledger 208 (owner 07.10). p.1 — "in the light theme the black LAB ADMIN plate: fit it into the light colour": the light
      theme has a light plate — warm ivory (not the grey of ledger 137), the gold hairline, the logo as a rounded tile, and
      the champagne wordmark in a deeper gold that reads on ivory (--champ-wordmark: #765827 at the sides, #a8874a in the
      middle — 3.4:1 or more for the large bold letters; ledger 211); "Prime" small in grey ink. The dark theme keeps the dark plate (sections 6–7). p.2 — "too much yellow
      in the side blocks": counts and the calendar markers are neutral; gold is left for the accents (hover, the selected
      and today's day). */
body[data-theme="light"] .sidebar .brand{border:1px solid rgba(var(--champ-rgb),.6)!important;background:#fffdf8!important;background-image:linear-gradient(150deg,#ffffff 0%,#f6efe0 100%)!important;
  box-shadow:inset 0 1px 0 #fff,0 8px 20px rgba(92,72,43,.1)}
body[data-theme="light"] .sidebar .brand::before{background:linear-gradient(90deg,transparent,rgba(var(--champ-rgb),.8),transparent)}
body[data-theme="light"] .sidebar .brand::after{background:radial-gradient(circle,rgba(var(--champ-rgb),.16),transparent 69%)}
body[data-theme="light"] .sidebar .brand .brand-copy{background:var(--champ-wordmark);-webkit-background-clip:text;background-clip:text}
body[data-theme="light"] .sidebar .brand .brand-copy::before{color:#6b6d73;-webkit-text-fill-color:#6b6d73}
body[data-theme="light"] .sidebar .brand .brand-logo{border-radius:11px;filter:drop-shadow(0 4px 10px rgba(92,72,43,.2))}
.pl-side-count,body[data-theme="light"] .pl-side-count{color:var(--side-muted);border-color:var(--side-line)}
.pl-mini-day .case-dot,.pl-calendar-key .case-dot{background:var(--side-muted)}
.pl-mini-day .task-dot,.pl-calendar-key .task-dot{border-color:var(--side-muted)}
/* SPEC114 AE.4c (owner 07.10, ledger 215; replaces AE.4b «documents only»): without a licence the program is closed
   completely. One calm full-screen lock (licence_gate.js #licenceLock); body.licence-locked hides everything else. The
   Hub is the rule (402 for everything but signing in / out, paying, updating, quitting and opening the documents
   folder) — this is its visible echo. */
body.licence-locked>:not(.licence-lock):not(script){display:none!important}
.licence-lock{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:24px 16px;overflow:auto;background:#141518;color:#ece7dc}
body[data-theme="light"] .licence-lock{background:#f6f3ec;color:#24221e}
.licence-lock-card{width:100%;max-width:560px;display:grid;gap:14px;padding:28px 28px 24px;border:1px solid var(--champ,#d7b56d);border-radius:18px;background:#1d2025;box-shadow:0 24px 60px rgba(0,0,0,.35)}
body[data-theme="light"] .licence-lock-card{background:#fffdf8;box-shadow:0 18px 48px rgba(92,72,43,.16)}
.licence-lock-brand{margin:0;font-size:13px;letter-spacing:.08em;text-transform:uppercase;opacity:.75}
.licence-lock-brand b{color:var(--champ,#d7b56d)}
.licence-lock h1{margin:0;font-size:22px;line-height:1.3}
.licence-lock-reason{margin:0;opacity:.8;font-size:14px}
.licence-lock-files{display:grid;gap:8px;padding:12px 14px;border:1px solid rgba(215,181,109,.35);border-radius:12px}
.licence-lock-files p{margin:0;font-size:14px}
.licence-lock-path{display:block;font-size:13px;word-break:break-all;opacity:.9}
.licence-lock button{width:auto;border:1px solid var(--champ,#d7b56d);background:transparent;color:inherit;border-radius:9px;padding:8px 14px;font-weight:700;cursor:pointer}
.licence-lock button:hover{background:rgba(215,181,109,.15)}
.licence-lock .licence-lock-folder{justify-self:start}
.licence-lock-plans{display:flex;flex-wrap:wrap;gap:10px}
.licence-lock .licence-lock-plan{flex:1 1 160px;background:var(--champ,#d7b56d);color:#141414;padding:12px 16px;font-size:15px}
.licence-lock .licence-lock-plan:hover{background:#ecd08e}
.licence-lock-promo{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-end}
.licence-lock-promo label{display:grid;gap:4px;flex:1 1 220px;font-size:12px;font-weight:700}
.licence-lock-promo input{min-width:0}
.licence-lock-actions{display:flex;flex-wrap:wrap;gap:8px}
.licence-lock-notice{margin:0;font-weight:650}
.licence-lock-error{margin:0;color:#e57373;font-weight:650}

/* M44: phone-sized owner workspace. Desktop rules above remain unchanged. */
@media(max-width:760px){
  body button,body [role="button"],body a.button,body summary{min-width:44px;min-height:44px!important;height:auto!important;white-space:normal!important;overflow-wrap:anywhere}
  .summary .label-actions button,.summary .label-actions .tool-group-toggle{min-height:44px!important}
  body .app,body .main,body .workspace,body .stack{min-width:0;max-width:100%}
  body .case-form-grid{grid-template-columns:minmax(0,1fr)!important}
  body .case-form-grid>.field{grid-column:auto!important;min-width:0}
  body .case-form-grid .field-label-actions{flex-wrap:wrap;gap:8px}
  body .case-form-grid .privacy-toggle{overflow:visible;text-overflow:clip;flex-shrink:0;padding:6px 10px}
  body .case-title-line,body .card-head,body .case-head-actions,body .summary-toolbar{flex-wrap:wrap;min-width:0}
  body .case-title-line .case-number{height:auto;white-space:normal}
  body .sidebar .brand{height:auto!important;min-height:86px!important;max-height:none;overflow:visible}
  body .sidebar .brand-copy{align-self:center}
  body .pl-side-card.pl-compact,body .pl-entry-card{height:auto!important;max-height:none;min-height:108px}
  body .pl-side-card.pl-compact .pl-side-content{max-height:none}
  body .pl-side-card.pl-compact .pl-side-empty{display:block;overflow:visible;-webkit-line-clamp:unset}
  body .pl-side-heading,body .pl-side-footer{flex-wrap:wrap}
  body #unifiedWork .service-row,body #unifiedWork .service-followup{grid-template-columns:minmax(0,1fr)!important}
  body #unifiedWork .service-row>.field,body #unifiedWork .service-followup>*{min-width:0;grid-column:auto!important}
  body #workSelection,body #implantSelection,body #billAccount,body #summaryPatient{max-width:100%;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
  body #unifiedWork .tooth-arch{min-width:1424px!important;width:1424px!important;grid-template-columns:repeat(31,44px)!important;gap:2px!important}
  body #unifiedWork .tooth,body #unifiedWork .bridge-connector{width:44px!important;min-width:44px!important;height:44px!important}
  body #lines .work-item{grid-template-columns:minmax(0,1fr)!important;height:auto;max-height:none;padding:12px}
  body #lines .work-item>*{min-width:0;grid-column:auto!important;max-width:100%}
  body #lines .work-item .work-edit-actions{padding-right:0;display:flex;flex-wrap:wrap;gap:8px}
  body #lines .work-item [data-edit-work],body #lines .work-item .work-drag,body #lines .work-item .work-parameters,body #lines .work-item .remove-work{position:static;margin:0;transform:none}
  body .case-work-save-row,body .lab-slip-actions{display:flex;flex-wrap:wrap;gap:8px}
  body .case-work-save-row>button,body .lab-slip-actions>button{flex:1 1 140px}
  body .helper-bubble-close{top:4px;right:4px}
  body .helper-bubble-card{padding-top:52px}
  body .recovery-settings{display:flex;flex-direction:column;overflow:auto}
  body .recovery-settings .settings-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-height:230px;overflow:auto;flex:none}
  body .recovery-settings .settings-nav button{min-width:0}
  body .recovery-settings .settings-panel{min-width:0;min-height:250px;overflow:visible;flex:1 0 auto}
  body .recovery-settings .settings-panel-scroll{overflow:visible;padding:12px}
  body .recovery-settings .settings-footer{flex-wrap:wrap}
  body .recovery-settings .settings-footer button{max-width:100%;width:auto}
  body .rh-history-filter,body .rh-report-filter{grid-template-columns:minmax(0,1fr)}
  body .rh-shell .record-text-action,body .rh-shell .rh-pdf{min-height:44px;min-width:44px;white-space:normal}
  body #unifiedWork #workToggle,body #unifiedWork #implantToggle{min-height:44px!important;height:auto!important}
  body .main-toolbar .utility-btn{min-height:44px!important;height:auto!important}
  body #invoiceOpen,body #lines .work-item .work-drag,body #lines .work-item .work-parameters{min-width:44px!important;width:44px!important;flex-basis:44px}
  body .invoice-date-row{grid-template-columns:minmax(0,1fr)!important}
  body[data-theme] .summary .invoice-date-row #saveInvoice{width:100%!important;min-width:44px!important;min-height:44px!important;padding:8px 10px!important}
  body #shadeSelection{height:auto!important;min-height:44px;overflow:visible}
  body #toast{min-width:0!important;max-width:calc(100vw - 32px);overflow-wrap:anywhere}
  body .modal-backdrop{padding:6px!important}
  body .modal-backdrop .modal{max-width:100%;margin-inline:auto}
  body .rh-shell .rh-table-wrap{overflow-x:auto!important;max-width:100%;min-width:0}
  body .recovery-settings-modal #modalBody{overflow:auto!important}
  body .recovery-settings-modal #recoverySettingsRoot,body .recovery-settings-modal .recovery-settings{height:auto;min-height:100%;overflow:visible}
}
