/* Stand Planner. Dark, Apple-pro look borrowed from the BarberOne funnel and BarberOne v5:
   black stage, glass panels, native system type, text buttons, blue for "selected", amber for "check the fit". */
:root {
  --bg: #000;
  --text: #fff;
  --sec: #8e8e93;
  --sec2: #636366;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --fill: rgba(255, 255, 255, 0.06);
  --fill2: rgba(255, 255, 255, 0.1);
  --glass: rgba(18, 18, 20, 0.62);
  --blue: #0a84ff;
  --blue-soft: rgba(10, 132, 255, 0.16);
  --red: #ff453a;
  --amber: #ffd60a;
  --green: #30d158;
  --f: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --r: 14px;
  color-scheme: dark;
  font-family: var(--f);
  color: var(--text);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #000; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(70% 60% at 50% 40%, #0e0f12 0%, #050506 55%, #000 100%) fixed;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* film grain and vignette, as on the funnel */
.veil { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(65% 55% at 50% 45%, transparent 0%, rgba(0,0,0,.25) 70%, rgba(0,0,0,.75) 100%); }
.grain { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"); }

.kicker { display: block; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--sec); }

/* ---------- buttons and inputs ---------- */
/* BarberOne buttons: plain text, no box. Blue for the main action, grey-white for the rest, red to delete.
   The one solid white button (.btn-primary) is kept for "Add an item" and saving a form. */
.btn {
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
  min-height: 36px; padding: 0 2px; margin: 0;
  border: 0; border-radius: 6px; background: none; color: #e5e5ea; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-transform: none; letter-spacing: 0;
  transition: color .15s, opacity .15s, background .18s;
  touch-action: manipulation;
}
.btn:hover { color: #fff; }
.btn:active { opacity: .55; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tag:focus-visible, .card:focus-visible, .ref:focus-visible, .choice:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px; }
.btn-accent { color: #4da3ff; }
.btn-accent:hover { color: #7cbcff; }
.btn-quiet { color: var(--sec); font-weight: 500; }
.btn-danger { color: var(--red); }
.btn-danger:hover { color: #ff6961; }
.btn-primary { background: #fff; color: #000; padding: 0 22px; min-height: 44px; border-radius: 100px; }
.btn-primary:hover { background: #e9e9ec; color: #000; }
.btn-primary:active { opacity: 1; transform: scale(.98); }
.btn-block { width: 100%; min-height: 48px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* Paper-form fields: a faint 5% white fill, no outline; a blue underline when in use. */
input, select, textarea {
  font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
  width: 100%; padding: 12px 14px;
  border: 0; border-radius: 10px;
  background: rgba(255,255,255,.05); color: var(--text);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.08);
  transition: box-shadow .18s, background .18s;
}
input::placeholder, textarea::placeholder { color: var(--sec2); }
input:focus, select:focus, textarea:focus { outline: none; background: rgba(255,255,255,.07); box-shadow: inset 0 -2px 0 var(--blue); }
select option, select optgroup { background: #1c1c1e; color: #fff; }
select option:disabled { color: #636366; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sec); margin: 18px 0 7px; }

.error { color: var(--red); font-weight: 500; }

/* ---------- sign-in: the v5 "What's on your mind" hero, over the turning stand ---------- */
.signin {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(55% 45% at 50% 50%, rgba(0,0,0,.55) 0%, rgba(0,0,0,.2) 70%, transparent 100%);
}
.signin-inner { width: 100%; max-width: 560px; text-align: center; animation: rise .7s var(--ease) backwards; }
.signin .hello { margin: 0 0 12px; font-size: 14px; color: #d1d1d6; }
.signin h1 { font-size: clamp(38px, 7vw, 60px); font-weight: 700; letter-spacing: -.035em; text-shadow: 0 2px 30px rgba(0,0,0,.6); }
.signin .lede { margin: 14px auto 30px; max-width: 420px; font-size: 16px; line-height: 1.5; color: #c7c7cc; }
/* Glass pill: frosted fill, a light rim that is brighter along the top edge, soft inner highlight. */
.pill-input { position: relative; display: flex; align-items: center; border-radius: 100px; padding: 6px 6px 6px 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.06) 100%), rgba(14,14,18,.45);
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(255,255,255,.06), 0 20px 60px rgba(0,0,0,.55);
  transition: box-shadow .25s var(--ease); }
.pill-input::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.12) 45%, rgba(255,255,255,.22) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.name-pill { margin-bottom: 12px; padding-right: 24px; }
.pill-input input { flex: 1; min-width: 0; border: 0; background: none; color: #fff; padding: 12px 8px 12px 0; font-size: 17px; box-shadow: none; }
.pill-input input::placeholder { color: rgba(255,255,255,.5); }
.pill-input input:focus { box-shadow: none; background: none; }
.pill-input:focus-within { box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -1px 0 rgba(255,255,255,.06), 0 20px 60px rgba(0,0,0,.55), 0 0 0 4px rgba(10,132,255,.28); }

/* Water-drop button, kept flat: a gentle top-to-bottom blue, a faint sheen across the top, a crisp light rim. */
.go { position: relative; overflow: hidden; flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; color: #fff; cursor: pointer;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #3b9bff 0%, #0a84ff 55%, #0876ea 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1px 2px rgba(0,40,110,.25), inset 0 0 0 1px rgba(255,255,255,.14),
    0 4px 14px rgba(10,132,255,.35), 0 1px 3px rgba(0,0,0,.35);
  transition: transform .15s var(--ease), filter .2s, box-shadow .2s; }
.go::before { content: ""; position: absolute; top: 2px; left: 6px; right: 6px; height: 46%; border-radius: 100px 100px 60% 60% / 100px 100px 40% 40%; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.32) 0%, rgba(255,255,255,0) 100%); }
.go svg { position: relative; z-index: 1; }
.go:hover { filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 2px rgba(0,40,110,.25),
  inset 0 0 0 1px rgba(255,255,255,.18), 0 6px 20px rgba(10,132,255,.5), 0 1px 3px rgba(0,0,0,.35); }
.go:active { transform: scale(.93); }
.signin .error { min-height: 1.3em; margin: 16px 0 0; font-size: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* While signed out only the stage shows, full screen, behind the hero. */
body.signed-out .top, body.signed-out .panel, body.signed-out .list,
body.signed-out .tags, body.signed-out .hint { display: none !important; }
body.signed-out .stage { position: fixed; inset: 0; height: auto; z-index: 0; }

/* ---------- header ---------- */
#app { position: relative; z-index: 2; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.title { min-width: 0; }
.title .kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.title strong { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
/* "Live" dot beside the stand name: green while updates are coming in, grey when offline. */
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #c7c7cc; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(48,209,88,.6); animation: pulse 2.4s infinite; }
.live.off { color: var(--sec); }
.live.off::before { background: var(--sec2); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(48,209,88,.55); } 70% { box-shadow: 0 0 0 7px rgba(48,209,88,0); } 100% { box-shadow: 0 0 0 0 rgba(48,209,88,0); } }
.actions { display: flex; gap: 22px; align-items: center; }
.me { font: inherit; font-size: 12px; font-weight: 600; color: #e5e5ea; background: none; border: 0; padding: 0 0 0 10px; margin: 0;
  border-left: 1px solid var(--line2); cursor: pointer; }
.me:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.view-badge { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sec); padding-left: 10px; border-left: 1px solid var(--line2); }
/* Viewers: the sign-in link reads as the main action. */
body.viewer #btn-signout { color: #4da3ff; font-weight: 600; }
.actions > span { display: contents; }

/* segmented control, like the Everyone / Late filter in v5 */
.segmented { display: inline-flex; padding: 3px; border-radius: 100px; background: var(--fill); border: 1px solid var(--line); }
.segmented button { font: inherit; font-size: 13px; font-weight: 600; min-height: 32px; min-width: 52px; padding: 0 14px; border: 0; border-radius: 100px;
  background: none; color: var(--sec); cursor: pointer; transition: background .2s var(--ease), color .2s; }
.segmented button[aria-pressed="true"] { background: #fff; color: #000; }
.segmented button:not([aria-pressed="true"]):hover { color: #fff; }


/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 1fr; }
.stage { position: relative; height: 62vh; min-height: 340px; overflow: hidden; touch-action: none; }
.three-root, .three-root canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; white-space: nowrap;
  font-size: 12px; color: var(--sec); pointer-events: none; padding: 6px 12px; border-radius: 100px;
  background: rgba(0,0,0,.4); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); }
.panel { position: relative; padding: 22px 20px 40px; min-width: 0; }
.list { padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; align-content: start; }

@media (min-width: 900px) {
  #app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
  .layout { grid-template-columns: minmax(0, 1fr) 440px; flex: 1; min-height: 0; }
  .stage { height: auto; min-height: 0; }
  .list { overflow: auto; padding: 24px; }
  .panel { overflow: auto; margin: 16px 16px 16px 0; padding: 26px 24px 30px; border-radius: 22px;
    background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(1.3); backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.45); }
  .panel::-webkit-scrollbar, .list::-webkit-scrollbar { width: 0; }
}

/* ---------- floating 3D labels ---------- */
.tags { position: absolute; inset: 0; pointer-events: none; }
.tag {
  position: absolute; left: 0; top: 0;
  pointer-events: auto; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap; letter-spacing: .01em;
  padding: 6px 9px; border-radius: 100px;
  background: rgba(20,20,22,.66); color: #fff; border: 1px solid rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.tag:hover { border-color: rgba(255,255,255,.4); }
.tag .n { color: var(--sec); font-weight: 500; }
.tag.selected { background: #fff; color: #000; border-color: #fff; box-shadow: 0 0 0 4px rgba(10,132,255,.35), 0 8px 24px rgba(0,0,0,.5); }
.tag.selected .n { color: #636366; }

.tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px rgba(255,214,10,.8); }
.tag.check { border-color: rgba(255,214,10,.5); }

/* ---------- fit status: plain text with a dot (empty, fits, or items still to check) ---------- */
.fit { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: #c7c7cc; white-space: nowrap; }
.fit::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sec2); flex: none; }
.fit.ok::before { background: var(--green); }
.fit.check { color: #ffd60a; }
.fit.check::before { background: var(--amber); }
.fit.empty { color: var(--sec); }

/* ---------- backboard switch, top right of the stage ---------- */
.switch { position: absolute; top: 14px; right: 14px; z-index: 3; display: inline-flex; align-items: center; gap: 10px; margin: 0;
  padding: 6px 6px 6px 14px; border-radius: 100px; cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #fff;
  background: rgba(20,20,22,.6); border: 1px solid var(--line2); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { position: relative; width: 40px; height: 24px; border-radius: 100px; background: rgba(120,120,128,.36); transition: background .25s var(--ease); }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .25s var(--ease); }
.switch input:checked + i { background: var(--blue); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }
body.signed-out .switch { display: none; }


/* ---------- list view cards ---------- */
.list { grid-auto-rows: auto; align-items: stretch; }
.card {
  text-align: left; font: inherit; color: #fff; cursor: pointer; margin: 0; height: auto;
  background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 18px; padding: 16px;
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  transition: border-color .18s, background .18s, transform .12s var(--ease);
}
.card:hover { border-color: rgba(255,255,255,.24); background: rgba(28,28,30,.7); }
.card:active { transform: scale(.98); }
.card.selected { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.card .code { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.card .lbl { font-size: 12.5px; line-height: 1.35; color: var(--sec); }
.card .meta { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; font-size: 12.5px; color: #c7c7cc; }
.card .meta .fit { font-size: 12.5px; }
.group-title { grid-column: 1 / -1; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--sec); margin: 14px 2px 2px; }
.group-title:first-child { margin-top: 0; }

/* ---------- placement panel (styled like the v5 customer detail) ---------- */
.empty { color: var(--sec); font-size: 15px; line-height: 1.5; }
.panel > .empty:only-child { padding: 40px 6px; text-align: center; }
.p-head h2 { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; }
.p-head .p-sub { margin: 6px 0 0; font-size: 14px; color: var(--sec); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; margin: 22px 0 14px; }
.stats span { display: block; font-size: 12px; color: var(--sec); }
.stats b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 3px; }
.stats small { font-size: 12px; color: var(--sec); font-weight: 500; margin-left: 3px; }
.stats b.check { color: var(--amber); }
.stats b.over { color: var(--red); }
.meter { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin: 0 0 22px; }
.meter i { display: block; height: 100%; border-radius: 4px; background: #fff; transition: width .5s var(--ease); }
.meter.full i { background: var(--blue); }
.meter.over i { background: var(--red); }
.note { margin: -6px 0 18px; font-size: 13.5px; color: var(--sec); }

/* Callouts use the BarberOne card: hairline border, bold title, short text, text buttons. Only callouts get a card. */
.callout { margin: 0 0 20px; padding: 18px 20px 12px; border-radius: 18px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.02); }
.callout h4 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.callout .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: none; }
.callout .dot.over { background: var(--red); }
.callout p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: #c7c7cc; }
.callout-actions { display: flex; gap: 22px; margin-top: 6px; }

.section-label { margin: 6px 0 2px; }
.print-row { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: -8px 0 16px; }

/* Labels menu: BarberOne list rows with a chevron. */
.choices { display: grid; border-top: 1px solid var(--line); }
.choice { font: inherit; text-align: left; color: #fff; cursor: pointer; margin: 0; display: grid; grid-template-columns: 1fr auto 14px; align-items: center; gap: 2px 14px;
  padding: 16px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; transition: background .15s; }
.choice:hover { background: rgba(255,255,255,.03); }
.choice::after { content: ""; grid-column: 3; grid-row: 1 / 3; width: 8px; height: 8px; border: solid var(--sec); border-width: 2px 2px 0 0; transform: rotate(45deg); justify-self: center; }
.choice b { font-size: 16px; font-weight: 600; }
.choice span { grid-column: 2; grid-row: 1 / 3; font-size: 13px; color: var(--sec); }
.choice small { grid-column: 1; font-size: 13px; color: var(--sec); line-height: 1.4; }

.items { list-style: none; padding: 0; margin: 0 0 18px; }
.item { padding: 16px 0; border-top: 1px solid var(--line); }
.item.flash { animation: flash 2.4s var(--ease) backwards; border-radius: 14px; }
@keyframes flash { 0%, 30% { background: rgba(10,132,255,.18); box-shadow: 0 0 0 1px rgba(10,132,255,.6); } 100% { background: transparent; box-shadow: 0 0 0 1px transparent; } }
.ref { flex: none; display: inline-flex; align-items: stretch; height: fit-content; margin: 0; padding: 0; cursor: copy; overflow: hidden;
  font: 600 12.5px/1 ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; color: #fff;
  border: 0; border-radius: 9px;
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset 0 1px 0 rgba(255,255,255,.18), 0 4px 14px rgba(0,0,0,.35);
  transition: box-shadow .18s, transform .12s var(--ease); }
.ref i { font: 600 8.5px/1 var(--f); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: var(--sec);
  padding: 7px 7px 6px 9px; border-right: 1px solid rgba(255,255,255,.1); display: grid; place-items: center; }
.ref span { padding: 7px 10px 6px 9px; letter-spacing: .16em; }
.ref:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.24), inset 0 1px 0 rgba(255,255,255,.22), 0 4px 18px rgba(0,0,0,.4); }
.ref:active { transform: scale(.96); }

/* the "does this fit" tick in the item form */
.check-row { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0 0; padding: 0; cursor: pointer;
  text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 500; color: #fff; line-height: 1.4; }
.check-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-row .tick { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; border: 1.5px solid rgba(255,255,255,.35);
  display: grid; place-items: center; transition: background .18s, border-color .18s; }
.check-row .tick::after { content: ""; width: 6px; height: 11px; margin-top: -2px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(45deg) scale(0); transition: transform .18s var(--ease); }
.check-row input:checked + .tick { background: var(--blue); border-color: var(--blue); }
.check-row input:checked + .tick::after { transform: rotate(45deg) scale(1); }
.check-row input:focus-visible + .tick { outline: 2px solid var(--blue); outline-offset: 2px; }
.check-row small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 400; color: var(--sec); }
.item:last-child { border-bottom: 1px solid var(--line); }
.item-top { display: flex; gap: 12px; align-items: flex-start; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #000;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.item-main { flex: 1; min-width: 0; }
.item h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.item .sub { font-size: 13px; color: var(--sec); margin: 3px 0 0; }
.item .facts { font-size: 13px; color: #d1d1d6; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0 50px; }
.item .notes { font-size: 13.5px; line-height: 1.5; color: #c7c7cc; margin: 8px 0 0 50px; white-space: pre-wrap; }
.item-actions { display: flex; flex-wrap: wrap; gap: 0 22px; margin: 8px 0 0 50px; }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0 50px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 76px; height: 76px; }
.thumb img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; display: block; background: var(--fill); border: 1px solid var(--line); }
.thumb button {
  position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #000; background: #fff; color: #000; font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0;
}
.uploading { font-size: 12px; color: var(--sec); align-self: center; }

/* hidden file inputs sit behind the camera buttons */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- item form: a paper form, not a card ---------- */
.item-form { margin: 4px 0 26px; padding: 22px 0 0; border-top: 1px solid var(--line); animation: rise .35s var(--ease) backwards; }
.item-form h3 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.item-form h3 + label { margin-top: 16px; }
.row2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.btn-grey { margin-top: 10px; background: rgba(255,255,255,.07); color: #c7c7cc; border-radius: 100px; font-weight: 600; }
.btn-grey:hover { background: rgba(255,255,255,.11); color: #fff; }
.items.archived { margin-top: 10px; opacity: .72; }
.items.archived .item:hover { opacity: 1; }
.item .by { color: var(--sec); }
.dialog-sub { margin: -8px 0 16px; font-size: 14px; line-height: 1.5; color: #c7c7cc; }
.name-dialog .error { min-height: 1.2em; margin: 8px 0 0; font-size: 13px; }
.field-hint { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.4; color: var(--sec); }
.field-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sec); margin: 18px 0 7px; }
/* Origin switch: three segments, one chosen (Holloway / Aldgate / Shoreditch). */
.segmented.origin { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; border: 0; background: rgba(255,255,255,.05); border-radius: 12px; padding: 4px; }
.segmented.origin label { margin: 0; position: relative; text-transform: none; letter-spacing: 0; cursor: pointer; }
.segmented.origin input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented.origin span { display: grid; place-items: center; min-height: 38px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--sec);
  transition: background .2s var(--ease), color .2s; }
.segmented.origin label:hover input:not(:checked) + span { color: #fff; }
.segmented.origin input:checked + span { background: #fff; color: #000; }
.segmented.origin input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.form-actions { display: flex; gap: 22px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
input[type="file"] { padding: 10px; font-size: 14px; color: var(--sec); }
input[type="file"]::file-selector-button { font: inherit; font-size: 14px; font-weight: 600; margin-right: 12px; padding: 6px 2px; border: 0; background: none; color: #4da3ff; cursor: pointer; }

/* ---------- dialog and toast ---------- */
/* The heading stays at the top, the list scrolls, and Close is pinned in a footer that is always visible. */
.dialog[open] { display: flex; flex-direction: column; }
.dialog > :not(form) { flex: none; }
#audit-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -26px; padding: 0 26px; overscroll-behavior: contain; }
.dialog > form { flex: none; display: flex; gap: 22px; align-items: center; margin: 0 -26px -26px; padding: 12px 26px 16px; border-top: 1px solid var(--line); background: rgba(22,22,24,.96); }
.dialog { width: min(640px, calc(100vw - 32px)); max-height: 80vh; overflow: hidden; padding: 26px; color: #fff;
  border: 1px solid var(--line2); border-radius: 22px; background: rgba(22,22,24,.92);
  -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); box-shadow: 0 40px 120px rgba(0,0,0,.7); }
.dialog[open] { animation: rise .35s var(--ease) backwards; }
.dialog::backdrop { background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog h2 { font-size: 26px; font-weight: 700; margin: 4px 0 16px; }
.audit-row { font-size: 13.5px; line-height: 1.45; padding: 11px 0; border-top: 1px solid var(--line); color: #d1d1d6; }
.audit-row time { color: var(--sec); margin-right: 8px; font-variant-numeric: tabular-nums; }
.audit-row strong { color: #fff; text-transform: capitalize; }
.audit-row .sub { color: var(--sec); }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70;
  max-width: calc(100vw - 32px); color: #fff; font-size: 14px; font-weight: 500;
  padding: 12px 18px; border-radius: 100px;
  background: rgba(28,28,30,.85); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--line2); box-shadow: 0 16px 50px rgba(0,0,0,.6);
  animation: toastIn .3s var(--ease) backwards;
}
.toast.bad { border-color: rgba(255,69,58,.55); color: #ffb3ad; }

@media (max-width: 899px) {
  .top { padding-left: 16px; padding-right: 16px; }
  .actions { width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; width: calc(100% + 32px); }
  .actions::-webkit-scrollbar { display: none; }
  .panel { border-top: 1px solid var(--line); background: rgba(10,10,12,.6); }
}
@media (max-width: 480px) {
  .title strong { font-size: 20px; }
  .tag { font-size: 11px; padding: 5px 8px; }
  .tag .n { display: none; }
  .stats b { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
