/* CrownOS design system: fonts, tokens and the engineering-drawing finish for Core (console, station, clock).
   Loaded last on each page. Source of truth: the CrownOS Design System (tokens.json, README). */
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:400;font-display:swap;src:url('/assets/fonts/IBMPlexSans-Regular.woff2') format('woff2')}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:500;font-display:swap;src:url('/assets/fonts/IBMPlexSans-Medium.woff2') format('woff2')}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:600;font-display:swap;src:url('/assets/fonts/IBMPlexSans-SemiBold.woff2') format('woff2')}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;font-display:swap;src:url('/assets/fonts/IBMPlexMono-Regular.woff2') format('woff2')}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:500;font-display:swap;src:url('/assets/fonts/IBMPlexMono-Medium.woff2') format('woff2')}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:600;font-display:swap;src:url('/assets/fonts/IBMPlexMono-SemiBold.woff2') format('woff2')}
:root{
  --crn-accent:#2f5d3a;--crn-accent-strong:#1e3f27;--crn-accent-soft:#e7efe8;--crn-accent-tint:#f1f6f2;
  --crn-canvas:#f6f5f1;--crn-surface:#ffffff;--crn-border:#e2dfd7;--crn-border-control:#8a857a;--crn-rule-strong:#868e87;
  --crn-ink:#1b1d1c;--crn-ink-muted:#5c625f;
  --crn-sidebar:#1f2321;--crn-sidebar-active:#2e3431;--crn-sidebar-ink:#c9cec9;--crn-sidebar-label:#8e968f;
  --crn-font-sans:'IBM Plex Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
  --crn-font-mono:'IBM Plex Mono',ui-monospace,Menlo,monospace;
  --crn-radius-sm:2px;--crn-radius-md:3px;--crn-radius-lg:4px;
  --crn-shadow-overlay:0 0 0 1px #e2dfd7,0 12px 32px rgba(27,29,28,.12);
}
:root{font-family:var(--crn-font-sans)}
body{font-variant-numeric:tabular-nums}
h1,h2,h3,h4{font-weight:600}

