/* Six String Theory — the shop's workbench.
   Rosewood bench, manila repair tags, nickel fret wire, rubber-stamp status. */
:root {
  --wood: #21150f;
  --wood-2: #2c1d15;
  --wood-3: #3a271b;
  --grain: #4a3323;
  --nickel: #ddd6cb;
  --muted: #a8937e;
  --faint: #7c6756;
  --pearl: #f4efe6;
  --manila: #e8d1a0;
  --manila-2: #dcc28a;
  --manila-edge: #b99558;
  --ink: #2b1d13;
  --ink-soft: #6b5440;
  --stamp-red: #b03a28;
  --stamp-blue: #2f5f8f;
  --stamp-green: #2f7442;
  --stamp-violet: #6a4794;
  --stamp-grey: #7d7064;
  --alert: #f08a70;
  --ok: #9ccf9f;
  --display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", "DejaVu Sans Condensed", sans-serif;
  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tag-cut: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--nickel);
  font: 16px/1.5 var(--sans);
  background-color: var(--wood);
  /* rosewood grain: long, slightly uneven streaks */
  background-image:
    radial-gradient(120% 60% at 50% 0%, rgba(232, 209, 160, .06), transparent 60%),
    repeating-linear-gradient(91deg, rgba(0, 0, 0, .0) 0 7px, rgba(0, 0, 0, .14) 7px 9px, rgba(0, 0, 0, 0) 9px 19px, rgba(255, 220, 180, .025) 19px 21px, rgba(0, 0, 0, 0) 21px 34px);
  background-attachment: fixed;
}
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--manila); }
:focus-visible { outline: 2px solid var(--manila); outline-offset: 2px; }
code { font-size: .9em; background: var(--wood-3); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.display { font-family: var(--display); font-weight: 700; letter-spacing: .01em; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------- frame */
.boot { display: grid; place-items: center; min-height: 60dvh; }
.boot img { width: 64px; opacity: .8; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.page { max-width: 760px; margin: 0 auto; padding: 0 16px calc(112px + var(--safe-bottom)); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(28, 18, 13, .86);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  padding: calc(8px + var(--safe-top)) 12px 8px;
  border-bottom: 1px solid var(--grain);
}
.topbar-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 10px; min-height: 46px; }
.topbar h1 {
  margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--display); font-weight: 700; font-size: 23px; letter-spacing: .02em; color: var(--pearl);
}
.topbar .sub { display: block; font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); line-height: 1.1; }
.topbar .logo { width: 36px; height: 36px; border-radius: 9px; flex: none; }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--grain); background: var(--wood-2); color: var(--nickel);
  font-weight: 600; font-size: 15.5px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--manila); border-color: var(--manila-edge); color: var(--ink); box-shadow: inset 0 -2px 0 var(--manila-edge); }
.btn.primary:hover { background: #efdab0; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--alert); border-color: rgba(240, 138, 112, .4); background: transparent; }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn svg { width: 19px; height: 19px; flex: none; }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--grain); background: var(--wood-2); cursor: pointer; color: var(--nickel);
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.plain { border-color: transparent; background: transparent; }

.fab {
  position: fixed; right: max(16px, calc(50% - 364px)); bottom: calc(18px + var(--safe-bottom)); z-index: 30;
  height: 58px; padding: 0 24px 0 20px; border-radius: 12px; border: 1px solid var(--manila-edge);
  background: var(--manila); color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .02em;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  box-shadow: inset 0 -3px 0 var(--manila-edge), 0 12px 28px rgba(0, 0, 0, .5);
}
.fab svg { width: 22px; height: 22px; }

/* ------------------------------------------------------------- the repair tag (signature element) */
.tag {
  position: relative; display: block; color: var(--ink); text-decoration: none;
  background:
    radial-gradient(140% 90% at 100% 0%, rgba(255, 255, 255, .22), transparent 55%),
    linear-gradient(180deg, var(--manila), var(--manila-2));
  clip-path: polygon(var(--tag-cut) 0, 100% 0, 100% 100%, var(--tag-cut) 100%, 0 calc(100% - var(--tag-cut)), 0 var(--tag-cut));
  padding: 14px 14px 14px 46px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35));
}
/* punched hole with a brass grommet */
.tag::before {
  content: ""; position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
  background: var(--wood);
  box-shadow: 0 0 0 3.5px #b48a45, 0 0 0 5px rgba(80, 52, 20, .35), inset 0 2px 3px rgba(0, 0, 0, .6);
}
.tag-ticket { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: .04em; color: var(--ink); }
.tag-title { font-weight: 700; font-size: 17px; line-height: 1.25; margin-top: 4px; }
.tag-line { font-size: 14px; color: var(--ink-soft); line-height: 1.35; }
.tag-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tag-note { font-size: 13px; color: var(--ink-soft); font-weight: 600; }

