:root {
  --bg: #ffffff;
  --card: #ffffff;
  --soft: #f3f3f4;
  --text: #0a0a0a;
  --sub: #8a8a8e;
  --line: #e6e6e8;
  --blue-text: #1d5bc4;
  --a: #4f9a3a;
  --a-text: #35782a;
  --a-rgb: 95, 174, 69;
  --err: #a8493f;
  --err-bg: #f9eeec;
  --bonus: #2f6fed;
  --bonus-bg: #e9f0fe;
  --blue: #3b8bff;
  --ink: #22305a;
  --chip-on-bg: #0a0a0a;
  --chip-on-fg: #fff;
  --btn-bg: #0a0a0a;
  --btn-fg: #fff;
  --ok: #1f9d63;
  --shadow: 0 10px 28px rgba(20, 24, 40, .08);
  color-scheme: light;
}
html.dark {
  --bg: #101010;
  --card: #181818;
  --soft: #1e1e1e;
  --text: #f5f6f8;
  --sub: #8f9096;
  --line: #2b2b2d;
  --bonus: #7aa5ff;
  --bonus-bg: #1c2740;
  --ink: #d6dcf2;
  --chip-on-bg: #f5f6f8;
  --chip-on-fg: #101010;
  --btn-bg: #f5f6f8;
  --btn-fg: #101010;
  --ok: #3dd68c;
  --blue-text: #8db4ff;
  --a: #8fd16f;
  --a-text: #8fd16f;
  --err: #e8a198;
  --err-bg: #2e1f1d;
  --shadow: 0 10px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #dcdcdc; }
html.dark, html.dark body { background: #000; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 520px) {
  html, body, html.dark, html.dark body { background: var(--bg); }
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.app {
  width: min(430px, 100%);
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
}
.app.wide { width: min(960px, 100%); padding-bottom: 40px; }

.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 8px;
  min-height: 56px;
}
.logo, .back { display: flex; align-items: center; gap: 2px; text-decoration: none; color: var(--text); }
.logo img, .back img { height: 42px; display: block; margin-left: -4px; }
.back span { font-size: 28px; line-height: 1; font-weight: 500; margin-right: 2px; }
.quiet { color: var(--sub); text-decoration: none; font-weight: 650; font-size: 14px; }

.coins {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px;
  height: 34px; padding: 0 12px 0 8px;
  background: var(--bg); cursor: pointer;
}
.coins svg { width: 20px; height: 20px; flex: none; }
.coins b { font-size: 15px; font-weight: 750; }
.coins span { font-size: 12px; color: var(--sub); font-weight: 550; }
.coins.zero { border-color: var(--text); background: var(--soft); }
.coins.zero b { color: var(--text); }

.chips {
  position: sticky; top: 56px; z-index: 4;
  background: var(--bg);
  display: flex; gap: 8px;
  padding: 6px 16px 10px;
  overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.chips::-webkit-scrollbar { display: none; }
.chips[hidden] { display: none; }
.chip {
  flex: none; height: 34px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font-size: 14px; font-weight: 650; padding: 0 13px;
  display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
}
.chip em { font-style: normal; font-size: 12px; font-weight: 750; color: var(--a-text); }
.chip.on { background: var(--chip-on-bg); color: var(--chip-on-fg); border-color: var(--chip-on-bg); }
.chip.on em { color: var(--chip-on-fg); opacity: .75; }
.sep { flex: none; width: 1px; background: var(--line); margin: 4px 2px; }

.day { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px 4px; font-size: 13px; color: var(--sub); font-weight: 550; }
.day b { color: var(--text); font-weight: 650; }
.banner { margin: 10px 16px 0; background: var(--soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.4; }
.banner b { display: block; font-size: 15px; margin-bottom: 2px; }
.banner span { color: var(--sub); }

.hero { margin: 10px 16px 6px; border: 1px solid var(--line); border-radius: 22px; padding: 16px; background: var(--card); }
.hero.side-a { box-shadow: inset 4px 0 0 var(--a); }
.hero.side-b { box-shadow: inset 4px 0 0 var(--blue); }
.kicker { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 750; letter-spacing: .4px; text-transform: uppercase; color: var(--sub); }
.kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--a); display: inline-block; }
.hero h2 { margin: 8px 0 2px; font-size: 27px; line-height: 1.08; letter-spacing: -.7px; font-weight: 800; }
.hero h2 a { text-decoration: none; }
.jars { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 4px; align-items: end; }
.jc { text-align: center; min-width: 0; }
.pc { font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.pc.a { color: var(--a); }
.lab.a { color: var(--a-text); }
.pc.b, .lab.b { color: var(--blue); }
.lab { font-size: 14px; font-weight: 650; margin-top: 4px; }
.hero .meta, .poll-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--sub); margin: 10px 2px 12px; font-weight: 550; }
.jar-still, .jar-live { width: 100%; height: auto; aspect-ratio: 646 / 623; display: block; background: transparent; }
.jar-live { touch-action: none; cursor: pointer; }
.btn {
  display: flex; width: 100%; height: 48px; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; background: var(--btn-bg); color: var(--btn-fg);
  font-size: 16px; font-weight: 750; cursor: pointer; text-decoration: none;
}
.btn.ghost { background: var(--soft); color: var(--text); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { width: auto; height: 40px; padding: 0 14px; font-size: 14px; }

.list { padding: 0 16px; }
.card {
  display: grid; grid-template-columns: 1fr 108px; gap: 10px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.card.voted { border-radius: 12px; padding-left: 10px; padding-right: 4px; margin-left: -10px; }
.card.side-a { background: linear-gradient(90deg, rgba(var(--a-rgb), .12), transparent 55%); box-shadow: inset 3px 0 0 var(--a); }
.card.side-b { background: linear-gradient(90deg, rgba(59, 139, 255, .12), transparent 55%); box-shadow: inset 3px 0 0 var(--blue); }
.card .m { font-size: 12px; color: var(--sub); font-weight: 650; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.card .m .hot { color: var(--a-text); }
.card .m .new { color: var(--text); background: var(--soft); border-radius: 6px; padding: 1px 6px; }
.coinbadge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px 2px 6px; font-weight: 800; font-size: 12.5px; }
.coinbadge i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.coinbadge.a { color: var(--a-text); background: rgba(var(--a-rgb), .16); }
.coinbadge.a i { background: var(--a); }
.coinbadge.b { color: var(--blue-text); background: rgba(59, 139, 255, .14); }
.coinbadge { white-space: nowrap; }
.coinbadge .cb-long { display: none; }
@media (min-width: 900px) {
  .coinbadge .cb-long { display: inline; }
  .coinbadge .cb-short { display: none; }
}
.coinbadge.b i { background: var(--blue); }
.card h3 { margin: 0; font-size: 18px; line-height: 1.18; letter-spacing: -.3px; font-weight: 750; }
#content > article > h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.15; letter-spacing: -.4px; font-weight: 750; }
#content > article > h1 + p { margin: 0 0 16px; color: var(--sub); }

.card .o { margin-top: 7px; font-size: 13px; color: var(--sub); font-weight: 550; display: flex; gap: 10px; flex-wrap: wrap; }
.card .o s { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.card .o s:before { content: ""; width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.card .o s.a:before { background: var(--a); }
.card .o s.b:before { background: var(--blue); }
.card .o b { color: var(--text); font-weight: 750; }
.card .v { margin-top: 7px; font-size: 12px; color: var(--sub); font-weight: 550; }
.card .jr { display: flex; gap: 4px; align-items: flex-end; justify-content: flex-end; }
.card .jr canvas { width: 50px; }

.next { margin: 14px 16px 0; border: 1.5px dashed var(--line); border-radius: 18px; padding: 16px; text-align: center; }
.next b { display: block; font-size: 15px; margin-bottom: 4px; }
.next span { font-size: 13px; color: var(--sub); line-height: 1.4; display: block; margin-bottom: 12px; }
.empty { padding: 30px 24px; text-align: center; color: var(--sub); font-size: 14px; }
.foot { padding: 26px 16px calc(28px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--sub); line-height: 1.45; text-align: center; }
.foot-links { display: flex; gap: 14px; justify-content: center; margin-top: 10px; }
.foot-links a, .foot-links button { background: none; border: 0; color: var(--sub); font-weight: 650; cursor: pointer; text-decoration: underline; padding: 4px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 8; }
.sheet-bg[hidden], .sheet[hidden] { display: none; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%);
  width: min(430px, 100%); bottom: 0; z-index: 9;
  background: var(--card); border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
}
.sheet h2 { margin: 0 0 8px; font-size: 18px; }
.sheet ul { list-style: none; margin: 0 0 12px; padding: 0; font-size: 15px; }
.sheet li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.sheet li img { width: 28px; height: 28px; object-fit: contain; }
.sheet li b { margin-left: auto; }
.sheet p { margin: 8px 0; font-size: 13px; color: var(--sub); line-height: 1.4; }
.sheet .btn { margin-top: 8px; }

.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.poll { padding: 8px 16px 0; }
.poll .catline { font-size: 12px; font-weight: 700; color: var(--sub); display: flex; gap: 8px; align-items: center; }
.poll h1 { margin: 8px 0 4px; font-size: 28px; line-height: 1.08; letter-spacing: -.6px; font-weight: 800; }
.side-btn { margin-top: 2px; background: none; border: 0; font-weight: 700; font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 999px; }
.side-btn.on { outline: 2px solid currentColor; }
.items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 10px; }
.item {
  border: 1px solid var(--line); background: var(--bg); border-radius: 14px;
  padding: 8px 4px 6px; cursor: pointer; text-align: center;
}
.item img { width: 36px; height: 36px; object-fit: contain; display: block; margin: 0 auto 2px; }
.item b { display: block; font-size: 12px; }
.item small { color: var(--sub); font-size: 11px; }
.item.on { border-color: var(--text); background: var(--soft); }
.item:disabled { opacity: .35; cursor: default; }
.remain { font-size: 13px; color: var(--sub); margin: 0 0 8px; }
.err { min-height: 1.2em; color: var(--err); font-size: 14px; font-weight: 600; margin: 8px 0; }
.err:not(:empty) { background: var(--err-bg); border-radius: 10px; padding: 8px 12px; }
.hint { font-size: 12px; color: var(--sub); line-height: 1.3; margin: 8px 0 0; }
.row-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.poll .actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.poll .actions .btn { width: 100%; min-width: 0; padding: 0 8px; }
.next .btn { margin-top: 12px; }
.closed-banner { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 8px 0; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--btn-bg); color: var(--btn-fg);
  border-radius: 18px; padding: 9px 16px; font-size: 13px; font-weight: 650; z-index: 30;
  width: max-content; max-width: calc(100vw - 32px); text-align: center; line-height: 1.35;
}

.ob[hidden] { display: none; }
.ob { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.ob-hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .48); pointer-events: none; }
.ob-card {
  position: fixed; pointer-events: auto;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; box-shadow: var(--shadow); max-width: 360px;
}
.ob-card h2 { margin: 0 0 6px; font-size: 16px; letter-spacing: -.2px; }
.ob-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.4; }
.ob-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ob-skip { background: none; border: 0; color: var(--sub); font-weight: 700; cursor: pointer; padding: 8px; }
.ob-next { background: var(--btn-bg); color: var(--btn-fg); border: 0; border-radius: 12px; height: 40px; padding: 0 16px; font-weight: 750; cursor: pointer; }

