/* Daylight design: white + cobalt, Plus Jakarta Sans */
:root {
  --bg: #F3F5FA;
  --card: #FFFFFF;
  --ink: #0E1330;
  --muted: #5B6178;
  --line: #E4E7F0;
  --soft: #EEF0F6;
  --blue: #2F4BFF;
  --blue-ink: #1A32D6;
  --blue-soft: #E8ECFF;
  --blue-pale: #D3DAFF;
  --warn: #B3321A;
  --warn-soft: #FFF4F1;
  --warn-line: #F3B4A5;
  --ok: #0B7A55;
  --ok-soft: #E3F6EE;
  --radius: 24px;
  --shadow-blue: 0 18px 40px -18px rgba(47, 75, 255, .55);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--blue); text-decoration: none; font-weight: 700; }
a:hover { color: var(--blue-ink); }
button { font-family: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; }
input, textarea, select { font-family: inherit; font-size: 16px; color: var(--ink); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.chip { font-size: 12px; font-weight: 700; color: var(--blue); background: var(--blue-soft); border-radius: 8px; padding: 5px 8px; min-width: 34px; text-align: center; }
.pill-group { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 3px; }
.pill-group button { border: none; background: transparent; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; color: var(--muted); min-height: 36px; }
.pill-group button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(14, 19, 48, .12); }
.btn { border: none; border-radius: 16px; min-height: 52px; padding: 0 18px; font-size: 16px; font-weight: 700; background: var(--ink); color: #fff; }
.btn:disabled { background: var(--line); color: var(--muted); }
.btn.blue { background: var(--blue); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); min-height: 40px; font-size: 13px; border-radius: 12px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn.plus { border: none; background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.bar { position: relative; height: 14px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--blue); border-radius: 99px; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.error-box { background: var(--warn-soft); color: var(--warn); border-radius: 14px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- Editor app ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.brandmark { font-weight: 800; font-size: 16px; flex-grow: 1; white-space: nowrap; }
@media (max-width: 480px) { .hide-sm { display: none; } }
.brandmark b { color: var(--blue); }
.avatar { width: 40px; height: 40px; border-radius: 99px; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.streak { display: flex; align-items: center; gap: 3px; }
.streak i { width: 9px; height: 18px; border-radius: 3px; background: var(--blue); display: block; }
.streak i.off { background: none; border: 1.5px dashed #9AA6FF; }
.streak b { margin-left: 6px; font-size: 15px; }

.ed-wrap { max-width: 1240px; margin: 0 auto; padding: 18px 16px 48px; display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "hello" "hero" "split" "log" "goal" "history" "check" "best" "past"; }
.a-hello { grid-area: hello; } .a-hero { grid-area: hero; } .a-split { grid-area: split; } .a-log { grid-area: log; }
.a-goal { grid-area: goal; } .a-history { grid-area: history; } .a-check { grid-area: check; } .a-best { grid-area: best; } .a-past { grid-area: past; }
@media (min-width: 900px) {
  .ed-wrap { padding: 28px 28px 56px; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(340px, 1fr);
    grid-template-areas: "hello hello hello" "hero hero log" "split split log" "goal history log" "check past past" "best best best"; align-items: start; }
  .a-log { position: sticky; top: 16px; }
}
.hello h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }

.hero { background: var(--blue); color: #fff; border-radius: 28px; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-blue); }
.hero .pill-group { background: rgba(255,255,255,.16); }
.hero .pill-group button { color: #fff; }
.hero .pill-group button.on { background: #fff; color: var(--blue); box-shadow: none; }
.hero .amount { font-size: 54px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.hero .sub { font-size: 14px; color: #DCE1FF; }
.payout { display: flex; align-items: center; gap: 10px; background: #fff; color: var(--ink); border-radius: 16px; padding: 12px 14px; font-size: 14px; }
.payout b { margin-left: auto; }
.est-tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; background: rgba(255,255,255,.18); border-radius: 999px; padding: 3px 8px; }

.line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--soft); }
.line:first-of-type { border-top: none; }
.line .grow { flex-grow: 1; display: flex; flex-direction: column; }
.line .amt { font-weight: 800; }

.chips5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.chips5 button { height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-size: 16px; font-weight: 800; }
.chips5 button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.stepper { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 14px; padding: 4px; }
.stepper .icon-btn { border: none; }
.stepper span { flex-grow: 1; text-align: center; font-size: 20px; font-weight: 800; }
.counter { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 16px; background: var(--bg); }
.counter .lbl { flex-grow: 1; font-weight: 700; }
.counter .n { width: 32px; text-align: center; font-size: 20px; font-weight: 800; }
.choice2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice2 button { min-height: 60px; border-radius: 16px; border: 2px solid var(--line); background: #fff; font-size: 14px; font-weight: 700; padding: 8px; }
.choice2 button.good { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-ink); }
.choice2 button.bad { border-color: #E5684B; background: var(--warn-soft); color: var(--warn); }
textarea.blocker { width: 100%; background: #FFF9F7; border: 2px solid var(--warn-line); border-radius: 16px; padding: 12px; resize: vertical; min-height: 90px; }
.label { font-size: 13px; font-weight: 600; color: var(--muted); }
select.day { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 10px; font-size: 14px; font-weight: 600; max-width: 210px; }
.done-badge { width: 52px; height: 52px; border-radius: 16px; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 170px; }
.bars > div { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bars .b { width: 100%; border-radius: 10px; background: var(--blue-pale); }
.bars .b.now { background: var(--blue); }
.bars .b.est { background: repeating-linear-gradient(135deg, var(--blue) 0 6px, #5A72FF 6px 12px); }
.bars .v { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.bars .l { font-size: 11px; color: var(--muted); white-space: nowrap; }

.check-list { background: var(--bg); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.check-list div { display: flex; gap: 10px; font-size: 14px; }
.check-list div::before { content: '→'; color: var(--blue); font-weight: 800; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tile { position: relative; height: 250px; border-radius: 22px; overflow: hidden; background: var(--blue) center/cover no-repeat; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; }
.tile::after { content: ''; position: absolute; inset: 40% 0 0 0; background: linear-gradient(transparent, rgba(14,19,48,.75)); }
.tile > * { position: relative; z-index: 1; }
.tile .views { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: #fff; }
.tile .tap { font-size: 12px; font-weight: 600; color: #DCE1FF; }
.tile .play { position: absolute; top: 12px; left: 12px; width: 36px; height: 36px; border-radius: 99px; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; z-index: 1; }

.past-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--soft); }
.past-row .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--blue); flex-shrink: 0; }
.past-row .dot.bad { background: #E5684B; }
.past-row .grow { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.past-row .note { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Admin ---------- */
.adm-top { background: #fff; border-bottom: 1px solid var(--line); }
.adm-top-in { max-width: 1240px; margin: 0 auto; padding: 12px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.adm-nav { display: flex; flex-wrap: wrap; gap: 4px; flex-grow: 1; }
.adm-nav button { border: none; background: none; border-radius: 10px; padding: 9px 14px; font-size: 14px; font-weight: 700; color: var(--muted); min-height: 40px; }
.adm-nav button.on { background: var(--ink); color: #fff; }
.adm-main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 56px; display: flex; flex-direction: column; gap: 16px; }
.flexwrap { display: flex; flex-wrap: wrap; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi { background: #fff; border-radius: 22px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi .v { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.tag { align-self: flex-start; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 4px 8px; background: var(--bg); color: var(--muted); }
.tag.up { background: var(--ok-soft); color: var(--ok); }
.tag.down { background: var(--warn-soft); color: var(--warn); }
.cost-hero { flex: 1 1 340px; min-width: 0; }
.stackbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; background: rgba(255,255,255,.2); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; min-height: 36px; }
.filters button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chart { display: flex; align-items: flex-end; gap: 12px; height: 240px; }
.chart > div { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart .col { width: 100%; max-width: 40px; display: flex; flex-direction: column-reverse; border-radius: 10px; overflow: hidden; }
.chart .t { font-size: 12px; font-weight: 700; }
.chart .l { font-size: 11px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 99px; display: block; }
.ed-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ed-card .mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ed-card .mini span { display: block; font-size: 11px; color: var(--muted); }
.ed-card .mini b { font-size: 16px; font-weight: 800; }
.status { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; background: var(--bg); color: var(--muted); }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.behind { background: var(--warn-soft); color: var(--warn); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--soft); }
.list-row .grow { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.initials { width: 40px; height: 40px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.blocker-item { background: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.table-wrap { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; min-width: 640px; }
table.grid th { font-size: 12px; color: var(--muted); text-align: left; font-weight: 600; padding: 8px; }
table.grid td { padding: 8px; border-top: 1px solid var(--soft); vertical-align: middle; }
table.grid input { width: 72px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: 15px; }
.hint { font-size: 11px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.linkbox { font-size: 12px; color: var(--muted); word-break: break-all; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: #fff; border-radius: 28px; padding: 32px 28px; max-width: 380px; width: 100%; display: flex; flex-direction: column; gap: 16px; text-align: center; align-items: center; }
