/* Buzz Curve keeps its own palette and type. This sheet loads after
   shared/style.css, so equal-specificity rules here win by source order. */
:root{
  /* Layout: one phone-first column. The "right now" readout is the only boxed object; curve, form and log sit open on the ground. */
  color-scheme:light;
  --bg:#F1F2F6;
  --surface:#FFFFFF;
  --ink:#1C1922;
  --muted:#5D586A;
  --line:#DAD9E2;
  --amber:#A65B06;
  --amber-soft:#F7E8D3;
  --wine:#8E1D3E;
  --wine-soft:#F6DFE6;
  --clear:#2A7453;
  --shadow:0 1px 0 rgba(28,25,34,.03), 0 14px 32px -20px rgba(60,30,70,.35);
  --display:"Bricolage Grotesque","Avenir Next","Segoe UI",system-ui,sans-serif;
  --body:"Atkinson Hyperlegible",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#141118; --surface:#1E1924; --ink:#F1ECF4; --muted:#A79FB2; --line:#332C3C;
    --amber:#F2A541; --amber-soft:#3A2915; --wine:#EC6C90; --wine-soft:#3E1B29; --clear:#63C99D;
    --shadow:0 0 0 rgba(0,0,0,0);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#141118; --surface:#1E1924; --ink:#F1ECF4; --muted:#A79FB2; --line:#332C3C;
  --amber:#F2A541; --amber-soft:#3A2915; --wine:#EC6C90; --wine-soft:#3E1B29; --clear:#63C99D;
  --shadow:0 0 0 rgba(0,0,0,0);
  color-scheme:dark;
}
/* Snackbox nav and theme toggle pick up this page's palette in both themes. */
:root{
  --color-bg:var(--bg); --color-bg-secondary:var(--surface); --color-text:var(--ink);
  --color-text-secondary:var(--muted); --color-border:var(--line);
  --color-accent:var(--amber); --color-accent-hover:var(--amber);
}
/* Elements below set their own display, which would otherwise beat the hidden attribute. */
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--body);font-size:16px;line-height:1.5}
.wrap{max-width:640px;margin:0 auto;padding-left:max(16px, env(safe-area-inset-left, 0px));padding-right:max(16px, env(safe-area-inset-right, 0px));padding-block:14px 56px;display:flex;flex-direction:column;gap:28px}
h1,h2{text-wrap:balance}
h2{font-family:var(--display);font-weight:800;font-size:22px;letter-spacing:-.01em;margin:0;line-height:1.15}
button{font:inherit;color:inherit}
/* shared/style.css gives every button:hover the accent background, and button:hover
   outranks a single class. Each button class below restates its own hover background. */
input:focus-visible,button:focus-visible,.chart:focus-visible{outline:2px solid var(--amber);outline-offset:2px}