.admin { padding: 8px 16px 24px; }
.admin h1 { font-size: 24px; margin: 8px 0; letter-spacing: -.4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 10px 0 16px; }
.stat { background: var(--soft); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 22px; letter-spacing: -.4px; }
.stat span { color: var(--sub); font-size: 12px; }
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin th, .admin td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin th { color: var(--sub); font-size: 12px; font-weight: 700; }
.admin form, .panel { border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin: 12px 0; }
.admin label { display: block; font-size: 13px; font-weight: 700; margin: 8px 0 4px; }
.admin input, .admin select {
  width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); padding: 0 10px;
}
.admin .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.alert { background: rgba(255, 107, 91, .1); border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: 14px; }
.login { max-width: 360px; margin: 24px auto; padding: 0 16px; }
.noscript { padding: 16px; text-align: center; }
.tiny { font-size: 12px; color: var(--sub); }
@media (prefers-reduced-motion: reduce) {
  .shake-btn, .shake-note { display: none !important; }
}
@media (min-width: 800px) {
  .admin table { font-size: 14px; }
}

/* ---- shared tweaks ---- */
.side { display: contents; }
.chips.nav-links { display: none; }
.chips.nav-links a { text-decoration: none; }
.pc { margin-bottom: -4%; position: relative; z-index: 1; }
.pc.nil { color: var(--sub); font-weight: 650; opacity: .5; }
.card .v.first { color: var(--text); font-weight: 650; }
.more { display: none; }

