/* One phone screen. Each score is a tier with a huge numeral down the left; ties stack inside it and drag to order. */
:root {
  --bg: #f4f7ea; --surface: #ffffff; --ink: #1d2a1b; --muted: #5d6b58; --line: #d9e0c9;
  --accent: #e8610c; --accent-ink: #ffffff; --tint: #ffe9d2; --numeral: #e8610c; --danger: #b3261e;
  --cam-bg: #10130f; --cam-fg: #f4f7ea; --cam-line: #3a4236; --scrim: rgba(16,19,15,.55);
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-cat="lemon"] { --accent: #6d7f00; --tint: #f1f5b5; --numeral: #6d7f00; }
:root[data-cat="other"] { --accent: #0b7d73; --tint: #cfeee9; --numeral: #0b7d73; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #141a12; --surface: #1f271c; --ink: #eef2e3; --muted: #a3af9b; --line: #333d2e;
    --accent: #ff8a3c; --accent-ink: #1d1206; --tint: #43280f; --numeral: #ff8a3c; --danger: #ff8a80; --scrim: rgba(0,0,0,.65); color-scheme: dark; }
  :root[data-cat="lemon"] { --accent: #d3e22f; --accent-ink: #1b1f00; --tint: #383d0c; --numeral: #d3e22f; }
  :root[data-cat="other"] { --accent: #4cd2c4; --accent-ink: #04211e; --tint: #103a36; --numeral: #4cd2c4; }
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.35 var(--body); overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }

.phone { position: relative; height: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); padding-top: env(safe-area-inset-top, 0px); }
.top { flex: none; display: flex; flex-direction: column; gap: 12px; padding-block: 14px 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar h1 { font: 800 25px/1 var(--display); letter-spacing: -.01em; }
.cam-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px; border-radius: 24px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cam-btn svg { width: 24px; height: 24px; }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line); font-weight: 600; font-size: 15px; color: var(--muted); }
.tab[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tab.new { border-style: dashed; }

.install { flex: none; display: flex; align-items: center; gap: 10px; margin: 0 16px 8px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--tint); font-size: 14px; }
.install span { flex: 1; min-width: 0; }
.install .go { flex: none; height: 36px; padding: 0 12px; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 600; }
.install .x { flex: none; width: 32px; height: 36px; color: var(--muted); font-size: 18px; }

main { flex: 1; min-height: 0; overflow-y: auto; padding-block: 2px calc(76px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.tier { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 4px; padding-block: 10px; border-top: 1px solid var(--line); }
.tier:first-child { border-top: 0; }
.num { position: sticky; top: 4px; align-self: start; font: 800 50px/.95 var(--display); letter-spacing: -.04em; color: var(--numeral); font-variant-numeric: tabular-nums; }
.num.ten { font-size: 40px; line-height: 1.15; }
.num.quarternum { font-size: 25px; line-height: 1.7; letter-spacing: -.04em; }
.num.none { font-size: 34px; color: var(--muted); line-height: 1.3; }
.rows { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tiehint { font-size: 12px; color: var(--muted); padding: 2px 0 0 2px; }

.row { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; touch-action: pan-y; }
.row.drag { position: relative; z-index: 3; box-shadow: 0 10px 26px rgba(0,0,0,.28); }
.row.flash { animation: flash 1.1s ease-out; }
@keyframes flash { 0%, 40% { background: var(--tint); } 100% { background: var(--surface); } }
.line { display: flex; align-items: center; min-height: 66px; }
.open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 6px; text-align: left; }
.thumb { flex: none; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: var(--tint); }
.thumb img, .slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.who { min-width: 0; }
.who b { display: block; font-weight: 600; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.who i { display: block; font-style: normal; font-size: 13px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.finding b { color: var(--muted); font-weight: 500; animation: pulse 1.4s ease-in-out infinite; }
.quiet b { color: var(--muted); font-weight: 500; }
@keyframes pulse { 50% { opacity: .45; } }
.rate { flex: none; height: 44px; padding: 0 8px; font-size: 13px; font-weight: 600; color: var(--accent); }
.handle { flex: none; width: 34px; height: 56px; display: grid; place-items: center; color: var(--muted); touch-action: none; cursor: grab; }
.handle svg { width: 16px; height: 16px; }
.num.halfnum { font-size: 32px; line-height: 1.45; letter-spacing: -.03em; }
.rate.unrated { margin-right: 6px; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); }
.padtop { display: flex; flex-direction: column; gap: 2px; }
.who-rates { font-weight: 700; color: var(--accent); }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 15px; }
.check input { flex: none; width: 24px; height: 24px; accent-color: var(--accent); }
.catline { display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-size: 13px; color: var(--muted); }
.catline button { height: 44px; padding-left: 12px; font-weight: 600; color: var(--accent); }
.field textarea, .inline textarea { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font: inherit; color: inherit; resize: vertical; }
.inline textarea { flex: 1; min-width: 0; background: var(--surface); }
.sheet.scrolls { max-height: 100%; overflow-y: auto; }
.filebtn { display: inline-flex; align-items: center; cursor: pointer; }
.splitline { font-size: 14px; color: var(--muted); margin-right: 8px; }
.keepbreaks { white-space: pre-wrap; }
.slide { position: relative; }
.coverchip { position: absolute; left: 8px; bottom: 8px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 10px; background: rgba(0,0,0,.66); color: #fff; font-size: 14px; font-weight: 600; }
.coverchip.on { min-height: 32px; background: var(--accent); color: var(--accent-ink); }
.padnote { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.ratings { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ratings li { display: flex; align-items: center; gap: 10px; padding-block: 6px; border-top: 1px solid var(--line); }
.ratings b { flex: none; min-width: 44px; font: 800 22px/1 var(--display); color: var(--numeral); }
.rwhen { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.rnote { color: var(--ink); }
.rdel { flex: none; min-height: 44px; padding-left: 8px; font-size: 13px; font-weight: 600; color: var(--danger); }
.photodel { position: absolute; right: 8px; top: 8px; min-height: 44px; padding: 0 12px; border-radius: 10px; background: rgba(0,0,0,.66); color: #fff; font-size: 14px; font-weight: 600; }
.ghost.danger { width: 100%; color: var(--danger); }
#catDelete { display: flex; flex-direction: column; gap: 10px; }
.sheet p.delask { color: var(--ink); font-weight: 600; }
.scores { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.scores button { height: 52px; border-radius: 10px; background: var(--tint); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }
.scores button.halfkey { height: 44px; margin-top: -2px; background: none; border: 1px solid var(--line); font-weight: 600; font-size: 16px; color: var(--muted); }
.scores button:nth-child(10) { margin-bottom: 8px; }
.scores button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.scoreval { font: 800 34px/1 var(--display); color: var(--numeral); margin-right: 8px; }
.empty { padding: 44px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.empty b { font: 800 22px/1.15 var(--display); color: var(--ink); text-wrap: balance; }

.toast { pointer-events: none; position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; padding: 10px 16px; border-radius: 20px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; z-index: 40; }

.scrim { position: absolute; inset: 0; background: var(--scrim); z-index: 30; display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--surface); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; gap: 14px; padding-block: 20px calc(20px + env(safe-area-inset-bottom, 0px)); padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
.sheet h2 { font: 800 22px/1.15 var(--display); text-wrap: balance; }
.sheet p { color: var(--muted); font-size: 15px; }
.sheet ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.field input { height: 50px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 18px; font-weight: 500; }
.primary { height: 52px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px; }
.primary[disabled] { opacity: .4; cursor: default; }
.ghost { height: 44px; border-radius: 12px; color: var(--muted); font-weight: 600; }
.err { color: var(--danger) !important; font-size: 14px; }

.gate { display: grid; place-items: center; overflow: auto; padding: 16px; }
.gate .card { max-width: 380px; border-radius: 18px; border: 1px solid var(--line); padding: 22px 18px; }

.camera { position: absolute; inset: 0; z-index: 25; background: var(--cam-bg); color: var(--cam-fg); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.camtop { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; }
.camtop button { height: 44px; padding: 0 8px; color: var(--cam-fg); font-weight: 600; }
.view { flex: 1; min-height: 0; position: relative; overflow: hidden; margin: 0 12px; border-radius: 12px; background: #000; display: grid; place-items: center; }
.view video { width: 100%; height: 100%; object-fit: cover; }
.flashfx { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flashfx.on { animation: fx .22s ease-out; }
@keyframes fx { 0% { opacity: .9; } 100% { opacity: 0; } }
.hint { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.62); color: #fff; font-size: 14px; text-align: center; }
.nocam { padding: 20px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.pick { display: inline-flex; align-items: center; height: 48px; padding: 0 18px; border-radius: 24px; background: var(--cam-fg); color: var(--cam-bg); font-weight: 700; cursor: pointer; }
.library { justify-self: start; display: inline-flex; align-items: center; height: 46px; padding: 0 16px; border-radius: 23px; border: 1px solid var(--cam-fg); color: var(--cam-fg); font-weight: 700; cursor: pointer; }
.shots { flex: none; display: flex; gap: 6px; height: 64px; padding: 8px 12px; overflow-x: auto; }
.shot { flex: none; width: 48px; height: 48px; border-radius: 7px; object-fit: cover; border: 1px solid var(--cam-line); }
.camfoot { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 4px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid var(--cam-fg); padding: 4px; }
.shutter::before { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--cam-fg); }
.shutter:active::before { transform: scale(.9); }
.shutter[disabled] { opacity: .3; }
.done { justify-self: end; height: 46px; padding: 0 16px; border-radius: 23px; background: var(--cam-fg); color: var(--cam-bg); font-weight: 700; }
.done[disabled] { opacity: .3; cursor: default; }

.detail { position: absolute; inset: 0; z-index: 15; background: var(--bg); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.dtop { flex: none; padding: 8px; }
.dtop button { height: 44px; padding: 0 10px; font-weight: 600; color: var(--accent); }
.dbody { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding-block: 0 calc(28px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.gallery { flex: none; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
.gallery::-webkit-scrollbar { display: none; }
.slide { flex: none; width: 78%; aspect-ratio: 1; max-width: 100%; border-radius: 14px; overflow: hidden; scroll-snap-align: center; background: var(--tint); }
.dbody h2 { font: 800 26px/1.1 var(--display); letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; }
.price { color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; margin-top: 4px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.about { max-width: 65ch; overflow-wrap: anywhere; }
.suggest { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: var(--tint); }
.suggest .hd { font-size: 13px; font-weight: 600; color: var(--muted); }
.suggest b { font-size: 18px; overflow-wrap: anywhere; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.small { min-height: 44px; padding: 0 14px; border-radius: 10px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); }
.small.main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.small.danger { color: var(--danger); }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 15px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.links { display: flex; flex-direction: column; gap: 4px; font-size: 14px; overflow-wrap: anywhere; }
.links a { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .row.flash, .finding b, .flashfx.on { animation: none; } }
