/* ==========================================================================
   Dictionary (/gym/dictionary/) — page styles.
   Tokens, fonts, buttons (.btn/.rf-btn-*), inputs (.rf-input), filter chips
   and the theme toggle come from /css/readflexes.css; the gym shell is the
   same as gym-fluency.css because the page lives in the same shell.
   HOUSE RULE: no narrow centred column — the entry and the side column fill
   the width, and stack on a phone.
   ========================================================================== */
:root{ --success:#00e676; --warning:#ffb020; --error:#ff4d6d; }

*{ box-sizing:border-box }
a{ color:inherit; text-decoration:none }
html,body{ height:100%; margin:0; overflow:hidden; display:block; }

.app{ display:grid; grid-template-columns:260px 1fr; height:100vh; }
.sidebar{ position:sticky; top:0; height:100vh; padding:18px 14px; border-right:1px solid var(--line);
  background:var(--panel); overflow:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
.brand{ display:flex; align-items:center; justify-content:center; margin-bottom:4px; }
.brand-logo{ height:120px; display:block; margin:0 auto; filter:drop-shadow(0 0 8px rgba(77,240,255,.25)); }
.brand-sub{ text-align:center; font-size:14px; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; margin:6px 0 18px; }
.brand-sub a:hover{ color:var(--neon-cyan); }
.nav-section{ margin-top:14px; }
.nav-title{ padding:8px 10px; }
.nav{ display:flex; flex-direction:column; gap:4px; padding:0 6px 8px; }
.nav a{ padding:10px 14px; border-radius:999px; border:1px solid transparent; display:flex; align-items:center; gap:10px; font-weight:700; color:var(--text);
  transition:background .15s, border-color .15s, color .15s, box-shadow .15s; }
.nav a:hover{ background:rgba(77,240,255,.08); border-color:var(--line); }
.nav a.active{ color:var(--neon-cyan); border-color:rgba(77,240,255,.45); background:rgba(77,240,255,.10); box-shadow:var(--glow-cyan); }
.nav a .icon{ width:18px; text-align:center; opacity:.9; }

.main{ padding:22px clamp(10px, 2vw, 28px); height:100vh; overflow:auto; overscroll-behavior:contain; }
.card{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:16px; }
.muted{ color:var(--muted); }
.small{ font-size:13px; }
.hidden{ display:none !important; }
/* display:flex beats [hidden] — several rows here are flex containers that hide. */
[hidden]{ display:none !important; }

.page-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:14px; }
.page-head h1{ margin:0 0 6px; font-size:26px; }
.page-head p{ margin:0; max-width:78ch; }
/* The floating 🌐 chip (site-lang-toggle.js) sits top-right; keep the theme toggle clear of it. */
.page-head .rf-theme-toggle{ margin-right:150px; }

h2{ font-size:18px; margin:0 0 10px; }

/* ── Search and language ─────────────────────────────────────────────────── */
.dict-toolbar{ display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-bottom:14px; }
.dict-search{ position:relative; display:flex; gap:8px; flex:1 1 420px; min-width:0; }
.dict-search .rf-input{ flex:1; min-width:0; font-size:20px; padding:12px 16px; }
.dict-suggest{ position:absolute; top:100%; left:0; right:0; z-index:20; margin:4px 0 0; padding:6px; list-style:none;
  background:var(--panel-2); border:1px solid var(--line); border-radius:var(--radius-sm); box-shadow:0 10px 28px rgba(0,0,0,.35); }
.dict-suggest li{ padding:8px 12px; border-radius:8px; cursor:pointer; font-size:17px; }
.dict-suggest li[aria-selected="true"], .dict-suggest li:hover{ background:rgba(77,240,255,.12); color:var(--neon-cyan); }
.dict-langs{ display:flex; gap:6px; flex-wrap:wrap; }
.rf-filter-chip[aria-checked="true"]{ color:var(--neon-gold); border-color:var(--neon-gold); }
.light-mode .rf-filter-chip[aria-checked="true"]{ color:#7a5d00; border-color:#b8960b; }

/* ── The entry and the side column ───────────────────────────────────────── */
.dict-grid{ display:grid; grid-template-columns:minmax(0, 2fr) minmax(280px, 1fr); gap:14px; align-items:start; }
.dict-side{ display:grid; gap:14px; }

.dict-entry .entry-head{ display:flex; gap:16px; align-items:flex-start; }
.dict-entry .entry-pic{ width:140px; height:140px; flex:0 0 auto; border-radius:var(--radius-sm); object-fit:cover;
  background:var(--panel-2); border:1px solid var(--line); image-rendering:pixelated; }
.dict-entry .entry-word{ font-family:var(--font-heading); font-size:40px; line-height:1.05; margin:0; overflow-wrap:anywhere; }
.dict-entry .entry-meta{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:6px 0 0; }
.dict-entry .entry-pos{ font-style:italic; color:var(--muted); }
.dict-entry .entry-actions{ display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.dict-sense{ border-top:1px solid var(--line); margin-top:14px; padding-top:12px; }
.dict-sense .sense-n{ font-family:var(--font-arcade); font-size:10px; color:var(--neon-gold); margin-right:8px; }
.light-mode .dict-sense .sense-n{ color:#7a5d00; }
.dict-sense .definition{ font-size:20px; margin:0 0 10px; line-height:1.4; }
.dict-sense h3{ font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:12px 0 6px; }
.dict-sense ul.examples{ margin:0; padding-left:20px; display:grid; gap:4px; font-size:17px; }
.dict-sense mark{ background:rgba(255,225,0,.18); color:inherit; border-radius:4px; padding:0 2px; font-weight:800; }
.light-mode .dict-sense mark{ background:rgba(255,200,0,.35); }
.chip-row{ display:flex; flex-wrap:wrap; gap:6px; }
.chip-row .rf-filter-chip .lang-tag{ font-size:11px; opacity:.7; margin-right:4px; text-transform:uppercase; }
.speak-btn{ min-width:44px; min-height:44px; }

.dict-wotd .wotd-word{ font-family:var(--font-heading); font-size:28px; margin:0; }
.dict-wotd .wotd-word button{ all:unset; cursor:pointer; color:var(--neon-cyan); }
.light-mode .dict-wotd .wotd-word button{ color:#006c80; }
.dict-wotd .wotd-word button:focus-visible{ outline:2px solid var(--neon-cyan); outline-offset:2px; border-radius:4px; }

.dict-list-head{ display:flex; justify-content:space-between; align-items:center; gap:8px; }
.dict-list-items{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:6px; }
.dict-list-items li{ display:flex; align-items:center; gap:2px; }
.dict-list-items .rf-filter-chip{ padding-right:8px; }
.dict-list-items .remove{ border:0; background:none; color:var(--muted); cursor:pointer; font-size:16px; min-width:32px; min-height:32px; }

.dict-credits{ margin-top:18px; }
.dict-credits a{ text-decoration:underline; }

/* ── Practice ────────────────────────────────────────────────────────────── */
.dict-practice{ margin-top:14px; }
.dict-practice-head{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between; margin-bottom:12px; }
.dict-practice-head h2{ margin:0; }
.dict-modes{ display:flex; gap:6px; }
.dict-modes .rf-filter-chip[aria-selected="true"]{ color:var(--neon-gold); border-color:var(--neon-gold); }
.light-mode .dict-modes .rf-filter-chip[aria-selected="true"]{ color:#7a5d00; border-color:#b8960b; }
.q-progress{ color:var(--muted); font-size:14px; margin:0 0 6px; }
.q-ask{ color:var(--muted); margin:0 0 6px; }
.q-prompt{ font-size:24px; font-weight:800; margin:0 0 14px; line-height:1.35; }
.q-choices{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
.q-choice{ text-align:left; padding:14px 16px; border-radius:var(--radius-sm); border:1px solid var(--line); background:var(--panel-2);
  color:var(--text); font:inherit; font-size:18px; cursor:pointer; min-height:56px; }
.q-choice:hover:not(:disabled){ border-color:rgba(77,240,255,.5); }
.q-choice.is-right{ border-color:var(--success); box-shadow:0 0 0 2px rgba(0,230,118,.35) inset; }
.q-choice.is-wrong{ border-color:var(--error); box-shadow:0 0 0 2px rgba(255,77,109,.35) inset; }
.q-choice.is-picked{ border-color:var(--neon-cyan); box-shadow:var(--glow-cyan); }
.q-choice.is-done{ opacity:.45; }
.q-typed{ display:flex; gap:8px; max-width:640px; }
.q-typed .rf-input{ flex:1; font-size:20px; }
.q-feedback{ min-height:28px; margin:12px 0 0; font-weight:700; }
.q-feedback.ok{ color:var(--success); }
.q-feedback.no{ color:var(--error); }
.light-mode .q-feedback.ok{ color:#00753a; }
.light-mode .q-feedback.no{ color:#b0002a; }
.q-next{ margin-top:12px; }
.match-board{ display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 2fr); gap:10px; }
.match-col{ display:grid; gap:8px; align-content:start; }

@media (max-width:1100px){ .dict-grid{ grid-template-columns:1fr; } }
@media (max-width:860px){
  html,body{ overflow:auto; height:auto; }
  .app{ display:block; height:auto; }
  .main{ height:auto; padding:14px; }
  .page-head .rf-theme-toggle{ margin-right:0; }
  .dict-entry .entry-pic{ width:96px; height:96px; }
  .dict-entry .entry-word{ font-size:32px; }
  .q-choices, .match-board{ grid-template-columns:1fr; }
}
