:root {
  --bg: #e9e8e4; --sheet: #f8f7f4; --text: #161616; --sub: #6b6a66; --line: #d3d1cb; --chip: #dcdbd6;
  --cardText: #1d1b18; --pill: rgba(0,0,0,.62); --pillText: #f4f1ea;
  --c0: #e1b066; --c1: #b4bdbd; --c2: #bdb1d3; --c3: #d7a1a3; --c4: #9fd0c6;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: 'Inter Tight', system-ui, sans-serif; font-size: 16px; -webkit-font-smoothing: antialiased; transition: background .25s, color .25s; min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
.grow { flex: 1; }
.sub { color: var(--sub); }
.sr { position: absolute; left: -9999px; }

/* header */
#top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(14px + env(safe-area-inset-top)) 16px 12px; background: var(--bg); }
.tabs { display: flex; gap: 6px; }
.tabs button, .pill { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 14px; white-space: nowrap; }
.tabs button.on, .pill.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.round { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--chip); display: inline-flex; align-items: center; justify-content: center; }
.round svg { width: 18px; height: 18px; }

.panel { background: var(--sheet); border-radius: 24px; padding: 16px; }
.picker { margin: 0 16px 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.theme { border-radius: 16px; border: 1.5px solid var(--line); background: transparent; padding: 10px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.theme.on { border-color: var(--text); }
.sw { display: flex; gap: 4px; } .sw i { width: 22px; height: 22px; border-radius: 50%; display: block; }

/* today hero */
.view { display: none; }
.view.on { display: block; }
.view { transition: transform .2s ease, opacity .2s ease; touch-action: pan-y; }
.view.in-r { animation: inR .28s ease; } .view.in-l { animation: inL .28s ease; }
@keyframes inR { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes inL { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.tabdots { display: none; }
.hero { padding: 16px 16px 0; display: flex; flex-direction: column; gap: 18px; }
.datebox { display: flex; align-items: center; gap: 18px; }
.bigdate { display: flex; flex-direction: column; font-size: 72px; font-weight: 400; letter-spacing: -.04em; line-height: .92; }
.vline { width: 1px; align-self: stretch; background: var(--text); margin: 8px 0; }
.wx { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wx .now { display: flex; align-items: center; gap: 8px; font-size: 32px; letter-spacing: -.02em; }
.wx .now svg { width: 30px; height: 30px; stroke-width: 1.4; }
.wx .lines { font-size: 13px; line-height: 1.35; display: flex; flex-direction: column; }
.hours { display: flex; gap: 6px; }
.hours div { flex: 1; border: 1px solid var(--line); border-radius: 16px; padding: 8px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; }
.hours b { font-weight: 400; font-size: 15px; }
.brief { display: flex; flex-direction: column; gap: 8px; }
.brief .label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); }
.brief .label svg { width: 14px; height: 14px; }
.brief p { margin: 0; font-size: 17px; line-height: 1.4; }
.brief button { align-self: flex-start; border: 0; background: none; padding: 0; font-size: 13px; color: var(--sub); text-decoration: underline; }

.radio { width: 100%; height: 56px; border-radius: 999px; border: 1px solid var(--line); background: transparent; display: flex; align-items: center; gap: 12px; padding: 0 8px; text-align: left; transition: background .2s; }
.radio .ic { width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; }
.radio .ic svg { fill: currentColor; stroke: none; width: 16px; height: 16px; }
.radio span.t { display: flex; flex-direction: column; line-height: 1.2; }
.radio span.t b { font-weight: 500; font-size: 15px; }
.radio span.t small { font-size: 12px; opacity: .75; }
.radio.on { background: var(--c0); color: var(--cardText); border-color: transparent; }
.radio.on .ic { background: var(--cardText); color: var(--c0); }

.qa { height: 52px; border-radius: 999px; border: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 0 6px 0 18px; }
.qa input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; outline: none; }
.qa input::placeholder { color: var(--sub); }
.qa button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; }
.qa.busy button { opacity: .5; }

.sheetblock { margin-top: 22px; background: var(--sheet); border-radius: 32px 32px 0 0; padding: 18px 10px 40px; display: flex; flex-direction: column; gap: 8px; min-height: 50vh; }
.sechead { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; font-size: 16px; font-weight: 500; }
.sechead .pill { height: 32px; font-size: 13px; background: var(--chip); border: 0; font-weight: 400; display: inline-flex; align-items: center; }

.ev { border: 0; width: 100%; text-align: left; font: inherit; border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 16px; color: var(--cardText); }
.ev h3 { margin: 0; font-size: 26px; font-weight: 400; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.ev .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.ev .row span { display: flex; flex-direction: column; font-size: 20px; }
.ev .row small { font-size: 12px; opacity: .75; }
.ev .row .end { align-items: flex-end; text-align: right; }
.ev .len { height: 30px; padding: 0 12px; border-radius: 999px; background: var(--pill); color: var(--pillText); display: flex; align-items: center; font-size: 12px; white-space: nowrap; }
.ev.past { opacity: .55; }
.ev.allday { padding: 12px 16px; gap: 4px; }
.ev.allday h3 { font-size: 20px; }
.game { border-radius: 22px; padding: 14px 16px; color: var(--cardText); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; position: relative; }
.game b { font-weight: 500; font-size: 17px; }
.game .score { grid-row: span 2; font-size: 30px; letter-spacing: -.02em; }
.game small { font-size: 12px; opacity: .8; }
.game .live { position: absolute; top: -6px; right: 14px; font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: var(--pill); color: var(--pillText); padding: 3px 8px; border-radius: 999px; }
.game.post { opacity: .75; }
.nextgames { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; font-size: 13px; color: var(--sub); }
.nextgames b { color: var(--text); font-weight: 500; }
a.pill { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.day .chip.game-chip { background: transparent; border: 1px solid var(--pill); color: var(--cardText); }
.bar.thin { height: 3px; margin-top: 4px; }
.empty { padding: 18px 10px; color: var(--sub); font-size: 15px; }

.task { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.task .box { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--text); background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.task .box svg { width: 12px; height: 12px; stroke-width: 4; stroke: var(--sheet); }
.task.done .box { background: var(--text); }
.task .tt { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 6px 0; display: flex; flex-direction: column; }
.task .tt b { font-weight: 400; font-size: 16px; overflow-wrap: anywhere; }
.task.done .tt b { text-decoration: line-through; opacity: .5; }
.task .tt small { font-size: 12px; color: var(--sub); }
.task .tt small.late { color: var(--text); font-weight: 500; }
.task i.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* calendar */
.cal { padding: 8px 10px 40px; display: flex; flex-direction: column; gap: 8px; }
.day { border-radius: 24px; padding: 14px 16px; color: var(--cardText); display: flex; gap: 12px; }
.day .d { width: 104px; flex-shrink: 0; display: flex; flex-direction: column; }
.day .d small { font-size: 14px; }
.day .d b { font-weight: 400; font-size: 44px; letter-spacing: -.03em; line-height: .95; margin-top: 4px; }
.day .d .w { font-size: 12px; margin-top: 8px; opacity: .8; }
.day .list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; border-left: 1px solid currentColor; padding-left: 12px; justify-content: center; }
.day .chip { border: 0; text-align: left; font: inherit; border-radius: 12px; background: var(--pill); color: var(--pillText); padding: 7px 10px; font-size: 13px; line-height: 1.25; display: flex; gap: 8px; }
.day .chip span:first-child { opacity: .75; white-space: nowrap; }
.day .chip.task { min-height: 0; border: 1px dashed var(--pill); background: transparent; color: var(--cardText); }
.day .none { font-size: 13px; opacity: .65; }

/* server */
.shead { padding: 20px 16px 0; display: flex; flex-direction: column; gap: 16px; }
.shead h2 { margin: 0; font-size: 44px; font-weight: 400; letter-spacing: -.03em; line-height: 1.02; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips > span { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.chips > span.warn { border-color: var(--text); font-weight: 500; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.count { border-radius: 20px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; color: var(--cardText); }
.count b { font-weight: 400; font-size: 36px; letter-spacing: -.03em; line-height: 1; }
.count small { font-size: 13px; }
.item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 10px; border-bottom: 1px solid var(--line); }
.item span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item b { font-weight: 400; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item small { font-size: 12px; color: var(--sub); }
.item i { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.disk { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px 8px; font-size: 13px; }
.disk div:first-child { display: flex; justify-content: space-between; }
.bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--text); border-radius: 999px; }
.seg { display: flex; gap: 6px; padding: 0 8px 8px; }
.seg .pill { height: 34px; font-size: 13px; }

/* login, sheet, toast */
#login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 32px 24px; max-width: 420px; margin: 0 auto; }
#login h1 { margin: 0; font-size: 56px; font-weight: 400; letter-spacing: -.04em; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--sub); }
.field input, .field select, .field textarea { height: 50px; border-radius: 16px; border: 1px solid var(--line); background: var(--sheet); padding: 0 14px; font-size: 16px; color: var(--text); }
.field textarea { height: 90px; padding: 12px 14px; resize: vertical; }
.btn { height: 50px; border-radius: 999px; border: 0; background: var(--text); color: var(--bg); font-size: 16px; font-weight: 500; padding: 0 22px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.err { color: #b3261e; font-size: 14px; min-height: 18px; }
dialog#sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 90vh; border-radius: 28px 28px 0 0; background: var(--bg); color: var(--text); }
dialog#sheet::backdrop { background: rgba(0,0,0,.4); }
.sheetin { padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheetin h2 { margin: 0; font-size: 26px; font-weight: 400; letter-spacing: -.02em; }
.sheetin h3 { margin: 8px 0 0; font-size: 15px; font-weight: 500; }
.row2 { display: flex; gap: 8px; } .row2 > * { flex: 1; min-width: 0; }
.callist { display: flex; flex-direction: column; gap: 6px; }
.callist div { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 14px; font-size: 14px; }
.callist div span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.callist button { border: 0; background: var(--chip); border-radius: 999px; height: 34px; padding: 0 12px; font-size: 13px; }
.status { font-size: 13px; color: var(--sub); line-height: 1.6; }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 14px; transition: .25s; pointer-events: none; max-width: 90vw; z-index: 20; }
#toast.on { opacity: 1; transform: translateX(-50%); }

/* desktop: all three views side by side, tabs hidden */
@media (min-width: 1100px) {
  .tabs { display: none; }
  #top { padding: 18px 28px 12px; }
  #top::before { content: 'Today'; font-size: 22px; letter-spacing: -.02em; }
  .picker { margin: 0 28px 8px; max-width: 520px; margin-left: auto; }
  main#app { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 0 28px 28px; align-items: start; }
  .view, .view.on { display: block; }
  .view { background: transparent; }
  #v-cal, #v-server { background: var(--sheet); border-radius: 28px; padding-top: 10px; }
  #v-server .sheetblock { margin-top: 12px; background: transparent; min-height: 0; }
  .sheetblock { border-radius: 28px; min-height: 0; }
  .hero { padding-left: 0; padding-right: 0; }
  #v-today .sheetblock { margin-top: 18px; }
}

.fab { position: fixed; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 6; }
.fab svg { width: 26px; height: 26px; stroke-width: 2; }
@media (max-width: 380px) { .tabs button { padding: 0 12px; } #top { gap: 6px; } }