/* header */
.head{display:flex;flex-direction:column;gap:12px}
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:8px;font-family:var(--display);font-weight:800;font-size:20px;letter-spacing:-.015em}
.brand svg{width:30px;height:20px;fill:none;stroke:var(--amber);stroke-width:2.4;stroke-linecap:round}
.me{font-size:14px;color:var(--muted);background:transparent;border:1px solid var(--line);border-radius:999px;padding:6px 14px;min-height:38px;display:inline-flex;gap:10px;align-items:center;cursor:pointer}
.me:hover{background:transparent}
.me .edit{color:var(--amber);font-weight:700}
.settings{display:flex;flex-direction:column;gap:14px;padding-block:14px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.set-row{display:flex;flex-wrap:wrap;gap:16px 24px}
.fld{display:flex;flex-direction:column;gap:6px;min-width:0}
.lbl{font-size:12px;text-transform:uppercase;letter-spacing:.09em;color:var(--muted);font-weight:700}
.inline{display:inline-flex;align-items:center;gap:6px}
.unit{color:var(--muted);font-size:14px}
.hint{margin:0;font-size:13px;color:var(--muted);max-width:60ch}
input[type="number"],input[type="time"]{font-family:var(--mono);font-size:17px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:8px 10px;min-height:44px;width:5.5em;font-variant-numeric:tabular-nums}
input[type="time"]{width:auto;min-width:8em}
.seg,.chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.chip{font-size:15px;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:7px 14px;min-height:40px;cursor:pointer;white-space:nowrap}
.chip:hover{background:var(--surface)}
.chip[aria-pressed="true"],.chip[aria-checked="true"]{background:var(--amber-soft);border-color:var(--amber);font-weight:700}

/* example banner */
.sample{display:flex;gap:6px 14px;align-items:center;justify-content:space-between;flex-wrap:wrap;font-size:14px;color:var(--muted);border:1px dashed var(--line);border-radius:12px;padding:8px 14px}
.sample p{margin:0;flex:1 1 240px;min-width:0}
.link{font-size:14px;font-weight:700;color:var(--amber);background:none;border:0;padding:6px 0;cursor:pointer;text-decoration:underline;text-underline-offset:3px;min-height:36px}
.link:hover{background:none}

/* now card */
.now{background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:18px 18px 16px;display:flex;flex-direction:column;gap:10px;box-shadow:var(--shadow)}
.now-top{display:flex;align-items:center;gap:8px 10px;flex-wrap:wrap;min-height:36px}
.clock{font-family:var(--mono);font-weight:600;font-size:16px;font-variant-numeric:tabular-nums}
.mode{font-size:14px;color:var(--muted)}
.pill{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;padding:3px 9px;border-radius:999px;border:1px solid transparent;background:var(--amber-soft);color:var(--amber)}
.pill[data-t="falling"]{background:transparent;border-color:var(--line);color:var(--muted)}
.pill[data-t="peak"]{background:var(--amber);color:var(--surface)}
.back{margin-left:auto}
.state{font-family:var(--display);font-weight:800;font-size:clamp(42px,12vw,64px);line-height:.95;letter-spacing:-.03em;margin:2px 0 0;color:var(--amber)}
.now[data-level="0"] .state{color:var(--clear)}
.now[data-level="3"] .state,.now[data-level="4"] .state{color:var(--wine)}
.words{font-family:var(--display);font-weight:600;font-size:21px;line-height:1.3;margin:0}
.bac-row{display:flex;align-items:baseline;gap:4px 12px;flex-wrap:wrap}
.bac{font-family:var(--mono);font-size:30px;font-weight:600;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.bac small{font-size:16px;color:var(--muted);margin-left:1px;font-weight:500}
.bac-note{font-size:14px;color:var(--muted)}
.story{margin:2px 0 0;max-width:62ch}
.alert{border:1.5px solid var(--wine);background:var(--wine-soft);border-radius:12px;padding:10px 12px;font-size:15px;margin:0}
.alert strong{color:var(--wine)}
.body{display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px 14px;margin:6px 0 0;padding-top:12px;border-top:1px solid var(--line)}
.body dt{font-size:12px;text-transform:uppercase;letter-spacing:.09em;color:var(--muted);font-weight:700;padding-top:3px}
.body dd{margin:0;font-size:15px}

/* curve */
.sec-head{display:flex;align-items:baseline;gap:4px 12px;flex-wrap:wrap;margin-bottom:10px}
.sub{font-size:13px;color:var(--muted)}
.chart{position:relative;touch-action:pan-y;cursor:crosshair;user-select:none;-webkit-user-select:none;border-radius:10px}
.chart svg{display:block;width:100%;height:auto;overflow:visible}
.chart text{font-family:var(--mono);font-size:11px;fill:var(--muted)}
.chart-empty{border:1px dashed var(--line);border-radius:12px;padding:36px 16px;text-align:center;color:var(--muted);font-size:15px}
.grid{stroke:var(--line);stroke-width:1}
.axis{stroke:var(--muted);stroke-width:1;opacity:.5}
.limit{stroke:var(--wine);stroke-width:1.25;stroke-dasharray:4 4}
.chart text.limit-t{fill:var(--wine);font-weight:600}
.stA{stop-color:var(--wine)}
.stB{stop-color:var(--amber)}
.line-past{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.line-fut{fill:none;stroke-width:2.25;stroke-dasharray:1 6;stroke-linecap:round;stroke-linejoin:round}
.dk{fill:var(--amber);stroke:var(--bg);stroke-width:2}
.dk-span{stroke:var(--amber);stroke-width:5;stroke-linecap:round;opacity:.45}
.nowline{stroke:var(--ink);stroke-width:1;opacity:.4}
.chart text.now-t{fill:var(--ink);font-weight:600}
.viewline{stroke:var(--ink);stroke-width:1.25;stroke-dasharray:3 3}
.dot{fill:var(--ink);stroke:var(--surface);stroke-width:2.5}
.pulse{fill:var(--amber);transform-box:fill-box;transform-origin:center;animation:pulse 2.4s ease-out infinite}
@keyframes pulse{from{transform:scale(.6);opacity:.55}to{transform:scale(2.4);opacity:0}}
@media (prefers-reduced-motion: reduce){.pulse{animation:none;opacity:0}}
.miles{list-style:none;margin:12px 0 0;padding:0 0 4px;display:flex;gap:6px;overflow-x:auto;scrollbar-width:thin}
.miles li{flex:0 0 auto}
.miles button{text-align:left;background:transparent;border:1px solid var(--line);border-radius:10px;padding:7px 11px;cursor:pointer;display:flex;flex-direction:column;gap:1px;min-height:44px}
.miles time{font-family:var(--mono);font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}
.miles span{font-size:14px;line-height:1.3;white-space:nowrap}
.miles .next button{border-style:dashed;color:var(--muted)}
.miles .k-peak time{color:var(--amber)}
.miles .k-limit time{color:var(--wine)}
.miles .k-clear time{color:var(--clear)}

/* add */
.add{display:flex;flex-direction:column;gap:16px}
.types{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
@media (min-width:560px){.types{grid-template-columns:repeat(8,minmax(0,1fr))}}
.type{font-size:14px;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 2px 8px;display:flex;flex-direction:column;align-items:center;gap:4px;cursor:pointer;min-height:66px}
.type:hover{background:var(--surface)}
.type .ico{width:26px;height:26px}
.type[aria-checked="true"]{border-color:var(--amber);background:var(--amber-soft);font-weight:700}
.type[aria-checked="true"] .ico{color:var(--amber)}
.ico{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.row2{display:flex;flex-wrap:wrap;gap:16px 20px}
.row2 .size{flex:1 1 260px}
.add-row{display:flex;align-items:center;justify-content:space-between;gap:10px 14px;flex-wrap:wrap}
.std{font-family:var(--mono);font-size:14px;color:var(--muted)}
.std.err{color:var(--wine);font-family:var(--body);font-weight:700}
.primary{font-weight:700;font-size:17px;background:var(--amber);color:var(--surface);border:0;border-radius:999px;padding:12px 24px;min-height:48px;cursor:pointer}
.primary:hover{background:var(--amber)}
.primary:active{transform:translateY(1px)}

/* log */
.log .sec-head .link{margin-left:auto}
.drinks{list-style:none;margin:0;padding:0;border-top:1px solid var(--line)}
.dr{display:grid;grid-template-columns:28px minmax(0,1fr) auto 40px;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid var(--line)}
.dr .ico{width:24px;height:24px;color:var(--amber)}
.dr-main{display:flex;flex-direction:column;min-width:0}
.dr-name{font-weight:700}
.dr-meta{font-size:13px;color:var(--muted);font-family:var(--mono)}
.dr-time{font-family:var(--mono);font-size:15px;font-variant-numeric:tabular-nums}
.x{width:40px;height:40px;padding:0;border-radius:999px;border:0;background:transparent;color:var(--muted);cursor:pointer;display:grid;place-items:center}
.x:hover{background:var(--wine-soft);color:var(--wine)}
.x svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.tag{font-size:10px;letter-spacing:.08em;text-transform:uppercase;border:1px solid var(--line);border-radius:6px;padding:1px 6px;color:var(--muted);font-weight:700;margin-left:6px;vertical-align:2px}
.empty{color:var(--muted);margin:12px 0 0}

.fine{font-size:13px;color:var(--muted);border-top:1px solid var(--line);padding-top:14px}
.fine p{margin:0 0 8px;max-width:65ch}

.toast{position:fixed;left:max(16px, env(safe-area-inset-left, 0px));right:max(16px, env(safe-area-inset-right, 0px));bottom:calc(16px + env(safe-area-inset-bottom, 0px));max-width:480px;margin:0 auto;background:var(--ink);color:var(--bg);border-radius:12px;padding:8px 8px 8px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:15px;z-index:20}
.toast .link{color:var(--amber-soft);padding:6px 10px}
