/* 红读 HóngDú — red theme */
:root {
  --red: #c8102e;
  --red-d: #9e0c24;
  --red-dd: #6d0818;
  --red-l: #f9e3e6;
  --red-ll: #fdf2f3;
  --gold: #c99a2e;
  --gold-l: #fbf1d9;
  --bg: #fbf6f1;
  --surface: #ffffff;
  --surface-2: #f6ede6;
  --text: #2a1a1c;
  --muted: #7d6a6c;
  --line: #ead9d3;
  --shadow: 0 1px 2px rgba(110, 8, 24, .06), 0 4px 16px rgba(110, 8, 24, .08);
  --ok: #2f8a4f;
  --warn: #c77700;
  --zh-font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, var(--zh-font);
  --reader-size: 24px;
  --radius: 14px;
  --nav-h: 64px;
  --t1: #e0302f; --t2: #d98b00; --t3: #2e8b57; --t4: #2b63c6; --t5: #8a8a8a;
}
[data-theme="dark"] {
  --red: #e5384f;
  --red-d: #ff5a6e;
  --red-dd: #ffb3bd;
  --red-l: #3a161c;
  --red-ll: #2a1216;
  --gold: #e2b955;
  --gold-l: #3a2e15;
  --bg: #170b0d;
  --surface: #221114;
  --surface-2: #2c171b;
  --text: #f4e6e7;
  --muted: #b39a9d;
  --line: #3d2227;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35);
  --t1: #ff6b6b; --t2: #ffb340; --t3: #5fd08a; --t4: #6aa0ff; --t5: #9b9b9b;
}
[data-zhfont="serif"] { --zh-font: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif; }
[data-zhfont="kai"] { --zh-font: "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", serif; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ui-font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a { color: var(--red); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.zh { font-family: var(--zh-font); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: .5rem; }
.wrap { flex-wrap: wrap; }
.center { text-align: center; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-d) 100%);
  color: #fff;
  padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem;
  display: flex; align-items: center; gap: .75rem;
  box-shadow: 0 2px 10px rgba(110, 8, 24, .25);
}
[data-theme="dark"] .topbar { background: linear-gradient(135deg, #7a0d1f 0%, #4a0712 100%); }
.topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; gap: .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .seal { background: #fff; color: var(--red); border-radius: 8px; padding: 0 .35rem; font-family: var(--zh-font); font-weight: 800; }
[data-theme="dark"] .topbar .seal { color: #7a0d1f; }
.topbar .iconbtn { color: #fff; }
.iconbtn {
  background: transparent; border: 0; padding: .45rem; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.iconbtn:hover { background: rgba(255,255,255,.15); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn.on { background: rgba(255,255,255,.25); }

/* ---------- nav ---------- */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); font-size: .7rem; gap: 2px; position: relative;
}
.nav a svg { width: 24px; height: 24px; }
.nav a.active { color: var(--red); }
.nav a.active::before { content: ""; position: absolute; top: 0; width: 32px; height: 3px; border-radius: 0 0 3px 3px; background: var(--red); }
.nav .badge { position: absolute; top: 6px; left: calc(50% + 6px); background: var(--red); color: #fff; font-size: .62rem; border-radius: 9px; padding: 0 5px; min-width: 16px; text-align: center; line-height: 16px; }

@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 92px; }
  .nav { top: 0; right: auto; width: 92px; height: 100vh; flex-direction: column; justify-content: flex-start; padding-top: 5rem; border-top: 0; border-right: 1px solid var(--line); }
  .nav a { flex: 0 0 72px; }
  .nav a.active::before { top: 18px; left: 0; width: 3px; height: 36px; border-radius: 0 3px 3px 0; }
  .topbar { margin-left: 0; }
}

/* ---------- layout ---------- */
main { max-width: 980px; margin: 0 auto; padding: 1rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 1.4rem 0 .6rem; }
.section-title h2 { font-size: 1.05rem; margin: 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem;
}
.grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem; }
.stat .v { font-size: 1.5rem; font-weight: 750; color: var(--red); line-height: 1.2; }
.stat .l { font-size: .75rem; color: var(--muted); }

.hero {
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.18) 0, transparent 40%), linear-gradient(135deg, var(--red) 0%, var(--red-dd) 100%);
  color: #fff; border-radius: 18px; padding: 1.2rem 1.2rem 1.1rem; position: relative; overflow: hidden;
}
[data-theme="dark"] .hero { background: linear-gradient(135deg, #7a0d1f 0%, #3a0610 100%); }
.hero::after { content: "读"; font-family: var(--zh-font); position: absolute; right: -.5rem; bottom: -2.4rem; font-size: 9rem; opacity: .09; font-weight: 900; }
.hero h2 { margin: 0 0 .2rem; font-size: 1.3rem; }
.hero .sub { opacity: .9; font-size: .9rem; }
.hero .progress { background: rgba(255,255,255,.25); }
.hero .progress > div { background: #ffd66b; }
.hero .btn { background: #fff; color: var(--red-d); border-color: #fff; }

.progress { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--red); border-radius: 6px; transition: width .3s; }

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--red); color: #fff; border: 1px solid var(--red);
  border-radius: 12px; padding: .6rem 1rem; font-weight: 600; font-size: .95rem;
}
.btn:hover { background: var(--red-d); }
.btn.ghost { background: transparent; color: var(--red); border-color: var(--line); }
.btn.ghost:hover { background: var(--red-ll); }
.btn.soft { background: var(--red-l); color: var(--red-d); border-color: transparent; }
.btn.sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .5; cursor: default; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; white-space: nowrap;
}
.chip.on { background: var(--red); color: #fff; border-color: var(--red); }
.badge-l { display: inline-block; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; background: var(--red-l); color: var(--red-d); white-space: nowrap; }
.badge-l.gold { background: var(--gold-l); color: #8a6512; }
[data-theme="dark"] .badge-l.gold { color: var(--gold); }
.badge-l.ok { background: rgba(47,138,79,.14); color: var(--ok); }
.lv1,.lv2 { --lc: #2f8a4f; } .lv3,.lv4 { --lc: #c77700; } .lv5,.lv6 { --lc: #c8102e; }

.search {
  width: 100%; padding: .7rem 1rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); outline: none; font-size: 1rem;
}
.search:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-l); }

/* ---------- story cards ---------- */
.story-card { cursor: pointer; display: flex; flex-direction: column; gap: .35rem; transition: transform .12s, box-shadow .12s; position: relative; overflow: hidden; }
.story-card:hover { transform: translateY(-2px); }
.story-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lc, var(--red)); }
.story-card .t { font-family: var(--zh-font); font-size: 1.3rem; font-weight: 700; }
.story-card .tp { font-size: .8rem; color: var(--muted); margin-top: -.3rem; }
.story-card .te { font-size: .9rem; }
.story-card .meta { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .75rem; color: var(--muted); }
.story-card .done { position: absolute; top: .8rem; right: .8rem; color: var(--ok); }
.story-card .cov { font-size: .75rem; }

