/* conate.me — app shell modeled on the familiar donation-platform layout:
   top header + fixed left sidebar + content column, label/input form rows,
   underline tabs, flat gray secondary buttons. Brand color is conate.me's own. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --gray-1: #f7f7f8;   /* secondary buttons, sidebar cards, table headers */
  --gray-2: #f0f0f2;   /* search box, read-only fields */
  --field: #ffffff;
  --line: #cccccc;     /* inputs, tab bar */
  --line-soft: rgba(0, 0, 0, 0.1);
  --text: #030303;
  --text-2: #606060;
  --muted: #8c8c8c;
  --brand: #ff4f8b;        /* conate.me pink */
  --brand-strong: #e63a76;
  --brand-soft: #fff0f5;
  --on-brand: #ffffff;
  --accent-2: #6c5ce7;
  --live: #ff3b30;
  --ok: #12b886;
  --danger: #e03131;
  --warn-bg: #fff8e6;
  --warn-line: #ffe2a4;
  --radius: 8px;
  --header-h: 60px;
  --sidebar-w: 215px;
  font-family: 'Pretendard JP Variable', 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; margin: 24px 0 10px; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.wrap { word-break: break-all; }
.center { text-align: center; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: #fff; border-bottom: 1px solid #eee;
}
.menu-btn { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; padding: 4px; color: var(--text); }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 20px; letter-spacing: -0.04em; color: var(--text); }
.brand::before {
  content: ''; width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, #ff4f8b, #ff8a5c); box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.35);
}
.brand:hover { text-decoration: none; }
.top-search { margin-left: auto; position: relative; width: 300px; }
.top-search input { height: 36px; padding: 0 12px 0 34px; background: var(--gray-2); border: 0; border-radius: var(--radius); font-size: 13px; }
.top-search::before { content: '⌕'; position: absolute; left: 12px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 18px; }
.topbar nav { display: flex; gap: 8px; align-items: center; }

/* ---------- shell ---------- */
.shell {
  max-width: 1200px; margin: 0 auto; padding: 24px 24px 60px;
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 32px; align-items: start;
}
.shell.single { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.content { min-width: 0; }

/* ---------- sidebar ---------- */
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 12px; }
.side-profile { display: flex; gap: 10px; align-items: center; }
.side-profile .name { font-weight: 700; }
.side-card { background: var(--gray-1); border-radius: 12px; padding: 14px; }
.side-card .line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.side-card .line b { font-weight: 700; }
.side-card .addr { font-size: 12px; color: var(--muted); word-break: break-all; }
.side-nav { display: flex; flex-direction: column; margin-top: 4px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 4px; font-weight: 600; font-size: 14px; border-radius: 6px; }
.side-nav a:hover { background: var(--gray-1); text-decoration: none; }
.side-nav a.active { color: var(--brand-strong); }
.side-nav .ico { width: 18px; text-align: center; }
.side-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.side-promo { border-radius: 12px; padding: 16px; color: #fff; background: linear-gradient(135deg, #6c5ce7, #ff4f8b); font-weight: 700; line-height: 1.35; }
.side-promo .muted { color: rgba(255, 255, 255, 0.85); font-weight: 500; margin-top: 6px; }
.side-backdrop { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--brand); color: var(--on-brand); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--brand-strong); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: var(--gray-1); color: var(--text); border-color: var(--line-soft); font-weight: 700; }
.btn.secondary:hover { background: #efeff1; }
.btn.ghost { background: transparent; color: var(--brand-strong); }
.btn.danger { background: var(--danger); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.full { width: 100%; }
.btn.submit { display: flex; width: 320px; max-width: 100%; height: 44px; margin: 0 auto; font-size: 18px; font-weight: 700; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.btn-group .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 18px; padding: 4px; }

/* ---------- inputs ---------- */
label { font-weight: 600; font-size: 14px; }
input, textarea, select {
  width: 100%; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0;
  font: inherit; font-size: 14px; color: var(--text); background: var(--field);
}
textarea { height: auto; min-height: 82px; padding: 10px 14px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); }
input[readonly] { background: var(--gray-1); }
input[type=checkbox] { width: auto; height: auto; accent-color: var(--brand); }
input[type=file] { height: auto; padding: 8px; }
.field { position: relative; display: flex; align-items: center; }
.field input, .field textarea { flex: 1; }
.field .counter { position: absolute; right: 12px; color: var(--muted); font-size: 13px; pointer-events: none; }
.field textarea + .counter { top: 10px; }
.field .suffix { position: absolute; left: 0; padding-left: 14px; pointer-events: none; color: var(--text); white-space: pre; }
.field .suffix .ghost { visibility: hidden; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; margin: 8px 0; cursor: pointer; }

/* toggle switch built on a checkbox */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* label | control rows */
.form-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center; margin: 14px 0; }
.form-row > label:first-child, .form-row > .label { align-self: center; }
.form-row.top { align-items: start; }
.form-row.top > label:first-child { padding-top: 10px; }
.form-row .help { grid-column: 2; margin-top: -8px; }
.form-row .inline { display: flex; gap: 14px; align-items: center; }
.form-row .inline > .field { flex: 1; }
.divider { border: 0; border-top: 1px solid var(--line-soft); margin: 24px 0; }

