/* ============================================================================
   Beach Lost & Found — "the return desk"

   The look is drawn from the subject rather than a UI kit: property manifests,
   evidence logs, card catalogues, luggage tags. That means ruled registers
   instead of floating cards, near-square corners like a filing card, stamped
   small-caps labels, and item codes set in a real monospace because the code
   *is* the record's identity.

   Type does the heavy lifting:
     Archivo     — display. A grotesque with signage and wayfinding roots.
     Public Sans — body and UI. Built by the US government for dense records
                   interfaces, which is precisely what this is.
     DM Mono     — codes, counts, anything that should line up in a column.

   Colour stays strictly black / paper / Long Beach gold. Gold behaves like a
   marker pen: it highlights the live thing and fills the data. It is never a
   decorative rail on a rounded card, and it never carries text.
   ========================================================================= */

:root {
  /* Paper, faintly warm, well clear of the usual cream. */
  --background: 40 14% 97%;
  --foreground: 30 6% 9%;

  --card: 0 0% 100%;
  --card-foreground: 30 6% 9%;

  --popover: 0 0% 100%;
  --popover-foreground: 30 6% 9%;

  --primary: 43 100% 50%;
  --primary-foreground: 30 8% 8%;

  --secondary: 40 10% 93%;
  --secondary-foreground: 30 6% 14%;

  --muted: 40 10% 93%;
  --muted-foreground: 35 5% 40%;

  --accent: 43 90% 92%;
  --accent-foreground: 30 6% 12%;

  --destructive: 4 68% 42%;
  --destructive-foreground: 0 0% 100%;

  --success: 150 55% 27%;
  --success-foreground: 0 0% 100%;

  --border: 38 12% 86%;
  --rule: 36 10% 78%;           /* the darker hairline used for ledger rules */
  --input: 38 12% 80%;
  --ring: 43 100% 42%;

  /* Filing-card square, not app-store round. */
  --radius: 3px;

  --shadow-sm: 0 1px 0 0 hsl(36 10% 84%);
  --shadow: 0 1px 2px hsl(30 10% 20% / .07);
  --shadow-md: 0 2px 6px hsl(30 10% 20% / .09);
  --shadow-lg: 0 12px 34px hsl(30 10% 15% / .17);

  /* The fallbacks are metric-matched below, so the page does not jump when the
     webfonts arrive. Before that, "Public Sans" swapping to Arial moved every
     line of every table a few pixels -- small, constant, and the exact kind of
     thing that reads as unfinished without anyone being able to say why. */
  --font-display: "Archivo", "Archivo Fallback", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", "Public Sans Fallback", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* ── type scale ──────────────────────────────────────────────────────
     A scale rather than a pile of one-off pixel values. Every size in the
     app comes from here, which is what stops a heading on one screen being
     27px and 26px on the next. */
  --t-display: 27px;    /* h1 */
  --t-section: 17px;    /* h2 */
  --t-body:    14px;
  --t-small:   12.5px;
  --t-tiny:    11.5px;
  --t-stamp:   10.5px;  /* the small-caps ledger labels */

  /* ── motion ──────────────────────────────────────────────────────────
     One curve and three durations, so everything decelerates the same way.
     `--ease` is a soft overshoot-free ease-out; things arrive, they do not
     bounce. A register does not bounce. */
  --ease: cubic-bezier(.2, .85, .3, 1);
  --fast: .16s;
  --mid:  .28s;
  --slow: .44s;
}

/* Metric-matched fallbacks. The adjustments make Arial occupy very nearly the
   same space as the real face, so the swap is a change of shape rather than a
   reflow. Measured against each family's own metrics. */
@font-face {
  font-family: "Public Sans Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 100.5%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%;
}
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 101%; ascent-override: 94%; descent-override: 24%; line-gap-override: 0%;
}

.dark {
  /* Carbon paper rather than pure black: it stops the gold glaring. */
  --background: 36 8% 7%;
  --foreground: 40 10% 94%;

  --card: 36 7% 10%;
  --card-foreground: 40 10% 94%;

  --popover: 36 7% 11%;
  --popover-foreground: 40 10% 94%;

  --primary: 43 96% 57%;
  --primary-foreground: 30 10% 7%;

  --secondary: 36 6% 16%;
  --secondary-foreground: 40 10% 94%;

  --muted: 36 6% 15%;
  --muted-foreground: 38 6% 60%;

  --accent: 43 30% 16%;
  --accent-foreground: 43 90% 72%;

  --destructive: 4 62% 56%;
  --destructive-foreground: 0 0% 100%;

  --success: 150 45% 55%;
  --success-foreground: 30 10% 7%;

  --border: 36 6% 19%;
  --rule: 36 6% 26%;
  --input: 36 6% 24%;
  --ring: 43 96% 57%;

  --shadow-sm: 0 1px 0 0 hsl(36 6% 16%);
  --shadow: 0 1px 2px hsl(0 0% 0% / .5);
  --shadow-md: 0 2px 8px hsl(0 0% 0% / .55);
  --shadow-lg: 0 14px 38px hsl(0 0% 0% / .62);
}

* { box-sizing: border-box; border-color: hsl(var(--border)); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
  /* Both faces have proper old-style/lining sets; lining suits a ledger. */
  font-variant-numeric: lining-nums;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.021em;
  text-wrap: balance;
}
/* Larger type needs tighter tracking to look evenly set; smaller type needs
   looser. One rule each rather than eyeballing it per heading. */
h1 { font-size: var(--t-display); letter-spacing: -.028em; }
h2 { font-size: var(--t-section); letter-spacing: -.018em; }

/* Explanatory paragraphs read better with a shorter measure and pretty
   wrapping -- no orphaned last word hanging under a full line. */
p { text-wrap: pretty; }
a { color: inherit; }
code, .mono, .tnum { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
[hidden] { display: none !important; }
::selection { background: hsl(var(--primary) / .4); }

/**
 * Stamped label. Small caps, tracked out — the way a field is titled on a
 * printed manifest. Shared by section headings, statistic captions, table
 * headers and buttons, which is what gives the whole thing one voice.
 */
.stamp, .stat .k, table.dg thead th, .modal header h2 {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

/* ── logo ───────────────────────────────────────────────────────────── */
.logo { display: block; }
.logo .lf-text   { fill: hsl(var(--foreground)); }
.logo .lf-sub    { fill: hsl(var(--muted-foreground)); }
.logo .lf-gold   { fill: hsl(var(--primary)); }
.logo .lf-stroke { stroke: hsl(var(--foreground) / .78); }

/* ── chrome ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: hsl(var(--background));
  border-bottom: 2px solid hsl(var(--foreground));
  display: flex; align-items: stretch; gap: 0; padding: 0 18px; flex-wrap: wrap;
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px 11px 0; margin-right: 4px;
  border-right: 1px solid hsl(var(--rule));
}
.nav { display: flex; gap: 0; flex-wrap: wrap; }
.nav a {
  position: relative; display: flex; align-items: center; isolation: isolate;
  padding: 0 14px; text-decoration: none; border-radius: 0;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  letter-spacing: .01em; color: hsl(var(--muted-foreground));
}
.nav a:hover { color: hsl(var(--foreground)); background: hsl(var(--muted)); }
/* The live tab is marked with a highlighter swipe, not a filled pill. */
.nav a.on { color: hsl(var(--foreground)); background: transparent; }
.nav a.on::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px; height: 9px;
  background: hsl(var(--primary) / .6); z-index: -1;
}
.spacer { flex: 1 1 auto; }
.who {
  display: flex; align-items: center; gap: 12px;
  font-size: 11.5px; color: hsl(var(--muted-foreground));
  padding: 10px 0 10px 18px; border-left: 1px solid hsl(var(--rule));
}
.who b { color: hsl(var(--foreground)); font-weight: 700; }

main { max-width: 1360px; margin: 0 auto; padding: 30px 22px 96px; }
main.wide { max-width: none; }

.head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { font-size: var(--t-display); font-weight: 650; letter-spacing: -.028em; }
.head h2 { font-size: var(--t-section); font-weight: 650; letter-spacing: -.018em; }
.head p {
  margin: 4px 0 0; font-size: var(--t-small); line-height: 1.5;
  color: hsl(var(--muted-foreground)); max-width: 66ch;
}

/* ── theme switch ───────────────────────────────────────────────────── */
.seg {
  display: inline-flex; padding: 0; gap: 0;
  border: 1px solid hsl(var(--rule)); border-radius: var(--radius); overflow: hidden;
}
.seg button {
  display: grid; place-items: center; width: 28px; height: 23px; padding: 0;
  border: 0; border-right: 1px solid hsl(var(--rule)); background: transparent;
  color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 0;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: hsl(var(--foreground)); background: hsl(var(--muted)); }
.seg button[aria-pressed="true"] {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}

/* ── surfaces ───────────────────────────────────────────────────────── */
.card {
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px;
}
.card.flush { padding: 0; }

/* ── forms ──────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 15px; }
.grid.two   { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Choice of entry style: deliberately reads as a small view switch rather
   than two competing calls to action. */
.entry-switch { margin: 0 0 18px; }
.entry-switch button { width: auto; padding: 7px 12px; font-size: 10.5px; }
.entry-switch button[aria-pressed="true"] { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.entry-grid-note { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; color: hsl(var(--muted-foreground)); font-size: var(--t-small); }
.entry-grid-note .stamp { color: hsl(var(--foreground)); white-space: nowrap; }

label {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: hsl(var(--muted-foreground)); margin-bottom: 6px;
}
label .opt { font-weight: 500; letter-spacing: .04em; text-transform: none; }

input, select, textarea {
  width: 100%; font-family: var(--font-body); font-size: 13.5px;
  color: hsl(var(--foreground)); background: hsl(var(--card));
  border: 1px solid hsl(var(--input)); border-radius: var(--radius);
  padding: 9px 11px; outline: none; transition: border-color .1s, box-shadow .1s;
}
input::placeholder, textarea::placeholder { color: hsl(var(--muted-foreground) / .75); }
/* Focus reads as an underlined field on a form, not a glowing ring. */
input:focus, select:focus, textarea:focus {
  border-color: hsl(var(--foreground)); box-shadow: inset 0 -2px 0 hsl(var(--primary));
}
textarea { resize: vertical; min-height: 74px; }
select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 53%, calc(100% - 10px) 53%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-body); font-size: 12px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid hsl(var(--foreground) / .82); background: transparent;
  color: hsl(var(--foreground)); border-radius: var(--radius);
  padding: 9px 15px; cursor: pointer; text-decoration: none;
  transition: background .1s, color .1s, border-color .1s;
}
button:hover, .btn:hover { background: hsl(var(--foreground)); color: hsl(var(--background)); }
button.primary, .btn.primary {
  background: hsl(var(--primary)); border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
button.primary:hover, .btn.primary:hover {
  background: hsl(var(--foreground)); border-color: hsl(var(--foreground));
  color: hsl(var(--background));
}
button.ghost { border-color: transparent; }
button.ghost:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
button.destructive { color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / .6); }
button.destructive:hover { background: hsl(var(--destructive)); color: #fff; }
button.sm, .btn.sm { padding: 6px 10px; font-size: 10.5px; letter-spacing: .08em; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:active, .btn:active { transform: translateY(1px); }

/* ── badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; font-family: var(--font-body);
  font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 2px; white-space: nowrap; line-height: 1.6;
  background: transparent; color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--rule));
}
.badge.gold    { border-color: hsl(var(--primary)); background: hsl(var(--primary) / .3);
                 color: hsl(var(--foreground)); }
.badge.success { border-color: hsl(var(--success) / .5); color: hsl(var(--success)); }
.badge.danger  { border-color: hsl(var(--destructive) / .5); color: hsl(var(--destructive)); }
.badge.outline { border-style: dashed; }
.tag {
  display: inline-block; font-family: var(--font-body); font-size: 11px;
  font-weight: 600; line-height: 1.6; padding: 1px 7px; border-radius: 2px;
  white-space: nowrap; background: hsl(var(--muted)); color: hsl(var(--foreground));
  border: 1px solid hsl(var(--rule));
}

/* ── the tally row ──────────────────────────────────────────────────── */
/* Caption above, figure below, hairline between — a tally sheet rather than a
   row of cards. No accent rail: that pattern is the tell of a generated
   layout, and it is doing no work here. */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 0; border-top: 2px solid hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--rule)); background: transparent;
}
.stat {
  display: flex; flex-direction: column;
  padding: 13px 18px 15px; border-right: 1px solid hsl(var(--rule));
  background: transparent; border-radius: 0; box-shadow: none; position: static;
}
.stat:last-child { border-right: 0; }
.stat .k { color: hsl(var(--muted-foreground)); margin: 0 0 5px; display: block; order: -1; }
.stat .n {
  font-family: var(--font-display); font-size: 29px; font-weight: 600;
  letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums;
}

