:root {
  --bg: #14181f; --panel: #1d232d; --panel2: #242c38; --line: #2e3744;
  --txt: #e6eaf0; --muted: #9aa6b6; --accent: #6ea8ff; --good: #5fd08a;
  --bad: #ff6b6b; --warn: #f3c969;
  --sq-light: #e9edf2; --sq-dark: #7f95b0; --sel: #c8d96a; --last: #f3d96b;
  --dur: .16s; --ease: cubic-bezier(.2, .6, .2, 1);   /* shared motion tokens */
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
header {
  display: flex; align-items: center; gap: 20px; padding: 14px 22px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
header h1 { font-size: 18px; margin: 0; display: flex; align-items: center; gap: 9px; flex: 0 0 auto; white-space: nowrap; }
.logo { width: 24px; height: 24px; color: var(--accent); flex: 0 0 auto; }
#meta { margin-left: auto; color: var(--muted); font-size: 13px; }
.piece-select { padding: 5px 9px; font-size: 12.5px; }
nav button {
  background: none; border: none; color: var(--muted); font-size: 15px;
  padding: 6px 12px; border-radius: 7px; cursor: pointer;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
nav button:hover { color: var(--txt); }
nav button.active { background: var(--panel2); color: var(--txt); }
.nav-toggle { display: none; }   /* hamburger — only shown below iPad-portrait width */
/* piece-set, when folded into the mobile menu */
.menu-extra { display: flex; align-items: center; gap: 8px; padding: 8px 14px 4px; }
.menu-extra label { color: var(--muted); font-size: 13px; }
.menu-extra #piece-set { flex: 1; }
main { padding: 22px; max-width: 1180px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; animation: tab-in var(--dur) var(--ease); }
@keyframes tab-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid.two { margin-top: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { transform: translateY(-2px); border-color: #3a4350; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.card h3 { margin: 0 0 12px; font-size: 14px; color: var(--muted); font-weight: 600; }
.card canvas { max-height: 240px; }
.note { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.wp { font-weight: 700; }
.wp.lo { color: var(--bad); } .wp.mid { color: var(--warn); } .wp.hi { color: var(--good); }

/* board */
.board {
  position: relative; aspect-ratio: 1/1;
  width: min(72vw, 520px); border-radius: 8px; overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.4); user-select: none;
}
.board-sq { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); }
.board-pc { position: absolute; inset: 0; pointer-events: none; }
.sq { position: relative; display: flex; align-items: center; justify-content: center; cursor: default; }
.sq.light { background: var(--sq-light); } .sq.dark { background: var(--sq-dark); }
.sq.last { box-shadow: inset 0 0 0 9999px rgba(243,217,107,.35); }
.sq.sel  { box-shadow: inset 0 0 0 9999px rgba(200,217,106,.5); }
.pc {
  position: absolute; top: 0; left: 0; width: 12.5%; height: 12.5%;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; user-select: none;
  transition: transform .18s cubic-bezier(.22, .7, .25, 1); will-change: transform;
}
.pc img { width: 92%; height: 92%; pointer-events: none; -webkit-user-drag: none; }
.hint { position: absolute; width: 26%; height: 26%; border-radius: 50%; background: rgba(40,40,40,.35); }
.hint.cap { width: 86%; height: 86%; border: 5px solid rgba(40,40,40,.35); background: none; border-radius: 50%; }
.co { position: absolute; font-size: 10px; font-style: normal; color: rgba(20,30,45,.55); }
.co.file { right: 3px; bottom: 1px; } .co.rank { left: 3px; top: 1px; }

.trainer-wrap { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.panel { flex: 1; min-width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
button {
  background: var(--panel2); color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 13px; cursor: pointer; font-size: 14px;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), filter var(--dur) var(--ease), transform var(--dur) var(--ease);
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:active:not(:disabled) { transform: translateY(1px); }   /* tactile press */
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font-size: 14px; transition: border-color var(--dur) var(--ease); }
.badge { background: var(--panel2); padding: 4px 10px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.prompt { font-size: 15px; }
.feedback { min-height: 22px; font-weight: 600; }
.feedback.good { color: var(--good); animation: fb-pulse .2s var(--ease); }
.feedback.bad  { color: var(--bad);  animation: fb-nudge .2s var(--ease); }
@keyframes fb-pulse { from { opacity: .4; } to { opacity: 1; } }
@keyframes fb-nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.line { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted); white-space: pre-wrap; }
a { color: var(--accent); }
.games { max-height: 300px; overflow-y: auto; margin-bottom: 12px; }
.game-item { padding: 7px 10px; border-radius: 7px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 13.5px; transition: background-color var(--dur) var(--ease), outline-color var(--dur) var(--ease); }
.game-item:hover { background: var(--panel2); }
.game-item.active { background: var(--panel2); outline: 1px solid var(--accent); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.win { background: var(--good); } .dot.loss { background: var(--bad); } .dot.draw { background: var(--muted); }
/* openings variation rows: one tidy line previewing as many moves as fit (the full
   line plays out on the board); ellipsis rather than the old fixed 8-ply truncation */
.dd-line { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* save / notes / review */
button.save.on { background: #3a3417; border-color: var(--warn); color: var(--warn); }
.chk { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
.note-box {
  width: 100%; min-height: 64px; resize: vertical; margin-bottom: 12px;
  background: var(--bg); color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 14px;
}
.note-box:focus { outline: none; border-color: var(--accent); }
.pill {
  display: none; min-width: 18px; padding: 0 6px; margin-left: 2px; border-radius: 9px;
  background: var(--warn); color: #1a1d12; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.pill.show { display: inline-block; animation: pill-pop var(--dur) var(--ease); }
@keyframes pill-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
.rv-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; margin-bottom: 11px; }
.rv-item.done { opacity: .55; }
.rv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.rv-head .tag { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--panel2); color: var(--muted); }
.rv-head b { font-size: 14px; }
.rv-head .jump { margin-left: auto; }
.rv-note { color: var(--txt); font-size: 13.5px; white-space: pre-wrap; }
.rv-note.empty { color: var(--muted); font-style: italic; }

/* coach */
.coach { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.coach-head { font-size: 13px; color: var(--txt); font-weight: 600; margin-bottom: 8px; }
.coach-hint { color: var(--muted); font-weight: 400; }
.coach-thread { max-height: 260px; overflow-y: auto; margin-bottom: 9px; display: flex; flex-direction: column; gap: 8px; }
.coach-thread:empty { display: none; }
.msg { padding: 8px 11px; border-radius: 9px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.5; }
.msg.user { background: var(--panel2); align-self: flex-end; max-width: 88%; }
.msg.assistant { background: #16201a; border: 1px solid #234; align-self: flex-start; max-width: 95%; }
.msg.pending { color: var(--muted); font-style: italic; animation: msg-in var(--dur) var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .who { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.msg.queued .who::after { content: " · queued for Claude"; color: var(--warn); }
.coach-input { width: 100%; resize: vertical; background: var(--bg); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; margin-bottom: 8px; }
.coach-input:focus { outline: none; border-color: var(--accent); }
.coach-status { font-size: 12px; color: var(--muted); }
.coach-status.err { color: var(--bad); }

/* tools */
.job-log { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 12.5px; color: var(--muted); white-space: pre-wrap; max-height: 320px; overflow-y: auto; margin: 0; min-height: 60px; }
input[type=text], #dd-open-name { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; font-size: 14px; }
#dd-open-name { min-width: 160px; }
/* loading spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 13px; height: 13px; vertical-align: -2px;
  margin-right: 7px; border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
/* button busy: hide the label and overlay a centered spinner (reads on dark + accent bg) */
button.is-loading { position: relative; color: transparent !important; pointer-events: none; }
button.is-loading::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 15px; height: 15px;
  margin: -8px 0 0 -8px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
/* long pipeline jobs keep their label, gain a leading spinner */
button.running { opacity: .7; }
button.running::before {
  content: ""; display: inline-block; width: 11px; height: 11px; vertical-align: -1px;
  margin-right: 7px; border: 2px solid rgba(255,255,255,.3); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}

/* first-run setup */
.setup { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.setup.hidden { display: none; }
.setup-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px 30px; width: 100%; max-width: 480px; }
.setup-card h1 { margin: 0 0 6px; font-size: 22px; }
.setup-card label { display: block; margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.setup-card input { width: 100%; margin-top: 6px; background: var(--bg); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 15px; }
.setup-card input:focus { outline: none; border-color: var(--accent); }
.su-opt { color: var(--muted); font-weight: 400; }
.su-error { color: var(--bad); min-height: 18px; font-size: 13.5px; margin: 12px 0 0; }
.setup-card .row { margin-top: 18px; }
.setup-card #su-go { background: var(--accent); color: #0b1220; border: none; font-weight: 600; padding: 9px 18px; }
.setup-card #su-log { margin-top: 16px; max-height: 220px; }

/* settings */
#settings label { display: block; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
#settings input { width: 100%; margin-top: 6px; background: var(--bg); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 15px; }
#settings input:focus { outline: none; border-color: var(--accent); }
#set-save { background: var(--accent); color: #0b1220; border: none; font-weight: 600; }

/* latest games */
.hidden { display: none; }
.lt-list { max-height: 320px; overflow-y: auto; margin: 14px 0 4px; }
.lt-card { padding: 10px 12px; align-items: flex-start; }
.lt-card-main { display: flex; flex-direction: column; gap: 2px; }
.lt-card-main b { font-size: 14.5px; }
.lt-vs { color: var(--txt); font-size: 13px; }
.lt-tags { color: var(--muted); font-size: 12px; }
.lt-an { color: var(--good); }
.lt-left { display: flex; flex-direction: column; gap: 12px; }
.lt-boardrow { display: flex; gap: 8px; align-items: stretch; }
.evalbar { position: relative; width: 18px; flex: 0 0 auto; border-radius: 4px; overflow: hidden; background: #2b313c; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.evalbar-fill { position: absolute; left: 0; right: 0; bottom: 0; background: #eef2f7; transition: height .25s ease; }
.evalbar.flip .evalbar-fill { bottom: auto; top: 0; }
.evalbar-num { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); font: 600 9px ui-monospace, Menlo, monospace; padding: 1px 3px; border-radius: 3px; background: rgba(0,0,0,.6); color: #fff; }
.evalbar.flip .evalbar-num { top: auto; bottom: 3px; }
.lt-evalcard { padding: 10px 12px; height: 150px; }
.lt-sliphead { margin: 14px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lt-reviewbtn { background: var(--accent); color: #0b1220; border: none; font-weight: 600; font-size: 12.5px; padding: 5px 10px; border-radius: 7px; margin: 0 6px; cursor: pointer; transition: filter var(--dur) var(--ease); }
.lt-reviewbtn:hover { filter: brightness(1.08); }
[data-coach="lt"] .coach-thread { max-height: 420px; }
[data-coach="lt"] .msg { white-space: pre-wrap; }
.lt-reviewbtn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.lt-reviewbtn.ghost:hover { border-color: var(--accent); filter: none; }
/* play (correspondence) */
.play-left { flex: 1; min-width: 260px; }
.play-h { margin: 14px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.play-h:first-child { margin-top: 0; }
#play .game-item { gap: 8px; }
#play .game-item button { padding: 4px 10px; font-size: 12px; margin-left: 6px; }
/* the list scrolls (load older games near the bottom); outline-offset keeps the
   active card's accent outline from being clipped by overflow */
.lt-list .game-item.active { outline-offset: -1px; }
.lt-toggle { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); font-weight: 600; }
/* progress / diagnosis history */
.pg-games { max-height: 460px; overflow-y: auto; }
.pg-row { display: grid; grid-template-columns: 14px 92px 1fr auto auto; gap: 12px; align-items: center; }
.pg-date { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pg-stat { color: var(--muted); font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; }
#pg-weak table { width: 100%; }
#pg-acpl { max-height: 210px; }
#pg-report-btn { background: var(--accent); color: #0b1220; border: none; font-weight: 600; }
.pg-report { white-space: pre-wrap; line-height: 1.55; }
.pg-report-ts { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.pg-report-old { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.pg-report-old summary { cursor: pointer; color: var(--muted); font-size: 13px; }
/* clickable "better line" links inside coach answers */
a.cline { display: inline-block; margin: 1px 0; padding: 1px 7px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); color: var(--accent); font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; text-decoration: none; cursor: pointer; transition: border-color var(--dur) var(--ease); }
a.cline:hover { border-color: var(--accent); }

.help-link { display: inline-block; font-size: 12px; margin: 4px 0 2px; color: var(--accent); text-decoration: none; }
.help-link:hover { text-decoration: underline; }

/* app version footer */
.app-version { text-align: center; color: var(--muted); font-size: 11px; padding: 16px 0 22px; }
.app-version:empty { display: none; }

/* install-to-home-screen banner */
.install-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: max(14px, env(safe-area-inset-bottom)); z-index: 60;
  max-width: 92vw; display: flex; align-items: center; gap: 12px;
  background: var(--panel2); border: 1px solid var(--accent); border-radius: 10px;
  padding: 10px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.45); font-size: 13.5px;
}
.install-banner.hidden { display: none; }
.install-banner .install-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#install-go { background: var(--accent); color: #0b1220; border: none; font-weight: 600; }
.install-x { background: none; border: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.install-x:hover { color: var(--txt); }

/* ---------------- responsive / mobile (phones, installed PWA) ---------------- */
/* content layout for narrow screens; the header/nav reflow is owned by the
   hamburger breakpoint below (834px), which is wider — so it governs first. */
@media (max-width: 768px) {
  header h1 { font-size: 16px; }
  main { padding: 14px 12px; }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .trainer-wrap { gap: 16px; }
  .panel { min-width: 0; width: 100%; }    /* was 280px — forced horizontal overflow */
  .board { width: min(92vw, 460px); }
  .yr { display: none; }                   /* drop the year from dates — saves width */
  /* long titles stay one tidy line on phones; tapping a game expands it to full text */
  .lt-card-main { flex: 1; min-width: 0; }
  .lt-card-main > b { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .lt-card.active .lt-card-main > b { white-space: normal; overflow: visible; }
  .pg-open { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}
@media (max-width: 480px) {
  .board { width: 92vw; }
  button { padding: 12px 16px; }           /* ≥44px tall touch targets */
  nav button { padding: 12px 14px; }
  .pg-row { grid-template-columns: 12px 46px 1fr auto auto; gap: 8px; font-size: 12px; }
  .lt-list, .games, .pg-games { max-height: 52vh; }
}

/* hamburger nav — up to the widest iPad in portrait (834px: Pro 11" / Air).
   Sole owner of the mobile header/nav reflow (the 768px block only does content). */
@media (max-width: 834px) {
  header {
    flex-wrap: wrap; gap: 10px; padding: 10px 12px;
    /* clear the translucent status bar when launched from the Home Screen */
    padding-top: max(10px, env(safe-area-inset-top));
  }
  #meta { display: none; }   /* keep the header uncluttered wherever the hamburger shows */
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    order: 1; margin-left: auto;   /* the only auto margin → pins hard-right */
    background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
    padding: 9px 13px; border-radius: 8px; cursor: pointer;
  }
  #piece-set { order: 2; } /* JS folds this into the menu; order is the pre-JS fallback */
  #logout { order: 3; }
  /* 2-bar hamburger → close morph (Apple-style); driven by aria-expanded */
  .nav-toggle .bars { position: relative; display: block; width: 18px; height: 12px; }
  .nav-toggle .bars i {
    position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform var(--dur) var(--ease), top var(--dur) var(--ease);
  }
  .nav-toggle .bars i:nth-child(1) { top: 2px; }
  .nav-toggle .bars i:nth-child(2) { top: 8px; }
  .nav-toggle[aria-expanded="true"] .bars i:nth-child(1) { top: 5px; transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bars i:nth-child(2) { top: 5px; transform: rotate(-45deg); }
  /* tabs become a full-height slide-in menu below the header */
  nav#tabs {
    display: flex; order: 5; flex-direction: column; gap: 4px;
    position: fixed; left: 0; right: 0; top: var(--header-h, 56px); bottom: 0; z-index: 4;
    background: var(--panel); border-top: 1px solid var(--line);
    padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); overflow-y: auto;
    opacity: 0; pointer-events: none; transform: translateY(-10px);
    transition: opacity .22s var(--ease), transform .22s var(--ease);
  }
  nav#tabs.open { opacity: 1; pointer-events: auto; transform: none; }
  body.menu-open { overflow: hidden; }   /* lock the page behind the full-screen menu */
  /* each item fades + rises in, staggered, so the menu feels alive */
  nav#tabs > * { opacity: 0; transform: translateY(16px); transition: opacity .34s var(--ease), transform .34s var(--ease); }
  nav#tabs.open > * { opacity: 1; transform: none; }
  nav#tabs.open > *:nth-child(1)  { transition-delay: .04s; }
  nav#tabs.open > *:nth-child(2)  { transition-delay: .07s; }
  nav#tabs.open > *:nth-child(3)  { transition-delay: .10s; }
  nav#tabs.open > *:nth-child(4)  { transition-delay: .13s; }
  nav#tabs.open > *:nth-child(5)  { transition-delay: .16s; }
  nav#tabs.open > *:nth-child(6)  { transition-delay: .19s; }
  nav#tabs.open > *:nth-child(7)  { transition-delay: .22s; }
  nav#tabs.open > *:nth-child(8)  { transition-delay: .25s; }
  nav#tabs.open > *:nth-child(9)  { transition-delay: .28s; }
  nav#tabs.open > *:nth-child(10) { transition-delay: .31s; }
  nav#tabs.open > *:nth-child(11) { transition-delay: .34s; }
  nav#tabs button { width: 100%; text-align: left; padding: 14px; border-radius: 9px; font-size: 16px; }
  nav#tabs button.active { background: var(--panel2); }
  /* account section (piece-set + sign-out) pinned to the bottom of the menu */
  #piece-set-row { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 14px 4px; }
  nav#tabs #logout {
    width: 100%; text-align: left; margin-top: 2px; font-size: 16px;
    background: none; border: 1px solid transparent; color: var(--bad); padding: 14px; border-radius: 9px;
  }
  nav#tabs #logout:hover { border-color: var(--bad); }
}

/* respect users who ask for less motion — neutralize the added transitions/keyframes */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}