/* ---- desktop shell: sidebar + main, from 1024px ---- */
@media (min-width: 1024px) {
  html, body, html.dark, html.dark body { background: var(--bg); }
  .app:not(.wide) {
    width: min(1440px, 100%);
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    column-gap: 40px;
    padding: 0 32px;
    align-items: start;
  }
  .side {
    display: flex; flex-direction: column; gap: 14px;
    position: sticky; top: 0; align-self: start;
    max-height: 100vh; overflow-y: auto; scrollbar-width: none;
    padding: 20px 0 24px;
  }
  .side::-webkit-scrollbar { display: none; }
  .side .top {
    position: static; display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
    padding: 0; min-height: 0; background: none;
  }
  .side .logo img, .side .back img { height: 52px; margin-left: -5px; }
  .back span { display: none; }
  .side .coins {
    width: 100%; height: 52px; padding: 0 16px 0 12px; gap: 10px; border-radius: 16px;
    background: var(--soft); border-color: transparent;
  }
  .side .coins svg { width: 26px; height: 26px; }
  .side .coins b { font-size: 20px; }
  .side .coins span { font-size: 13px; }
  .side .coins:hover { border-color: var(--line); }
  .chips, .chips.nav-links {
    position: static; display: flex; flex-direction: column; gap: 2px; overflow: visible;
    padding: 0; border: 0; background: none;
  }
  .chips[hidden] { display: none; }
  .chips .sep { width: auto; height: 1px; margin: 8px 0; }
  .chip {
    width: 100%; height: 40px; border: 0; border-radius: 12px; justify-content: space-between;
    padding: 0 12px; font-size: 15px; background: none;
  }
  .chip:hover { background: var(--soft); }
  .chip.on { background: var(--soft); color: var(--text); box-shadow: inset 3px 0 0 var(--text); border-radius: 4px 12px 12px 4px; }
  .chip.on em { color: var(--a); opacity: 1; }
  #content { min-width: 0; padding: 20px 0 40px; max-width: 1100px; width: 100%; }
  #content .day { padding: 4px 0 8px; font-size: 14px; }
  .banner { margin: 8px 0 0; }

  .hero { margin: 8px 0 8px; padding: 26px 32px 28px; border-radius: 26px; }
  .hero h2 { font-size: 40px; letter-spacing: -1.1px; margin: 10px 0 4px; }
  .hero .jars { max-width: 700px; margin: 16px auto 6px; gap: 40px; }
  .hero .pc { font-size: 38px; }
  .hero .lab { font-size: 17px; margin-top: 8px; }
  .hero .meta { max-width: 700px; margin: 14px auto 16px; font-size: 14px; }
  .hero .btn { max-width: 420px; margin: 0 auto; height: 52px; }

  .list { padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .card { grid-template-columns: 1fr 140px; padding: 18px 0; }
  .card h3 { font-size: 20px; }
  .card .jr canvas { width: 66px; }
  .card.voted { padding-left: 14px; margin-left: -14px; }
  .next { margin: 20px 0 0; }
  .foot { padding: 36px 0 24px; max-width: 560px; margin: 0 auto; }
  .empty { padding: 48px 24px; }

  /* poll: jars big on the left, controls in a column on the right */
  .poll { padding: 0; }
  .poll h1 { font-size: 44px; letter-spacing: -1.2px; margin: 10px 0 2px; max-width: 900px; }
  .poll .catline { font-size: 13px; }
  .poll-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; margin-top: 12px; }
  .stage .jars { gap: 36px; margin: 8px 0 0; }
  .stage .pc { font-size: 40px; }
  .stage .side-btn { font-size: 17px; margin-top: 6px; padding: 6px 14px; }
  .stage .poll-meta { font-size: 14px; margin: 12px 4px 0; }
  .ctl { padding-top: 56px; }
  .ctl .items { grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
  .ctl .item { padding: 12px 6px 10px; display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; align-items: center; }
  .ctl .item img { grid-row: 1 / span 2; width: 40px; height: 40px; margin: 0; }
  .ctl .item b { font-size: 14px; align-self: end; }
  .ctl .item small { font-size: 12px; align-self: start; }
  .ctl .btn { height: 54px; font-size: 17px; }
  .ctl .remain { font-size: 14px; margin: 0 0 12px; }
  .jar-live { max-width: 400px; margin: 0 auto; }
  .more { display: block; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }
  .more h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.3px; }
  .more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; }
  .more h2 { grid-column: 1 / -1; }
  .more a { text-decoration: none; padding: 12px 0; border-bottom: 1px solid var(--line); display: block; }
  .more a span { display: block; font-size: 12px; font-weight: 650; color: var(--sub); }
  .more a b { font-size: 16px; font-weight: 700; letter-spacing: -.2px; line-height: 1.2; display: block; margin-top: 2px; }
  .more a:hover b { text-decoration: underline; }

  .sheet {
    top: 50%; bottom: auto; transform: translate(-50%, -50%); width: 420px;
    border-radius: 22px; border: 1px solid var(--line);
  }
  .toast { bottom: 32px; }
  .app.wide { width: min(1040px, 100%); }
}
.scroll-x { overflow-x: auto; }
.center { text-align: center; }

