/* Chessboard. Tokens follow the LaunchPoint design system: ink, paper, one red accent. */
:root {
  --red: #EC2E38; --red-600: #C81E27; --red-700: #9E141C; --red-50: #FDECEE;
  --ink: #141414; --ink-800: #232323; --ink-700: #38383A; --ink-500: #56565A;
  --paper: #F8F6F1; --paper-0: #FFFFFF; --paper-100: #F1EEE7;
  --gray-200: #E4E0D8; --gray-300: #CFCBC1; --gray-400: #A9A59B; --gray-500: #7E7A71;
  --green: #1E7A44; --green-50: #E9F4EE; --amber: #9A6A00; --amber-50: #FBF2DE;
  --font: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --symbols: "Noto Sans Symbols 2", "Segoe UI Symbol", "Apple Symbols", serif;
  --r-sm: 3px; --r-md: 6px; --r-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 21, 23, .07);
  --shadow-md: 0 2px 8px rgba(20, 21, 23, .08), 0 1px 2px rgba(20, 21, 23, .06);
  --shadow-lg: 0 12px 32px rgba(20, 21, 23, .16), 0 2px 6px rgba(20, 21, 23, .08);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --focus: 0 0 0 2px var(--paper-0), 0 0 0 4px var(--red);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--font); }
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: var(--r-md); z-index: 50; }
.skip:focus { left: 16px; }

/* ---- top bar ---- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px max(16px, calc((100vw - 1200px) / 2)); background: var(--ink); color: var(--paper); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; font-size: 19px; }
.brand-mark { width: 24px; height: 24px; color: var(--paper); }
.brand-mark rect:last-child { fill: var(--red); }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; padding: 6px 12px; border-radius: var(--r-md); font-weight: 600; font-size: 14px; color: rgba(248, 246, 241, .75); transition: background 120ms var(--ease), color 120ms var(--ease); }
.nav a:hover { color: var(--paper); background: rgba(255, 255, 255, .08); }
.nav a.on { color: var(--paper); background: rgba(255, 255, 255, .12); box-shadow: inset 0 -2px 0 var(--red); }

main { max-width: 1200px; margin: 0 auto; padding: 28px 16px 64px; outline: none; }

/* ---- type ---- */
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.1; }
h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.eyebrow { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--red); margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.muted { color: var(--ink-500); }
.small { font-size: 13px; }
.lede { font-size: 17px; margin: 10px 0 6px; max-width: 70ch; }
.ok-text { color: var(--green); } .bad-text { color: var(--red-600); }

/* ---- layout ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 8px 0 0; }
.row { display: flex; align-items: center; } .gap { gap: 10px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; gap: 12px; } .end { justify-content: flex-end; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; margin-top: 20px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.col { display: grid; gap: 20px; }
.card { background: var(--paper-0); border: 1px solid var(--gray-200); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.card-head h2::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; background: var(--ink); box-shadow: 10px 10px 0 -0px var(--gray-200); vertical-align: 2px; }
.back { display: inline-block; margin-bottom: 14px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-500); }
.back:hover { color: var(--ink); }
.link { font-weight: 600; font-size: 14px; text-decoration: none; color: var(--red-600); }
.link:hover { text-decoration: underline; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--ink); background: var(--paper-0); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease); }
.btn:hover { background: var(--paper-100); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-600); border-color: var(--red-600); }
.btn.primary:active { background: var(--red-700); }
.btn.ghost { border-color: var(--gray-300); background: transparent; }
.btn.ghost:hover { border-color: var(--ink); background: var(--paper-0); }
.btn.danger, .btn.ghost.danger { color: var(--red-600); }
.btn.danger:not(.ghost) { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.btn.ok { border-color: var(--green); color: var(--green); }
.btn.ok:hover { background: var(--green-50); }
.btn.bad { border-color: var(--gray-300); color: var(--red-600); }
.btn.bad:hover { background: var(--red-50); border-color: var(--red-600); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; cursor: pointer; width: 32px; height: 32px; border-radius: var(--r-md); color: var(--ink-500); flex: none; }
.icon-btn:hover { background: var(--paper-100); color: var(--ink); }
.link-btn { border: 0; background: none; padding: 0; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-500); text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger:hover { color: var(--red-600); }
.link-btn:disabled { opacity: .5; }
.file-btn { position: relative; }

/* ---- avatars, pieces, deltas ---- */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: var(--r-md); background: var(--ink); color: var(--paper); font-weight: 700; object-fit: cover; letter-spacing: .02em; }
.avatar.xs { width: 24px; height: 24px; font-size: 10px; border-radius: var(--r-sm); }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.avatar.md { width: 44px; height: 44px; font-size: 15px; }
.avatar.xl { width: 88px; height: 88px; font-size: 28px; border-radius: var(--r-lg); }
.piece { font-family: var(--symbols); font-size: 20px; line-height: 1; color: var(--ink); }
.piece.king { color: var(--red); }
.delta { font: 600 13px/1 var(--mono); white-space: nowrap; }
.delta.up { color: var(--green); } .delta.down { color: var(--red-600); } .delta.flat { color: var(--gray-400); }
.delta.new { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; padding: 3px 6px; border-radius: var(--r-pill, 999px); background: var(--paper-100); color: var(--ink-500); }
.rank-move { font: 600 11px/1 var(--mono); margin-left: 4px; }
.rank-move.up { color: var(--green); } .rank-move.down { color: var(--red-600); }

