/* Starfall palette: identical to Android Theme.kt (SF). All text pairs >= 7:1 contrast. */
:root {
  --bg: #121212; --card: #242424; --card-done: #1C2B22; --text: #FFFFFF; --text2: #D6D6D6; --text-done: #C9C9C9;
  --track: #3A3A3A; --amber: #FFC94A; --sky: #64B5FF; --mint: #4FD8A0; --coral: #FF8A65; --pink: #FF7AB6;
  --violet: #B9A3FF; --green: #5BE38F; --on-accent: #121212;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
main { max-width: 560px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; }
svg { display: block; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.sync { font-size: 15px; font-weight: 700; color: var(--text2); display: flex; align-items: center; gap: 8px; }
.sync .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.sync.pending .dot { background: var(--amber); } .sync.offline .dot { background: var(--coral); }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover, .icon-btn:focus-visible { background: var(--card); outline: none; }
.icon-btn svg { width: 30px; height: 30px; fill: var(--text2); }

/* header */
.header { display: flex; align-items: center; padding: 0 0 4px; }
.header .col { flex: 1; min-width: 0; }
.h-today { font-size: 40px; font-weight: 900; line-height: 1.1; margin: 0; letter-spacing: -0.5px; }
.h-date { font-size: 20px; font-weight: 600; color: var(--text2); margin-top: 2px; }
.h-left { font-size: 20px; font-weight: 700; color: var(--amber); margin-top: 10px; }
.h-left.all { color: var(--green); }
.ring { position: relative; width: 104px; height: 104px; flex: none; }
.ring svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring .track { stroke: var(--track); }
.ring .bar { stroke: var(--amber); stroke-linecap: round; transition: stroke-dashoffset .4s ease, stroke .3s; }
.ring.all .bar { stroke: var(--green); }
.ring .label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .n { font-size: 26px; font-weight: 900; line-height: 1.1; }
.ring .d { font-size: 14px; font-weight: 700; color: var(--text2); }

/* groups + cards */
.part { font-size: 16px; font-weight: 800; letter-spacing: 1.5px; color: var(--text2); text-transform: uppercase; margin: 24px 0 12px 4px; }
.cards { display: grid; gap: 12px; }
.card {
  width: 100%; min-height: 96px; display: flex; align-items: center; gap: 14px; text-align: left;
  border: 0; border-radius: 20px; background: var(--card); padding: 14px 16px; cursor: pointer;
  transition: background-color .25s, transform .08s; touch-action: manipulation;
}
.card:active:not(:disabled) { transform: scale(.985); }
.card:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.card.done { background: var(--card-done); cursor: default; }
.card.focus:not(.done) { min-height: 120px; box-shadow: inset 0 0 0 3px var(--amber); }
.badge { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.badge svg { width: 30px; height: 30px; fill: var(--accent); }
.body { flex: 1; min-width: 0; }
.now { font-size: 14px; font-weight: 900; letter-spacing: 1.5px; color: var(--amber); }
.title { font-size: 22px; font-weight: 700; line-height: 26px; color: var(--text); }
.done .title { color: var(--text-done); text-decoration: line-through; text-decoration-thickness: 2px; }
.sub { font-size: 18px; font-weight: 600; color: var(--accent); margin-top: 4px; line-height: 1.35; }
.done .sub { color: var(--green); }
.check { width: 64px; height: 64px; flex: none; border-radius: 50%; border: 4px solid var(--accent); display: grid; place-items: center; transition: background-color .25s, border-color .25s; }
.done .check { background: var(--green); border-color: var(--green); }
.check svg { width: 40px; height: 40px; fill: var(--on-accent); opacity: 0; transition: opacity .2s; }
.done .check svg { opacity: 1; }

/* login + misc */
.panel { background: var(--card); border-radius: 20px; padding: 20px; margin-top: 24px; }
.panel h2 { margin: 0 0 8px; font-size: 26px; font-weight: 900; }
.panel p { margin: 0 0 16px; font-size: 18px; color: var(--text2); line-height: 1.4; }
input[type=password], input[type=text] {
  width: 100%; font: inherit; font-size: 18px; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--track);
  background: var(--bg); color: var(--text);
}
input:focus { outline: none; border-color: var(--amber); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 22px; border-radius: 16px; border: 0;
  background: var(--amber); color: var(--on-accent); font-size: 18px; font-weight: 800; cursor: pointer; }
.btn.wide { width: 100%; margin-top: 14px; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--track); }
.err { color: var(--coral); font-weight: 700; font-size: 17px; margin-top: 12px; }
.footer { margin-top: 28px; color: var(--text2); font-size: 15px; font-weight: 600; text-align: center; }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: 92vw;
  background: #F2F2F2; color: #121212; font-weight: 700; font-size: 17px; padding: 14px 20px; border-radius: 14px; box-shadow: 0 8px 30px #000a; z-index: 10; }

/* settings dialog */
dialog { width: min(560px, 100vw); max-width: 100vw; max-height: 92vh; margin: auto auto 0; border: 0; border-radius: 24px 24px 0 0;
  background: #1B1B1B; color: var(--text); padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { dialog { margin: auto; border-radius: 24px; } }
dialog::backdrop { background: #000c; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font-size: 28px; font-weight: 900; }
.sec { font-size: 16px; font-weight: 800; letter-spacing: 1.5px; color: var(--text2); text-transform: uppercase; margin: 22px 0 10px; }
.scroll-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.scroll-grid button { min-height: 56px; border-radius: 14px; border: 0; background: var(--card); font-size: 20px; font-weight: 800; cursor: pointer; }
.scroll-grid button[aria-pressed=true] { background: var(--pink); color: var(--on-accent); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--card); font-size: 28px; font-weight: 800; cursor: pointer; }
.stepper .val { flex: 1; text-align: center; font-size: 26px; font-weight: 900; }
.hint { color: var(--text2); font-size: 16px; line-height: 1.4; margin-top: 10px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border-radius: 16px; padding: 14px; }
.stat .v { font-size: 30px; font-weight: 900; }
.stat .k { font-size: 15px; font-weight: 700; color: var(--text2); }
/* Google sign-in + token copy (v1.1) */
.btn.google { display: flex; align-items: center; justify-content: center; gap: 12px; text-decoration: none; }
.btn.google svg { background: #fff; border-radius: 50%; padding: 3px; width: 30px; height: 30px; }
.copyrow { display: flex; gap: 8px; margin: 4px 0 12px; }
.copyrow input { flex: 1; min-width: 0; }
.panel a { color: var(--amber, #FFC94A); }