/* admin + login polish */
.login input {
  width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); padding: 0 12px;
}
.login label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
.login h1 { margin: 0 0 4px; letter-spacing: -.5px; }
.admin h2 { font-size: 18px; margin: 22px 0 8px; letter-spacing: -.3px; }
.admin td .btn.small { display: inline-flex; margin: 0 4px 4px 0; }
.admin .row-actions .btn.small { display: inline-flex; }
.admin .row-actions { margin-top: 8px; }
.admin .btn.small:disabled { opacity: .35; }
@media (min-width: 1024px) {
  .app.wide .top { padding: 18px 24px 10px; }
  .admin { padding: 8px 24px 40px; }
  .login { margin-top: 64px; }
}

/* ---- bonus coins and tasks ---- */
.wallet { display: flex; align-items: center; gap: 8px; }
.coins em { font-style: normal; font-size: 12px; font-weight: 750; color: var(--bonus); background: var(--bonus-bg); border-radius: 999px; padding: 1px 6px; margin-left: 1px; }
.coins em[hidden] { display: none; }
.more-coins {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 34px; height: 34px; padding: 0; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.more-coins[hidden] { display: none; }
.more-coins i { font-style: normal; font-size: 20px; line-height: 1; font-weight: 500; margin-top: -2px; }
.more-coins span { display: none; }
.banner .btn.small { margin-top: 10px; }
.banner .btn[hidden] { display: none; }
.linkbtn { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--text); text-decoration: underline; cursor: pointer; }
.linkbtn[hidden] { display: none; }