/* ── bars ───────────────────────────────────────────────────────────── */
.bars { display: grid; gap: 0; }
.bar {
  display: grid; grid-template-columns: 168px 1fr 56px; gap: 14px;
  align-items: center; font-size: 12.5px;
  padding: 5px 0; border-bottom: 1px solid hsl(var(--border));
}
.bar:last-child { border-bottom: 0; }
.bar .lbl {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; color: hsl(var(--foreground));
}
.bar .swatch { width: 9px; height: 9px; border-radius: 1px; flex: 0 0 auto;
               border: 1px solid hsl(var(--rule)); }
.bar .track { display: block; background: transparent; height: 15px; overflow: hidden; }
.bar .fill {
  /* display:block is load-bearing: width does not apply to an inline box. */
  display: block; height: 100%; min-width: 3px; background: hsl(var(--primary));
  transition: width .34s cubic-bezier(.2,.8,.3,1);
}
.bar .v {
  text-align: right; font-family: var(--font-mono); font-size: 12px;
  font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground));
}

/* ── the register (data grid) ───────────────────────────────────────── */
.gridwrap {
  border-top: 2px solid hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--rule));
  background: transparent; overflow: auto; max-height: 76vh; position: relative;
}
table.dg { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.dg th, table.dg td {
  border-bottom: 1px solid hsl(var(--border));
  padding: 0; text-align: left; vertical-align: middle;
}
table.dg thead th {
  position: sticky; top: 0; z-index: 3;
  background: hsl(var(--background)); color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--rule)); white-space: nowrap;
}
table.dg thead tr.filters th { top: 31px; z-index: 2; }
.dg .hcell {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  cursor: pointer; user-select: none;
}
.dg .hcell:hover { color: hsl(var(--foreground)); }
.dg .sort { opacity: .3; font-size: 9px; }
.dg .hcell[data-dir] { color: hsl(var(--foreground)); }
.dg .hcell[data-dir] .sort { opacity: 1; }
.dg .filter input, .dg .filter select {
  border: 0; border-radius: 0; background: transparent; padding: 6px 11px;
  font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0;
}
.dg .filter input:focus, .dg .filter select:focus {
  box-shadow: inset 0 -2px 0 hsl(var(--primary)); background: hsl(var(--muted) / .5);
}
table.dg tbody td { padding: 8px 12px; }
/* Faint banding, the way ruled ledger paper alternates. */
table.dg tbody tr:nth-child(even) td { background: hsl(var(--muted) / .38); }
table.dg tbody tr:hover td { background: hsl(var(--primary) / .16); }
table.dg tbody tr.sel td { background: hsl(var(--primary) / .26); }
table.dg td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* The item code identifies the record, so it gets a real face. */
table.dg td.code {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .02em; color: hsl(var(--foreground)); white-space: nowrap;
}
/* The item code is the one thing on the intake form that has to match a
   physical label, so it is typeset like the tag itself rather than like a
   field among fields. */
.codetag {
  border: 1px solid hsl(var(--rule)); border-radius: 3px;
  background: hsl(var(--muted) / .5); padding: 12px 14px;
}
.codetag label { margin-bottom: 4px; }
input.codefield {
  font-family: var(--font-mono); font-size: 22px; font-weight: 600;
  letter-spacing: .02em; padding: 6px 10px; max-width: 220px;
  background: hsl(var(--background));
}
.codetag p { margin: 8px 0 0; }

/* The masked ID, and the way through to the whole number. The reveal is a
   quiet control on purpose: it should be findable, not inviting. */
