/* Gleamworth review app: phone first, readable in daylight, touch targets of 44 px or more.
   Colours and sizes follow the approved phone screens. */
:root {
  --bg: #F6F6F3;
  --card: #FFFFFF;
  --ink: #18181B;
  --ink-2: #27272A;
  --muted: #52525B;
  --muted-2: #3F3F46;
  --label: #5B5B63;
  --line: #E4E4E0;
  --line-2: #D9D9D4;
  --soft: #ECECE8;
  --accent: #1E4FD8;
  --accent-dark: #163BA3;
  --accent-soft: #E6ECFC;
  --check-bg: #FDEBD3;
  --check-ink: #7A3E06;
  --warn: #C2410C;
  --warn-bg: #FFF4EC;
  --warn-ink: #9A3412;
  --warn-line: #F3C9A8;
  --warn-dark: #7C2D12;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.4;
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.loading, .empty { padding: 64px 20px; color: var(--muted); text-align: center; }

/* Screen frame */
.top { padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 12px; display: flex; flex-direction: column; gap: 10px; }
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.top-title { font-size: 14px; font-weight: 600; color: var(--muted); text-align: center; flex: 1; }
.icon-btn {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--ink); padding: 0; margin-left: -10px; text-decoration: none;
}
.text-btn {
  min-height: 44px; padding: 0 4px; border: none; background: none;
  font-size: 15px; font-weight: 600; color: var(--accent); text-decoration: none;
  display: inline-flex; align-items: center;
}
.text-btn.muted { color: var(--muted); }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar > div { height: 6px; background: var(--accent); }
.bar.thick { height: 8px; background: var(--soft); border-radius: 4px; }
.bar.thick > div { height: 8px; }
.body { flex: 1; padding: 0 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.bottom {
  position: sticky; bottom: 0; padding: 12px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  border-top: 1px solid var(--line); background: var(--bg);
}

/* Home */
.home-head { padding: calc(env(safe-area-inset-top, 0px) + 28px) 20px 4px; display: flex; justify-content: space-between; align-items: flex-end; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); }
.home-head h1 { font-size: 28px; font-weight: 700; line-height: 1.15; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit;
}
.card.dashed { border: 1px dashed var(--line-2); }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-title { font-size: 17px; font-weight: 600; }
.card.dashed .card-title { color: var(--muted-2); }
.card-sub { font-size: 14px; color: var(--muted); }
.count { font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.card.dashed .count { color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { border-radius: 14px; padding: 14px; gap: 2px; min-height: 44px; }
.tile .card-title { font-size: 15px; }
.tile .card-sub { font-size: 13px; }
.section-label { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--label); }
.pill { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--soft); color: var(--muted-2); white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 700; }
.stat .margin { font-size: 12px; color: var(--muted); }
.stat .what { font-size: 13px; color: var(--muted-2); }
.small { font-size: 13px; color: var(--muted); }
.signout { align-self: center; }

