/* OPSIN web — warm sun-forward theme */
:root {
  --bg: #fdf8f0;
  --bg-sky: linear-gradient(180deg, #cfe8f5 0%, #fdf8f0 240px);
  --card: #ffffff;
  --ink: #1d2430;
  --ink-2: #5b6472;
  --ink-3: #8a93a2;
  --accent: #f5a623;
  --accent-deep: #e8890c;
  --good: #34a853;
  --warn: #e8890c;
  --bad: #d93a2f;
  --indigo: #5865c9;
  --radius: 18px;
  --shadow: 0 2px 14px rgba(30, 40, 60, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  background-image: var(--bg-sky);
  background-repeat: no-repeat;
  color: var(--ink);
  min-height: 100vh;
}
.hidden { display: none !important; }

#main { max-width: 560px; margin: 0 auto; padding: 0 16px calc(84px + env(safe-area-inset-bottom)); }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 4px 8px; }
.topbar h1 { font-size: 34px; margin: 0; letter-spacing: -.5px; }
.loc-line { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; margin-top: 4px; text-transform: uppercase; letter-spacing: .6px; }
.loc-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.streak-badge { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent-deep); background: #fff; }

.view { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h3 { margin: 0 0 4px; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; color: #5d6b85; display: flex; justify-content: space-between; align-items: center; }
.card .big { font-size: 30px; font-weight: 700; margin: 6px 0 2px; }
.card .sub { color: var(--ink-2); font-size: 14px; }
.muted { color: var(--ink-3); font-size: 12px; }
.center { text-align: center; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Progress ring */
.ring-wrap { display: flex; flex-direction: column; align-items: center; padding: 8px 0; }
.ring { position: relative; width: 190px; height: 190px; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .pct { font-size: 44px; font-weight: 800; }
.ring .lbl { color: var(--ink-2); font-size: 13px; }
.pill { display: inline-block; background: #fff3dd; color: var(--accent-deep); border-radius: 999px; padding: 3px 12px; font-weight: 600; font-size: 14px; margin-top: 4px; }
.tri { display: flex; justify-content: space-around; border-top: 1px solid #eef0f4; margin-top: 14px; padding-top: 12px; }
.tri > div { text-align: center; }
.tri .v { font-size: 18px; font-weight: 700; }
.tri .k { font-size: 12px; color: var(--ink-2); }

/* Plan list */
.plan-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f2f6; align-items: flex-start; }
.plan-item:last-child { border-bottom: none; }
.plan-item .icon { font-size: 20px; width: 30px; text-align: center; flex: none; margin-top: 1px; }
.plan-item .body { flex: 1; }
.plan-item .t { font-weight: 650; font-size: 15px; }
.plan-item .d { color: var(--ink-2); font-size: 13px; margin-top: 2px; line-height: 1.35; }
.plan-item .when { font-size: 13px; font-weight: 700; color: var(--accent-deep); white-space: nowrap; }
.plan-item.done { opacity: .5; }
.plan-item.now { background: #fff8ec; margin: 0 -10px; padding: 12px 10px; border-radius: 12px; border-bottom: none; }

/* Windows */
.win-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: #faf7f1; margin-bottom: 8px; }
.win-row .rank { background: var(--accent); color: #fff; border-radius: 8px; font-size: 12px; font-weight: 800; padding: 3px 8px; }
.win-row .t { font-weight: 700; }
.win-row .meta { color: var(--ink-2); font-size: 13px; }
.win-row .iu { margin-left: auto; font-weight: 800; color: var(--accent-deep); }

/* Sun arc */
.arc-wrap { display: flex; flex-direction: column; align-items: center; }
.arc-times { display: flex; justify-content: space-between; width: 100%; color: var(--ink-2); font-size: 13px; margin-top: -8px; }

/* Track */
.timer { font-size: 64px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; margin: 8px 0; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; background: #eef0f4; color: var(--ink-2); }
.badge.live { background: #e3f6e8; color: var(--good); }
.badge.low { background: #f4f4f6; color: var(--ink-2); }

button.primary {
  appearance: none; border: 0; width: 100%; padding: 15px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
}
button.primary:disabled { opacity: .45; cursor: default; }
button.secondary {
  appearance: none; border: 1.5px solid var(--accent); background: #fff; color: var(--accent-deep);
  width: 100%; padding: 13px; border-radius: 999px; font-size: 16px; font-weight: 700; cursor: pointer;
}
button.ghost { appearance: none; border: 0; background: transparent; color: var(--accent-deep); font-weight: 700; font-size: 14px; cursor: pointer; padding: 8px; }

.session-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f2f6; font-size: 14px; }
.session-row:last-child { border-bottom: none; }
.session-row .iu { font-weight: 700; color: #2b8ccb; }

/* Stats bars */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 130px; margin-top: 12px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar { width: 100%; border-radius: 6px 6px 3px 3px; background: #e8ebf0; min-height: 4px; position: relative; }
.bars .bar.f { background: linear-gradient(180deg, var(--accent), #f7c15e); }
.bars .day { font-size: 11px; color: var(--ink-2); }
.bars .pctlbl { font-size: 10px; color: var(--ink-2); }

/* Forms / settings */
.field { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid #f0f2f6; gap: 10px; }
.field:last-child { border-bottom: none; }
.field label { font-size: 15px; }
.field .hint { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.field input[type="number"], .field input[type="time"], .field input[type="text"], .field select {
  font-size: 15px; padding: 8px 10px; border-radius: 10px; border: 1px solid #dfe3ea; background: #fbfbfd; max-width: 150px; text-align: right;
}
.field input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }
.seg { display: flex; background: #eef0f4; border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 4px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* Skin type cards */
.skin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.skin-card { border: 2px solid transparent; border-radius: 14px; padding: 12px; cursor: pointer; background: #faf7f1; }
.skin-card.on { border-color: var(--accent); background: #fff6e6; }
.skin-card .sw { width: 30px; height: 30px; border-radius: 50%; margin-bottom: 8px; border: 2px solid rgba(0,0,0,.08); }
.skin-card .t { font-weight: 700; font-size: 14px; }
.skin-card .d { font-size: 12px; color: var(--ink-2); }

/* Onboarding */
.onboarding { position: fixed; inset: 0; background: var(--bg); background-image: var(--bg-sky); z-index: 50; overflow-y: auto; }
.ob-inner { max-width: 520px; margin: 0 auto; padding: 40px 20px 40px; display: flex; flex-direction: column; min-height: 100vh; }
.ob-progress { height: 6px; background: #e8e3d8; border-radius: 3px; margin-bottom: 28px; overflow: hidden; }
.ob-progress .fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.ob-inner h2 { font-size: 30px; text-align: center; margin: 8px 0 6px; letter-spacing: -.4px; }
.ob-inner .lead { text-align: center; color: var(--ink-2); margin: 0 0 24px; font-size: 15px; }
.ob-body { flex: 1; }
.ob-actions { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.ob-logo { text-align: center; font-size: 46px; margin-bottom: 4px; }
.ob-note { background: #fff8ec; border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); margin-top: 16px; line-height: 1.4; }

.uv-scale { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 10px; }
.uv-scale div { flex: 1; }
.uv-marker { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

.disclaimer { text-align: center; color: var(--ink-3); font-size: 11.5px; padding: 6px 20px 0; line-height: 1.45; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-top: 1px solid #eceef2;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); z-index: 40;
}
.tabbar .tab { appearance: none; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--ink-3); font-weight: 600; cursor: pointer; padding: 4px 14px; border-radius: 12px; }
.tabbar .tab.active { color: var(--accent-deep); background: #fff3dd; }
.tab-icon { font-size: 19px; }

@media (min-width: 600px) {
  .tabbar { max-width: 560px; left: 50%; transform: translateX(-50%); border-radius: 18px 18px 0 0; border: 1px solid #eceef2; border-bottom: 0; }
}

/* Settings Support & Legal rows */
.link-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f0f2f6; text-decoration: none; color: var(--ink); }
.link-row:last-child { border-bottom: none; }
.link-row .lr-icon { font-size: 18px; width: 26px; text-align: center; }
.link-row .lr-body { flex: 1; }
.link-row .lr-t { font-size: 15px; font-weight: 600; }
.link-row .lr-d { font-size: 12px; color: var(--ink-3); }
.link-row .lr-chev { color: var(--ink-3); }

/* Standalone document pages (FAQ, legal) */
.doc { max-width: 720px; margin: 0 auto; padding: 28px 20px 80px; }
.doc-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.doc-nav a { color: var(--accent-deep); text-decoration: none; font-weight: 600; font-size: 14px; }
.doc h1 { font-size: 30px; letter-spacing: -.4px; margin: 6px 0 4px; }
.doc .eff { color: var(--ink-3); font-size: 13px; margin-bottom: 22px; }
.doc h2 { font-size: 19px; margin: 28px 0 8px; }
.doc h3 { font-size: 16px; margin: 20px 0 6px; }
.doc p, .doc li { color: var(--ink); font-size: 15px; line-height: 1.6; }
.doc ul { padding-left: 20px; }
.doc a { color: var(--accent-deep); }
.doc .callout { background: #fff8ec; border: 1px solid #f3ddb0; border-radius: 12px; padding: 14px 16px; margin: 18px 0; font-size: 14.5px; line-height: 1.55; }
.doc .callout strong { color: var(--accent-deep); }
.doc .faq-q { font-weight: 700; margin-top: 22px; font-size: 16px; }
.doc .faq-a { color: var(--ink-2); margin-top: 4px; line-height: 1.6; }
.doc footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid #eceef2; color: var(--ink-3); font-size: 12.5px; }
.doc footer a { color: var(--ink-2); }