.idcell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.idcell .reveal {
  padding: 1px 6px; font-size: 9.5px; letter-spacing: .07em;
  border-color: hsl(var(--rule)); color: hsl(var(--muted-foreground));
}
.idcell .reveal:hover {
  background: hsl(var(--foreground)); border-color: hsl(var(--foreground));
  color: hsl(var(--background));
}
/* A revealed number is marked as the temporary, watched thing it is. */
.revealed {
  background: hsl(var(--primary) / .34); padding: 1px 5px; border-radius: 2px;
  font-weight: 500; letter-spacing: .02em;
  animation: revealIn var(--fast) var(--ease);
}
@keyframes revealIn { from { opacity: 0 } to { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .revealed { animation: none; } }

/* Signature thumbnails are captured on a paper-white pad in both themes, so
   they carry their own ground and only need a rule around them. */
.sigcell { display: block; line-height: 0; }
.sigcell img {
  height: 26px; width: auto; max-width: 100%; background: #fff;
  border: 1px solid hsl(var(--rule)); border-radius: 2px; padding: 1px;
}
.sigcell:hover img { border-color: hsl(var(--primary)); }
table.dg td.trunc { max-width: 640px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

table.dg td.edit { padding: 0; }
table.dg td.edit input, table.dg td.edit select {
  border: 0; border-radius: 0; background: transparent; padding: 8px 11px; font-size: 13px;
}
table.dg td.edit input:focus, table.dg td.edit select:focus {
  box-shadow: inset 0 0 0 2px hsl(var(--primary)); background: hsl(var(--card));
}
table.dg td.bad input { background: hsl(var(--destructive) / .14); }

.gridbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 0; font-size: 12px; color: hsl(var(--muted-foreground));
}
.gridbar b { font-family: var(--font-mono); color: hsl(var(--foreground)); }

/* ── feedback ───────────────────────────────────────────────────────── */
/* Confirmations and errors.
   Previously set in tracked-out uppercase, which is fine for "SAVED." and
   close to unreadable for "Windows has no printer called 'Brother QL-1050'.
   It can see: …". The stamped label keeps the ledger voice; the message
   itself is left in a sentence case a person can actually read at a glance. */
.toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 100;
  display: flex; align-items: flex-start; gap: 11px;
  transform: translateX(-50%) translateY(160%);
  background: hsl(var(--foreground)); color: hsl(var(--background));
  padding: 11px 17px; border-radius: var(--radius);
  font-size: var(--t-small); font-weight: 500; line-height: 1.45;
  text-align: left; box-shadow: var(--shadow-lg);
  transition: transform var(--mid) var(--ease), opacity var(--mid) var(--ease);
  opacity: 0; max-width: min(560px, 92vw);
}
.toast.on { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.bad { background: hsl(var(--destructive)); color: #fff; }
.toast .tlabel {
  flex: 0 0 auto; font-size: var(--t-stamp); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; padding-top: 1px;
  color: hsl(var(--primary));
}
.toast.bad .tlabel { color: #fff; opacity: .85; }
.toast .tmsg { flex: 1 1 auto; min-width: 0; }

.msg {
  padding: 11px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 15px;
  border-left: 3px solid transparent;
}
.msg.bad  { background: hsl(var(--destructive) / .1); color: hsl(var(--destructive));
            border-left-color: hsl(var(--destructive)); }
.msg.good { background: hsl(var(--success) / .12); color: hsl(var(--success));
            border-left-color: hsl(var(--success)); }
.msg.gold { background: hsl(var(--primary) / .2); color: hsl(var(--foreground));
            border-left-color: hsl(var(--primary)); }

.empty {
  text-align: center; color: hsl(var(--muted-foreground)); padding: 46px 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
/* The richer version: an empty screen should say why it is empty and what to
   do about it, not just stamp NOTHING TO SHOW and leave you there. */
.emptybox {
  display: grid; justify-items: center; gap: 12px; text-align: center;
  padding: 46px 22px; color: hsl(var(--muted-foreground));
}
.emptybox h3 {
  font-family: var(--font-display); font-size: 16px; font-weight: 650;
  letter-spacing: -.015em; color: hsl(var(--foreground));
}
.emptybox p { margin: 0; max-width: 46ch; font-size: var(--t-small); line-height: 1.5; }
.emptybox .row { justify-content: center; }

/* "Load more" under a register. Deliberately full width and quiet — it is a
   continuation of the table, not a call to action. */
.loadmore {
  width: 100%; border: 1px solid hsl(var(--border)); border-top: 0;
  background: hsl(var(--muted) / .4); color: hsl(var(--muted-foreground));
  padding: 12px; border-radius: 0;
}
.loadmore:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.muted { color: hsl(var(--muted-foreground)); }
.tiny  { font-size: var(--t-tiny); line-height: 1.5; }
kbd {
  font-family: var(--font-mono); font-size: 10.5px; padding: 2px 5px;
  border: 1px solid hsl(var(--rule)); border-bottom-width: 2px; border-radius: 2px;
  background: hsl(var(--card)); color: hsl(var(--muted-foreground));
}
details > summary {
  cursor: pointer; font-family: var(--font-body); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
}
details > summary::marker { color: hsl(var(--primary)); }

/* ── branding ───────────────────────────────────────────────────────── */
/* The logo's own gold underline with its triangular notch, reused as a rule. */
.brandrule {
  position: relative; height: 5px; margin: 32px 0 6px;
  background: hsl(var(--primary)); border-radius: 0;
}
.brandrule::after {
  content: ""; position: absolute; right: 24px; bottom: 100%;
  border-left: 12px solid transparent; border-right: 12px solid transparent;
  border-bottom: 14px solid hsl(var(--primary));
}
.brandrule:first-child { margin-top: 0; }
.brandmark { display: grid; place-items: center; gap: 12px; padding: 42px 20px;
             color: hsl(var(--muted-foreground)); }
.brandmark .logo { opacity: .3; }

.danger-hint { color: hsl(var(--muted-foreground)); border-color: transparent; }
.danger-hint:hover { color: #fff; background: hsl(var(--destructive)) !important; }

/* ── modal ──────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center;
  background: hsl(30 10% 8% / .55); padding: 18px; animation: fadeIn .14s ease-out;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal .sheet {
  width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: hsl(var(--card)); border: 1px solid hsl(var(--foreground) / .5);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
  animation: sheetPop .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes sheetPop {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .modal, .modal .sheet { animation: none; }
  button:active, .btn:active { transform: none; }
  .bar .fill { transition: none; }
}
.modal header, .modal footer {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
}
.modal header {
  border-bottom: 2px solid hsl(var(--foreground));
  background: hsl(var(--primary) / .22);
}
.modal header h2 { font-size: 11px; letter-spacing: .14em; }
.modal footer { border-top: 1px solid hsl(var(--rule)); background: hsl(var(--muted) / .5); }
.sheetbody { overflow: auto; padding: 22px; }

/* A printer setup guide needs to be easy to use while standing at the machine. */
.print-setup-sheet { width: min(780px, 100%); }
.setup-lead { margin: 0 0 17px; max-width: 68ch; color: hsl(var(--muted-foreground)); }
.setup-steps { display: grid; gap: 12px; margin: 0; padding-left: 25px; }
.setup-steps li { padding-left: 4px; font-size: var(--t-small); line-height: 1.55; }
.setup-steps b { display: block; color: hsl(var(--foreground)); }
.setup-steps code { display: inline-block; margin-top: 4px; padding: 2px 5px; background: hsl(var(--muted)); border: 1px solid hsl(var(--rule)); border-radius: 2px; font-size: 10.5px; overflow-wrap: anywhere; }
.setup-steps em { font-style: normal; font-weight: 700; }
.print-setup-sheet .msg { margin: 18px 0 0; font-size: var(--t-small); }

/* ── sign-in ────────────────────────────────────────────────────────── */
.authwrap { position: relative; }
.authwrap::before {
  content: ""; position: absolute; left: 50%; top: -110px; width: 440px; height: 440px;
  transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(circle, hsl(var(--primary) / .18), transparent 66%);
}
.authwrap > * { position: relative; }

/* ── new-report signal ──────────────────────────────────────────────── */
.navbadge {
  display: inline-block; margin-left: 7px; min-width: 17px; padding: 0 5px;
  border-radius: 2px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  line-height: 17px; text-align: center;
}
.alertcard {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
  background: hsl(var(--primary) / .18);
  border-top: 2px solid hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--rule));
  padding: 14px 16px;
}
.alertdot {
  width: 8px; height: 8px; background: hsl(var(--primary)); flex: 0 0 auto;
  box-shadow: 0 0 0 4px hsl(var(--primary) / .3); animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px hsl(var(--primary) / .08); } }
@media (prefers-reduced-motion: reduce) { .alertdot { animation: none; } }
.newdot {
  display: inline-block; width: 6px; height: 6px; background: hsl(var(--primary));
  margin-right: 8px; vertical-align: middle;
}

.appfoot {
  display: flex; align-items: center; gap: 12px; max-width: 1360px;
  margin: 0 auto; padding: 18px 22px 34px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); border-top: 1px solid hsl(var(--rule));
}
.appfoot .logo { opacity: .55; }

@media (max-width: 760px) {
  main { padding: 18px 13px 72px; }
  .bar { grid-template-columns: 104px 1fr 44px; }
  .topbar { padding: 0 11px; }
  .topbar .brand { border-right: 0; padding-right: 10px; }
  .nav a { padding: 10px 10px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
}

/* ============================================================================
   GUIDANCE — tooltips, skeletons, the tour, the getting-started checklist

   Everything here exists to answer a question a new person would otherwise
   have to ask someone. Student assistants turn over every semester, so the
   interface has to teach itself; "ask Dave" is not a feature.
   ========================================================================= */

/* ── tooltips ───────────────────────────────────────────────────────── */
/* One floating element reused for every tip, positioned in JS. A tooltip per
   trigger would mean hundreds of absolutely-positioned nodes in a 100-row
   grid, and they would each need clipping out of the scroll container. */
#tip {
  position: fixed; z-index: 400; max-width: 280px; pointer-events: none;
  background: hsl(var(--foreground)); color: hsl(var(--background));
  font-family: var(--font-body); font-size: var(--t-tiny); font-weight: 500;
  line-height: 1.45; letter-spacing: 0; text-transform: none; text-align: left;
  padding: 7px 10px; border-radius: var(--radius); box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(3px);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
#tip.on { opacity: 1; transform: none; }
#tip kbd {
  background: hsl(var(--background) / .18); color: inherit;
  border-color: hsl(var(--background) / .3);
}
#tip b { color: hsl(var(--primary)); font-weight: 700; }

/* ── skeletons ──────────────────────────────────────────────────────── */
/* A shape where the content will be, rather than the word "Loading…". The
   difference is whether the screen looks broken for 400ms or merely busy. */
.sk { display: block; background: hsl(var(--muted)); border-radius: 2px; position: relative;
      overflow: hidden; }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, hsl(var(--foreground) / .06), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.25s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-head { display: grid; gap: 9px; margin-bottom: 22px; }
.sk-rows { border-top: 2px solid hsl(var(--foreground)); }
.sk-rows .sk-row {
  display: grid; grid-template-columns: 108px 1fr 128px 92px; gap: 18px;
  align-items: center; padding: 11px 12px; border-bottom: 1px solid hsl(var(--border));
}
.sk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
            border-top: 2px solid hsl(var(--foreground));
            border-bottom: 1px solid hsl(var(--rule)); }
.sk-tiles > div { padding: 13px 18px 15px; border-right: 1px solid hsl(var(--rule)); }
.sk-tiles > div:last-child { border-right: 0; }

/* Skeletons must not outlive their purpose. If the fetch is quick the shimmer
   never gets a chance to look like a stuck page, so it fades in rather than
   appearing instantly. */
.skwrap { animation: skIn .18s var(--ease) both; animation-delay: .12s; }
@keyframes skIn { from { opacity: 0 } to { opacity: 1 } }

/* ── the getting-started checklist ──────────────────────────────────── */
.checklist { border-top: 2px solid hsl(var(--foreground)); margin-bottom: 24px; }
.checklist .ck {
  display: flex; align-items: flex-start; gap: 14px; padding: 13px 4px;
  border-bottom: 1px solid hsl(var(--border));
}
.checklist .ck:last-child { border-bottom: 1px solid hsl(var(--rule)); }
.checklist .box {
  flex: 0 0 auto; width: 17px; height: 17px; margin-top: 2px;
  border: 1.5px solid hsl(var(--rule)); border-radius: 2px;
  display: grid; place-items: center; font-size: 11px; color: transparent;
}
.checklist .ck.done .box {
  background: hsl(var(--primary)); border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.checklist .ck.done .what { color: hsl(var(--muted-foreground)); text-decoration: line-through;
                            text-decoration-color: hsl(var(--rule)); }
.checklist .body { flex: 1 1 auto; min-width: 0; }
.checklist .what { font-weight: 650; font-size: var(--t-small); }
.checklist .why { margin: 2px 0 0; font-size: var(--t-tiny); color: hsl(var(--muted-foreground)); }

/* A one-time, route-specific nudge. It is intentionally part of the page
   flow—not a toast—so there is time to read it without blocking the task. */
.context-hint {
  display: flex; align-items: flex-start; gap: 18px; margin: -4px 0 22px;
  padding: 13px 15px; border-left: 3px solid hsl(var(--primary));
  border-bottom: 1px solid hsl(var(--rule)); background: hsl(var(--primary) / .1);
  animation: hintIn var(--mid) var(--ease) both;
}
.context-hint > div { flex: 1 1 auto; min-width: 0; }
.context-hint .stamp { display: block; margin-bottom: 3px; color: hsl(var(--muted-foreground)); }
.context-hint strong { display: block; font-size: var(--t-small); font-weight: 700; }
.context-hint p { max-width: 76ch; margin: 2px 0 0; font-size: var(--t-small); line-height: 1.48; color: hsl(var(--muted-foreground)); }
.context-hint button { flex: 0 0 auto; margin-top: 3px; }
@keyframes hintIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

/* ── the tour ───────────────────────────────────────────────────────── */
/* A hole cut in a dimming layer, rather than a modal that describes the thing
   it is covering up. The hole is drawn with a very large spread shadow so
   there is one element to position and nothing to keep in sync. */
#tourveil {
  position: fixed; inset: 0; z-index: 500; pointer-events: auto;
  animation: fadeIn var(--fast) ease-out;
}
#tourhole {
  position: fixed; border-radius: var(--radius); pointer-events: none;
  box-shadow: 0 0 0 9999px hsl(30 10% 8% / .62), 0 0 0 2px hsl(var(--primary));
  transition: top var(--mid) var(--ease), left var(--mid) var(--ease),
              width var(--mid) var(--ease), height var(--mid) var(--ease);
}
#tourstep {
  position: fixed; z-index: 501; width: min(360px, calc(100vw - 28px));
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--foreground) / .5); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transition: top var(--mid) var(--ease), left var(--mid) var(--ease);
}
#tourstep header {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  border-bottom: 2px solid hsl(var(--foreground)); background: hsl(var(--primary) / .22);
}
#tourstep header h2 {
  font-size: var(--t-stamp); letter-spacing: .14em; text-transform: uppercase;
  font-family: var(--font-body); font-weight: 700;
}
#tourstep .tourbody { padding: 15px 16px; font-size: var(--t-small); line-height: 1.55; }
#tourstep .tourbody p { margin: 0 0 9px; }
#tourstep .tourbody p:last-child { margin-bottom: 0; }
#tourstep footer {
  display: flex; align-items: center; gap: 9px; padding: 11px 16px;
  border-top: 1px solid hsl(var(--rule)); background: hsl(var(--muted) / .5);
}
#tourstep .dots { display: flex; gap: 5px; margin-right: auto; }
#tourstep .dots i {
  width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--rule));
  transition: background var(--fast) var(--ease);
}
#tourstep .dots i.on { background: hsl(var(--primary)); }