.sheet.tasks { max-height: min(86vh, 640px); overflow-y: auto; }
.tasks-head { display: flex; align-items: center; justify-content: space-between; }
.tasks-head h2 { margin: 0; }
.tasks .x { width: 32px; height: 32px; border-radius: 999px; border: 0; background: var(--soft); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.tasks-sub { margin: 4px 0 6px; }
.task-list { list-style: none; margin: 4px 0 8px; padding: 0; }
.task-list .task {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: start;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.task .t-main b { display: block; font-size: 15px; line-height: 1.3; }
.task .t-main small { display: block; margin-top: 2px; font-size: 13px; color: var(--sub); line-height: 1.35; }
.task .t-link { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 650; color: var(--text); }
.task .price {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 6px; border-radius: 999px;
  background: var(--bonus-bg); color: var(--bonus); font-size: 13px; font-weight: 750;
}
.task .price i { width: 12px; height: 12px; border-radius: 50%; background: var(--bonus); opacity: .85; }
.task .t-act { grid-column: 1 / -1; }
.task .t-act .btn { width: 100%; margin: 0; text-align: center; }
.task .code-form { display: flex; gap: 8px; }
.task .code-form input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px;
}
.task .code-form .btn { width: auto; flex: none; padding: 0 16px; }
.task .t-done { font-size: 13px; font-weight: 700; color: var(--sub); }
.task .t-done::before { content: '✓ '; }
.task.is-done .t-main, .task.is-done .price { opacity: .5; }
.task .t-err { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--err); }
.task .t-err[hidden] { display: none; }
.task-end { padding: 12px 0 4px; border-top: 1px solid var(--line); font-size: 13px; color: var(--sub); }
.sheet .fine { font-size: 12px; }

