/* LikeMagnet app: same identity as the website (magnet red, indigo ink, cool paper), tuned for one-hand phone use. */
@font-face { font-family: "Unbounded"; src: url("unbounded-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Unbounded"; src: url("unbounded-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("hanken-grotesk-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("hanken-grotesk-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("hanken-grotesk-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("hanken-grotesk-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #F5F6FA; --surface: #FFFFFF; --ink: #1E1B3A; --muted: #5B6075; --magnet: #E3263B; --on-magnet: #FFFFFF;
  --steel: #A9B2C4; --blush: #FFE7EA; --line: #DCE0EA; --good: #16794A; --good-bg: #E2F5EB; --warn: #A15C00; --warn-bg: #FFF1DC;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif; --body: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 16px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #13122A; --surface: #1C1A38; --ink: #EEF0F8; --muted: #A3A8BD; --magnet: #FF4A5F; --steel: #7E879C; --blush: #3A1D2D; --line: #2E2C4C; --good: #4CC98A; --good-bg: #173327; --warn: #F0A848; --warn-bg: #3A2C14; color-scheme: dark; }
}
:root[data-theme="dark"] { --paper: #13122A; --surface: #1C1A38; --ink: #EEF0F8; --muted: #A3A8BD; --magnet: #FF4A5F; --steel: #7E879C; --blush: #3A1D2D; --line: #2E2C4C; --good: #4CC98A; --good-bg: #173327; --warn: #F0A848; --warn-bg: #3A2C14; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--body); -webkit-text-size-adjust: 100%; }
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--magnet); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }

/* Shell */
.top { position: sticky; top: 0; z-index: 4; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 12px; min-height: 56px; width: min(680px, 100% - 32px); margin: 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 8px; font: 800 .98rem/1 var(--display); text-decoration: none; letter-spacing: -.01em; }
.logo svg { width: 24px; height: 24px; }
.top nav { margin-left: auto; display: flex; gap: 4px; }
.top nav a { text-decoration: none; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.top nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
main.app { width: min(680px, 100% - 32px); margin: 0 auto; padding: 20px 0 80px; display: grid; gap: 16px; }

/* Type */
.h1 { font: 800 1.6rem/1.15 var(--display); letter-spacing: -.03em; }
.h2 { font: 700 1.15rem/1.3 var(--body); }
.lede { color: var(--muted); font-size: 1.02rem; }

/* Cards and blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; }
.card.hero { border: 2px solid var(--ink); }
.back { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: grid; gap: 10px; }

/* Buttons and chips */
.btn { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  background: var(--magnet); color: var(--on-magnet); font: 700 1rem/1 var(--body); padding: 14px 20px; border-radius: 999px; min-height: 48px;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--magnet) 55%, #000); transition: transform .1s ease, box-shadow .1s ease; }
.btn:active { transform: translateY(4px); box-shadow: none; }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; border: 1.5px solid var(--line); }
.btn.dark { background: var(--ink); color: var(--paper); box-shadow: 0 4px 0 color-mix(in srgb, var(--ink) 60%, #000); }
.btn.small { min-height: 38px; padding: 9px 14px; font-size: .9rem; box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { appearance: none; cursor: pointer; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .95rem/1 var(--body);
  padding: 11px 15px; border-radius: 999px; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.chip.on, .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.num-chips .chip { min-width: 52px; justify-content: center; font: 800 1.05rem/1 var(--display); }

/* Forms */
label.field { display: grid; gap: 6px; font-weight: 600; }
.hint { font-weight: 400; color: var(--muted); font-size: .88rem; }
input[type="email"], input[type="password"], input[type="text"], input[type="number"], input[type="tel"], textarea, select {
  width: 100%; font: 400 1rem/1.4 var(--body); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 600; margin-bottom: 4px; padding: 0; }

/* Steps on the home screen */
.steps { display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.step .n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 800 .95rem/1 var(--display); background: var(--paper); border: 1.5px solid var(--line); }
.step.done .n { background: var(--good); border-color: var(--good); color: #fff; }
.step b { display: block; }
.step span { color: var(--muted); font-size: .9rem; }
.step .go { color: var(--magnet); font-weight: 700; }

/* Uploader */
.drop { border: 2px dashed var(--steel); border-radius: var(--r); padding: 22px; text-align: center; display: grid; gap: 8px; justify-items: center; cursor: pointer; background: var(--surface); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(20, 18, 42, .75); color: #fff; font-weight: 700; cursor: pointer; }
.thumb .tag { position: absolute; left: 4px; bottom: 4px; background: rgba(20, 18, 42, .75); color: #fff; font-size: .72rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; }

/* Working state */
.working { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 28px 16px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--magnet); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { width: 100%; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--magnet); width: 0; transition: width .3s ease; }

/* Results */
.picks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .picks { grid-template-columns: repeat(3, 1fr); } }
.pick { display: grid; gap: 8px; align-content: start; }
.pick figure { margin: 0; position: relative; border-radius: 14px; overflow: hidden; background: var(--line); aspect-ratio: 4 / 5; }
.pick figure img { width: 100%; height: 100%; object-fit: cover; }
.pick .badge { position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font: 800 .85rem/1 var(--display); }
.pick:first-child .badge { background: var(--magnet); color: #fff; }
.pick b { font-size: .95rem; }
.pick p { font-size: .86rem; color: var(--muted); }
.pick a.dl { font-size: .86rem; font-weight: 700; color: var(--magnet); }
.score { display: flex; align-items: baseline; gap: 8px; }
.score b { font: 800 3rem/1 var(--display); letter-spacing: -.04em; color: var(--magnet); }
.meter { height: 10px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--magnet); }
.subscores { display: flex; gap: 16px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.subscores b { color: var(--ink); }
ul.clean { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fix { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.pill { font-size: .72rem; font-weight: 800; padding: 4px 8px; border-radius: 99px; margin-top: 2px; white-space: nowrap; }
.pill.high { background: var(--blush); color: var(--magnet); }
.pill.medium { background: var(--warn-bg); color: var(--warn); }
.pill.good { background: var(--good-bg); color: var(--good); }
.copybox { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.copybox .label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.copybox .text { font-size: 1rem; white-space: pre-wrap; }
.copybox .row { justify-content: space-between; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); }
.status.red { color: var(--magnet); border-color: var(--blush); background: var(--blush); }
.callout { padding: 14px; border-radius: 12px; background: var(--blush); color: var(--ink); }
.callout.good { background: var(--good-bg); }
.note-ok { color: var(--good); font-weight: 700; }

/* Report chart */
.chart { width: 100%; height: auto; }
.chart text { fill: var(--muted); font: 600 11px var(--body); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--paper); border-radius: 12px; padding: 12px; }
.stat b { display: block; font: 800 1.4rem/1.1 var(--display); }
.stat span { font-size: .8rem; color: var(--muted); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font-weight: 600; z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100% - 32px); }

/* Check-in page from email */
body.plain { display: grid; min-height: 100vh; place-items: center; }
.checkin-page { width: min(420px, 100% - 32px); display: grid; gap: 14px; text-align: center; justify-items: center; padding: 32px 0; }
.checkin-page .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; font-size: 2rem; font-weight: 800; }
.checkin-page h1 { font: 800 1.4rem/1.2 var(--display); letter-spacing: -.02em; }

/* Admin */
.admin-wide { width: min(1100px, 100% - 32px); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.tile b { display: block; font: 800 1.5rem/1.1 var(--display); }
.tile span { font-size: .82rem; color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
table.data th { font-size: .78rem; color: var(--muted); font-weight: 700; }
table.data td.wrap { white-space: normal; min-width: 200px; }
.health li { display: flex; gap: 8px; align-items: baseline; }
code.copyable { background: var(--paper); border: 1px solid var(--line); padding: 4px 8px; border-radius: 8px; word-break: break-all; }

@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .btn, .bar i { transition: none; } }

/* Admin settings: label line with status badge and where the value comes from */
label.field > .lbl { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
label.field > .lbl .pill { margin-top: 0; }

/* Admin dashboard: sidebar + content */
body.admin { background: var(--paper); }
.admin-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.admin-shell:has(> .side[hidden]) { grid-template-columns: minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px; background: #1E1B3A; color: #fff; }
.side[hidden] { display: none; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: #fff; text-decoration: none; font: 800 1.05rem/1 var(--display); letter-spacing: -.02em; }
.side-brand svg { width: 26px; height: 26px; }
.side nav { display: grid; gap: 2px; }
.side nav a, .side-out { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: rgba(255, 255, 255, .72); text-decoration: none; font: 600 .95rem/1.2 var(--body); background: none; border: 0; cursor: pointer; text-align: left; }
.side nav a:hover, .side-out:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side nav a[aria-current="page"] { background: #E3263B; color: #fff; }
.side svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
.side-out { margin-top: auto; }
.side a:focus-visible, .side-out:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.admin-main { width: 100%; max-width: 1120px; padding: 28px 32px 64px; display: grid; gap: 16px; align-content: start; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid2 .span2 { grid-column: 1 / -1; }
.card-head { display: flex; align-items: center; gap: 10px; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.settings { display: grid; gap: 16px; }
@media (prefers-color-scheme: dark) { .side { background: #0E0D20; border-right: 1px solid var(--line); } }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .side { height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; overflow-x: auto; z-index: 20; }
  .side-brand span, .side nav a span, .side-out span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .side nav { display: flex; gap: 2px; }
  .side-out { margin: 0 0 0 auto; }
  .admin-main { padding: 18px 16px 48px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
}

/* On/off switch (admin settings) */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; width: 46px; height: 26px; border-radius: 99px; background: var(--steel); position: relative; transition: background .15s ease; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s ease; }
.switch input:checked + .track { background: var(--good); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--magnet); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch .track, .switch .track::after { transition: none; } }