/* rubber stamp */
.stamp {
  display: inline-block; padding: 3px 8px 2px; border: 2px solid currentColor; border-radius: 4px;
  font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.1;
  transform: rotate(-3deg); opacity: .88; color: var(--stamp-red);
  mix-blend-mode: multiply;
}
.stamp.received { color: var(--stamp-blue); }
.stamp.in_progress { color: var(--ink-soft); }
.stamp.waiting { color: var(--stamp-violet); }
.stamp.ready { color: var(--stamp-green); }
.stamp.picked_up { color: var(--stamp-grey); }

/* board cards = tags with a photo */
.cards { display: grid; gap: 14px; }
@media (min-width: 700px) { .cards { grid-template-columns: 1fr 1fr; } }
.card.tag { display: grid; grid-template-columns: 1fr 92px; gap: 12px; align-items: center; min-height: 128px; }
.card.tag:nth-child(odd) { transform: rotate(-.35deg); }
.card.tag:nth-child(even) { transform: rotate(.3deg); }
.card.tag:active { transform: scale(.985); }
.card-body { min-width: 0; }
.card-body .tag-title, .card-body .tag-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb {
  width: 92px; height: 92px; border-radius: 8px; overflow: hidden; background: rgba(43, 29, 19, .12);
  display: grid; place-items: center; color: var(--manila-edge); box-shadow: 0 0 0 1px rgba(43, 29, 19, .15);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb svg { width: 36px; height: 36px; }

/* ------------------------------------------------------------- board header */
.bench-head { padding: 22px 2px 6px; }
.bench-head h2 { font-family: var(--display); font-weight: 800; font-size: clamp(38px, 11vw, 54px); line-height: .95; margin: 0; color: var(--pearl); letter-spacing: .005em; }
.bench-head p { margin: 8px 0 0; color: var(--muted); font-size: 15.5px; }
.bench-head p b { color: var(--nickel); font-weight: 600; }

.search { position: relative; margin: 16px 0 10px; }
.search input, .search input[type=search] {
  width: 100%; height: 48px; padding: 0 14px 0 44px !important; border-radius: 10px;
  background: rgba(20, 13, 9, .6); border: 1px solid var(--grain); outline: none; color: var(--nickel);
}
.search input:focus { border-color: var(--manila-edge); }
.search svg { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; color: var(--faint); pointer-events: none; }

.tabs { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; margin: 4px 0 18px; border-bottom: 1px solid var(--grain); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 10px 0 11px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; margin-bottom: -1px;
  display: inline-flex; gap: 7px; align-items: baseline;
}
.tab .count { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--faint); }
.tab[aria-selected="true"] { color: var(--pearl); border-bottom-color: var(--manila); }
.tab[aria-selected="true"] .count { color: var(--manila); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 52px; height: 52px; color: var(--faint); margin-bottom: 8px; }
.empty h2 { font-family: var(--display); font-weight: 700; color: var(--pearl); font-size: 26px; margin: 0 0 4px; }

/* ------------------------------------------------------------- forms */
.stack { display: grid; gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 12px; min-width: 0; }
legend, .section-title {
  font-family: var(--display); font-weight: 700; font-size: 24px; padding: 0; margin: 14px 0 2px; color: var(--pearl); letter-spacing: .01em;
}
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
label small { font-weight: 400; color: var(--faint); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 10px;
  background: rgba(20, 13, 9, .6); border: 1px solid var(--grain); color: var(--pearl); font-size: 16px; font-weight: 400; outline: none;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--manila-edge); box-shadow: 0 0 0 3px rgba(232, 209, 160, .14); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row.wrap-sm { grid-template-columns: 1fr; } }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--nickel); }
