/* Huedata app: black gallery ground, light type, color as the only loud element */
:root {
  --bg: #0b0b0b;
  --panel: #141414;
  --line: #262626;
  --ink: #f2f2f2;
  --muted: #9a9a9a;
  --soft: #cfcfcf;
  --spectrum: linear-gradient(90deg, #ff3b3b, #ffd60a, #5ad35a, #19c3c3, #2f7bff, #e040c8);
  --sans: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #050505; color: var(--ink); font-family: var(--sans); font-weight: 400; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mono { font-family: var(--mono); }
.eyebrow { font-size: 13px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }

.app { position: relative; max-width: 480px; margin: 0 auto; height: 100%; background: var(--bg); overflow: hidden; }
.view { position: absolute; inset: 0 0 calc(64px + env(safe-area-inset-bottom, 0px)) 0; overflow-y: auto; overflow-x: hidden; }
.app.fullbleed .view { bottom: 0; }
.app.fullbleed .tabs { display: none; }

.tabs { position: absolute; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid #1e1e1e; background: var(--bg); z-index: 5; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; color: var(--muted); }
.tabs a.on { color: var(--ink); }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 8px; }
.top .logo { height: 22px; display: block; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; border-radius: 22px; cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.badge { font-size: 12px; letter-spacing: 0.12em; padding: 4px 8px; border-radius: 10px; border: 1px solid #555; color: #e6e6e6; white-space: nowrap; }

.seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; padding: 3px; border-radius: 22px; background: #1a1a1a; }
.seg button { height: 38px; border-radius: 19px; border: 0; background: transparent; color: var(--soft); font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #0b0b0b; }
.seg button:disabled { color: #555; cursor: default; }

.pill { height: 54px; border-radius: 27px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; font-weight: 500; cursor: pointer; padding: 0 22px; }
.pill.solid { background: var(--ink); color: #0b0b0b; }
.pill.ring { padding: 1.5px; background: var(--spectrum); }
.pill.ring > span { height: 100%; width: 100%; border-radius: 26px; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 0 20px; }
.actions { position: sticky; bottom: 0; padding: 18px 16px 18px; background: linear-gradient(180deg, rgba(11,11,11,0) 0%, var(--bg) 30%); display: flex; gap: 10px; }
.actions .pill { flex: 1 1 0; }

.toast { position: absolute; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #0b0b0b; padding: 10px 16px; border-radius: 20px; font-size: 14px; z-index: 20; white-space: nowrap; }

/* SCAN */
.scan { position: absolute; inset: 0; background: #000; overflow: hidden; }
.scan video, .scan canvas.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan .shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(11,11,11,0.65) 0%, rgba(11,11,11,0) 22%, rgba(11,11,11,0) 48%, rgba(11,11,11,0.9) 74%, #0b0b0b 100%); }
.scan .top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; }
.reticle { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%; border: 1.5px solid #fff; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); transition: left .15s, top .15s; }
.reticle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #fff; }
.reticle .swatch { position: absolute; right: -8px; bottom: -8px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; }
.hint { position: absolute; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: 13px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.6); pointer-events: none; }
.reading { position: absolute; left: 16px; right: 16px; bottom: calc(210px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; z-index: 2; }
.reading .nm { font-size: clamp(30px, 9vw, 40px); font-weight: 300; line-height: 1.02; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.reading .meta { font-family: var(--mono); font-size: 14px; color: var(--soft); margin-top: 6px; }
.reading .stage { text-align: right; flex-shrink: 0; }
.reading .stage b { display: block; font-weight: 300; font-size: 22px; margin-top: 6px; }
.palette { position: absolute; left: 16px; right: 16px; bottom: calc(210px + env(safe-area-inset-bottom, 0px)); display: flex; height: 72px; border-radius: 16px; overflow: hidden; z-index: 2; }
.palette button { flex: 1 1 0; border: 0; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-family: var(--mono); font-size: 11px; }
.scan .seg { position: absolute; left: 16px; right: 16px; bottom: calc(146px + env(safe-area-inset-bottom, 0px)); z-index: 2; }
.controls { position: absolute; left: 0; right: 0; bottom: calc(30px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; justify-content: space-around; padding: 0 40px; z-index: 2; }
.controls .side { width: 52px; height: 52px; border-radius: 16px; border: 1px solid #444; background: #161616; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; }
.controls .side svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.capture { width: 84px; height: 84px; border-radius: 50%; padding: 2px; border: 0; background: conic-gradient(#ff3b3b, #ffd60a, #5ad35a, #19c3c3, #2f7bff, #7a4dff, #e040c8, #ff3b3b); cursor: pointer; }
.capture span { display: flex; width: 100%; height: 100%; border-radius: 50%; background: #0b0b0b; align-items: center; justify-content: center; }
.capture i { display: block; width: 66px; height: 66px; border-radius: 50%; }
.camera-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; background: radial-gradient(circle at 50% 35%, #1d1d1d, #0b0b0b 70%); }
.camera-off h2 { margin: 0; font-weight: 300; font-size: 28px; line-height: 1.15; }
.camera-off p { margin: 0; color: var(--soft); font-size: 15px; line-height: 1.5; max-width: 320px; }

/* CARD */
.field { margin: 6px 16px 0; height: 420px; border-radius: 28px; position: relative; overflow: hidden; }
.field .tl { position: absolute; top: 20px; left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: flex-start; }
.field .tl .lab { display: flex; flex-direction: column; gap: 4px; font-size: 13px; letter-spacing: 0.14em; }
.wheel { width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(from 0deg, #ff3b3b, #ffd60a, #5ad35a, #19c3c3, #2f7bff, #7a4dff, #e040c8, #ff3b3b); display: flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0; }
.wheel span { width: 40px; height: 40px; border-radius: 50%; display: block; }
.wheel i { position: absolute; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: #fff; border: 2px solid #0b0b0b; }
.field .bl { position: absolute; left: 22px; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; }
.field .big { font-size: clamp(40px, 13vw, 52px); font-weight: 300; line-height: 0.98; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.field .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; }
.coords { margin: 18px 16px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.coords div { padding: 14px 0 14px 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.coords span:first-child { font-size: 12px; letter-spacing: 0.14em; color: var(--muted); }
.coords span:last-child { font-family: var(--mono); font-size: 14px; line-height: 1.35; }
.contrast { margin: 14px 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.contrast div { padding: 12px 14px; border-radius: 14px; display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.contrast span:last-child { font-family: var(--mono); font-size: 14px; }
.sec { padding: 36px 20px 0; position: relative; }
.sec h3 { margin: 8px 0 0; font-size: 26px; font-weight: 300; line-height: 1.15; text-wrap: balance; }
.sec .note { margin-top: 12px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.sample { font-size: 12px; letter-spacing: 0.08em; color: #7d7d7d; text-transform: uppercase; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.harm { display: flex; height: 64px; margin-top: 16px; border-radius: 14px; overflow: hidden; }
.harm button { flex: 1 1 0; border: 0; cursor: pointer; }
.harm-names { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.harm-names div { min-width: 0; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.harm-names span { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.locked { position: relative; }
.locked .blur { filter: blur(9px); pointer-events: none; user-select: none; }
.lock-card { position: absolute; left: 20px; right: 20px; top: 50%; transform: translateY(-50%); padding: 18px; border-radius: 20px; background: var(--ink); color: #0b0b0b; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.lock-card .eyebrow { color: #555; }
.lock-card b { font-weight: 300; font-size: 20px; line-height: 1.2; }
.lock-card a { font-size: 15px; font-weight: 500; text-decoration: underline; }
.curve { display: block; width: 100%; height: auto; margin-top: 16px; }
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); font-size: 13px; color: var(--muted); margin-top: 6px; }
.stages .on { color: var(--ink); }
.sig { position: relative; width: 100%; max-width: 350px; aspect-ratio: 1; margin: 12px auto 0; }
.sig .ring { position: absolute; left: 20.3%; top: 20.3%; width: 59.4%; height: 59.4%; border-radius: 50%; border: 1px solid var(--line); }
.sig .lobe { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); }
.sig .lbl { position: absolute; transform: translate(-50%, -50%); font-size: 13px; white-space: nowrap; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.duo { display: flex; flex-shrink: 0; }
.duo i { width: 22px; height: 40px; display: block; }
.duo i:first-child { border-radius: 6px 0 0 6px; } .duo i:last-child { border-radius: 0 6px 6px 0; }
.grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.grow small { font-size: 14px; color: var(--muted); }
.use { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.use button { height: 56px; border-radius: 14px; border: 1px solid #333; background: var(--panel); font-size: 15px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; cursor: pointer; }
.use button small { font-size: 12px; letter-spacing: 0.1em; color: var(--muted); }

/* WATCHLIST */
.page { padding: 14px 16px 40px; }
.page h1 { margin: 8px 0 0; font-size: clamp(36px, 11vw, 44px); font-weight: 300; line-height: 1; letter-spacing: -0.02em; text-wrap: balance; }
.alert-banner { margin-top: 18px; min-height: 112px; border-radius: 24px; padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.alert-banner b { font-weight: 300; font-size: 24px; line-height: 1.12; }
.grid2 { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { height: 176px; border-radius: 22px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.tile .nm { font-size: 20px; font-weight: 300; line-height: 1.08; overflow-wrap: anywhere; }
.tile .row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: 0.1em; }
.tile .x { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 16px; border: 0; background: rgba(0,0,0,0.18); color: inherit; cursor: pointer; font-size: 16px; line-height: 1; }
.empty { margin-top: 28px; padding: 28px 20px; border: 1px dashed #333; border-radius: 22px; text-align: center; color: var(--soft); line-height: 1.5; }

/* PLANS */
.plan-card { border: 0; padding: 1.5px; border-radius: 24px; background: #262626; text-align: left; cursor: pointer; width: 100%; }
.plan-card[aria-pressed="true"] { background: var(--spectrum); }
.plan-card > span { display: flex; flex-direction: column; gap: 14px; border-radius: 23px; background: #111; padding: 20px; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.plan-head b { font-weight: 300; font-size: 26px; }
.plan-card ul { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.35; color: #e6e6e6; }
.fine { text-align: center; font-size: 14px; color: var(--muted); line-height: 1.45; margin: 10px 0 0; }

@media (min-width: 520px) {
  body { padding-block: 20px; }
  .app { height: calc(100% - 40px); border-radius: 36px; box-shadow: 0 0 0 1px #222, 0 40px 100px rgba(0,0,0,0.6); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
