:root {
  --bg: #11141b;
  --bg-2: #171b24;
  --panel: #1c212c;
  --panel-2: #242a37;
  --line: #2f3646;
  --chalk: #eef3f6;      /* soft white */
  --muted: #98a2b3;
  --dim: #697285;
  --accent: #22d3ee;     /* cyan */
  --accent-2: #67e8f9;
  --accent-deep: #0e9fb8;
  --accent-ink: #052a32; /* text on cyan */
  --accent-soft: rgba(34, 211, 238, 0.12);
  --hold-red: #ff4d4d;
  --hold-blue: #3d9bff;
  --hold-yellow: #ffd23d;
  --danger: #f58a9b;
  --radius: 14px;
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1100px 560px at 90% -12%, rgba(34,211,238,0.07), transparent 60%),
    radial-gradient(800px 480px at -10% 110%, rgba(238,243,246,0.035), transparent 60%),
    var(--bg);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(26px, 5vw, 38px); font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); }
.hidden, [hidden] { display: none !important; }
small.eyebrow, .eyebrow { display: block; font-size: 10.5px; letter-spacing: .14em; font-weight: 700; color: var(--muted); text-transform: uppercase; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px max(14px, env(safe-area-inset-left));
  background: rgba(17,20,27,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.brand img { width: 32px; height: 32px; display: block; }
.brand b { color: var(--accent); font-weight: 800; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { text-decoration: none; color: var(--muted); padding: 7px 10px; border-radius: 10px; font-weight: 500; position: relative; }
.nav a:hover { color: var(--chalk); background: var(--panel); }
.nav a.active { color: var(--chalk); }
.nav .bell { display: grid; place-items: center; padding: 7px 8px; }
.nav .bell svg { width: 20px; height: 20px; }
.nav .bell .count { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; font-family: var(--font-mono); }
.vp-pill { display: flex; align-items: center; gap: 6px; background: var(--panel) !important; border: 1px solid var(--line); font-family: var(--font-mono); font-weight: 700; font-size: 13px; color: var(--chalk) !important; }
.vp-pill i { color: var(--accent); font-style: normal; }

.app { max-width: 1100px; margin: 0 auto; padding: 18px 16px 110px; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--chalk);
  padding: 10px 16px; border-radius: 12px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: transform .08s, background .15s, border-color .15s;
  min-height: 42px;
}
.btn:hover { background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); }
.btn-danger { color: var(--danger); border-color: rgba(245,138,155,.4); background: transparent; }
.btn-danger:hover { background: rgba(245,138,155,.1); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn-trial { width: 100%; margin-top: 12px; background: linear-gradient(90deg, var(--accent), var(--chalk)); color: var(--accent-ink); border: 0; font-weight: 800; letter-spacing: .01em; box-shadow: 0 0 24px rgba(34,211,238,.35); }
.btn-trial.off { background: var(--panel-2); color: var(--chalk); box-shadow: none; border: 1px solid var(--line); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-decoration: none; flex: 0 0 auto; }
.icon-btn svg { width: 20px; height: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field > .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 13px; outline: none; transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.textarea { min-height: 84px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.error-text { color: var(--danger); font-size: 14px; min-height: 20px; }
.help { font-size: 12.5px; color: var(--muted); }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--panel-2); color: var(--chalk); box-shadow: inset 0 0 0 1px var(--line); }
.seg.big { display: flex; width: 100%; }
.seg.big button { flex: 1; padding: 10px; }
.seg.mode button.on[data-mode=ranked] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stack > * + * { margin-top: 14px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 88vh; display: grid; place-items: center; }
.auth { width: min(420px, 100%); }
.auth .hero { text-align: center; margin-bottom: 22px; }
.auth .hero img { width: 92px; height: 92px; display: block; margin: 0 auto 8px; }
.auth .hero p { color: var(--muted); margin: 8px 0 0; }
.auth .brand { justify-content: center; font-size: 26px; margin-bottom: 12px; }
.auth .switch { text-align: center; margin-top: 14px; color: var(--muted); }
.auth .switch a { color: var(--accent); }

/* ---------- summary / bars ---------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 22px; }
.stat { padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--font-mono); font-size: 24px; }
.stat b.accent { color: var(--accent); }
.stat span { font-size: 12.5px; color: var(--muted); }
.bar { height: 14px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin: 12px 0 6px; position: relative; }
.bar > i {
  display: block; height: 100%; border-radius: 8px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, #4fdcf2 10px 20px);
  box-shadow: 0 0 18px rgba(34,211,238,.35);
  transition: width .9s cubic-bezier(.2,.8,.2,1);
}
.bar.full > i { background: linear-gradient(90deg, var(--accent), var(--chalk)); }
.bar.sm { height: 8px; margin: 6px 0 0; }
.bar-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.bar-foot b { color: var(--chalk); font-family: var(--font-mono); }

/* ---------- boards grid ---------- */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 6px 0 14px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.board-card { text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .15s, border-color .15s; display: flex; flex-direction: column; }
.board-card:hover { transform: translateY(-2px); border-color: #485066; }
.board-card .thumb { aspect-ratio: 4 / 3; background: var(--bg-2) center / cover no-repeat; position: relative; }
.board-card .body { padding: 12px 14px 14px; }
.board-card .meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.board-card .my-rank { position: absolute; right: 10px; bottom: 10px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: rgba(17,20,27,.84); border: 1px solid var(--line); color: var(--muted); }
.thumb .tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.tag.public { color: var(--accent); }
.tag.ranked { color: var(--chalk); border-color: rgba(34,211,238,.45); }
.empty { text-align: center; padding: 44px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h3 { color: var(--chalk); margin-bottom: 6px; }

/* ---------- board screen ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.board-head { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 18px; align-items: start; margin-bottom: 16px; }
.board-head .photo { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); aspect-ratio: 4/3; }
.board-head .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) {
  .board-head { grid-template-columns: minmax(0, 1fr) auto; }
  .board-head .photo { grid-column: 1 / -1; aspect-ratio: 16/9; }
}
.facts { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.fact { background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 4px 9px; font-size: 12.5px; color: var(--muted); }
.fact b { color: var(--chalk); font-weight: 600; }
.desc { color: #cdd5de; white-space: pre-wrap; margin: 10px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 46px; z-index: 30; min-width: 220px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.menu a, .menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 9px; border: 0; background: transparent; text-decoration: none; cursor: pointer; font-weight: 500; }
.menu a:hover, .menu button:hover { background: var(--panel); }
.menu .badge { background: var(--accent); color: var(--accent-ink); border-radius: 9px; font-size: 11px; font-weight: 800; padding: 1px 7px; }
.menu .none { color: var(--muted); padding: 10px 12px; font-size: 13px; }

.mode-bar { margin: 4px 0 14px; }
.rank-card { margin-bottom: 18px; }
.rank-head { display: flex; gap: 14px; align-items: center; }
.rank-head h3 { font-size: 20px; }
.rank-icon { flex: 0 0 auto; display: block; }
.pending-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 6px 11px; border-radius: 20px; background: rgba(238,243,246,.08); border: 1px dashed rgba(238,243,246,.3); font-size: 13px; font-weight: 600; }
.free-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.free-card p { margin: 4px 0 0; font-size: 13.5px; }
.vp-big { text-align: right; font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.vp-big small { display: block; font-family: var(--font-body); font-size: 12px; color: var(--muted); font-weight: 500; }

.problem-list { display: flex; flex-direction: column; gap: 8px; }
.problem-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  transition: border-color .15s, background .15s;
}
.problem-row:hover { border-color: #485066; background: var(--panel-2); }
.problem-row.locked { opacity: .55; }
.problem-row.trial { border-color: rgba(34,211,238,.55); box-shadow: 0 0 0 1px rgba(34,211,238,.18), 0 0 22px rgba(34,211,238,.08); }
.problem-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.problem-row .sub { font-size: 12.5px; color: var(--muted); }
.problem-row .right { text-align: right; font-size: 13px; font-weight: 700; white-space: nowrap; }
.problem-row .right small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.ok-text { color: var(--accent); }
.badge-trial { display: inline-block; padding: 2px 8px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; }
.grade {
  font-family: var(--font-mono); font-weight: 700; font-size: 16px; text-align: center;
  border-radius: 10px; padding: 8px 0; background: var(--bg-2); border: 1px solid var(--line);
}
/* grade ramp: soft white to bright cyan */
.g0,.g1,.g2 { color: #c3ccd6; }
.g3,.g4,.g5 { color: #a5ecf6; }
.g6,.g7,.g8 { color: #6fe1f3; }
.g9,.g10,.g11 { color: var(--accent); border-color: rgba(34,211,238,.35); }
.g12,.g13,.g14,.g15,.g16,.g17 { color: var(--chalk); border-color: var(--accent); text-shadow: 0 0 12px rgba(34,211,238,.8); }

.fab {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(22px + env(safe-area-inset-bottom));
  width: 62px; height: 62px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; text-decoration: none; z-index: 25; border: 0; cursor: pointer;
  box-shadow: 0 10px 30px rgba(34,211,238,.35), 0 4px 12px rgba(0,0,0,.45);
  transition: transform .12s;
}
.fab:hover { transform: scale(1.05); }
.fab svg { width: 28px; height: 28px; }

/* ---------- join ranked / rank pickers ---------- */
.notice { border-color: rgba(34,211,238,.45); background: linear-gradient(180deg, rgba(34,211,238,.08), transparent 70%), var(--panel); margin-bottom: 16px; }
.notice h3 { margin-bottom: 6px; color: var(--accent); }
.notice p { margin: 8px 0 0; color: #d6dde5; }
.rank-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 16px; }
.rank-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg-2); cursor: pointer; text-align: left; }
.rank-opt b { display: block; }
.rank-opt small { color: var(--muted); font-family: var(--font-mono); }
.rank-opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
.rank-opt.current { opacity: .45; cursor: not-allowed; }
.sticky-confirm { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); }

/* ---------- climb view ---------- */
.climb-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 820px) { .climb-layout { grid-template-columns: 1fr; } }
.stage { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #0b0d12; }
.stage img { display: block; width: 100%; height: auto; }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage.dim img { filter: brightness(.6) saturate(.9); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 10px 2px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid; display: inline-block; flex: 0 0 auto; }
.dot.red { border-color: var(--hold-red); }
.dot.red2 { border-color: var(--hold-red); outline: 2px dashed var(--hold-red); outline-offset: 2px; width: 10px; height: 10px; }
.dot.blue { border-color: var(--hold-blue); }
.dot.yellow { border-color: var(--hold-yellow); }
.problem-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.problem-head .grade { font-size: 22px; padding: 10px 14px; }
.send-panel { margin-top: 16px; }
.send-panel .lines { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.send-panel .lines li { padding: 3px 0; }
.send-panel .lines b { color: var(--chalk); font-family: var(--font-mono); }
.check { display: flex; align-items: center; gap: 10px; margin: 12px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.locked-box { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line); color: var(--muted); }
.locked-box .big { font-size: 26px; }
.mode-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mode-chip.ranked { color: var(--accent); }

/* ---------- full-screen hold editor ---------- */
body.editing { overflow: hidden; }
body.editing .topbar { display: none; }
.fse {
  position: fixed; inset: 0; z-index: 40; background: #07090d;
  display: flex; flex-direction: column;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none;
}
.fse-top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: rgba(17,20,27,.94); border-bottom: 1px solid var(--line); }
.fse-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.fse-title span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fse-wrap { flex: 1; min-height: 0; position: relative; overflow: hidden; cursor: grab; }
.fse-wrap:active { cursor: grabbing; }
.fse.has-tool .fse-wrap { cursor: crosshair; }
.fse-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: 0 0 0 1px var(--line); will-change: transform; }
.zoom-ctl { position: absolute; right: 10px; top: 10px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.zoom-ctl button { width: 42px; height: 42px; border-radius: 12px; background: rgba(17,20,27,.86); border: 1px solid var(--line); color: var(--chalk); font-size: 20px; font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.fse.placing .zoom-ctl { display: none; }
.fse-stage img { display: block; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.fse-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fse-bottom { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); background: rgba(17,20,27,.94); border-top: 1px solid var(--line); }
.fse-hint { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); text-align: center; }
.fse-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 520px; margin: 0 auto; }
.ht { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px 8px; border-radius: 12px; background: var(--bg-2); border: 1.5px solid var(--line); font-weight: 600; font-size: 13px; position: relative; cursor: pointer; color: var(--muted); }
.ht.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(34,211,238,.18); color: var(--chalk); }
.ht .n { position: absolute; top: 4px; right: 7px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.fse.placing .fse-bottom { visibility: hidden; }
.capture { position: absolute; inset: 0; z-index: 5; cursor: move; touch-action: none; }
.placebar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px calc(16px + env(safe-area-inset-bottom)); pointer-events: none; }
.placebar > * { pointer-events: auto; }
.placebar .place-label { pointer-events: none; text-align: center; font-size: 12.5px; color: var(--chalk); background: rgba(0,0,0,.6); padding: 7px 12px; border-radius: 20px; line-height: 1.35; }
.round { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; box-shadow: 0 8px 24px rgba(0,0,0,.55); }
.round svg { width: 28px; height: 28px; }
.round.ok { background: var(--accent); color: var(--accent-ink); border: 0; }
.round.trash { background: #2b1c22; color: #ff9aa9; border: 1px solid rgba(255,154,169,.35); }
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(5,7,10,.66); display: flex; align-items: flex-end; justify-content: center; touch-action: auto; }
.sheet { width: min(520px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; user-select: text; -webkit-user-select: text; animation: up .25s cubic-bezier(.2,.9,.3,1); }
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 18px; } }
.sheet h3 { margin-bottom: 12px; }
.counts { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; margin: 0 0 14px; }
.counts b { color: var(--chalk); font-family: var(--font-mono); }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .settings-grid { grid-template-columns: 1fr; } }
.wall-photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.wall-photo img { display: block; width: 100%; height: auto; }
.req { padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.req + .req { margin-top: 10px; }
.req .move { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; font-size: 14px; }
.req .note { margin: 8px 0; padding: 8px 10px; border-left: 3px solid var(--accent); background: rgba(34,211,238,.06); border-radius: 0 8px 8px 0; font-size: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { font-size: 12px; padding: 3px 8px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.chip b { color: var(--chalk); font-family: var(--font-mono); }
.member { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.member:first-child { border-top: 0; }
.member .ctl { display: flex; gap: 6px; }
.member .select { padding: 7px 9px; width: auto; }

/* ---------- leaderboard / profile / notifications ---------- */
.ranks { display: flex; flex-direction: column; gap: 6px; }
.rank-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.rank-row.me { border-color: var(--accent); }
.rank-row .pos { font-family: var(--font-mono); font-weight: 700; color: var(--muted); }
.rank-row.p1 .pos { color: var(--accent); }
.rank-row .vp { font-family: var(--font-mono); font-weight: 700; text-align: right; }
.rank-row .vp small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.board-rank { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; }
.board-rank + .board-rank { margin-top: 8px; }
.board-rank .xpn { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.notif { display: block; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; }
.notif + .notif { margin-top: 8px; }
.notif.unread { border-color: rgba(34,211,238,.55); }
.notif small { color: var(--muted); }

/* ---------- toast & modal ---------- */
.toast {
  position: fixed; left: 50%; top: calc(70px + env(safe-area-inset-top)); transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  background: var(--panel-2); border: 1px solid var(--line); padding: 11px 16px; border-radius: 12px; z-index: 80;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); font-weight: 500;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(245,138,155,.5); color: #ffd6dc; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(6,8,11,.74); display: grid; place-items: center; z-index: 70; padding: 16px; animation: fade .2s; }
.modal { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; text-align: center; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.modal .gain { font-family: var(--font-mono); font-size: 25px; font-weight: 700; color: var(--accent); text-shadow: 0 0 28px rgba(34,211,238,.45); line-height: 1.25; margin: 6px 0; }
.modal .gain.zero { color: var(--muted); text-shadow: none; font-size: 22px; }
.modal .reason { color: var(--muted); font-size: 13.5px; margin: 0 0 6px; }
.modal .rankup { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: .02em; margin: 6px 0 2px; }
.modal .rankup em { font-style: normal; color: var(--accent); }
.modal .rank-icon { margin: 8px auto; }
.modal p { color: var(--muted); }
.modal .callout { margin: 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(34,211,238,.45); color: var(--chalk); font-size: 14px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 560px) {
  .brand span { display: none; }
  .nav a { padding: 7px 8px; }
  .app { padding-left: 14px; padding-right: 14px; }
}

/* ---------- Kilter import ---------- */
.steps { margin: 8px 0; padding-left: 20px; }
.steps li { margin: 8px 0; }
code { font-family: var(--font-mono); font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; word-break: break-all; }
.cal-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: center; max-width: 620px; margin: 0 auto; }
.cal-sample { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.cal-sample #s-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

/* ---------- Training ---------- */
.goal { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(34,211,238,.4); margin-bottom: 16px; font-weight: 600; }
.t-start { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.t-start .btn { min-height: 54px; font-size: 16px; }
.t-live { border-color: rgba(34,211,238,.55); margin-bottom: 16px; }
.t-plan, .t-plan-top { margin: 6px 0 0; font-weight: 600; }
.t-plan-top { padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px dashed rgba(34,211,238,.5); margin: 10px 0 14px; }
.t-wins { margin-bottom: 16px; background: linear-gradient(180deg, rgba(238,243,246,.05), transparent), var(--panel); }
.t-wins p { margin: 10px 0 0; font-size: 15px; }
.t-wins small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.t-next h3 { margin: 4px 0 4px; font-size: 20px; }
.t-next p { margin: 4px 0 0; }
.t-next .t-reason { color: var(--muted); font-size: 14px; }
.t-next.t-pain { border-color: rgba(245,138,155,.55); }
.t-next.t-rest, .t-next.t-load { border-color: rgba(238,243,246,.35); }
.t-next.t-phase { border-color: rgba(34,211,238,.55); }
.t-below { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.t-below > div { padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-size: 14px; }
@media (max-width: 640px) { .t-below { grid-template-columns: 1fr; } }
.t-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; height: 170px; margin-top: 12px; align-items: end; }
.t-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.t-bar i { display: block; width: 100%; max-width: 64px; min-height: 3px; border-radius: 8px 8px 3px 3px; background: var(--panel-2); border: 1px solid var(--line); }
.t-bar.now i { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 16px rgba(34,211,238,.3); }
.t-bar .v { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.t-bar.now .v { color: var(--chalk); }
.t-bar .l { font-size: 12px; color: var(--muted); white-space: nowrap; }
.t-insights { margin: 0; padding-left: 18px; }
.t-insights li { margin: 6px 0; }
.t-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.t-form .field > .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.pick { display: flex; gap: 6px; flex-wrap: nowrap; }
.pick button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 4px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg-2); color: var(--chalk); font-weight: 600; cursor: pointer; font-size: 14px; }
.pick.ten button { font-family: var(--font-mono); padding: 6px 0; }
.pick.wrap { flex-wrap: wrap; }
.pick.wrap button { flex: 1 1 auto; padding: 8px 12px; }
.pick button.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.sore-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sore { min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg-2); color: var(--chalk); font-weight: 600; cursor: pointer; }
.sore b { font-family: var(--font-mono); }
.sore.s1 { border-color: #ffd23d; background: rgba(255,210,61,.12); }
.sore.s2 { border-color: #ff9a3d; background: rgba(255,154,61,.15); }
.sore.s3 { border-color: #ff5d5d; background: rgba(255,93,93,.18); }
.chip-btn { padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--chalk); font-family: var(--font-mono); cursor: pointer; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 4px; font-size: 15px; }
.t-more { border-top: 1px solid var(--line); margin: 6px 0 14px; padding-top: 12px; }
.t-more summary { cursor: pointer; font-weight: 700; color: var(--accent); margin-bottom: 12px; list-style: none; }
.t-more summary::before { content: '+ '; }
.t-more[open] summary::before { content: '− '; }
.t-short { min-height: 58px; }
.t-bpick { display: grid; gap: 8px; }
.t-bnote { padding: 8px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 6px; font-size: 14px; }
.t-bnote button { float: right; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.t-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
.t-date { text-align: center; border-radius: 10px; padding: 4px 0; background: var(--bg-2); border: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.2; }
.t-date b { display: block; font-family: var(--font-mono); font-size: 18px; color: var(--chalk); }
.t-warn { color: #ffb45c; font-size: 18px; }
.t-warn-fact { border-color: rgba(255,180,92,.5); }
.t-snip { display: block; font-style: italic; }
.t-journal .t-entry + .t-entry { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.t-entry-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.t-entry-body { margin-top: 4px; white-space: pre-wrap; }
.t-entry-body a { color: var(--accent); }
.star { border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); border-radius: 9px; padding: 4px 10px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.star.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.t-starred { display: block; text-decoration: none; }
.t-starred + .t-starred { margin-top: 8px; }
.t-starred div { margin-top: 4px; white-space: pre-wrap; }
.t-climbnote { display: block; text-decoration: none; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.t-climbnote:first-of-type { border-top: 0; }
.t-climbnote small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 420px) { .nav a { padding: 7px 6px; font-size: 14px; } .vp-pill { font-size: 12px; } }

.t-sources { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 !important; }
.t-sources a { font-size: 13px; padding: 4px 10px; border-radius: 9px; border: 1px solid rgba(245,138,155,.45); text-decoration: none; background: rgba(245,138,155,.08); }