/* The help control that restarts it. Never hide the way back in. */
.helpbtn {
  border: 1px solid hsl(var(--rule)); background: transparent; padding: 0;
  width: 23px; height: 23px; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 12px; font-weight: 700;
  color: hsl(var(--muted-foreground)); letter-spacing: 0; text-transform: none;
}
.helpbtn:hover { background: hsl(var(--primary)); border-color: hsl(var(--primary));
                 color: hsl(var(--primary-foreground)); }

@media (prefers-reduced-motion: reduce) {
  .sk::after { animation: none; }
  .skwrap { animation: none; }
  .context-hint { animation: none; }
  #tourhole, #tourstep { transition: none; }
  #tip { transition: none; }
}

/* ============================================================================
   MOTION & CHARACTER

   Rules this layer follows, because this is a tool somebody uses forty times a
   shift and not a landing page:

     1. Animate on ARRIVAL, never on repetition. A view entering may flourish;
        a button clicked for the ninetieth time may not.
     2. Transform and opacity only. Nothing here causes a reflow.
     3. Nothing blocks input. Every animation is decorative; a row is clickable
        before it has finished settling.
     4. All of it collapses under prefers-reduced-motion.

   The vocabulary comes from the same place as the rest: rubber stamps, marker
   pens, a register being filled in by hand.
   ========================================================================= */

/* ── the marker pen ─────────────────────────────────────────────────── */
/* The gold swipe behind the live nav tab is drawn, not merely shown: a stroke
   pulled left to right, with the slightly uneven ends a real marker leaves. */
.nav a.on::after {
  transform-origin: left center;
  animation: swipe .34s cubic-bezier(.3,.9,.35,1) both;
  border-radius: 1px 3px 2px 1px;
}
@keyframes swipe {
  from { transform: scaleX(0) skewX(-12deg); opacity: .5; }
  to   { transform: scaleX(1) skewX(0);      opacity: 1; }
}
.nav a:not(.on)::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px; height: 9px;
  background: hsl(var(--primary) / .5); z-index: -1;
  transform: scaleX(0); transform-origin: left center;
  transition: transform .22s cubic-bezier(.3,.9,.35,1);
  border-radius: 1px 3px 2px 1px;
}
.nav a:not(.on):hover::after { transform: scaleX(1); }
.nav a:hover { background: transparent; }

/* ── the view settles in ────────────────────────────────────────────── */
/* The resting state is the FINISHED state and the animation only ever adds to
   it. `both` would leave opacity:0 painted during the delay, so a tab that
   never gets to run the animation -- restored from bfcache, or a browser that
   drops it -- would show a blank page. `backwards` alone has the same hazard,
   so the rule sets no starting opacity of its own: `rise` fades in from 0 and
   the element's own default is already 1. */
#view > * { animation: rise var(--slow) var(--ease) backwards; }
#view > *:nth-child(1) { animation-delay: 0ms; }
#view > *:nth-child(2) { animation-delay: 40ms; }
#view > *:nth-child(3) { animation-delay: 75ms; }
#view > *:nth-child(4) { animation-delay: 105ms; }
#view > *:nth-child(n+5) { animation-delay: 130ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}

/* ── the register fills in ──────────────────────────────────────────── */
/* Rows arrive in sequence, the way a ledger is written down a page. Capped at
   twelve: past that the stagger stops reading as intent and starts reading as
   lag. */
table.dg tbody tr { animation: rowin .3s cubic-bezier(.2,.85,.3,1) both; }
@keyframes rowin {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}
table.dg tbody tr:nth-child(1)  { animation-delay: 0ms }
table.dg tbody tr:nth-child(2)  { animation-delay: 14ms }
table.dg tbody tr:nth-child(3)  { animation-delay: 28ms }
table.dg tbody tr:nth-child(4)  { animation-delay: 42ms }
table.dg tbody tr:nth-child(5)  { animation-delay: 56ms }
table.dg tbody tr:nth-child(6)  { animation-delay: 70ms }
table.dg tbody tr:nth-child(7)  { animation-delay: 84ms }
table.dg tbody tr:nth-child(8)  { animation-delay: 98ms }
table.dg tbody tr:nth-child(9)  { animation-delay: 112ms }
table.dg tbody tr:nth-child(10) { animation-delay: 126ms }
table.dg tbody tr:nth-child(11) { animation-delay: 140ms }
table.dg tbody tr:nth-child(12) { animation-delay: 154ms }
table.dg tbody tr:nth-child(n+13) { animation-delay: 168ms }

/* A gold marker slides down the gutter of the row under the cursor. */
table.dg tbody tr { position: relative; }
table.dg tbody tr td:first-child { position: relative; }
table.dg tbody tr td:first-child::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: hsl(var(--primary)); transform: scaleY(0); transform-origin: top;
  transition: transform .16s cubic-bezier(.3,.9,.35,1);
}
table.dg tbody tr:hover td:first-child::before { transform: scaleY(1); }
table.dg tbody tr.rowactivatable { cursor: pointer; }
table.dg tbody tr.rowactivatable:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: -2px; }

/* A claim opens the actual inventory record in place, so the office never
   loses its place in the claims register while checking an item. */
.item-record-sheet { width: min(940px, 100%); }
.item-record-sheet header h2 { margin-top: 2px; }
.item-record-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 300px); gap: 22px; }
.item-record-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 2px solid hsl(var(--foreground)); }
.record-field { min-width: 0; padding: 11px 12px; border-bottom: 1px solid hsl(var(--rule)); border-right: 1px solid hsl(var(--rule)); }
.record-field:nth-child(even) { border-right: 0; }
.record-field.wide { grid-column: 1 / -1; border-right: 0; }
.record-field span { display: block; margin-bottom: 3px; font-size: var(--t-stamp); font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.record-field strong { display: block; font-size: var(--t-small); font-weight: 600; overflow-wrap: anywhere; }
.item-record-photo { min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 10px; border: 1px solid hsl(var(--rule)); background: hsl(var(--muted) / .45); text-align: center; text-decoration: none; font-size: var(--t-small); font-weight: 700; }
.item-record-photo img { display: block; max-width: 100%; max-height: 310px; object-fit: contain; }
.item-record-photo small { font-weight: 500; color: hsl(var(--muted-foreground)); }
.item-record-photo.empty { color: hsl(var(--muted-foreground)); font-weight: 500; }
.item-record-history { margin-top: 25px; }
.item-record-history > .stamp { display: block; margin-bottom: 8px; }
.mini-register { border-top: 2px solid hsl(var(--foreground)); }
.mini-register > div { display: grid; grid-template-columns: 110px minmax(140px, 1fr) 110px 120px; align-items: center; gap: 10px; padding: 9px 10px; border-bottom: 1px solid hsl(var(--rule)); font-size: var(--t-small); }
@media (max-width: 650px) { .item-record-layout { grid-template-columns: 1fr; } .mini-register > div { grid-template-columns: 1fr 1fr; } }

/* ── the tally ticks over ───────────────────────────────────────────── */
.stat { position: relative; overflow: hidden; }
.stat .n { transition: color .2s; }
/* A hairline sweeps under the figure as the count lands. */
.stat::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px;
  background: hsl(var(--primary)); transform: scaleX(0); transform-origin: left;
  transition: transform .4s cubic-bezier(.2,.85,.3,1);
}
.stat.counted::after { transform: scaleX(1); }
.stat:hover .n { color: hsl(var(--primary)); }

/* ── data draws itself ──────────────────────────────────────────────── */
.bar .fill { transform-origin: left center; transform: scaleX(1); }
.bars.drawn .fill { animation: draw .55s cubic-bezier(.2,.85,.25,1) backwards; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bars.drawn .bar:nth-child(1)  .fill { animation-delay: 30ms }
.bars.drawn .bar:nth-child(2)  .fill { animation-delay: 60ms }
.bars.drawn .bar:nth-child(3)  .fill { animation-delay: 90ms }
.bars.drawn .bar:nth-child(4)  .fill { animation-delay: 120ms }
.bars.drawn .bar:nth-child(5)  .fill { animation-delay: 150ms }
.bars.drawn .bar:nth-child(6)  .fill { animation-delay: 180ms }
.bars.drawn .bar:nth-child(7)  .fill { animation-delay: 210ms }
.bars.drawn .bar:nth-child(8)  .fill { animation-delay: 240ms }
.bars.drawn .bar:nth-child(n+9) .fill { animation-delay: 270ms }
.bar { transition: background .14s; }
.bar:hover { background: hsl(var(--primary) / .09); }
.bar:hover .v { color: hsl(var(--foreground)); font-weight: 500; }

/* ── the returned stamp ─────────────────────────────────────────────── */
/* An item that has gone home is stamped, not badged: slight rotation, a
   doubled rule, letters pushed apart. The look of an inked hand stamp. */
.badge.success {
  transform: rotate(-1.6deg);
  border: 1.5px solid hsl(var(--success) / .55);
  box-shadow: 0 0 0 1.5px hsl(var(--background)), 0 0 0 2.5px hsl(var(--success) / .22);
  letter-spacing: .14em; padding: 2px 8px;
}
tr:hover .badge.success { animation: stamp .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes stamp {
  0%   { transform: rotate(-1.6deg) scale(1); }
  35%  { transform: rotate(-4deg) scale(1.09); }
  100% { transform: rotate(-1.6deg) scale(1); }
}

/* ── the toast stamps down ──────────────────────────────────────────── */
.toast {
  transition: transform .26s cubic-bezier(.2,1.25,.35,1), opacity .18s;
  opacity: 0;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0) rotate(-.5deg); }

/* ── item codes read as tags ────────────────────────────────────────── */
/* A punched eyelet on the left, the way a luggage tag is threaded. */
table.dg td.code { position: relative; padding-left: 22px; }
table.dg td.code::before {
  content: ""; position: absolute; left: 11px; top: 50%; width: 5px; height: 5px;
  margin-top: -2.5px; border-radius: 50%;
  border: 1px solid hsl(var(--muted-foreground) / .55);
  transition: border-color .16s, background .16s;
}
table.dg tbody tr:hover td.code::before {
  border-color: hsl(var(--primary)); background: hsl(var(--primary));
}

/* ── loading has a pulse ────────────────────────────────────────────── */
.empty { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .5 } }