label.check input { width: 20px; height: 20px; accent-color: var(--manila); }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--grain);
  background: var(--wood-2); color: var(--nickel); font-size: 15px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { background: var(--manila); border-color: var(--manila-edge); color: var(--ink); font-weight: 600; }
.chip.add { border-style: dashed; color: var(--muted); background: transparent; }
.chip svg { width: 16px; height: 16px; }

.suggest { position: relative; }
.suggest-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 15;
  background: var(--wood-2); border: 1px solid var(--grain); border-radius: 12px; box-shadow: 0 14px 30px rgba(0,0,0,.45); overflow: hidden;
}
.suggest-list button { display: block; width: 100%; text-align: left; padding: 11px 14px; background: none; border: 0; border-bottom: 1px solid var(--grain); cursor: pointer; }
.suggest-list button:last-child { border-bottom: 0; }
.suggest-list button:hover, .suggest-list button:focus { background: var(--wood-3); }
.suggest-list small { display: block; color: var(--muted); font-size: 13px; }
.linked { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(232, 209, 160, .12); border: 1px solid rgba(232, 209, 160, .25); font-size: 14px; }
.linked strong { flex: 1; }

.alert { background: rgba(240, 138, 112, .12); color: var(--alert); border-radius: 10px; padding: 11px 14px; font-size: 14.5px; }
.hint { background: rgba(20, 13, 9, .5); border: 1px solid var(--grain); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; color: var(--muted); }
.hint b { color: var(--pearl); }

.sticky-actions {
  position: sticky; bottom: 0; z-index: 10; margin: 18px -16px 0; padding: 14px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(to top, var(--wood) 72%, transparent);
  display: flex; gap: 10px;
}
.sticky-actions .btn { flex: 1; }

/* ------------------------------------------------------------- photo tray */
.tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tray-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--wood-3); }
.tray-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tray-item .x { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.62); color: #fff; display: grid; place-items: center; cursor: pointer; }
.tray-item .x svg { width: 15px; height: 15px; }
.tray-item .bar { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 5px; border-radius: 5px; background: rgba(0,0,0,.5); overflow: hidden; }
.tray-item .bar i { display: block; height: 100%; width: 0; background: var(--manila); transition: width .2s; }
.tray-item.failed::after { content: "Didn't upload. Remove and retry"; position: absolute; inset: auto 0 0; background: #8a2c1d; color: #fff; font-size: 11px; text-align: center; padding: 3px; }
.tray-item.selectable { cursor: pointer; }
.tray-item.selectable::before { content: ""; position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.3); z-index: 1; }
.tray-item.selected::before { background: var(--manila) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b1d13' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/16px no-repeat; border-color: var(--manila); }
.tray-item.selected { outline: 3px solid var(--manila); outline-offset: -3px; }
.add-photo {
  aspect-ratio: 1; border-radius: 8px; border: 1.5px dashed var(--grain); background: rgba(20, 13, 9, .4); color: var(--muted);
  display: grid; place-items: center; align-content: center; gap: 4px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.add-photo svg { width: 26px; height: 26px; }

/* ------------------------------------------------------------- job page */
.job-cover { margin: 0 -16px; position: relative; height: min(46vh, 380px); overflow: hidden; background: var(--wood-3); }
.job-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.job-cover::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(to bottom, transparent, var(--wood)); }
.job-tag { margin: 18px 0 0; padding: 18px 18px 18px 50px; }
.job-cover + .job-tag { margin-top: -64px; z-index: 2; }
.job-tag .tag-ticket { font-size: 30px; }
.job-tag h2 { margin: 6px 0 2px; font-family: var(--display); font-weight: 800; font-size: clamp(30px, 8.5vw, 40px); line-height: 1; color: var(--ink); }
.job-tag .facts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 14.5px; color: var(--ink-soft); }
.job-tag .facts b { color: var(--ink); font-weight: 700; }
.tag-headrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.job-tag .stamp { font-size: 15px; }
.service-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.service-tags span { font-size: 13.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(43, 29, 19, .1); color: var(--ink); }
.concern { margin: 12px 0 0; font-size: 15px; color: var(--ink); white-space: pre-line; border-top: 1px dashed rgba(43, 29, 19, .3); padding-top: 10px; }