/* Console frame: charcoal sidebar, forest green for action and selection. */
.sidebar{background:var(--crn-sidebar);color:#fff}
.navigation button{color:var(--crn-sidebar-ink)}
.navigation button.active{background:var(--crn-sidebar-active);color:#fff}
dialog{box-shadow:var(--crn-shadow-overlay)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--crn-accent);outline-offset:2px}

/* Title-block labels and tags. */
.eyebrow,th{font-family:var(--crn-font-mono);text-transform:uppercase;letter-spacing:.08em;font-weight:500}
.badge,.fl-badge{font-family:var(--crn-font-mono);text-transform:uppercase;letter-spacing:.06em;font-weight:500;border-radius:var(--crn-radius-sm)}
.price-check strong{font-family:var(--crn-font-mono)}

/* Dark panels: the sign-in story, toast and station top bar sit on charcoal like the sidebar. */
.login-story,.sidebar,#notice,.fl-top{background:var(--crn-sidebar)}
.login-story .foot{color:var(--crn-sidebar-label)}
/* The station's centred screens sit on the light canvas; draw the white logo in ink there (the top bar keeps it white). */
.fl-center .fl-logo{filter:brightness(0);opacity:.88}
/* Phone menu: sections open full screen as charcoal tiles; the current one is forest green. */
@media(max-width:700px){
  .navigation button{background:var(--crn-sidebar-active);border-radius:var(--crn-radius-md)}
  .navigation button.active{background:var(--crn-accent);color:#fff}
}

/* Form fields: a 3:1 edge against the page, so a field reads as a field (WCAG 1.4.11). */
:is(.shell,dialog,.login,[data-page="launcher"]) :is(input,select,textarea){border-color:var(--crn-border-control)}
/* Keyboard focus on the charcoal frame and the green selection: a light ring (green on charcoal is 2:1). */
:is(.sidebar,.login-story,#notice) :focus-visible,.navigation button.active:focus-visible{outline-color:#fff}

/* Console frame. On a computer the account sits in the top bar; the menu's foot is empty. */
.topbar{justify-content:flex-end}
.sidebar-bottom{display:none}
/* While the console reloads a section its last view stays up; a thin bar shows the work. */
main.content[aria-busy="true"]{position:relative}
main.content[aria-busy="true"]::before{content:"";position:absolute;top:0;left:0;height:2px;width:40%;background:var(--crn-accent);animation:crn-busy 1s ease-in-out infinite alternate}
@keyframes crn-busy{from{transform:translateX(0)}to{transform:translateX(150%)}}
/* The last view, while it reloads: dimmed after a moment (quick reloads never flicker). */
.stale{animation:crn-dim .2s .15s forwards}
@keyframes crn-dim{to{opacity:.55}}
@media(prefers-reduced-motion:reduce){main.content[aria-busy="true"]::before{animation:none;width:100%;opacity:.5}}
/* The page heading takes focus after moving to a section (for keyboards and screen readers); no ring on it. */
#page-title:focus{outline:none}
/* Codes (SKUs, invoice and order numbers) never break across lines. */
td.sku{white-space:nowrap}
/* A link-styled button inside a line of facts (an invoice's order). */
button.link{background:none;border:0;padding:0;min-height:0;color:var(--crn-accent);text-decoration:underline;text-underline-offset:2px;font:inherit;cursor:pointer}
/* A problem notice: red, read out at once, and up a little longer. */
#notice.problem{background:#8a2e27}

@media(max-width:700px){
  /* The account moves to the foot of the menu, so a page starts right under the menu bar. */
  .topbar{display:none}
  .shell.menu-open .sidebar-bottom{display:block;border-top:1px solid #3b403d;padding:14px 2px 0;letter-spacing:0}
  .sidebar-bottom .account{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
  .sidebar-bottom .account span{flex:1 1 100%;min-width:0;max-width:none;font-size:13px;color:var(--crn-sidebar-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .sidebar-bottom .account button{flex:1;min-height:44px;font-size:15px;background:transparent;color:#fff;border:1px solid #4a514d}
  /* Page heading: the menu button already names the section, so the group label goes. */
  .page-heading{gap:14px;margin-bottom:20px}
  .page-heading .eyebrow{display:none}
  .page-heading h1{font-size:26px;margin:0 0 6px}
  .page-heading p{font-size:14px}
  .page-heading .heading-actions{flex-wrap:wrap}
  /* Filters stay on one line and scroll sideways. */
  .toolbar.order-filters{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .toolbar.order-filters::-webkit-scrollbar{display:none}
  .toolbar.order-filters>*{flex:none}
  /* List tables read as cards: the row's first cell leads, every other cell is labelled with its column, and the
     row's buttons span the card. */
  .table-wrap table.cards{min-width:0;table-layout:auto}
  table.cards thead{display:none}
  table.cards,table.cards tbody,table.cards tr{display:block;width:100%}
  table.cards tr{padding:14px 18px;border-bottom:1px solid var(--crn-border)}
  table.cards tr:last-child{border-bottom:0}
  /* Card spacing wins over a table's own desktop padding (.production table.shipments td and the like), which otherwise
     pulled the values under their column names. */
  table.cards td{display:block;position:relative;width:auto!important;padding:5px 0 5px 40%!important;border:0;text-align:left;white-space:normal;min-height:28px}
  table.cards td::before{content:attr(data-label);position:absolute;left:0;top:7px;width:36%;font-family:var(--crn-font-mono);font-size:11px;font-weight:500;letter-spacing:.06em;text-transform:uppercase;color:var(--crn-ink-muted);overflow-wrap:anywhere}
  table.cards td:first-child,table.cards td.cell-actions,table.cards td[data-label=""]{padding-left:0!important}
  table.cards td:first-child::before,table.cards td.cell-actions::before,table.cards td[data-label=""]::before{display:none}
  table.cards td:first-child{padding-bottom:8px!important}
  table.cards td.cell-actions{padding-top:10px!important}
  table.cards td.cell-blank{display:none}
  table.cards td.cell-actions .table-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:stretch}
  table.cards td.cell-actions .table-actions>*{flex:1 1 auto;min-height:44px}
  /* Totals under a card list: label left, amount right. */
  table.cards tfoot{display:block;border-top:1px solid var(--crn-border)}
  table.cards tfoot tr{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:10px 18px}
  table.cards tfoot td{padding:0!important;border:0;min-height:0;text-align:right}
  table.cards tfoot td:first-child{text-align:left}
  table.cards td input,table.cards td select{width:100%;max-width:none}
}
/* Station screen. Start, Done and the form buttons stay in reach at the foot of the screen, so a worker never scrolls
   for them (phones scroll as before). Finished work reads as done, with rework as a small separate button. */
@media(min-width:701px){.fl-panel .fl-actions{position:sticky;bottom:0;z-index:3;background:var(--crn-surface);padding:12px 0;box-shadow:0 -1px 0 var(--crn-border)}}
.fl-actions .fl-banner{flex:1 1 100%;margin:0}
.fl-banner.ok{background:var(--crn-accent-soft);color:var(--crn-accent-strong)}
.fl-rework{min-height:56px;padding:10px 20px}

/* The one scan box (scan.js `CrownScan.box`): the field and its buttons on one row, the status line under them. A label
   kept for screen readers only is hidden the same way on every page, the station screen included. */
.scan-box-label.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.scan-box-row{display:flex;gap:8px;align-items:stretch;flex:1;min-width:0}
.scan-box-row input{flex:1;min-width:0}
.scan-box-row button{white-space:nowrap}
.scan-box-msg{margin:4px 0 0;min-height:0}
.scan-box-msg:empty{display:none}

/* The one photo viewer (crown-dialog.js `CrownDialog.photo`): a photo full size over the page, on every page. */
.crown-photo{width:min(96vw,1400px);max-width:none;height:min(94vh,1000px);max-height:none;padding:0;border:0;border-radius:10px;background:#111;color:#fff}
.crown-photo::backdrop{background:rgba(0,0,0,.7)}
.crown-photo[open]{display:flex;flex-direction:column}
.crown-photo-bar{display:flex;align-items:center;gap:12px;padding:10px 14px;font-size:14px}
.crown-photo-bar span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crown-photo-bar a,.crown-photo-bar button{min-height:40px;padding:6px 16px;border:1px solid rgba(255,255,255,.5);border-radius:6px;background:transparent;color:#fff;font:inherit;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center}
.crown-photo img{flex:1;min-height:0;width:100%;object-fit:contain}
@media(max-width:700px){.crown-photo{width:100vw;height:100vh;border-radius:0}}
