/* סוגיה סדורה – עיצוב חם, לימודי ונקי */
:root {
  --bg: #FEFAF0;
  --surface: #FFFFFF;
  --surface-2: #F7F0E1;
  --line: #E9DFCB;
  --ink: #142E3F;
  --ink-2: #4A5D6B;
  --ink-3: #7D8B95;
  --primary: #ED7473;
  --accent: #21ADAD;
  --shadow: 0 1px 2px rgba(20, 46, 63, .06), 0 6px 18px rgba(20, 46, 63, .07);
  --shadow-lg: 0 10px 40px rgba(20, 46, 63, .18);
  --radius: 18px;
  --font-ui: 'Assistant', 'Segoe UI', Arial, sans-serif;
  --font-text: 'Frank Ruhl Libre', 'David', 'Times New Roman', serif;
  --text-scale: 1;

  /* צבעי תפקידים */
  --r-ink: #142E3F;  --r-slate: #3D5A80; --r-gray: #6B7A89; --r-gray2: #8A96A6;
  --r-teal: #1A9C9C; --r-red: #DC4B4A;  --r-purple: #8E3F86; --r-mauve: #A86A98;
  --r-blue: #3E74B8; --r-green: #2B8F54; --r-green2: #3B9E78; --r-orange: #D9782A;
  --r-gold: #B88F14; --r-gold2: #8A6A12; --r-brown: #8B5E3C;
  --band-a: rgba(33, 173, 173, .05);
  --band-b: rgba(237, 116, 115, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1E29; --surface: #172A38; --surface-2: #1D3343; --line: #2A4253;
    --ink: #F3EEE2; --ink-2: #C4CDD3; --ink-3: #8DA0AD;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    --r-ink: #9FB7CC; --r-slate: #8FA8D0; --r-gray: #A3B0BC; --r-gray2: #B3BDC8;
    --r-teal: #3CC7C7; --r-red: #FF7A78; --r-purple: #D98ACF; --r-mauve: #D9A3C9;
    --r-blue: #7FAEE8; --r-green: #5FCB8A; --r-green2: #6CD0A8; --r-orange: #F2A35E;
    --r-gold: #E3C04F; --r-gold2: #D2B054; --r-brown: #D2A07A;
    --band-a: rgba(33, 173, 173, .08); --band-b: rgba(237, 116, 115, .07);
  }
}
:root[data-theme="dark"] {
  --bg: #0F1E29; --surface: #172A38; --surface-2: #1D3343; --line: #2A4253;
  --ink: #F3EEE2; --ink-2: #C4CDD3; --ink-3: #8DA0AD;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  --r-ink: #9FB7CC; --r-slate: #8FA8D0; --r-gray: #A3B0BC; --r-gray2: #B3BDC8;
  --r-teal: #3CC7C7; --r-red: #FF7A78; --r-purple: #D98ACF; --r-mauve: #D9A3C9;
  --r-blue: #7FAEE8; --r-green: #5FCB8A; --r-green2: #6CD0A8; --r-orange: #F2A35E;
  --r-gold: #E3C04F; --r-gold2: #D2B054; --r-brown: #D2A07A;
  --band-a: rgba(33, 173, 173, .08); --band-b: rgba(237, 116, 115, .07);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* מבנה כללי */
.screen { max-width: 980px; margin: 0 auto; padding: 0 16px 120px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .title { flex: 1; min-width: 0; font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { display: block; font-weight: 600; font-size: 13px; color: var(--ink-3); }
.icon-btn {
  width: 48px; height: 48px; border-radius: 14px; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:focus-visible, .btn:focus-visible, .card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn {
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: var(--bg);
}
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.coral { background: var(--primary); color: #fff; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: 12px; }

/* בית */
.hero { padding: 28px 4px 8px; }
.hero .eyebrow { color: var(--primary); font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.hero h1 { font-size: clamp(32px, 7vw, 48px); line-height: 1.1; margin: 6px 0 10px; font-weight: 800; }
.hero p { margin: 0; color: var(--ink-2); font-size: 18px; max-width: 560px; }
.search {
  margin: 22px 0 8px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; min-height: 54px;
  box-shadow: var(--shadow);
}
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); min-height: 52px; }
.search svg { color: var(--ink-3); }
.section-title { font-size: 20px; font-weight: 800; margin: 30px 4px 12px; display: flex; align-items: center; gap: 10px; }
.section-title small { font-weight: 600; color: var(--ink-3); font-size: 14px; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; text-align: right; display: block; width: 100%;
  text-decoration: none; transition: transform .15s, box-shadow .15s;
}
button.card:hover, a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card.disabled { opacity: .55; box-shadow: none; }
.card h3 { margin: 0 0 4px; font-size: 21px; font-weight: 800; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.pill.ok { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--r-teal); }
.pill.coral { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--r-red); }

.continue-card { display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--bg); border: 0; }
.continue-card p { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.continue-card .go { margin-inline-start: auto; width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; }

.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* בחירת דף */
.perek-head { padding: 22px 4px 6px; }
.perek-head h1 { margin: 0; font-size: clamp(28px, 6vw, 40px); font-weight: 800; line-height: 1.15; }
.perek-head p { margin: 6px 0 0; color: var(--ink-2); }
.daf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.daf-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.daf-card .num { font-family: var(--font-text); font-size: 30px; font-weight: 700; line-height: 1; }
.daf-card .amudim { display: flex; gap: 8px; }
.amud-btn {
  flex: 1; min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; line-height: 1.1;
}
.amud-btn small { font-weight: 600; color: var(--ink-3); font-size: 12px; }
.amud-btn:hover { border-color: var(--accent); }
.amud-btn.done { background: color-mix(in srgb, var(--accent) 14%, var(--bg)); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.amud-btn[disabled] { opacity: .35; cursor: default; }

/* רובריקות הסוגיות */
.amud-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 4px; }
.amud-title { font-family: var(--font-text); font-size: clamp(30px, 7vw, 44px); font-weight: 700; margin: 0; line-height: 1.1; }
.rubrics { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin-top: 12px; }
.rubric { position: relative; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 190px; }
.rubric .top { display: flex; align-items: center; gap: 8px; }
.rubric .no {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--ink); color: var(--bg); font-weight: 800; font-size: 17px;
}
.rubric h3 { font-size: 20px; line-height: 1.3; margin: 0; }
.rubric .range { color: var(--ink-3); font-size: 14px; font-weight: 700; }
.rubric .learned-mark { margin-inline-start: auto; color: var(--r-teal); }
.fingerprint { display: flex; gap: 2px; height: 10px; border-radius: 6px; overflow: hidden; margin-top: auto; }
.fingerprint i { flex: 1; min-width: 2px; }
.rubric .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.cont-note { font-size: 13px; color: var(--ink-3); font-weight: 600; }

/* צבעי תפקיד */
[data-c="ink"] { --rc: var(--r-ink); } [data-c="slate"] { --rc: var(--r-slate); }
[data-c="gray"] { --rc: var(--r-gray); } [data-c="gray2"] { --rc: var(--r-gray2); }
[data-c="teal"] { --rc: var(--r-teal); } [data-c="red"] { --rc: var(--r-red); }
[data-c="purple"] { --rc: var(--r-purple); } [data-c="mauve"] { --rc: var(--r-mauve); }
[data-c="blue"] { --rc: var(--r-blue); } [data-c="green"] { --rc: var(--r-green); }
[data-c="green2"] { --rc: var(--r-green2); } [data-c="orange"] { --rc: var(--r-orange); }
[data-c="gold"] { --rc: var(--r-gold); } [data-c="gold2"] { --rc: var(--r-gold2); }
[data-c="brown"] { --rc: var(--r-brown); }
.fingerprint i { background: var(--rc); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 800; color: var(--rc); background: color-mix(in srgb, var(--rc) 13%, transparent);
  white-space: nowrap; border: 0;
}
.chip.solid { background: var(--rc); color: #fff; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rc); }
.term { font-weight: 800; color: var(--rc); }

/* מסך סוגיה */
.sugya-screen { height: 100dvh; display: flex; flex-direction: column; }
.sugya-head { padding: 0 16px 8px; max-width: 980px; margin: 0 auto; width: 100%; }
.sugya-head h1 { font-size: clamp(22px, 5vw, 30px); margin: 2px 0 2px; line-height: 1.2; font-weight: 800; }
.sugya-head .summary { color: var(--ink-2); margin: 0; font-size: 15.5px; }
.sugya-head .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; }
.tabs button { border: 0; background: transparent; min-height: 40px; padding: 0 14px; border-radius: 11px; font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.draft-note { font-size: 13px; color: var(--r-orange); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }

/* הלוח */
.board-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; border-top: 1px solid var(--line); background:
  radial-gradient(circle, color-mix(in srgb, var(--ink) 10%, transparent) 1px, transparent 1.2px) 0 0 / 22px 22px, var(--bg);
  touch-action: none; cursor: grab; user-select: none; }
.board-wrap.grabbing { cursor: grabbing; }
.board { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.board svg.edges { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.edges path { fill: none; stroke: color-mix(in srgb, var(--ink) 28%, transparent); stroke-width: 2; }
.edges path.hl { stroke: var(--primary); stroke-width: 3; }
.band { position: absolute; left: 0; border-radius: 22px; }
.band:nth-of-type(odd) { background: var(--band-a); }
.band:nth-of-type(even) { background: var(--band-b); }
.band-label {
  position: absolute; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink);
  white-space: nowrap;
}
.band-label b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 15px; }
[hidden] { display: none !important; }
.cm-part .node .nt .ln:nth-child(n+2) { display: none; }
.cm-part .node .nt .ln:first-child::after { content: ' …'; color: var(--ink-3); }
.cm-part .node .nt .ln:only-child::after { content: ''; }
.cm-none .node:not(.nonote) .nt { display: none; }
.cm-none .node.nonote .nt .ln:nth-child(n+2) { display: none; }
.cm-none .node .nn { border-top: 0; padding-top: 0; margin-top: 2px; font-size: 16px; color: var(--ink); }
.card-mode { position: absolute; z-index: 6; bottom: calc(16px + env(safe-area-inset-bottom)); right: 16px; box-shadow: var(--shadow); background: var(--surface); border: 1px solid var(--line); align-items: center; }
.card-mode .seg-lbl { font-weight: 800; font-size: 14px; padding: 0 8px; color: var(--ink-2); }
.seg.card-mode button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seq {
  flex: none; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 9px; display: inline-grid; place-items: center;
  font-weight: 800; font-size: 15px; background: var(--ink); color: var(--bg); font-family: var(--font-ui);
}
.stage-tag { justify-content: center; font-size: 16px; gap: 8px; }
.stage-tag span { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2px 10px; box-shadow: var(--shadow); overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 40px); }
.stage-tag b { flex: none; }
.node {
  position: absolute; top: 0; left: 0; width: 300px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--line); border-right: 6px solid var(--rc); padding: 10px 12px 10px 12px; cursor: pointer;
  transition: box-shadow .15s, opacity .2s;
}
.node.proposal { border-style: dashed; border-right-style: solid; }
.node:hover { box-shadow: var(--shadow-lg); }
.node.sel { box-shadow: 0 0 0 3px var(--primary), var(--shadow-lg); }
.node.dim { opacity: .25; }
.node .nh { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.node .nk { font-size: 12px; color: var(--ink-3); font-weight: 700; margin-inline-start: auto; }
.node .nt { font-family: var(--font-text); font-size: calc(17px * var(--text-scale)); line-height: 1.55; }
.node .nt .ln { display: block; }
.node .nn { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: 6px; }
.node .fold {
  position: absolute; left: -14px; top: 12px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--shadow);
  font-weight: 800; font-size: 13px; color: var(--ink-2); padding: 0;
}
.node .fold svg.i { width: 16px; height: 16px; }
.board-wrap.arrange .node { cursor: move; }
.board-tools {
  position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 5;
}
.board-tools .icon-btn { background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); }
.board-tools .icon-btn.on { background: var(--ink); color: var(--bg); }
.legend {
  position: absolute; top: 12px; right: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; max-width: min(560px, calc(100% - 24px));
}
.legend .chip { cursor: pointer; min-height: 32px; background: var(--surface); box-shadow: var(--shadow); }
.legend .chip[aria-pressed="true"] { background: var(--rc); color: #fff; }
.legend .chip[aria-pressed="true"] .dot { background: #fff; }
.zoom-label { font-size: 12px; text-align: center; color: var(--ink-3); font-weight: 700; }

/* תצוגת טקסט */
.text-view { flex: 1; overflow: auto; border-top: 1px solid var(--line); }
.text-inner { max-width: 820px; margin: 0 auto; padding: 16px 16px 140px; }
.text-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.stage-h { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; font-weight: 800; font-size: 19px; }
.stage-h b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 14px; flex: none; }
.para {
  position: relative; background: var(--surface); border-radius: 14px; border: 1px solid var(--line); border-right: 5px solid var(--rc);
  padding: 10px 14px; margin: 0 0 10px; cursor: pointer;
}
.para.proposal { border-style: dashed; border-right-style: solid; }
.para .ph { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.para .ph .reply { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.para .pt { font-family: var(--font-text); font-size: calc(19px * var(--text-scale)); line-height: 1.7; }
.para .pt .ln { display: block; }
.para .pn { margin-top: 6px; color: var(--ink-2); font-size: 15.5px; }
.daf-mark { display: inline-block; font-family: var(--font-ui); font-size: 12px; font-weight: 800; color: #fff; background: var(--accent); border-radius: 6px; padding: 0 6px; margin-inline-start: 6px; vertical-align: middle; }
.mode-notes .pt { display: none; }
.mode-text .pn { display: none; }

/* גיליון פרטים */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 30, 41, .35); z-index: 40; }
.sheet {
  position: fixed; z-index: 41; background: var(--surface); box-shadow: var(--shadow-lg); overflow: auto;
  left: 0; right: 0; bottom: 0; max-height: 82dvh; border-radius: 24px 24px 0 0; padding: 8px 18px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .25s ease;
}
.sheet.open { transform: none; }
.sheet .grip { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 6px auto 10px; }
.sheet h2 { margin: 4px 0 8px; font-size: 21px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet .full-text { font-family: var(--font-text); font-size: calc(20px * var(--text-scale)); line-height: 1.75; background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.sheet .full-text .ln { display: block; }
.sheet .box { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.sheet .box h4 { margin: 0 0 4px; font-size: 14px; color: var(--ink-3); }
.sheet .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sheet label { display: block; font-weight: 700; margin: 14px 0 6px; }
.sheet textarea { width: 100%; min-height: 90px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; padding: 10px 12px; }
.sheet select { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; padding: 0 10px; }
.role-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.role-pick .chip { min-height: 36px; cursor: pointer; }
.role-pick .chip[aria-pressed="true"] { background: var(--rc); color: #fff; }
.sheet .actions { display: flex; gap: 8px; margin-top: 16px; position: sticky; bottom: 0; background: var(--surface); padding-top: 10px; }
@media (min-width: 900px) {
  .sheet { left: auto; top: 0; bottom: 0; right: 0; width: 440px; max-height: none; border-radius: 0; transform: translateX(105%); padding-top: 18px; }
  .sheet .grip { display: none; }
}

/* חיפוש והגדרות */
.result { display: block; margin-bottom: 10px; }
.result .snip { font-family: var(--font-text); font-size: 17px; color: var(--ink-2); margin-top: 4px; }
.result mark { background: color-mix(in srgb, var(--primary) 30%, transparent); color: inherit; border-radius: 4px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.setting:last-child { border-bottom: 0; }
.setting .lbl b { display: block; }
.setting .lbl small { color: var(--ink-3); }
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.seg button { border: 0; background: transparent; min-height: 40px; padding: 0 12px; border-radius: 9px; font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); }
input[type="range"] { accent-color: var(--accent); width: 180px; }

.empty { text-align: center; padding: 40px 16px; color: var(--ink-2); }
.toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 700; z-index: 60; transition: .2s;
  display: flex; gap: 12px; align-items: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: transparent; border: 0; color: var(--primary); font-weight: 800; min-height: 32px; }

.legend-page .fam { margin-bottom: 18px; }
.legend-page .fam h3 { margin: 0 0 8px; font-size: 17px; }
.legend-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; }
.legend-row .chip { flex: none; }
.term-list { columns: 2 260px; column-gap: 24px; }
.term-item { break-inside: avoid; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.term-item b { font-family: var(--font-text); font-size: 18px; }

@media (max-width: 600px) {
  .sugya-head .row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .sugya-head .row > * { flex: none; }
  .sugya-head h1 { font-size: 20px; }
  .view-board .sugya-head .summary { display: none; }
  .topbar .btn.small { padding: 0 8px; }
  .node { width: 260px; }
  .legend { top: 8px; right: 8px; gap: 4px; }
  .legend .chip { font-size: 12px; padding: 2px 8px; min-height: 30px; }
  .tabs button { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