.client-row { display: flex; align-items: center; gap: 12px; padding: 16px 2px; border-bottom: 1px solid var(--grain); }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--wood-3); color: var(--manila); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; border: 1px solid var(--grain); }
.client-row .who { flex: 1; min-width: 0; }
.client-row .who div:first-child { font-weight: 600; color: var(--pearl); }
.client-row .who div:last-child { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-row .acts { display: flex; gap: 6px; }

/* status as a fretboard: each fret is a stage; the pearl inlay marks where the job is */
.fretboard { margin: 18px 0 6px; }
.frets {
  display: grid; grid-template-columns: repeat(5, 1fr); height: 58px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(180deg, #3b2416 0%, #2a170d 48%, #331d11 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 -2px 0 rgba(0,0,0,.4), 0 0 0 1px #140b06;
  position: relative;
}
/* six strings across the board */
.frets::before {
  content: ""; position: absolute; inset: 6px 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(180deg, transparent 0 7px, rgba(221, 214, 203, .55) 7px 8px, transparent 8px 9.2px);
}
.fret {
  position: relative; border: 0; background: transparent; cursor: pointer; padding: 0;
  border-right: 3px solid #cfc8bd; box-shadow: 1px 0 0 rgba(0,0,0,.5);
}
.fret:last-child { border-right: 0; box-shadow: none; }
.fret::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #e9e1d2 45%, #c8bba5); box-shadow: 0 1px 3px rgba(0,0,0,.6);
  transform: scale(0); transition: transform .22s cubic-bezier(.3,1.6,.5,1); z-index: 3;
}
.fret[aria-pressed="true"]::after { transform: scale(1); }
.fret[aria-pressed="true"] { background: rgba(232, 209, 160, .08); }
.fret-labels { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 7px; }
.fret-labels span { text-align: center; font-size: 12px; line-height: 1.2; color: var(--faint); padding: 0 2px; }
.fret-labels span.on { color: var(--pearl); font-weight: 600; }

.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 4px; }
.action {
  display: grid; justify-items: center; gap: 6px; padding: 13px 4px 11px; border-radius: 10px;
  background: var(--wood-2); border: 1px solid var(--grain); color: var(--nickel); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; line-height: 1.15;
}
.action svg { width: 24px; height: 24px; color: var(--manila); }
.action.primary { background: var(--manila); border-color: var(--manila-edge); color: var(--ink); box-shadow: inset 0 -2px 0 var(--manila-edge); }
.action.primary svg { color: var(--ink); }

.print-nudge { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: rgba(232, 209, 160, .1); border: 1px dashed var(--manila-edge); color: var(--nickel); font-size: 14.5px; }
.print-nudge svg { width: 26px; height: 26px; color: var(--manila); flex: none; }
.print-nudge span { flex: 1; }

/* work log */
.timeline { position: relative; margin: 14px 0 0; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--grain), transparent); }
.t-item { position: relative; margin: 0 0 18px; }
.t-item::before { content: ""; position: absolute; left: -21px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--wood); border: 2px solid var(--manila); }
.t-item.intake::before { border-color: #8fb0d4; }
.t-item.final::before { background: var(--ok); border-color: var(--ok); }
.t-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.t-stage { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--pearl); letter-spacing: .01em; }
.t-when { font-size: 13.5px; color: var(--faint); flex: 1; }
.t-body { white-space: pre-line; margin: 0 0 10px; color: var(--nickel); max-width: 62ch; }
.t-body:last-child { margin: 0; }
.t-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.t-photos button { aspect-ratio: 1; border: 0; padding: 0; border-radius: 8px; overflow: hidden; background: var(--wood-3); cursor: zoom-in; }
.t-photos button:first-child:nth-last-child(n+2) { grid-column: span 2; grid-row: span 2; }
.t-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-status { position: relative; margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.t-status::before { content: ""; position: absolute; left: -18px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.t-status b { color: var(--nickel); font-weight: 600; }
.vis { display: inline-flex; align-items: center; color: var(--faint); }
.vis svg { width: 17px; height: 17px; }

.sent-list { display: grid; gap: 6px; margin-top: 8px; }
.sent { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--muted); padding: 10px 12px; background: var(--wood-2); border: 1px solid var(--grain); border-radius: 10px; }
.sent svg { width: 18px; height: 18px; flex: none; color: var(--ok); }
.sent.bad svg { color: var(--alert); }
.sent span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--nickel); }