/* ── the brand rule draws out ───────────────────────────────────────── */
.brandrule {
  transform-origin: left center;
  animation: rule .5s cubic-bezier(.2,.85,.25,1) both;
}
@keyframes rule { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ── buttons acknowledge ────────────────────────────────────────────── */
button, .btn { position: relative; overflow: hidden; isolation: isolate; }
button.primary::after, .btn.primary::after {
  content: ""; position: absolute; inset: 0; background: hsl(var(--foreground));
  transform: scaleX(0); transform-origin: left; z-index: -1;
  transition: transform .2s cubic-bezier(.3,.9,.35,1);
}
button.primary:hover::after, .btn.primary:hover::after { transform: scaleX(1); }

/* ── scrollbars are part of the surface ─────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: hsl(var(--rule)) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: hsl(var(--rule)); border: 3px solid hsl(var(--background));
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: hsl(var(--primary)); }
::-webkit-scrollbar-corner { background: transparent; }

.alertcard { animation: rise .38s cubic-bezier(.2,.85,.3,1) both; }

/* ── everything off, on request ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #view > *, table.dg tbody tr, .bars.drawn .fill, .brandrule,
  .nav a.on::after, .alertcard, .empty, tr:hover .badge.success {
    animation: none !important;
  }
  table.dg tbody tr td:first-child::before,
  .nav a:not(.on)::after,
  button.primary::after, .btn.primary::after { transition: none; }
  .stat::after { transition: none; transform: scaleX(1); }
}

/* ── command palette ────────────────────────────────────────────────── */
/* shadcn's Command behaviour, wearing this project's clothes: a terminal
   prompt rather than a rounded search card. */
.cmdk {
  position: fixed; inset: 0; z-index: 300; display: grid;
  place-items: start center; padding: 12vh 18px 18px;
  background: hsl(30 10% 8% / .5); animation: fadeIn .12s ease-out;
}
.cmdk[hidden] { display: none; }
.cmdk-sheet {
  width: min(660px, 100%); display: flex; flex-direction: column;
  background: hsl(var(--card)); border: 2px solid hsl(var(--foreground));
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
  animation: cmdkIn .22s cubic-bezier(.2,.95,.3,1);
}
@keyframes cmdkIn {
  from { opacity: 0; transform: translateY(-10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.cmdk-input {
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-bottom: 1px solid hsl(var(--rule)); background: hsl(var(--primary) / .16);
}
.cmdk-prompt {
  font-family: var(--font-mono); font-size: 15px; font-weight: 500;
  color: hsl(var(--foreground)); opacity: .55;
}
.cmdk-input input {
  flex: 1; border: 0; background: transparent; padding: 15px 0;
  font-family: var(--font-body); font-size: 15px; border-radius: 0;
}
.cmdk-input input:focus { box-shadow: none; border: 0; }
.cmdk-list { overflow: auto; max-height: 52vh; padding: 6px 0; }
.cmdk-group {
  padding: 9px 15px 5px; font-size: 9.5px; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.cmdk-row {
  display: flex; align-items: baseline; gap: 11px; width: 100%;
  padding: 9px 15px; border: 0; border-radius: 0; background: transparent;
  text-align: left; text-transform: none; letter-spacing: 0;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 500;
  color: hsl(var(--foreground)); cursor: pointer; overflow: hidden;
}
.cmdk-row:hover { background: transparent; color: hsl(var(--foreground)); }
/* One highlight, driven by the keyboard, so hover never fights the caret. */
.cmdk-row.on { background: hsl(var(--primary) / .26); }
.cmdk-row.on::before {
  content: ""; position: absolute; left: 0; width: 3px; height: 22px;
  background: hsl(var(--primary));
}
.cmdk-row { position: relative; }
.cmdk-code {
  font-family: var(--font-mono); font-size: 12px; color: hsl(var(--muted-foreground));
  flex: 0 0 auto; min-width: 62px;
}
.cmdk-row.on .cmdk-code { color: hsl(var(--foreground)); }
.cmdk-main { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-hint {
  font-size: 11.5px; color: hsl(var(--muted-foreground));
  flex: 0 0 auto; max-width: 42%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.cmdk-empty {
  padding: 28px 15px; text-align: center; font-size: 10.5px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: hsl(var(--muted-foreground));
}
.cmdk-foot {
  display: flex; align-items: center; gap: 14px; padding: 8px 15px;
  border-top: 1px solid hsl(var(--rule)); background: hsl(var(--muted) / .5);
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: hsl(var(--muted-foreground));
}
.cmdk-foot kbd { margin-right: 3px; }

/* The hint in the top bar that the palette exists at all. */
.cmdk-cue {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid hsl(var(--rule)); border-radius: var(--radius);
  padding: 4px 9px; background: transparent;
  font-family: var(--font-body); font-size: 10.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.cmdk-cue:hover { border-color: hsl(var(--foreground)); color: hsl(var(--foreground));
                  background: transparent; }
.cmdk-cue kbd { font-size: 9.5px; padding: 1px 4px; }

@media (prefers-reduced-motion: reduce) {
  .cmdk, .cmdk-sheet { animation: none; }
}
@media (max-width: 640px) { .cmdk-hint { display: none; } }

/* ============================================================================
   Beach Lost & Found — Return Ticket rebuild

   The original application remains the workflow reference. This layer changes
   the visual system around it: white-first CSULB color usage, the supplied
   Operations Department lockups, and a live handoff ticket instead of an
   equal-weight dashboard of cards.
   ========================================================================== */

:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 0%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 0%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 0%;
  --primary: 43.23 100% 46.27%; /* CSULB gold #ECAA00 */
  --primary-foreground: 0 0% 0%;
  --secondary: 0 0% 96%;
  --secondary-foreground: 0 0% 0%;
  --muted: 0 0% 96%;
  --muted-foreground: 150 0.88% 44.31%; /* CSULB gray #707271 */
  --accent: 49.72 100% 57.65%; /* CSULB light gold #FFDA27 */
  --accent-foreground: 0 0% 0%;
  --border: 0 0% 82%;
  --rule: 150 0.88% 44.31%;
  --input: 0 0% 68%;
  --ring: 43.23 100% 46.27%;
  --radius: 14px;
  --shadow-sm: none;
  --shadow: 0 12px 28px hsl(0 0% 0% / .08);
  --shadow-md: 0 18px 36px hsl(0 0% 0% / .1);
  --shadow-lg: 0 24px 56px hsl(0 0% 0% / .18);
  --t-display: clamp(2rem, 3.2vw, 3.35rem);
  --t-section: clamp(1.25rem, 1.8vw, 1.7rem);
}

.dark {
  --background: 0 0% 8%;
  --foreground: 0 0% 100%;
  --card: 0 0% 12%;
  --card-foreground: 0 0% 100%;
  --popover: 0 0% 12%;
  --popover-foreground: 0 0% 100%;
  --primary: 49.72 100% 57.65%;
  --primary-foreground: 0 0% 0%;
  --secondary: 0 0% 17%;
  --secondary-foreground: 0 0% 100%;
  --muted: 0 0% 17%;
  --muted-foreground: 0 0% 70%;
  --accent: 43 80% 24%;
  --accent-foreground: 0 0% 100%;
  --border: 0 0% 28%;
  --rule: 0 0% 48%;
  --input: 0 0% 42%;
  --ring: 49.72 100% 57.65%;
}

html { scrollbar-gutter: stable; }
body { background: hsl(var(--background)); caret-color: hsl(var(--primary)); }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.03em; }
h1 { line-height: .98; }
h2 { line-height: 1.08; }
a { text-underline-offset: .2em; }
::selection { background: #ffda27; color: #000; }

.logo { display: block; object-fit: contain; }
.logo-mark { border-radius: 50%; }
.logo-full { width: min(100%, var(--logo-width, 268px)); height: auto; }
.topbar {
  min-height: 84px; gap: 8px; padding: 7px clamp(14px, 2.4vw, 34px);
  border-bottom: 1px solid hsl(var(--foreground)); background: hsl(var(--background));
  box-shadow: none;
}
.topbar .brand { padding: 0 20px 0 0; margin: 0; border-right: 1px solid hsl(var(--border)); }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-lockup { width: 136px; height: auto; max-height: 56px; object-fit: contain; }
.brand-app-name { max-width: 114px; font-family: var(--font-display); font-size: 13px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.nav { align-items: stretch; gap: 2px; }
.nav a { min-height: 54px; padding: 0 11px; color: hsl(var(--foreground)); font-size: 12px; font-weight: 650; letter-spacing: -.005em; }
.nav a.on { background: hsl(var(--primary)); }
.nav a.on::after, .nav a:not(.on)::after { display: none; }
.nav a:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.who { position: relative; gap: 9px; padding: 0 0 0 14px; border-left: 1px solid hsl(var(--border)); }
.who b { font-size: 12px; }
.assist-cue, .cmdk-cue {
  border: 1px solid hsl(var(--foreground)); border-radius: 999px; background: hsl(var(--background));
  color: hsl(var(--foreground)); padding: 6px 10px; font-size: 11px; font-weight: 700;
  letter-spacing: .01em; text-transform: none;
}
.assist-cue { background: hsl(var(--primary)); }
.assist-cue:hover, .cmdk-cue:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.smart-help-menu {
  position: absolute; z-index: 80; top: calc(100% + 10px); right: 0; width: min(390px, calc(100vw - 28px));
  display: grid; gap: 14px; padding: 18px; background: hsl(var(--card)); border: 1px solid hsl(var(--foreground));
  border-radius: 14px; box-shadow: var(--shadow-md); animation: help-arrive .22s var(--ease) both;
}
.guide-top { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.guide-top h2 { margin: 0; font-family: var(--font-display); font-size: 21px; letter-spacing: -.025em; }
.guide-top p { margin: 4px 0 0; color: hsl(var(--muted-foreground)); font-size: 12px; line-height: 1.45; }
.guide-close { min-height: 30px; padding: 4px 7px; flex: 0 0 auto; border-color: hsl(var(--border)); background: transparent; color: hsl(var(--muted-foreground)); }
.guide-close:hover { color: hsl(var(--foreground)); background: hsl(var(--secondary)); }
.guide-wayfinding { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; height: 14px; isolation: isolate; }
.guide-wayfinding::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 6px; height: 1px; background: hsl(var(--border)); }
.guide-wayfinding span { width: 8px; height: 8px; justify-self: start; border: 1px solid hsl(var(--foreground)); border-radius: 50%; background: hsl(var(--card)); opacity: .62; }
.guide-wayfinding span:nth-child(2) { justify-self: center; }
.guide-wayfinding span:nth-child(3) { justify-self: end; }
.guide-prompts { display: flex; flex-wrap: wrap; gap: 7px; }
.guide-prompts button { min-height: 31px; width: auto; padding: 5px 8px; border-color: hsl(var(--border)); background: hsl(var(--secondary)); color: hsl(var(--foreground)); font-size: 11px; text-transform: none; letter-spacing: 0; }
.guide-prompts button:hover { background: hsl(var(--accent)); }
.guide-form { display: grid; gap: 7px; }
.guide-form label { font-size: 12px; font-weight: 750; }
.guide-form textarea { min-height: 76px; resize: vertical; font-size: 13px; line-height: 1.42; }
.guide-form-actions { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.guide-form-actions p { max-width: 24ch; margin: 0; color: hsl(var(--muted-foreground)); font-size: 10.5px; line-height: 1.35; }
.guide-form-actions button { min-height: 34px; flex: 0 0 auto; }
.guide-answer { min-height: 0; overflow: hidden; }
.guide-answer:has(p) { padding: 12px; border: 1px solid hsl(var(--border)); background: hsl(var(--secondary)); border-radius: 10px; }
.guide-answer p { margin: 0; color: hsl(var(--foreground)); font-size: 12px; line-height: 1.48; white-space: pre-wrap; }
.guide-answer p.guide-problem { color: #942222; }
.guide-next { display: inline-flex; align-items: center; min-height: 30px; margin-top: 10px; padding: 4px 8px; border: 1px solid hsl(var(--foreground)); border-radius: 8px; color: hsl(var(--foreground)); font-size: 11px; font-weight: 750; text-decoration: none; }
.guide-next:hover { background: hsl(var(--accent)); }
.guide-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding-top: 2px; border-top: 1px solid hsl(var(--border)); }
.guide-tools a, .guide-tools button { display: grid; place-items: center; min-height: 38px; padding: 6px; border: 0; background: transparent; color: hsl(var(--foreground)); font-size: 10.5px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; text-transform: none; letter-spacing: 0; }
.guide-tools a:hover, .guide-tools button:hover { background: hsl(var(--accent)); }
.smart-help-menu.has-answer .guide-wayfinding span { animation: guide-waypoint .48s var(--ease) both; }
.smart-help-menu.has-answer .guide-wayfinding span:nth-child(2) { animation-delay: .1s; }
.smart-help-menu.has-answer .guide-wayfinding span:nth-child(3) { animation-delay: .2s; }
.smart-help-menu.has-answer .guide-answer { animation: guide-answer-arrive .45s var(--ease) both; }
.smart-help-menu.is-thinking .guide-wayfinding span { background: #ffda27; }
@keyframes guide-waypoint { 0% { opacity: .62; transform: translateX(0); } 45% { opacity: 1; background: #ffda27; transform: translateX(4px) scale(1.16); } 100% { opacity: 1; background: #ecaa00; transform: none; } }
@keyframes guide-answer-arrive { from { opacity: .01; clip-path: inset(0 0 100% 0 round 10px); } to { opacity: 1; clip-path: inset(0 0 0 0 round 10px); } }
@keyframes help-arrive { from { opacity: .01; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

main { max-width: 1440px; padding: clamp(24px, 4vw, 56px) clamp(16px, 3vw, 44px) 100px; }
.head { margin-bottom: 14px; }
.head p { color: hsl(var(--muted-foreground)); font-size: 13px; }
.brandrule { height: 25px; margin: 16px 0 28px; background: url("/brand/rule-gold-triangle.png") center / min(100%, 600px) 100% no-repeat; transform-origin: center; }
.brandrule.grey { background-image: url("/brand/rule-grey-triangle.png"); }

.desk-intro { display: flex; justify-content: space-between; align-items: end; gap: 28px; }
.desk-intro-copy { max-width: 58ch; }
.desk-intro-copy p { margin: 12px 0 0; max-width: 57ch; font-size: 15px; color: hsl(var(--muted-foreground)); }
.desk-summary { display: flex; gap: 16px; padding-bottom: 6px; font-size: 12px; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.desk-summary span { display: grid; gap: 2px; }
.desk-summary b { color: hsl(var(--foreground)); font-family: var(--font-display); font-size: 24px; line-height: 1; letter-spacing: -.035em; }
.return-routes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 18px; border-top: 1px solid hsl(var(--foreground)); border-bottom: 1px solid hsl(var(--border)); }
.return-routes a { position: relative; min-height: 108px; display: grid; align-content: center; gap: 7px; padding: 16px 18px; overflow: hidden; border-right: 1px solid hsl(var(--border)); color: hsl(var(--foreground)); text-decoration: none; transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.return-routes a:last-child { border-right: 0; }
.return-routes a::after { content: ""; position: absolute; right: 18px; bottom: 13px; left: 18px; height: 2px; background: #ecaa00; transform: scaleX(0); transform-origin: left; transition: transform .24s var(--ease); }
.return-routes strong { font-family: var(--font-display); font-size: 18px; letter-spacing: -.025em; }
.return-routes span { max-width: 30ch; color: hsl(var(--muted-foreground)); font-size: 12px; line-height: 1.4; }
.return-routes a:hover { background: hsl(var(--accent)); }
.return-routes a:hover span { color: hsl(var(--foreground)); }
.return-routes a:hover::after, .return-routes a:focus-visible::after { transform: scaleX(1); }

.return-ticket { display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, 28%); min-height: 280px; margin: 0 0 28px; border: 1px solid hsl(var(--foreground)); border-top: 7px solid #ecaa00; border-radius: 16px; overflow: hidden; background: hsl(var(--card)); animation: ticket-arrive .5s var(--ease) both; }
.ticket-main { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); padding: clamp(22px, 3vw, 38px); }
.ticket-photo { display: grid; place-items: center; min-height: 190px; overflow: hidden; border: 1px solid hsl(var(--foreground)); border-radius: 12px; background: #ffda27; }
.ticket-photo img { width: 100%; height: 100%; max-height: 250px; object-fit: cover; }
.ticket-photo img[src$="lost-found-logo-circle.png"] { object-fit: contain; padding: 24px; }
.ticket-copy { display: grid; align-content: start; gap: 9px; min-width: 0; }
.ticket-status { min-height: 24px; }
.ticket-copy h2 { max-width: 22ch; font-size: clamp(1.55rem, 2.5vw, 2.65rem); overflow-wrap: anywhere; }
.ticket-meta { margin: 0; color: hsl(var(--muted-foreground)); font-family: var(--font-mono); font-size: 12px; }
.ticket-trail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.ticket-trail li { position: relative; display: grid; gap: 3px; min-width: 0; padding-top: 18px; color: hsl(var(--muted-foreground)); }
.ticket-trail li::before { content: ""; position: absolute; top: 0; left: 0; width: 10px; height: 10px; border: 1px solid hsl(var(--foreground)); border-radius: 50%; background: hsl(var(--background)); }
.ticket-trail li:not(:last-child)::after { content: ""; position: absolute; top: 4px; left: 14px; right: 0; height: 1px; background: hsl(var(--border)); }
.ticket-trail li.done::before, .ticket-trail li.current::before { background: #ecaa00; border-color: #ecaa00; }
.ticket-trail li.current { color: hsl(var(--foreground)); }
.ticket-trail span { font-size: 12px; font-weight: 700; line-height: 1.2; }
.ticket-trail small { max-width: 18ch; font-size: 11px; line-height: 1.35; }
.ticket-side { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: clamp(20px, 2.5vw, 34px); background: hsl(var(--secondary)); border-left: 1px solid hsl(var(--border)); }
.ticket-facts { display: grid; gap: 13px; }
.ticket-facts span { display: flex; align-items: baseline; gap: 8px; color: hsl(var(--muted-foreground)); font-size: 12px; }
.ticket-facts b { color: hsl(var(--foreground)); font-family: var(--font-display); font-size: 23px; letter-spacing: -.035em; }
.ticket-action { width: 100%; min-height: 46px; }
@keyframes ticket-arrive { from { opacity: .01; transform: translateY(14px); clip-path: inset(0 0 18% 0 round 16px); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 16px); } }

.desk-section { margin-top: 40px; }
.register-card { padding: clamp(14px, 2vw, 26px); border-radius: 14px; box-shadow: none; }
.account-section { padding-top: 8px; border-top: 1px solid hsl(var(--border)); }
.card { border-color: hsl(var(--border)); border-radius: 14px; box-shadow: none; }
.gridwrap { border-top-color: hsl(var(--foreground)); border-radius: 0; }
table.dg thead th { background: hsl(var(--background)); }
table.dg tbody tr:hover { background: hsl(var(--accent) / .45); }

input, select, textarea { border-radius: 10px; background: hsl(var(--card)); }
input:focus, select:focus, textarea:focus { border-color: hsl(var(--foreground)); box-shadow: 0 0 0 3px hsl(var(--primary) / .35); }
button, .btn { min-height: 38px; border-radius: 10px; font-size: 12px; letter-spacing: .01em; text-transform: none; transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease); }
button.primary, .btn.primary { background: #ecaa00; border-color: #ecaa00; color: #000; }
button.primary:hover, .btn.primary:hover { background: #000; border-color: #000; color: #fff; }
button.primary::after, .btn.primary::after { display: none; }
.badge { border-radius: 999px; letter-spacing: .06em; }
.badge.gold { background: #ffda27; border-color: #ecaa00; }
.badge.success { transform: none; box-shadow: none; }

.intake-path { display: flex; align-items: center; gap: 0; width: min(640px, 100%); margin: 0 0 18px; border-top: 1px solid hsl(var(--foreground)); border-bottom: 1px solid hsl(var(--border)); }
.intake-path span { flex: 1; padding: 10px 12px; border-right: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); font-size: 12px; font-weight: 650; text-align: center; }
.intake-path span:first-child { background: #ffda27; color: #000; }
.intake-path span:last-child { border-right: 0; }
.field-action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.field-action-row span, .assist-result { color: hsl(var(--muted-foreground)); font-size: 11.5px; line-height: 1.4; }
.field-action-row button { flex: 0 0 auto; background: hsl(var(--secondary)); }
.assist-result { min-height: 18px; margin: 6px 0 0; color: hsl(var(--foreground)); }
.intake-photo-preview { display: block; width: min(260px, 100%); max-height: 200px; margin-top: 10px; object-fit: cover; border: 1px solid hsl(var(--foreground)); border-radius: 10px; }
.intake-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid hsl(var(--border)); }
.intake-actions > div:last-child { display: flex; align-items: center; gap: 8px; }

.appfoot { border-top: 1px solid hsl(var(--border)); background: hsl(var(--secondary)); }
.appfoot .logo-mark { width: 21px; height: 21px; }
.cmdk-sheet { border: 1px solid hsl(var(--foreground)); border-radius: 16px; }
.cmdk-input { background: #ffda27; }
.cmdk-row.on { background: hsl(var(--accent)); }

.auth-shell { width: min(980px, 100%); max-width: 980px; padding: 0; display: grid; grid-template-columns: minmax(260px, .85fr) minmax(300px, 1fr); border: 1px solid hsl(var(--foreground)); border-radius: 16px; overflow: hidden; background: hsl(var(--card)); }
.auth-brand-panel { display: grid; align-content: center; gap: 18px; padding: clamp(28px, 5vw, 60px); background: #111; color: #fff; }
.auth-brand-panel img { width: min(100%, 330px); height: auto; }
.auth-brand-panel h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.auth-brand-panel p { margin: 0; color: #e0e0e0; max-width: 34ch; }
.auth-shell .authwrap { padding: clamp(28px, 5vw, 54px); }

@media (max-width: 1180px) {
  .brand-app-name { display: none; }
  .topbar .brand { padding-right: 12px; }
  .nav a { padding: 0 9px; }
  .who { margin-left: auto; }
}
@media (max-width: 940px) {
  .topbar { align-items: center; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; border-top: 1px solid hsl(var(--border)); }
  .nav a { flex: 0 0 auto; min-height: 44px; }
  .return-ticket { grid-template-columns: 1fr; }
  .ticket-side { border-top: 1px solid hsl(var(--border)); border-left: 0; }
  .ticket-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .topbar { min-height: 0; padding: 7px 14px; }
  .brand-lockup { width: 122px; }
  .who { gap: 6px; border-left: 0; padding-left: 0; }
  #whoami, #themeSwitch, #helpBtn, .cmdk-cue kbd { display: none; }
  .cmdk-cue { padding: 6px 8px; }
  .desk-intro { display: grid; gap: 18px; }
  .desk-summary { white-space: normal; }
  .return-routes { grid-template-columns: 1fr; }
  .return-routes a { min-height: 82px; border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .return-routes a:last-child { border-bottom: 0; }
  .ticket-main { grid-template-columns: 88px minmax(0, 1fr); gap: 16px; padding: 20px; }
  .ticket-photo { min-height: 88px; height: 88px; }
  .ticket-photo img[src$="lost-found-logo-circle.png"] { padding: 12px; }
  .ticket-trail { grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
  .ticket-trail li { grid-template-columns: 94px minmax(0, 1fr); padding: 0 0 0 18px; }
  .ticket-trail li::before { top: 4px; }
  .ticket-trail li:not(:last-child)::after { top: 14px; left: 4px; right: auto; bottom: -5px; width: 1px; height: auto; }
  .ticket-trail small { max-width: none; }
  .ticket-facts { grid-template-columns: 1fr; gap: 8px; }
  .desk-section { margin-top: 32px; }
  .field-action-row { align-items: flex-start; flex-direction: column; }
  .intake-actions > div:last-child { width: 100%; justify-content: space-between; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .return-ticket, .smart-help-menu, .smart-help-menu.has-answer .guide-wayfinding span, .smart-help-menu.has-answer .guide-answer { animation: none; }
  .return-routes a, .return-routes a::after, button, .btn { transition: none; }
}

/* ── Beach Lost & Found Office identity + reports ─────────────────────── */
/* The app-native lockup intentionally sits on a paper-white sign so its
   black lettering remains legible in both office light and dark modes. */
.logo-mark { border-radius: 9px; background: #fff; }
.topbar .brand { display: flex; align-items: center; }
.brand-link {
  gap: 0;
  padding: 4px 7px;
  border: 1px solid #000;
  border-radius: 10px;
  background: #fff;
}
.brand-lockup { width: 184px; max-height: none; }
.brand-app-name { display: none; }
.ticket-photo img[src$="beach-lost-found-mark.svg"] { object-fit: contain; padding: 24px; }

.claim-form-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 24px;
  padding: clamp(18px, 2.7vw, 30px);
  border: 1px solid hsl(var(--foreground));
  border-radius: 14px;
  background: hsl(var(--card));
}
.claim-form-banner h2 { margin: 0; font-size: var(--t-section); }
.claim-form-banner p { max-width: 62ch; margin: 8px 0 0; color: hsl(var(--muted-foreground)); font-size: 13px; line-height: 1.5; }
.claim-form-banner .btn { flex: 0 0 auto; white-space: nowrap; }

.report-page-head { align-items: end; }
.report-page-head > div:first-child { max-width: 66ch; }
.report-controls {
  display: grid;
  gap: 16px;
  margin: 0 0 28px;
  padding: 16px 0 18px;
  border-top: 1px solid hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
}
.report-presets { display: flex; flex-wrap: wrap; gap: 7px; }
.report-presets button { min-height: 34px; padding-inline: 11px; border-color: hsl(var(--border)); background: transparent; color: hsl(var(--foreground)); }
.report-presets button[aria-pressed="true"] { border-color: #000; background: #ffda27; color: #000; }
.report-presets button:hover { border-color: #000; background: hsl(var(--secondary)); }
.report-presets button[aria-pressed="true"]:hover { background: #ecaa00; }
.report-controls .grid { align-items: end; }
.report-run { display: flex; align-items: end; }
.report-run button { width: 100%; }

.report-loading { min-height: 420px; padding: 8px 0; }
.report-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 0 28px;
  border-top: 1px solid hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
}
.report-metric { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 18px 16px 20px; border-right: 1px solid hsl(var(--border)); }
.report-metric:last-child { border-right: 0; }
.report-metric strong { font-family: var(--font-display); font-size: clamp(1.5rem, 2.2vw, 2.35rem); font-variant-numeric: tabular-nums; line-height: .95; letter-spacing: -.045em; }
.report-metric span { font-size: 11px; font-weight: 750; letter-spacing: .01em; }
.report-metric small { min-height: 1.25em; color: hsl(var(--muted-foreground)); font-size: 10.5px; line-height: 1.3; }

.report-visuals {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr);
  margin: 0 0 28px;
  border-top: 1px solid hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
}
.report-activity { min-width: 0; margin: 0; padding: clamp(20px, 3vw, 32px); border-right: 1px solid hsl(var(--border)); }
.report-activity figcaption { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin: 0 0 20px; }
.report-activity h2, .report-flow h2, .report-category-returns h2, .report-retention h2 { margin: 0; font-size: var(--t-section); }
.report-activity figcaption p, .report-flow p, .report-category-returns p, .report-retention p { margin: 7px 0 0; color: hsl(var(--muted-foreground)); font-size: 12px; line-height: 1.45; }
.report-activity svg { display: block; width: 100%; height: clamp(220px, 26vw, 300px); overflow: visible; }
.chart-grid { stroke: hsl(var(--border)); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis { fill: hsl(var(--muted-foreground)); font-family: var(--font-body); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-axis-x { font-size: 9.5px; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px 12px; padding-top: 2px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; color: hsl(var(--muted-foreground)); font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.chart-legend i { display: block; width: 16px; height: 3px; border-radius: 999px; background: currentColor; }
.chart-legend i.intake, .report-line.intake { color: #ecaa00; stroke: #ecaa00; }
.chart-legend i.claims, .report-line.claims { color: hsl(var(--foreground)); stroke: hsl(var(--foreground)); }
.chart-legend i.inquiries, .report-line.inquiries { color: hsl(var(--muted-foreground)); stroke: hsl(var(--muted-foreground)); }
.report-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: office-report-trace .82s cubic-bezier(.18,.88,.26,1) forwards;
}
.report-line.claims { animation-delay: 90ms; }
.report-line.inquiries { animation-delay: 180ms; }
@keyframes office-report-trace { to { stroke-dashoffset: 0; } }
.report-activity-empty { display: grid; align-content: center; min-height: 280px; }

.report-flow { display: grid; align-content: space-between; gap: 26px; padding: clamp(20px, 3vw, 32px); background: hsl(var(--secondary)); }
.report-flow-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.report-flow-steps li { position: relative; display: grid; gap: 3px; padding: 0 0 19px 21px; }
.report-flow-steps li:last-child { padding-bottom: 0; }
.report-flow-steps li::before { content: ""; position: absolute; top: 4px; left: 0; width: 9px; height: 9px; border: 1px solid hsl(var(--foreground)); border-radius: 50%; background: hsl(var(--secondary)); }
.report-flow-steps li:first-child::before, .report-flow-steps li:last-child::before { background: #ecaa00; border-color: #ecaa00; }
.report-flow-steps li:not(:last-child)::after { content: ""; position: absolute; top: 15px; bottom: 0; left: 4px; width: 1px; background: hsl(var(--border)); }
.report-flow-steps strong { font-family: var(--font-display); font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.04em; }
.report-flow-steps span { color: hsl(var(--muted-foreground)); font-size: 12px; }
.report-flow-note { margin: 0 !important; padding-top: 15px; border-top: 1px solid hsl(var(--border)); }
.report-flow-note b { color: hsl(var(--foreground)); font-family: var(--font-display); font-size: 20px; letter-spacing: -.03em; }

.report-insights { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin: 0 0 28px; border-top: 1px solid hsl(var(--foreground)); border-bottom: 1px solid hsl(var(--border)); }
.report-category-returns, .report-retention { padding: clamp(20px, 3vw, 32px); }
.report-category-returns { border-right: 1px solid hsl(var(--border)); }
.category-return-list { display: grid; gap: 14px; margin-top: 22px; }
.category-return-row { display: grid; gap: 7px; }
.category-return-row > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.category-return-row b { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.category-return-row span { flex: 0 0 auto; color: hsl(var(--muted-foreground)); font-size: 10.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.category-return-track { display: block; height: 5px; overflow: hidden; background: hsl(var(--border)); }
.category-return-track i { display: block; height: 100%; background: #ecaa00; }
.report-retention .bars { margin-top: 22px; }
.report-retention .bar { padding-block: 8px; }

.report-details { margin: 0; border-top: 1px solid hsl(var(--foreground)); border-bottom: 1px solid hsl(var(--border)); }
.report-details summary { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 17px 0; cursor: pointer; list-style: none; }
.report-details summary::-webkit-details-marker { display: none; }
.report-details summary::after { content: "+"; order: 3; font-family: var(--font-display); font-size: 22px; line-height: 1; }
.report-details[open] summary::after { content: "−"; }
.report-details summary span { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.025em; }
.report-details summary small { margin-left: auto; color: hsl(var(--muted-foreground)); font-size: 11px; }
.report-breakdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid hsl(var(--border)); }
.report-breakdown { min-width: 0; padding: 22px 22px 24px 0; border-bottom: 1px solid hsl(var(--border)); }
.report-breakdown:nth-child(odd) { padding-right: 22px; border-right: 1px solid hsl(var(--border)); }
.report-breakdown:nth-child(even) { padding-left: 22px; }
.report-breakdown:last-child, .report-breakdown:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.report-breakdown h3 { margin: 0; font-size: 16px; }
.report-breakdown > p { min-height: 2.6em; margin: 6px 0 14px; color: hsl(var(--muted-foreground)); font-size: 11px; line-height: 1.35; }

@media (max-width: 1120px) {
  .report-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-metric:nth-child(3n) { border-right: 0; }
  .report-metric:nth-child(-n + 3) { border-bottom: 1px solid hsl(var(--border)); }
}
@media (max-width: 940px) {
  .brand-lockup { width: 168px; }
  .report-visuals { grid-template-columns: 1fr; }
  .report-activity { border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
}
@media (max-width: 680px) {
  .brand-link { padding: 3px 5px; }
  .brand-lockup { width: 150px; }
  .claim-form-banner { align-items: stretch; flex-direction: column; gap: 16px; }
  .claim-form-banner .btn { width: 100%; }
  .report-page-head { align-items: start; }
  .report-page-head .btn { flex: 1 1 auto; text-align: center; }
  .report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-metric { padding: 15px 12px 17px; }
  .report-metric:nth-child(3n) { border-right: 1px solid hsl(var(--border)); }
  .report-metric:nth-child(2n) { border-right: 0; }
  .report-metric:nth-child(-n + 4) { border-bottom: 1px solid hsl(var(--border)); }
  .report-activity figcaption { display: grid; gap: 10px; }
  .chart-legend { justify-content: start; }
  .report-activity svg { height: 220px; }
  .report-insights { grid-template-columns: 1fr; }
  .report-category-returns { border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .report-details summary { align-items: start; }
  .report-details summary small { margin-left: 0; }
  .report-breakdown-grid { grid-template-columns: 1fr; }
  .report-breakdown, .report-breakdown:nth-child(odd), .report-breakdown:nth-child(even) { padding: 20px 0; border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .report-breakdown:last-child { border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .report-line { animation: none; stroke-dashoffset: 0; }
}

/* ── Owner workbook import ───────────────────────────────────────────── */
.sync-page-head > div { max-width: 68ch; }
.sync-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 28px;
  padding: 0;
  border-top: 1px solid hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
  list-style: none;
}
.sync-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  min-width: 0;
  padding: 17px 18px 19px;
  border-right: 1px solid hsl(var(--border));
}
.sync-steps li:last-child { border-right: 0; }
.sync-steps > li > span {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid hsl(var(--foreground));
  border-radius: 50%;
  background: #ffda27;
  color: #000;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.sync-steps b { display: block; font-size: 13px; line-height: 1.25; }
.sync-steps p { margin: 4px 0 0; color: hsl(var(--muted-foreground)); font-size: 11.5px; line-height: 1.45; }

.sync-workspace {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
  margin: 0 0 20px;
  border-top: 1px solid hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
}
.sync-picker, .sync-preview { min-width: 0; padding: clamp(21px, 3vw, 34px); }
.sync-picker { border-right: 1px solid hsl(var(--border)); }
.sync-picker h2, .sync-preview h2, .sync-runbar h2 { font-size: var(--t-section); }
.sync-picker > p:not(.sync-file-meta):not(.sync-local-note) { max-width: 42ch; margin: 7px 0 20px; color: hsl(var(--muted-foreground)); font-size: 12px; line-height: 1.5; }
.sync-file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #ecaa00;
  border-radius: 10px;
  background: #ffda27;
  color: #000;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.sync-file-button:hover { border-color: #000; background: #ecaa00; transform: translateY(-1px); }
.sync-file-button:focus-within { outline: 2px solid hsl(var(--ring)); outline-offset: 3px; }
.sync-file-button input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.sync-file-button:has(input:disabled) { cursor: wait; opacity: .62; }
.sync-file-button:has(input:disabled) input { cursor: wait; }
.sync-file-meta { display: grid; gap: 2px; margin: 13px 0 0; font-size: 11.5px; line-height: 1.45; }
.sync-file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-file-meta span { color: hsl(var(--muted-foreground)); }
.sync-local-note { max-width: 62ch; margin: 14px 0 0; padding-top: 13px; border-top: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); font-size: 11px; line-height: 1.5; }

.sync-preview { display: grid; align-content: start; }
.sync-preview-intro p { max-width: 57ch; margin: 7px 0 0; color: hsl(var(--muted-foreground)); font-size: 12px; line-height: 1.5; }
.sync-preview-intro strong { color: hsl(var(--foreground)); }
.sync-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 22px 0 0;
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
}
.sync-counts > div { min-width: 0; padding: 14px 12px 15px; border-right: 1px solid hsl(var(--border)); }
.sync-counts > div:first-child { padding-left: 0; }
.sync-counts > div:last-child { padding-right: 0; border-right: 0; }
.sync-counts dt { color: hsl(var(--muted-foreground)); font-size: 10.5px; font-weight: 700; }
.sync-counts dd { margin: 3px 0 2px; font-family: var(--font-display); font-size: clamp(1.45rem, 2.4vw, 2rem); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.sync-counts small { display: block; overflow: hidden; color: hsl(var(--muted-foreground)); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sync-preview-notes { margin-top: 15px; }
.sync-preview-notes p { margin: 6px 0; color: hsl(var(--muted-foreground)); font-size: 11px; line-height: 1.5; }
.sync-preview-notes p b { color: hsl(var(--foreground)); }
.sync-warnings { display: grid; gap: 5px; margin: 12px 0; padding: 12px 0 0 17px; border-top: 1px solid hsl(var(--border)); color: hsl(var(--destructive)); font-size: 11px; line-height: 1.45; }
.sync-error { color: hsl(var(--destructive)) !important; }

.sync-runbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 34px;
  padding: 17px 0 18px;
  border-bottom: 1px solid hsl(var(--border));
}
.sync-runbar > div { min-width: 0; }
.sync-runbar h2 { margin: 0; }
.sync-run-message { max-width: 68ch; margin: 5px 0 0; color: hsl(var(--muted-foreground)); font-size: 11.5px; line-height: 1.45; }
.sync-run-message.success { color: hsl(var(--success)); font-weight: 650; }
.sync-run-message.danger { color: hsl(var(--destructive)); font-weight: 650; }
.sync-runbar button { flex: 0 0 auto; min-width: 158px; }
.sync-runbar button:disabled { cursor: not-allowed; opacity: .58; }

.sync-current { margin: 0 0 30px; }
.sync-current .head { margin-bottom: 13px; }
.sync-current .head > div { max-width: 65ch; }
.sync-current-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
}
.sync-state { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 18px 17px 19px; border-right: 1px solid hsl(var(--border)); }
.sync-state:last-child { border-right: 0; }
.sync-state span { color: hsl(var(--muted-foreground)); font-size: 10.5px; font-weight: 700; }
.sync-state strong { font-family: var(--font-display); font-size: clamp(1.6rem, 2.7vw, 2.45rem); font-variant-numeric: tabular-nums; letter-spacing: -.045em; line-height: 1; }
.sync-state small { min-height: 1.35em; color: hsl(var(--muted-foreground)); font-size: 10.5px; line-height: 1.35; }
.sync-media-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 0 18px;
  border-bottom: 1px solid hsl(var(--border));
}
.sync-media-line > div { min-width: 0; }
.sync-media-line b { display: block; font-size: 12px; }
.sync-media-line p { margin: 4px 0 0; color: hsl(var(--muted-foreground)); font-size: 11px; line-height: 1.45; }
.sync-media-line .btn { flex: 0 0 auto; white-space: nowrap; }
.sync-history { display: grid; grid-template-columns: minmax(190px, .65fr) minmax(0, 1.35fr); gap: clamp(20px, 4vw, 56px); padding: 22px 0 0; }
.sync-history h3 { font-size: 15px; }
.sync-history > div > p, .sync-empty-history { margin: 5px 0 0; color: hsl(var(--muted-foreground)); font-size: 11px; line-height: 1.45; }
.sync-history-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid hsl(var(--border)); }
.sync-history-list li { padding: 10px 0 11px; border-bottom: 1px solid hsl(var(--border)); }
.sync-history-list li:last-child { border-bottom: 0; }
.sync-history-list li > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sync-history-list b { font-size: 11.5px; }
.sync-history-list span { min-width: 0; overflow: hidden; color: hsl(var(--muted-foreground)); font-size: 10px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.sync-history-list p { margin: 2px 0 0; color: hsl(var(--muted-foreground)); font-family: var(--font-mono); font-size: 10px; font-variant-numeric: tabular-nums; line-height: 1.4; }

@media (max-width: 940px) {
  .sync-workspace { grid-template-columns: 1fr; }
  .sync-picker { border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .sync-history { grid-template-columns: 1fr; gap: 13px; }
}
@media (max-width: 680px) {
  .sync-steps { grid-template-columns: 1fr; }
  .sync-steps li { padding: 14px 0; border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .sync-steps li:last-child { border-bottom: 0; }
  .sync-picker, .sync-preview { padding: 20px 0; }
  .sync-counts { grid-template-columns: 1fr; }
  .sync-counts > div, .sync-counts > div:first-child, .sync-counts > div:last-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; padding: 11px 0; border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .sync-counts > div:last-child { border-bottom: 0; }
  .sync-counts dt { grid-column: 1; grid-row: 1; }
  .sync-counts dd { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .sync-counts small { grid-column: 1; grid-row: 2; }
  .sync-runbar { align-items: stretch; flex-direction: column; gap: 14px; }
  .sync-runbar button { width: 100%; }
  .sync-current-grid { grid-template-columns: 1fr; }
  .sync-state { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 14px 0; border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .sync-state:last-child { border-bottom: 0; }
  .sync-state span { grid-column: 1; grid-row: 1; }
  .sync-state strong { grid-column: 2; grid-row: 1 / span 2; }
  .sync-state small { grid-column: 1; grid-row: 2; }
  .sync-media-line { align-items: stretch; flex-direction: column; }
  .sync-media-line .btn { width: 100%; text-align: center; }
  .sync-history-list li > div { align-items: start; flex-direction: column; gap: 2px; }
  .sync-history-list span { max-width: 100%; text-align: left; }
}