/* chips (voice, network, coin, amount presets) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button, .chip {
  height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--field);
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer;
}
.chips button:hover { border-color: var(--brand); }
.chips button.active { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-soft); }
.chips button.fill { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ---------- tabs (underline) ---------- */
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a {
  flex: 0 0 auto; min-width: 96px; height: 40px; padding: 0 16px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active, .tabs a.active { color: var(--brand-strong); border-bottom-color: var(--brand); }
.tabs a:hover { text-decoration: none; }
.tab-badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px; border-radius: 99px; background: var(--live); color: #fff; font-size: 10px; vertical-align: 2px; }

/* ---------- banner ---------- */
.banner {
  position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1150 / 270; min-height: 150px;
  color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 0 48px;
}
.banner.short { aspect-ratio: 1150 / 200; } /* the slimmer banner on donate pages */
.banner .slide { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 48px; opacity: 0; transition: opacity .5s; }
.banner .slide.on { opacity: 1; }
.banner .eyebrow { font-size: 16px; font-weight: 700; opacity: .9; }
.banner .headline { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; line-height: 1.2; }
.banner .art { position: absolute; right: 48px; top: 50%; transform: translateY(-50%); font-size: 88px; filter: drop-shadow(0 8px 20px rgba(0,0,0,.25)); }
.banner .dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.banner .dots button { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.5); cursor: pointer; }
.banner .dots button.on { background: #fff; width: 18px; border-radius: 99px; }
.b1 { background: linear-gradient(115deg, #2b1a6b 0%, #5a3be0 55%, #ff4f8b 100%); }
.b2 { background: linear-gradient(115deg, #ff4f8b 0%, #ff8a5c 100%); }
.b3 { background: linear-gradient(115deg, #0b8f75 0%, #2bb5c9 100%); }

/* ---------- home ---------- */
.section-head { display: flex; align-items: center; gap: 8px; margin: 32px 0 14px; }
.section-head h2 { font-size: 18px; }
.live-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; background: var(--live); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.scard { display: block; color: inherit; }
.scard:hover { text-decoration: none; }
.scard .thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; display: grid; place-items: center; font-size: 46px; font-weight: 800; color: rgba(255,255,255,.95); }
.scard:hover .thumb { filter: brightness(1.05); }
.scard .pill { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.scard .meta { display: flex; gap: 10px; margin-top: 10px; align-items: flex-start; }
.scard .title { font-weight: 700; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.scard .sub { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; background: var(--gray-1); border-radius: 12px; }

/* ---------- avatars ---------- */
.avatar { --size: 40px; width: var(--size); height: var(--size); flex: 0 0 var(--size); border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: calc(var(--size) * 0.42); }
.avatar.sm { --size: 32px; }
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.avatar.lg { --size: 100px; }
.avatar-ring { padding: 3px; border-radius: 50%; background: conic-gradient(#ff4f8b, #ffb347, #5ad1ff, #8b5cf6, #ff4f8b); position: relative; }
.avatar-ring .avatar { border: 3px solid #fff; }

/* ---------- streamer page ---------- */
.creator { display: flex; gap: 20px; align-items: flex-start; margin: 24px 0 8px; flex-wrap: wrap; }
.creator .info { flex: 1; min-width: 220px; padding-top: 6px; }
.creator .name-line { display: flex; align-items: center; gap: 6px; }
.creator .bio { color: var(--text-2); font-size: 14px; margin-top: 6px; white-space: pre-line; overflow-wrap: anywhere; }
.creator .bio.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.creator .more { font-weight: 700; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 700; }
.creator .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.creator .slug { color: var(--muted); font-size: 13px; }
.fav-btn.on { color: var(--brand-strong); }
.side-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 16px 0 4px; align-items: start; }
.mini { background: var(--gray-1); border-radius: 12px; padding: 14px 16px; }
.mini h3 { margin: 0 0 8px; font-size: 14px; }
.goal-bar { height: 10px; border-radius: 99px; background: var(--gray-2); overflow: hidden; margin: 8px 0 6px; }
.goal-bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .6s ease; }
.poll-option { margin: 6px 0; font-size: 13px; }
.poll-option .bar { height: 6px; border-radius: 99px; background: var(--gray-2); overflow: hidden; margin-top: 3px; }
.poll-option .bar > span { display: block; height: 100%; background: var(--accent-2); }
.summary { background: var(--gray-1); padding: 12px 14px; font-size: 14px; }
.summary b { color: var(--brand-strong); }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); padding: 10px 12px; font-size: 13px; }
.sig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.sig-card { border: 1px solid var(--line); background: var(--field); padding: 8px; cursor: pointer; text-align: center; font: inherit; color: var(--text); }
.sig-card.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.sig-card img, .sig-card .ph { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--gray-1); display: grid; place-items: center; font-size: 32px; }
.sig-card b { display: block; margin-top: 6px; font-size: 13px; }
.sig-card span { font-size: 13px; color: var(--brand-strong); font-weight: 700; }
.done { text-align: center; padding: 48px 16px; }
.done .big { font-size: 52px; }

/* ---------- tables (received donations, history) ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: var(--gray-1); color: var(--text-2); font-weight: 600; padding: 10px 8px; text-align: center; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
tbody td { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); text-align: center; vertical-align: top; }
tbody td.left, thead th.left { text-align: left; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: var(--gray-2); color: var(--text-2); white-space: nowrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; margin: 24px 0 14px; cursor: pointer; background: none; border: 0; font-family: inherit; color: var(--text); }

/* ---------- dashboard / generic panels ---------- */
.panel { border-top: 1px solid var(--line-soft); padding: 24px 0; }
.panel:first-of-type { border-top: 0; }
.panel h2 { margin-bottom: 6px; }
.panel > .muted { margin-bottom: 14px; display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: var(--gray-1); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 22px; margin-top: 2px; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.thumb-sq { width: 48px; height: 48px; object-fit: contain; background: var(--gray-1); flex: 0 0 48px; display: grid; place-items: center; font-size: 20px; }
.events { list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--muted); }
.events li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); word-break: break-all; }
.fee-list { list-style: none; padding: 0; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 1em; }
.success { color: var(--ok); font-weight: 600; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand-strong); }
.badge.gray { background: var(--gray-2); color: var(--text-2); }
.badge.green { background: var(--brand-soft); color: var(--brand); }
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 24px; }
.attention { box-shadow: 0 0 0 2px var(--brand); border-radius: 8px; }

/* ---------- modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal { width: min(400px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 22px; }
.modal h2 { margin-bottom: 14px; }
.wallet-option { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.wallet-option:hover { border-color: var(--brand); }
.wallet-option img { width: 26px; height: 26px; border-radius: 6px; }
.modal .btn.secondary { width: 100%; margin-top: 6px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line-soft); margin-top: 40px; padding: 24px 0 8px; color: var(--muted); font-size: 12px; display: flex; gap: 16px; flex-wrap: wrap; }
.footer a:hover { color: var(--text); }
.legal h2 { margin: 28px 0 8px; font-size: 16px; }
.legal p, .legal li { color: var(--text-2); margin: 6px 0; }
.legal li { margin-left: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .shell { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 48px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 50; background: var(--bg); padding: 20px 16px;
    overflow-y: auto; transform: translateX(-105%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0,0,0,.12);
  }
  body.side-open .sidebar { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); }
  .top-search { width: auto; flex: 1; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .banner, .banner .slide { padding: 0 24px; }
  .banner, .banner.short { aspect-ratio: auto; height: 150px; }
  .banner .eyebrow { padding-right: 64px; }
  .banner .headline { padding-right: 56px; }
  .banner .headline { font-size: 24px; }
  .banner .art { font-size: 56px; right: 20px; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .brand { font-size: 17px; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .form-row.top > label:first-child { padding-top: 0; }
  .form-row .help { grid-column: 1; margin-top: 0; }
  .creator .actions { width: 100%; }
  .banner .eyebrow { font-size: 13px; }
  .banner .art { display: none; }
  .copy-row { flex-wrap: wrap; }
  .copy-row > * { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* stacked label/input forms (dashboard panels, login card) */
.panel label:not(.check):not(.switch), .card label:not(.check):not(.switch) { display: block; margin: 14px 0 6px; }
.panel .row > div { min-width: 0; }
.card .btn.full { margin-top: 18px; height: 44px; font-size: 16px; }
.row-buttons { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* sidebar wallet card + deposit window */
.wallet-card .line b { font-size: 15px; }
.wallet-card .icon-btn.small { font-size: 14px; color: var(--muted); padding: 0; }
.side-link { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; text-align: center; }
.side-link:hover { color: var(--text); text-decoration: underline; }
.deposit-list { margin: 0; padding-left: 18px; font-size: 14px; }
.deposit-list li { margin: 4px 0; }
.deposit-address { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--gray-1); border: 1px solid var(--line); padding: 10px 12px; word-break: break-all; user-select: all; }


/* light theme details kept from the first version */
.chips button.active { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-soft); }
.legal a { color: var(--brand-strong); }

/* ---------- watch mode: live stream + donate form side by side ---------- */
.player { margin-top: 8px; }
.player .screen { position: relative; aspect-ratio: 16 / 9; background: #0f0f10; border-radius: 12px; overflow: hidden; }
.player .screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-off { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #fff; text-align: center; padding: 16px; }
.player-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.live-badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; color: #fff; background: #555; }
.live-badge.youtube { background: #ff0033; }
.live-badge.twitch { background: #9146ff; }
.live-badge.kick { background: #53fc18; color: #000; }
.live-badge.chzzk { background: #00ffa3; color: #000; }
.scard .live-badge { position: absolute; top: 8px; right: 8px; }
body.watching .creator { margin-top: 14px; }
@media (min-width: 1100px) {
  body.watching .watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
  body.watching .watch-side { position: sticky; top: 76px; border: 1px solid var(--line-soft, #e5e5e5); border-radius: 12px; padding: 4px 18px 18px; background: var(--bg); }
  body.watching .watch-side .form-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  body.watching .watch-side .form-row > span:empty { display: none; }
  body.watching .watch-side .form-row.top > label:first-child { padding-top: 0; }
  body.watching .watch-side .sig-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.watching .watch-side .btn.submit { width: 100%; }
  body.watching .watch-side .tabs { overflow-x: auto; }
}

/* ---------- step titles, payment method ---------- */
.step { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 24px 0 8px; }
.step span { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-size: 13px; display: grid; place-items: center; flex: 0 0 24px; }
.pay-method { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; background: var(--gray-1); border-radius: 10px; margin: 8px 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-strong); font-weight: 700; cursor: pointer; margin-left: auto; }
.sig-card small { font-size: 11px; }
.side-foot .row select { flex: 1; min-width: 0; }

/* live cards on the home page */
.scard .thumb img.live-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scard .live-on { position: absolute; bottom: 8px; left: 8px; display: flex; gap: 6px; }
.scard .live-on span { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; color: #fff; background: rgba(0,0,0,.65); }
.scard .live-on .red { background: #ff0033; }
.scard .stream-title { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title { font-weight: 700; margin-top: 8px; }

/* read-aloud preview */
.preview-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: -6px; }
.voice-lang { max-width: 360px; }
.voice-list { margin-top: 8px; max-height: 220px; overflow-y: auto; }

/* ---------- wallet: deposit / withdraw ---------- */
.page-title { font-size: 24px; margin: 0 0 4px; }
.wallet-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.wallet-body { padding-top: 8px; }
.deposit-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; margin: 12px 0; }
.deposit-grid .qr { width: 180px; height: 180px; border: 1px solid var(--line-soft); border-radius: 12px; padding: 6px; background: #fff; }
.sub-title { font-size: 15px; margin: 20px 0 8px; }
.wallet-body .btn.submit { display: flex; margin: 16px auto 0; }
.confirm-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 12px 0; }
.confirm-list dt { color: var(--muted); }
.confirm-list dd { margin: 0; font-weight: 600; }
.side-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .deposit-grid { grid-template-columns: minmax(0, 1fr); justify-items: center; } }

/* ---------- creator dashboard: grouped menu, widgets, chart ---------- */
.side-group { font-size: 12px; font-weight: 700; color: var(--muted); margin: 14px 12px 4px; text-transform: uppercase; letter-spacing: .02em; }
.side-group:first-child { margin-top: 0; }
.widget-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 20px; }
.widget-card { display: grid; gap: 6px; justify-items: start; padding: 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--bg); }
.widget-card:hover { border-color: var(--brand); }
.widget-card .icon { font-size: 26px; }
.widget-card .state { font-size: 12px; color: var(--muted); }
.widget-card .state.on { color: var(--brand-strong); font-weight: 700; }
.chart-panel { margin-top: 16px; }
.chart { width: 100%; height: auto; margin-top: 10px; }
.chart .bar { fill: var(--brand); }
.chart .baseline { stroke: var(--line-soft); }
.chart .axis { font-size: 10px; fill: var(--muted); }
body.hide-stats #overview .stat b, body.hide-stats #chart { filter: blur(8px); }
.blocked-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.blocked-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-buttons.nowrap { flex-wrap: nowrap; }
.chart .axis { font-size: 13px; }
.panel > .btn { margin-top: 12px; }
.modal .wallet-option + p.center { margin: 10px 0 2px; }
.modal input[type=email], .modal input[inputmode=numeric] { margin: 6px 0; }

/* ---------- live chat ---------- */
.side-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 8px 0 4px; border-bottom: 1px solid var(--line-soft); }
.side-tabs[hidden] { display: none; }
.side-tabs button { height: 48px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.side-tabs button.active { color: var(--brand-strong); border-bottom-color: var(--brand); }
.side-chat { height: min(680px, calc(100vh - 150px)); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
@media (min-width: 1100px) {
  body.watching .side-tabs { margin: 0 -18px 4px; }
  body.watching .side-chat { margin: 0 -18px -18px; border: 0; border-radius: 0 0 12px 12px; }
}
.side-chat iframe { width: 100%; height: 100%; border: 0; display: block; }
.watch-side.chat-mode > :not(.side-tabs):not(.side-chat) { display: none !important; }

/* ---------- phones ---------- */
.mobile-tabs, .mobile-cta { display: none; }
@media (max-width: 760px) {
  /* app-style bottom tabs on donor pages */
  .mobile-tabs {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--bg); border-top: 1px solid var(--line-soft); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-tabs a, .mobile-tabs button {
    display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--muted); background: none; border: 0; font-family: inherit; padding: 2px 0; cursor: pointer;
  }
  .mobile-tabs .ico { font-size: 20px; line-height: 1.2; }
  .mobile-tabs a.active { color: var(--brand-strong); font-weight: 700; }
  body.has-tabs .shell { padding-bottom: 90px; }

  /* donate page: total + donate button pinned to the bottom */
  .mobile-cta {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--bg); border-top: 1px solid var(--line-soft); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(0,0,0,.06); transition: transform .2s;
  }
  .mobile-cta[hidden] { display: none; }
  .mobile-cta .btn { flex: 0 0 auto; min-width: 140px; }
  body.cta-hidden .mobile-cta { transform: translateY(110%); }
  body:has(.mobile-cta:not([hidden])) .shell { padding-bottom: 96px; }

  /* watch mode: the stream stays on top while scrolling the form, like a video app */
  /* The player's wrappers step aside so the screen can stay stuck over the whole page. */
  body.watching .watch-main, body.watching .player { display: contents; }
  body.watching .player .screen { position: sticky; top: var(--header-h); z-index: 6; border-radius: 0; margin: -16px -16px 0; }
  body.chat-tab .mobile-cta { display: none; }
  .side-chat { height: 70vh; }

  /* dashboard header: keep the essentials */
  #who { display: none; }
  .topbar nav .btn.small { padding: 0 10px; }

  /* tables become cards (donation list, received donations) */
  #history table, #received table { min-width: 0; }
  #history thead, #received thead { display: none; }
  #history tr, #received tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); }
  #history td, #received td { display: block; padding: 0; border: 0; text-align: left !important; white-space: normal; }
  #history td:nth-child(1), #received td:nth-child(1) { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
  #history td:nth-child(2), #received td:nth-child(2) { font-weight: 700; }
  #history td:nth-child(3), #received td:nth-child(3) { text-align: right !important; font-weight: 700; color: var(--brand-strong); }
  #history td:nth-child(4), #received td:nth-child(4) { grid-column: 1 / -1; }
  #history td:nth-child(5) { grid-column: 1; font-size: 12px; }
  #history td:nth-child(6) { grid-column: 2; }
  #received td:nth-child(5) { grid-column: 1 / -1; }
  #history .table-wrap, #history .scroll-x { overflow: visible; }
}

/* stream channel connection (dashboard settings) */
.stream-box { border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; margin: 6px 0 14px; }
.stream-box.ok { border-color: #b7ebc6; background: #f2fbf5; }
.stream-box p { margin: 0 0 8px; }
.btn.connect-yt { background: #ff0033; }
.btn.connect-tw { background: #9146ff; }
.btn.disabled { opacity: .45; }

/* dashboard gate: sign in / become a streamer */
.gate { max-width: 520px; margin: 24px auto; display: grid; gap: 10px; }
.gate h1 { margin: 0; font-size: 24px; }
.gate .btn { justify-self: start; }

/* streamer registration */
.gate.register { max-width: 620px; gap: 14px; }
.reg-step { border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; }
.reg-step h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.reg-step h3 span { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-size: 13px; display: grid; place-items: center; }
.reg-step p { margin: 0; }
.slug-input { display: flex; align-items: stretch; border: 1px solid var(--line); background: var(--field); }
.slug-input .prefix { display: flex; align-items: center; padding: 0 0 0 12px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.slug-input input { border: 0; flex: 1; min-width: 0; padding-left: 2px; }
.slug-input:focus-within { border-color: var(--brand); }
.slug-status { font-size: 13px; font-weight: 600; min-height: 18px; margin: 0; }
.slug-status.ok { color: #12a150; }
.slug-status.bad { color: #e5484d; }
.slug-status.warn { color: #b7791f; }
.slug-rules { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: grid; gap: 2px; }
.reg-next { background: var(--gray-1); border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.reg-next ol { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; color: var(--text-2); }

.verify-needed { border: 2px solid var(--brand); background: var(--brand-soft); border-radius: 12px; padding: 14px 16px; margin: 12px 0; display: grid; gap: 6px; }
.verify-needed p { margin: 0; color: var(--text-2); font-size: 14px; }

/* Deposit / withdraw, laid out like Hyperliquid's transfer dialogs: coin "on" network,
   QR + address card, a fee/time summary, a red loss warning and one stateful button. */
.xfer-title { font-size: 20px; margin: 4px 0 14px; }
.xfer-head { display: flex; align-items: center; gap: 6px; }
.xfer-head .xfer-title { margin: 4px 0 14px; }
.xfer-option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 16px 18px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.xfer-option b { font-size: 16px; }
.xfer-option:hover:not(:disabled) { border-color: var(--brand); }
.xfer-option:disabled { cursor: not-allowed; opacity: 0.55; }
.xfer-pick, .xfer-field { margin-bottom: 14px; }
.xfer-pick-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.xfer-pick-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.xfer-coin, .xfer-select, .xfer-input { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--text); font: inherit; font-weight: 600; }
.xfer-select { width: 100%; cursor: pointer; }
.xfer-input { font-weight: 400; padding-right: 6px; }
.xfer-input:focus-within { border-color: var(--brand); }
.xfer-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; color: inherit; padding: 0; }
.xfer-max { border: 0; background: none; color: var(--brand-strong); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; padding: 0 6px; }
.usdc-dot { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #2775ca; color: #fff; font-size: 12px; font-weight: 700; }
.usdc-dot.big { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; font-size: 22px; border: 3px solid #fff; }
.xfer-qr-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; margin-bottom: 14px; border: 1px solid var(--brand); border-radius: 12px; }
.xfer-qr { position: relative; width: 160px; height: 160px; }
.xfer-qr img { width: 160px; height: 160px; }
.xfer-qr-card > .muted { align-self: flex-start; }
.xfer-address { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--gray-1); font-size: 13px; word-break: break-all; text-align: center; }
.xfer-address .icon-btn { flex: none; }
.xfer-info { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.xfer-info dt { color: var(--text-2); }
.xfer-info dd { margin: 0; text-align: right; }
.xfer-warning { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--danger); border-radius: 10px; background: color-mix(in srgb, var(--danger) 7%, transparent); color: var(--danger); font-size: 13px; text-align: center; }
.wallet-body .btn.submit.xfer-submit { width: 100%; border-radius: 10px; font-size: 16px; }
.wallet-body .btn.submit.xfer-submit:disabled { opacity: 0.6; cursor: not-allowed; }
@media (max-width: 560px) { .xfer-pick-row { grid-template-columns: minmax(0, 1fr); } .xfer-pick-row > .muted { display: none; } }

/* Login ("Connect") dialog, Hyperliquid's layout. */
.modal.connect { position: relative; width: 400px; max-width: calc(100vw - 32px); padding: 22px 20px 16px; border-radius: 16px; }
.connect-head { display: flex; align-items: center; gap: 4px; margin-bottom: 16px; padding-right: 28px; }
.connect-head h2 { font-size: 20px; }
.connect-close { position: absolute; top: 14px; right: 14px; font-size: 16px; color: var(--muted); }
.connect-email { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px 0 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius); }
.connect-email:focus-within { border-color: var(--brand); }
.connect-email img { width: 22px; height: 22px; }
.connect-email input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); padding: 0; }
.connect-email .btn { flex: none; }
.connect .error:empty { display: none; }
.connect-or { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; color: var(--muted); font-size: 12px; }
.connect-or::before, .connect-or::after { content: ''; flex: 1; border-top: 1px solid var(--line-soft); }
.connect .wallet-option .grow { flex: 1; text-align: left; }
.wallet-icon-blank { width: 26px; height: 26px; border-radius: 6px; background: var(--gray-2); }
.wallet-badge { font-size: 11px; font-weight: 600; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); padding: 2px 8px; border-radius: 999px; }
.connect .link-btn { margin: 0; }
.connect-terms { margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.connect-terms a { text-decoration: underline; }
.connect-back { font-size: 18px; color: var(--muted); }
.connect-mail { display: grid; place-items: center; width: 64px; height: 64px; margin: -4px auto 14px; border-radius: 50%; background: var(--brand-soft); }
.connect-mail img { width: 30px; height: 30px; }
.connect-code-text { margin: 8px 0 18px; color: var(--text-2); word-break: break-all; }
.code-boxes { display: flex; justify-content: center; gap: 8px; margin-bottom: 6px; }
.code-box { width: 44px; height: 54px; border: 1px solid var(--line); border-radius: 10px; text-align: center; font: inherit; font-size: 22px; font-weight: 700; color: var(--text); background: var(--field); }
.code-box:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.code-box:disabled { opacity: 0.6; }
@media (max-width: 380px) { .code-box { width: 38px; height: 48px; } .code-boxes { gap: 6px; } }

/* Transparent fee breakdown on the donate page. */
.fee-breakdown { display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: 2px 16px; margin: 6px 0 4px; font-size: 13px; }
.fee-breakdown dt { color: var(--text-2); }
.fee-breakdown dd { margin: 0; text-align: right; }
.fee-details { margin-top: 6px; font-size: 13px; }
.fee-details summary { cursor: pointer; color: var(--brand-strong); font-weight: 600; }
.fee-table { width: 100%; margin: 8px 0 4px; border-collapse: collapse; font-size: 13px; }
.fee-table th, .fee-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); text-align: right; }
.fee-table .left { text-align: left; }
.fee-table tr.active td { background: var(--brand-soft); }

/* Public fee page (/fees), laid out like a help-center fee sheet: category cards with the
   fee on the right, then a notes box. */
.fee-intro, .fee-notes { padding: 18px 20px; margin-bottom: 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--gray-1); }
.fee-intro h2 { font-size: 18px; margin-bottom: 8px; }
.fee-intro p { margin: 0; color: var(--text-2); }
.fee-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin-bottom: 14px; }
.fee-card { border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; background: var(--surface); }
.fee-card-head { padding: 12px 16px; background: var(--gray-1); border-bottom: 1px solid var(--line-soft); font-weight: 700; color: var(--text-2); }
.fee-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.fee-row:last-child { border-bottom: 0; }
.fee-row b { font-size: 15px; white-space: nowrap; }
.fee-row small { display: block; }
.fee-notes-head { font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.fee-notes ul { margin: 0; padding-left: 18px; line-height: 1.8; color: var(--text-2); font-size: 13px; }
@media (max-width: 640px) { .fee-grid { grid-template-columns: minmax(0, 1fr); } }
.chips-label { align-self: center; margin: 0 2px 0 8px; }

/* ---------- page loader ----------
   Pages start with <html class="loading"> (src/pages.js) and stay hidden behind a spinner
   until their script has rendered (static/ready.js). The spinner fades in only after a short
   delay so fast loads don't flash it, and CSS alone reveals the page after 10s if the
   scripts never run. */
.page-loader { display: none; }
html.loading .page-loader {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 1000; background: var(--bg);
  animation: loader-fade-in 0.2s ease 150ms both, loader-give-up 0s 10s forwards;
}
html.loading body > :not(.page-loader) { visibility: hidden; animation: loader-reveal 0s 10s forwards; }
.page-loader .loader-box { position: relative; width: 76px; height: 76px; }
.page-loader .spinner {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--brand-soft); border-top-color: var(--brand);
  animation: loader-spin 0.9s linear infinite;
}
/* the header logo mark (.brand::before), larger */
.page-loader .mark {
  position: absolute; inset: 18px; border-radius: 12px;
  background: linear-gradient(135deg, #ff4f8b, #ff8a5c); box-shadow: inset 0 0 0 9px rgba(255, 255, 255, 0.35);
  animation: loader-pulse 1.2s ease-in-out infinite;
}
.page-loader .word { margin-top: 14px; font-weight: 800; font-size: 18px; letter-spacing: -0.04em; color: var(--text); text-align: center; }
html.loading .page-loader { grid-auto-flow: row; align-content: center; }
@media (prefers-reduced-motion: reduce) { .page-loader .spinner { animation-duration: 2s; } .page-loader .mark { animation: none; } }
@keyframes loader-pulse { 50% { transform: scale(0.88); } }
@keyframes loader-spin { to { transform: rotate(360deg); } }
@keyframes loader-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes loader-give-up { to { visibility: hidden; } }
@keyframes loader-reveal { to { visibility: visible; } }