/* Site */
.site-name h1 { font-size: 21px; font-weight: 700; }
.site-name .meta { font-size: 14px; color: var(--muted); }
.shots { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.shot {
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); overflow: hidden;
  display: flex; flex-direction: column; padding: 0; text-align: left; height: 230px;
}
.shots.compact .shot { height: 170px; }
.shot img { width: 100%; flex: 1; min-height: 0; object-fit: cover; object-position: top; display: block; background: #EFEDE6; }
.shot .none { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; padding: 8px; text-align: center; }
.shot span.cap { font-size: 11px; font-weight: 600; color: var(--muted-2); padding: 4px 8px; background: var(--bg); }
.links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.links a { font-size: 14px; font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.links .small { margin-left: auto; }
.locked svg, .blind svg { flex: none; }
.locked { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--soft); color: var(--muted-2); font-size: 14px; }
.question { display: flex; justify-content: space-between; align-items: baseline; }
.question span { font-size: 15px; font-weight: 600; }
.question a { font-size: 14px; font-weight: 600; text-decoration: none; min-height: 44px; display: flex; align-items: center; }
.verdicts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.big {
  height: 64px; border-radius: 14px; border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font-size: 18px; font-weight: 700;
}
.big.prospect { border-color: var(--accent); color: var(--accent); }
.unsure-link { align-self: center; min-height: 44px; border: none; background: none; font-size: 15px; font-weight: 600; color: var(--muted); }

.thumb-row { display: flex; gap: 10px; align-items: center; }
.thumb { width: 76px; height: 50px; flex: none; border-radius: 6px; border: 1px solid var(--line-2); background: #EFEDE6; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.thumb-row .name { font-size: 17px; font-weight: 700; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group-label { font-size: 13px; font-weight: 600; color: var(--muted-2); }
.seg { display: grid; gap: 8px; }
.seg.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg.verdict3 { grid-template-columns: 1fr 1fr auto; }
.seg button {
  min-height: 48px; border-radius: 12px; border: 2px solid var(--line-2); background: var(--card);
  font-size: 16px; font-weight: 600; padding: 0 10px;
}
.seg.three button { min-height: 44px; border-radius: 10px; border-width: 1px; font-size: 15px; font-weight: 500; }
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 700; }
.seg.three button[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.seg.dark button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.seg .minor { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 999px; background: var(--soft); color: var(--muted-2); }
.chip.check { background: var(--check-bg); color: var(--check-ink); }
.chip.plain { font-weight: 400; background: var(--bg); padding: 4px 8px; }
.reason {
  min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); font-size: 13px;
}
.reason[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.dark .reason[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted-2); }
.field input, .field textarea, input.plain {
  min-height: 44px; border-radius: 10px; border: 1px solid var(--line-2); padding: 10px 12px;
  font: inherit; font-size: 16px; font-weight: 400; background: var(--card); color: var(--ink); width: 100%;
}
.field textarea { resize: vertical; min-height: 64px; }
.field .hint { font-weight: 400; color: var(--warn-ink); }
.primary {
  width: 100%; height: 54px; border-radius: 14px; border: none; background: var(--ink); color: #fff;
  font-size: 17px; font-weight: 700;
}
.primary:disabled { background: #D4D4D8; color: var(--muted-2); }
.error { color: var(--warn-ink); font-size: 14px; font-weight: 600; }

/* Judge card */
.judge { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.judge .pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vpill { font-size: 15px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: #fff; }
.vpill.not { background: var(--ink); }
.vpill.unsure { background: var(--soft); color: var(--muted-2); }
.tpill { font-size: 15px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.judge ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.judge .conf { font-size: 13px; font-weight: 600; color: var(--muted); }
.blind { background: var(--card); border: 1px dashed #A1A1AA; border-radius: 14px; padding: 14px; display: flex; gap: 10px; align-items: flex-start; }
.blind strong { font-size: 15px; display: block; }
.blind p { font-size: 14px; color: var(--muted); }
.match { border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 600; }
.match.yes { background: var(--accent-soft); color: var(--accent-dark); }
.match.no { background: var(--warn-bg); color: var(--warn-ink); }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.agree { height: 56px; border-radius: 14px; border: 2px solid var(--ink); background: var(--ink); color: #fff; font-size: 17px; font-weight: 700; }
.overrule { height: 56px; border-radius: 14px; border: 2px solid var(--warn); background: var(--warn-bg); color: var(--warn-ink); font-size: 17px; font-weight: 700; }
.panel { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.panel .group-label { color: var(--warn-dark); }
.notice { background: var(--soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--muted-2); }

/* Definitions */
.defs { display: flex; flex-direction: column; gap: 12px; }
.defs h1 { display: none; }
.defs h2 { font-size: 16px; font-weight: 700; margin-top: 6px; }
.defs h3 { font-size: 15px; font-weight: 600; margin-top: 4px; }
.defs p, .defs li { font-size: 14px; line-height: 1.45; }
.defs p:first-of-type { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: var(--soft); color: var(--muted-2); align-self: flex-start; }

/* Ranked list */
.list-head { padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); }
.list-head h1 { font-size: 21px; font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter, .filters select {
  flex: none; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); font-size: 13px; color: var(--ink);
}
.filter[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 600; }
.rows { display: flex; flex-direction: column; }
.row {
  text-decoration: none; color: inherit; display: flex; gap: 12px; align-items: center; padding: 12px 20px;
  border-bottom: 1px solid var(--soft); background: var(--card); min-height: 68px;
}
.row .rank { width: 30px; font-size: 14px; font-weight: 700; color: var(--muted); }
.row .mini { width: 64px; height: 44px; flex: none; border-radius: 6px; border: 1px solid var(--line-2); background: #EFEDE6; overflow: hidden; }
.row .mini img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row .txt b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .txt span { font-size: 13px; color: var(--muted); }
.badge { flex: none; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: var(--soft); color: var(--muted-2); }
.badge.todo { background: var(--accent-soft); color: var(--accent-dark); }
.badge.over { background: var(--warn-bg); color: var(--warn-ink); }

/* Full-screen image */
.viewer { position: fixed; inset: 0; background: rgba(10, 10, 12, 0.94); z-index: 10; display: flex; flex-direction: column; }
.viewer .close { align-self: flex-end; margin: calc(env(safe-area-inset-top, 0px) + 8px) 8px 0; width: 48px; height: 48px; border: none; background: none; color: #fff; font-size: 28px; }
.viewer .scroll { flex: 1; overflow: auto; touch-action: pan-x pan-y pinch-zoom; }
.viewer img { width: 100%; display: block; }

/* Sign in */
.signin { padding: 64px 20px; display: flex; flex-direction: column; gap: 14px; }
.signin h1 { font-size: 28px; font-weight: 700; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; z-index: 20;
}