/* ---------- reader ---------- */
.reader { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.reader-head { text-align: center; margin: .5rem 0 1.5rem; }
.reader-head .t { font-family: var(--zh-font); font-size: calc(var(--reader-size) * 1.45); font-weight: 800; color: var(--red); }
.reader-head .tp { color: var(--muted); }
.reader-head .te { font-style: italic; color: var(--muted); font-size: .95rem; }
.para { position: relative; margin: 0 0 1.4rem; padding: .2rem .2rem .2rem 0; }
.para-text { font-family: var(--zh-font); font-size: var(--reader-size); line-height: 2.0; text-align: justify; }
.para.pinyin-on .para-text { line-height: 2.55; }
.sent { border-radius: 6px; transition: background .2s; }
.sent.playing { background: var(--gold-l); }
.sent.sel { background: var(--red-ll); }
.w { cursor: pointer; border-radius: 4px; padding: 0 1px; transition: background .12s; }
.w:hover { background: var(--red-l); }
.w.active { background: var(--red); color: #fff; }
.w.active rt { color: #fff; }
.w.saved { border-bottom: 2px dotted var(--red); }
.w.vocab { box-shadow: inset 0 -.25em 0 var(--gold-l); }
.hide-hl .w.saved { border-bottom: 0; }
.hide-hl .w.vocab { box-shadow: none; }
ruby { ruby-align: center; }
rt { font-family: var(--ui-font); font-size: .42em; color: var(--muted); letter-spacing: 0; user-select: none; -webkit-user-select: none; }
.tones rt .t1 { color: var(--t1); } .tones rt .t2 { color: var(--t2); } .tones rt .t3 { color: var(--t3); } .tones rt .t4 { color: var(--t4); } .tones rt .t5 { color: var(--t5); }
.tr { display: block; font-family: var(--ui-font); font-size: .95rem; line-height: 1.5; color: var(--muted); background: var(--surface-2); border-left: 3px solid var(--red); border-radius: 0 8px 8px 0; padding: .35rem .7rem; margin: .3rem 0 .5rem; text-align: left; }
.tr.para-tr { border-left-color: var(--gold); }
.para-tools { display: flex; gap: .3rem; justify-content: flex-end; margin-top: -.2rem; opacity: .65; }
.para:hover .para-tools { opacity: 1; }
.tool-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: .15rem .55rem; font-size: .78rem; color: var(--muted); display: inline-flex; gap: .25rem; align-items: center; }
.tool-btn:hover { color: var(--red); border-color: var(--red); }
.tool-btn svg { width: 14px; height: 14px; }
.reader-toolbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 35;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 999px; padding: .3rem; display: flex; gap: .15rem;
}
@media (min-width: 900px) { .reader-toolbar { bottom: 20px; margin-left: 46px; } }
.reader-toolbar .iconbtn { color: var(--text); padding: .55rem; border-radius: 999px; }
.reader-toolbar .iconbtn.on { background: var(--red); color: #fff; }
.reader-toolbar .iconbtn:hover:not(.on) { background: var(--red-ll); }
.reader-progress { position: fixed; top: 0; left: 0; height: 3px; background: #ffd66b; z-index: 50; transition: width .2s; }
.sel-pop { position: absolute; z-index: 60; background: var(--red-dd); color: #fff; border-radius: 10px; padding: .35rem .7rem; font-size: .85rem; box-shadow: var(--shadow); display: flex; gap: .3rem; align-items: center; white-space: nowrap; border: 0; }
[data-theme="dark"] .sel-pop { background: #7a0d1f; }

.end-block { margin-top: 2rem; }
.end-block h3 { color: var(--red); margin: 1.6rem 0 .6rem; font-size: 1.05rem; display: flex; align-items: center; gap: .4rem; }
.vocab-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.vocab-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.vocab-item .h { font-family: var(--zh-font); font-size: 1.3rem; font-weight: 700; }
.vocab-item .p { font-size: .8rem; color: var(--muted); }
.vocab-item .m { font-size: .82rem; }
.grammar { border-left: 3px solid var(--gold); padding: .5rem .8rem; background: var(--surface); border-radius: 0 12px 12px 0; margin-bottom: .6rem; }
.grammar .pt { font-family: var(--zh-font); font-weight: 700; color: var(--red-d); font-size: 1.1rem; }
.quiz-q { margin-bottom: 1rem; }
.quiz-q .q { font-family: var(--zh-font); font-size: 1.1rem; font-weight: 600; }
.quiz-opt { display: block; width: 100%; text-align: left; margin: .35rem 0; padding: .55rem .8rem; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-family: var(--zh-font); font-size: 1rem; }
.quiz-opt:hover { border-color: var(--red); }
.quiz-opt.right { background: rgba(47,138,79,.14); border-color: var(--ok); }
.quiz-opt.wrong { background: var(--red-l); border-color: var(--red); }

/* ---------- sheet ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(30, 5, 10, .35); z-index: 70; opacity: 0; transition: opacity .2s; }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; max-height: 82vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.2);
  padding: .6rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out;
}
.sheet.show { transform: translateY(0); }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto .6rem; }
@media (min-width: 900px) {
  .sheet { left: auto; right: 1.2rem; bottom: 1.2rem; top: 1.2rem; width: 420px; max-height: none; border-radius: 20px; transform: translateX(120%); }
  .sheet.show { transform: translateX(0); }
  .sheet .grab { display: none; }
}
.wd-head { display: flex; align-items: flex-start; gap: .8rem; }
.wd-hz { font-family: var(--zh-font); font-size: 2.8rem; font-weight: 800; line-height: 1.1; color: var(--red); }
.wd-py { font-size: 1.15rem; margin-top: .2rem; }
.wd-defs { margin: .6rem 0; padding-left: 0; list-style: none; }
.wd-defs li { padding: .3rem 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.wd-defs li:last-child { border-bottom: 0; }
.wd-defs .rd { font-weight: 600; color: var(--red-d); margin-right: .4rem; }
.ctx-note { background: var(--gold-l); border-radius: 10px; padding: .5rem .7rem; font-size: .92rem; margin: .5rem 0; }
.chars { display: flex; gap: .5rem; flex-wrap: wrap; margin: .4rem 0; }
.char-box { border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem; cursor: pointer; min-width: 90px; flex: 1; }
.char-box:hover { border-color: var(--red); }
.char-box .c { font-family: var(--zh-font); font-size: 1.6rem; font-weight: 700; }
.char-box .d { font-size: .75rem; color: var(--muted); line-height: 1.3; }
.sheet h4 { margin: 1rem 0 .3rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ex { padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.ex:last-child { border-bottom: 0; }
.ex .z { font-family: var(--zh-font); font-size: 1.05rem; }
.ex .z b { color: var(--red); }
.ex .e { font-size: .85rem; color: var(--muted); }
.ex .s { font-size: .72rem; color: var(--muted); }
.sheet-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; position: sticky; bottom: -1.2rem; background: var(--surface); padding: .6rem 0; }
.big-zh { font-family: var(--zh-font); font-size: 1.35rem; line-height: 1.8; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; gap: .5rem; }
.li { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.li .h { font-family: var(--zh-font); font-size: 1.45rem; font-weight: 700; min-width: 3.2rem; }
.li .body { flex: 1; min-width: 0; }
.li .p { font-size: .85rem; color: var(--red-d); }
.li .m { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: .6rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; white-space: nowrap; }
.tabs button.on { color: var(--red); border-bottom-color: var(--red); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .big { font-size: 3rem; font-family: var(--zh-font); color: var(--red-l); font-weight: 900; }
[data-theme="dark"] .empty .big { color: var(--red-d); }

/* ---------- review ---------- */
.flash { min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .6rem; padding: 1.6rem 1.2rem; }
.flash .front-hz { font-family: var(--zh-font); font-size: 3.2rem; font-weight: 800; color: var(--red); }
.flash .ctx { font-family: var(--zh-font); font-size: 1.3rem; line-height: 1.8; }
.flash .ctx b { color: var(--red); background: var(--red-ll); border-radius: 4px; padding: 0 2px; }
.flash .ans { border-top: 1px dashed var(--line); padding-top: .8rem; width: 100%; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: 1rem; }
.grades button { border: 0; border-radius: 12px; padding: .7rem .2rem; color: #fff; font-weight: 700; }
.grades button small { display: block; font-weight: 400; opacity: .85; font-size: .72rem; }
.g1 { background: #8a1020; } .g2 { background: #c77700; } .g3 { background: #2f8a4f; } .g4 { background: #2b63c6; }
.cloze-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; width: 100%; }
.cloze-opts button { font-family: var(--zh-font); font-size: 1.4rem; padding: .6rem; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; }
.cloze-opts button.right { background: rgba(47,138,79,.18); border-color: var(--ok); }
.cloze-opts button.wrong { background: var(--red-l); border-color: var(--red); }

/* ---------- forms ---------- */
.field { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field label { font-weight: 600; }
.field .hint { font-size: .8rem; color: var(--muted); font-weight: 400; }
.field select, .field input[type=text], .field input[type=password], .field input[type=number] { padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); max-width: 55%; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 26px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--red); }
.switch input:checked + span::before { transform: translateX(20px); }
input[type=range] { accent-color: var(--red); }

.toast { position: fixed; left: 50%; transform: translateX(-50%) translateY(20px); bottom: calc(var(--nav-h) + 80px); background: var(--red-dd); color: #fff; padding: .55rem 1rem; border-radius: 12px; z-index: 100; opacity: 0; transition: .25s; pointer-events: none; font-size: .9rem; box-shadow: var(--shadow); }
[data-theme="dark"] .toast { background: #7a0d1f; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.heat { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; }
.heat div { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.heat .h1 { background: #f3b6bf; } .heat .h2 { background: #e46a7c; } .heat .h3 { background: #c8102e; } .heat .h4 { background: #7d0a1d; }
[data-theme="dark"] .heat .h1 { background: #5a1e27; }

.sotd { cursor: pointer; }
.sotd .z { font-family: var(--zh-font); font-size: 1.35rem; line-height: 1.7; }
.loading { padding: 3rem; text-align: center; color: var(--muted); }
.spin { width: 28px; height: 28px; border: 3px solid var(--red-l); border-top-color: var(--red); border-radius: 50%; animation: sp 0.8s linear infinite; margin: 0 auto .6rem; }
@keyframes sp { to { transform: rotate(360deg); } }
.pill-group { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pill-group button { border: 0; background: var(--surface); padding: .35rem .7rem; font-size: .85rem; }
.pill-group button.on { background: var(--red); color: #fff; }
.popover { position: fixed; z-index: 75; right: 1rem; top: 4rem; width: min(340px, calc(100vw - 2rem)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: .4rem 1rem; }