/* ---- scoreboard ---- */
.table-wrap { overflow-x: auto; margin: 0 -8px; }
.board { width: 100%; border-collapse: collapse; }
.board th { font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-500); text-align: left; padding: 0 8px 10px; white-space: nowrap; }
.board td { padding: 10px 8px; border-top: 1px solid var(--gray-200); vertical-align: middle; }
.board tbody tr { cursor: pointer; transition: background 120ms var(--ease); }
.board tbody tr:nth-child(odd) { background: linear-gradient(90deg, var(--paper) 0 52px, transparent 52px); }
.board tbody tr:hover { background: var(--paper-100); }
.c-rank { width: 92px; white-space: nowrap; }
.c-rank .rank-n { display: inline-block; width: 22px; font: 600 14px/1 var(--mono); }
.c-person { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.c-person > span { display: grid; line-height: 1.25; min-width: 0; }
.c-person .name { font-weight: 700; text-decoration: none; }
.c-person .name:hover { text-decoration: underline; }
.c-num { text-align: right; white-space: nowrap; }
.board th.c-num { text-align: right; }
.total { font: 700 17px/1 var(--mono); }
.c-trait { width: 46px; text-align: center; }
.board th.c-trait { text-align: center; }
.cell-bar { display: inline-block; min-width: 34px; padding: 3px 0; font: 500 12px/1 var(--mono); background: linear-gradient(0deg, var(--paper-100) 0 var(--v), transparent var(--v)); border-bottom: 2px solid var(--gray-300); }

/* ---- empty states ---- */
.empty { text-align: center; padding: 40px 16px; }
.empty-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.empty .row { justify-content: center; margin-top: 18px; }
.empty-small { padding: 12px 0; margin: 0; }

/* ---- projects ---- */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--gray-200); }
.tab { border: 0; background: none; padding: 8px 12px; font-weight: 600; font-size: 14px; color: var(--ink-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--red); }
.tab .count { font: 500 12px/1 var(--mono); color: var(--gray-500); margin-left: 4px; }
.proj-list { display: grid; gap: 10px; }
.proj { border: 1px solid var(--gray-200); border-radius: var(--r-lg); padding: 14px; background: var(--paper-0); }
.proj:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md); }
.proj-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proj-name { font-weight: 700; text-decoration: none; }
.proj-name:hover { text-decoration: underline; }
.proj-desc { margin: 6px 0 0; font-size: 14px; color: var(--ink-700); }
.proj .chips { margin-top: 10px; }
.proj-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.proj-foot .stack { display: flex; align-items: center; }
.proj-foot .stack a { margin-right: -6px; border: 2px solid var(--paper-0); border-radius: 5px; display: inline-flex; }
.proj-foot .stack .more { font: 600 11px/1 var(--mono); margin-left: 10px; color: var(--ink-500); }
.proj-actions { margin-left: auto; display: flex; gap: 6px; }
.overdue { color: var(--red-600); font-weight: 600; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font: 600 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.badge.active { background: var(--amber-50); color: var(--amber); }
.badge.completed { background: var(--green-50); color: var(--green); }
.badge.failed { background: var(--red-50); color: var(--red-600); }
.badge.archived { background: var(--paper-100); color: var(--ink-500); vertical-align: middle; font-size: 11px; }

/* ---- chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--paper-100); color: var(--ink-700); }
.chip small { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--gray-500); }
.chip.pos { background: var(--green-50); color: var(--green); }
.chip.neg { background: var(--red-50); color: var(--red-600); }
.chip.neutral { color: var(--gray-500); }
.chip.trait { background: var(--ink); color: var(--paper); }
.chip.trait small { color: var(--gray-400); }
.chip.tag { background: transparent; border: 1px solid var(--gray-300); }
.person-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 3px; border: 1px solid var(--gray-200); border-radius: var(--r-md); font-size: 13px; font-weight: 600; }
.person-chip button { border: 0; background: none; cursor: pointer; color: var(--gray-500); padding: 0 4px; }
.person-chip button:hover { color: var(--red-600); }

/* ---- people ---- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.search { flex: 1 1 260px; height: 40px; padding: 0 14px; border: 1px solid var(--gray-300); border-radius: var(--r-md); background: var(--paper-0); }
.search:focus { border-color: var(--ink); }
.select { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-500); }
.select select, .field select { height: 40px; padding: 0 10px; border: 1px solid var(--gray-300); border-radius: var(--r-md); background: var(--paper-0); color: var(--ink); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); flex: none; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.person-card { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--gray-200); border-radius: var(--r-lg); background: var(--paper-0); text-decoration: none; box-shadow: var(--shadow-sm); transition: box-shadow 120ms var(--ease), border-color 120ms var(--ease); }
.person-card:hover { box-shadow: var(--shadow-md); border-color: var(--gray-300); }
.pc-top { display: flex; align-items: center; gap: 12px; }
.pc-id { display: grid; line-height: 1.3; min-width: 0; flex: 1; }
.pc-id b, .pc-id span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-rank { font: 600 13px/1 var(--mono); display: flex; align-items: center; gap: 4px; }
.pc-score { display: flex; align-items: flex-end; gap: 10px; }
.pc-score .big { font: 700 30px/1 var(--mono); letter-spacing: -.02em; }
.pc-score .mini-bars { margin-left: auto; }
.mini-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 30px; }
.mini { width: 8px; height: 100%; background: var(--paper-100); display: flex; align-items: flex-end; border-radius: 2px; overflow: hidden; }
.mini span { width: 100%; background: var(--ink); }
.pc-foot { border-top: 1px solid var(--gray-200); padding-top: 10px; }

/* ---- profile ---- */
.profile-head { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.ph-id h1 { font-size: clamp(26px, 3.4vw, 36px); }
.ph-sub { margin: 6px 0 2px; font-weight: 600; color: var(--ink-700); }
.ph-id .chips { margin-top: 10px; }
.ph-score { display: grid; justify-items: end; gap: 4px; text-align: right; }
.ph-score .big { font: 700 44px/1 var(--mono); letter-spacing: -.03em; }
.ph-rank { display: flex; align-items: center; gap: 6px; font: 600 13px/1 var(--mono); white-space: nowrap; }
.ph-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--gray-200); padding-top: 14px; }
.trait-row { display: grid; grid-template-columns: 96px 1fr 30px 56px; align-items: center; gap: 10px; padding: 7px 0; }
.trait-name { font-weight: 600; font-size: 14px; }
.bar { height: 10px; background: var(--paper-100); border-radius: 2px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--ink) 0 10px, var(--ink-700) 10px 20px); transition: width 200ms var(--ease); }
.trait-val { font: 700 15px/1 var(--mono); text-align: right; }
.trait-row .delta { text-align: right; }
.spark-wrap { display: grid; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--gray-200); color: var(--ink); }
.spark { max-width: 100%; height: auto; }
.spark-dot { fill: var(--red); }
.events { margin-top: 12px; font-size: 14px; }
.events summary { cursor: pointer; font-weight: 600; color: var(--ink-500); }
.events ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.events li { display: flex; justify-content: space-between; gap: 10px; }
.sub { margin: 4px 0 8px; }
.plist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.plist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plist a { font-weight: 600; text-decoration: none; }
.plist a:hover { text-decoration: underline; }
.bio-block { margin-bottom: 14px; }
.bio-block p { margin: 6px 0 0; white-space: pre-line; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 14px 0 0; font-size: 14px; }
.facts dt { color: var(--ink-500); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.links { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; font-size: 14px; }
.links a { color: var(--red-600); overflow-wrap: anywhere; }

/* ---- notes ---- */
.note-form { display: grid; gap: 10px; margin-bottom: 18px; }
.note-form textarea, .card form textarea { width: 100%; resize: vertical; padding: 12px 14px; border: 1px solid var(--gray-300); border-radius: var(--r-md); background: var(--paper); line-height: 1.5; }
.note-form textarea:focus, .card form textarea:focus { border-color: var(--ink); background: var(--paper-0); }
.notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.note { padding: 14px 0; border-top: 1px solid var(--gray-200); }
.note-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-500); }
.src { font: 600 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 4px 6px; border-radius: var(--r-sm); background: var(--paper-100); }
.src.ai { background: var(--ink); color: var(--paper); }
.src.pending { background: var(--amber-50); color: var(--amber); }
.note-actions { margin-left: auto; display: flex; gap: 12px; }
.note-text { margin: 8px 0; white-space: pre-line; overflow-wrap: anywhere; }
.note-summary { margin: -2px 0 8px; font-size: 14px; color: var(--ink-500); font-style: italic; }
.note-edit { margin-top: 10px; padding: 12px; border-radius: var(--r-md); background: var(--paper); display: grid; gap: 10px; }
.note-edit p { margin: 0; }
.override-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.override-grid label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; }
.override-grid input { height: 34px; padding: 0 8px; border: 1px solid var(--gray-300); border-radius: var(--r-md); background: var(--paper-0); font-family: var(--mono); }