@media (min-width: 1024px) {
  .side .wallet { flex-direction: column; align-items: stretch; width: 100%; gap: 8px; }
  .side .more-coins {
    width: 100%; height: 44px; border-radius: 14px; font-size: 14px; font-weight: 700; background: none;
  }
  .side .more-coins:hover { border-color: var(--text); }
  .side .more-coins i { font-size: 18px; margin-top: 0; }
  .side .more-coins span { display: inline; }
  .sheet.tasks { width: 440px; }
}

/* admin: tasks */
.task-table td .tiny { margin-top: 2px; }
.pill { display: inline-block; font-size: 11px; font-weight: 750; padding: 1px 7px; border-radius: 999px; background: var(--soft); color: var(--sub); }
.pill.on { background: var(--bonus-bg); color: var(--bonus); }
.pill.warn { background: var(--err-bg); color: var(--err); }
.code-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--soft); border-radius: 6px; padding: 2px 6px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; font-weight: 550; }
.check input { width: 18px; height: 18px; }
.hint-line { margin: 4px 0 0; font-size: 12px; color: var(--sub); }

/* ---- diamond message ---- */
.msgbox { margin: 0 0 10px; }
.msgbox[hidden] { display: none; }
.msgbox label { display: block; font-size: 13px; font-weight: 650; margin: 0 0 6px; }
.msgbox label span { color: var(--sub); font-weight: 500; }
.msgrow { position: relative; }
.msgrow input { width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); padding: 0 56px 0 14px; font-size: 16px; }
.msgrow input:focus { outline: none; border-color: var(--text); }
.msgrow span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.jc { position: relative; }
.bubble {
  position: absolute; z-index: 5; max-width: 90%; padding: 7px 12px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; line-height: 1.25; white-space: nowrap;
  box-shadow: var(--shadow); pointer-events: none; animation: bubble-in .16s ease-out;
}
.bubble:after { content: ""; position: absolute; left: var(--tail, 50%); bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bubble { animation: none; } }

.admin tr.muted td { opacity: .6; }

/* not found / error */
.gone { margin: 24px 16px; border: 1px solid var(--line); border-radius: 22px; padding: 24px 20px; }
.gone b { display: block; font-size: 22px; letter-spacing: -.3px; margin-bottom: 6px; }
.gone span { display: block; font-size: 15px; line-height: 1.45; color: var(--sub); margin-bottom: 18px; }
.gone .btn { display: inline-flex; width: auto; padding: 0 22px; }

.sharebar { display: flex; justify-content: center; margin: 14px 0 4px; }
.sharebar .btn { min-width: 220px; }
.task .t-main small.t-progress { font-weight: 700; color: var(--a-text); }

/* out of coins: offer sheet + persistent card */
.ooc-card {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 12px;
  margin: 4px 0 12px;
}
.ooc-card > b { display: block; font-size: 16px; letter-spacing: -.2px; margin-bottom: 4px; }
.ooc-card .ooc-lead, .ooc-card .ooc-reset, .sheet.ooc .ooc-lead, .sheet.ooc .ooc-reset {
  margin: 0 0 6px; font-size: 14px; line-height: 1.4; color: var(--sub); font-weight: 500;
}
.ooc-card .ooc-reset, .sheet.ooc .ooc-reset { color: var(--text); font-weight: 650; margin-bottom: 12px; }
.ooc-actions { display: flex; flex-direction: column; gap: 8px; }
.ooc-actions .btn, .sheet.ooc .btn { margin: 0; }
.sheet.ooc .btn.ghost[disabled], .ooc-actions .btn.ghost[disabled] {
  opacity: 1; color: var(--sub); border-color: var(--line); background: var(--bg);
}
.banner.ooc-card { margin: 10px 16px 0; }
@media (min-width: 1024px) {
  .banner.ooc-card { margin: 8px 0 12px; padding: 18px 20px 16px; }
  .ctl .ooc-card { padding: 16px 16px 14px; }
  .ctl .ooc-card > b { font-size: 17px; }
}
.side .coins.zero { background: var(--soft); box-shadow: inset 3px 0 0 var(--text); }