/* ------------------------------------------------------------- sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(8, 4, 2, .62); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 760px; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--wood); border: 1px solid var(--grain); border-bottom: 0; border-radius: 18px 18px 0 0;
  padding: 8px 16px calc(16px + var(--safe-bottom)); animation: rise .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
.sheet-grip { width: 42px; height: 5px; border-radius: 5px; background: var(--grain); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { flex: 1; margin: 0; font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--pearl); }

.dictate { position: relative; }
.dictate textarea { padding-bottom: 62px; min-height: 170px; }
.dictate-bar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; }
.mic {
  height: 42px; padding: 0 16px 0 12px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--manila); color: var(--ink); font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px;
}
.mic svg { width: 20px; height: 20px; }
.mic.live { background: #c4452f; color: #fff; animation: live 1.2s ease-in-out infinite; }
@keyframes live { 50% { box-shadow: 0 0 0 8px rgba(196, 69, 47, .25); } }
.lang { height: 34px; min-height: 34px !important; width: auto !important; padding: 0 10px !important; border-radius: 999px !important; font-size: 13px !important; }
.polish {
  margin-left: auto; height: 42px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--manila-edge); background: var(--wood-2); color: var(--manila); font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px;
}
.polish svg { width: 18px; height: 18px; }
.polish.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.interim { color: var(--faint); font-style: italic; font-size: 14px; margin-top: 6px; }
.interim:empty { display: none; }
.undo { font-size: 13.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.undo button { background: none; border: 0; color: var(--manila); font-weight: 600; cursor: pointer; padding: 4px 0; }

/* ------------------------------------------------------------- lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.95); display: flex; flex-direction: column; }
.lightbox .lb-bar { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--safe-top)) 12px 10px; color: #fff; }
.lightbox .lb-img { flex: 1; display: grid; place-items: center; padding: 8px; min-height: 0; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lightbox .icon-btn { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
.lightbox .lb-count { font-size: 14px; opacity: .8; }

.preview-frame { width: 100%; height: 540px; border: 1px solid var(--grain); border-radius: 12px; background: #efe6d8; }

/* ------------------------------------------------------------- toast */
#toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-bottom)); transform: translate(-50%, 20px); z-index: 70;
  background: var(--pearl); color: var(--ink); padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: 14.5px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: #8a2c1d; color: #fff; }

/* ------------------------------------------------------------- sign-in / install */
.auth-page { display: grid; place-items: center; min-height: 100dvh; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card.wide { max-width: 520px; }
.auth-card .tag { padding: 22px 22px 22px 54px; margin-bottom: 22px; }
.auth-card .tag::before { left: 18px; }
.auth-card h1 { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: .95; margin: 0; color: var(--ink); }
.auth-card .tag p { margin: 6px 0 0; color: var(--ink-soft); font-size: 15px; }
.auth-card form { margin-top: 4px; }
.auth-card > p { color: var(--muted); }
.brand-mark { display: none; }

.divider { height: 1px; background: var(--grain); margin: 24px 0; border: 0; }
.menu-list { display: grid; gap: 8px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.job-hero { padding: 20px 0 6px; }
.job-hero h2 { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 9vw, 44px); line-height: 1; margin: 0 0 6px; color: var(--pearl); }
.job-hero .sub { color: var(--muted); margin: 0; }
@media (min-width: 700px) {
  .sheet { border-radius: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--grain); }
  .sheet-backdrop { align-items: center; }
}