/* ---- project page ---- */
.team-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.team-list li, .recs li { display: flex; align-items: center; gap: 10px; }
.rec-name { display: grid; line-height: 1.25; flex: 1; min-width: 0; text-decoration: none; }
.rec-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fit { font: 700 18px/1 var(--mono); display: grid; justify-items: end; }
.fit small { font: 500 9px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--gray-500); }
.recs { list-style: none; counter-reset: r; padding: 0; margin: 0; display: grid; gap: 10px; }

/* ---- forms & dialogs ---- */
.dialog { border: 0; padding: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--paper-0); color: var(--ink); }
.dialog.wide { width: min(860px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(20, 21, 23, .55); }
.dialog-body { padding: 22px; display: grid; gap: 16px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.dialog-head h2 { font-size: 22px; font-weight: 800; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; position: sticky; bottom: -22px; background: var(--paper-0); padding-bottom: 4px; }
.confirm-text { margin: 0; font-size: 16px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--red); padding: 0; margin-bottom: 12px; }
fieldset > p { margin: -4px 0 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.field { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-700); min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field input, .field textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--gray-300); border-radius: var(--r-md); background: var(--paper-0); font-weight: 400; color: var(--ink); }
.field input { height: 40px; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--ink); }
.req { color: var(--red); }
.sliders { display: grid; gap: 10px; margin-bottom: 12px; }
.slider { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; }
.slider input { accent-color: var(--red); width: 100%; }
.slider output { font: 600 14px/1 var(--mono); text-align: right; }
.trait-picker { display: grid; gap: 8px; }
.pick-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pick-row > span { font-weight: 600; font-size: 14px; cursor: help; }
.seg { display: inline-flex; border: 1px solid var(--gray-300); border-radius: var(--r-md); overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-500); border-left: 1px solid var(--gray-200); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--red); }
.team fieldset { border: 1px solid var(--gray-200); border-radius: var(--r-lg); padding: 14px; }
.team legend { padding: 0 6px; margin-left: -6px; }
.team .chips { margin-bottom: 12px; }
.radio-list { display: grid; gap: 10px; margin-bottom: 14px; }
.radio { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.radio input { margin-top: 4px; accent-color: var(--red); width: 16px; height: 16px; flex: none; }
.radio > span { display: grid; line-height: 1.35; }
.card form .row { margin-top: 10px; }

/* ---- toast ---- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); transition: opacity 200ms var(--ease), transform 200ms var(--ease); z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red-600); }
.toast.warn { background: var(--amber); }
.noscript { padding: 24px; text-align: center; }

/* ---- responsive ---- */
@media (max-width: 960px) {
  .home-grid, .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .board .c-trait { display: none; }
  .c-rank { width: 58px; }
  .c-rank .rank-n { width: 16px; }
  .board .rank-move { display: none; }
  .c-person { min-width: 0; gap: 8px; }
  .c-person .avatar { display: none; }
  .c-person .small { font-size: 12px; }
  .total { font-size: 15px; }
  .board td, .board th { padding-left: 6px; padding-right: 6px; }
  .profile-head { grid-template-columns: auto 1fr; }
  .ph-score { grid-column: 1 / -1; justify-items: start; text-align: left; grid-auto-flow: column; align-items: end; justify-content: start; gap: 10px; }
  .grid2 { grid-template-columns: 1fr; }
  .slider { grid-template-columns: 92px 1fr 40px; }
  .trait-row { grid-template-columns: 84px 1fr 28px 52px; }
  .avatar.xl { width: 64px; height: 64px; font-size: 22px; }
  .topbar { padding: 10px 16px; }
  .nav a { padding: 6px 8px; }
  .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
