/* BLG545E ders notları — ortak stil */
:root {
  /* Layout: graph-paper masthead band; from 1100px a sticky contents rail (232px) beside one reading column (~68ch); figures, tables and the LP lab use the full column */
  --paper: #F5F6F2;
  --paper-2: #ECEFEA;
  --ink: #18212A;
  --ink-2: #4A5663;
  --ink-3: #6F7A86;
  --rule: #D3D9D3;
  --grid: rgba(24, 33, 42, 0.06);
  --accent: #0E6B61;
  --accent-ink: #0B5A52;
  --accent-soft: #DDEEEA;
  --mark: #B06C0E;
  --mark-ink: #84500A;
  --mark-soft: #F6EAD3;
  --warn: #A3402B;
  --warn-soft: #F6E2DC;
  --code-bg: #E7ECE8;
  --cat-1: #CFE3F5;
  --cat-2: #F3D9C4;
  --cat-3: #D6EACB;
  --font-display: "Barlow Semi Condensed", "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  --font-body: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
  --measure: 68ch;
  --radius: 3px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11161A;
    --paper-2: #161D22;
    --ink: #E2E7EB;
    --ink-2: #A9B4BE;
    --ink-3: #85919C;
    --rule: #2B343C;
    --grid: rgba(226, 231, 235, 0.05);
    --accent: #58C2B3;
    --accent-ink: #7DD4C8;
    --accent-soft: #15302C;
    --mark: #E3A64A;
    --mark-ink: #F0BE6E;
    --mark-soft: #33270F;
    --warn: #EA8C7A;
    --warn-soft: #36211C;
    --code-bg: #192127;
    --cat-1: #1F3A52;
    --cat-2: #4A3322;
    --cat-3: #28412B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #11161A;
  --paper-2: #161D22;
  --ink: #E2E7EB;
  --ink-2: #A9B4BE;
  --ink-3: #85919C;
  --rule: #2B343C;
  --grid: rgba(226, 231, 235, 0.05);
  --accent: #58C2B3;
  --accent-ink: #7DD4C8;
  --accent-soft: #15302C;
  --mark: #E3A64A;
  --mark-ink: #F0BE6E;
  --mark-soft: #33270F;
  --warn: #EA8C7A;
  --warn-soft: #36211C;
  --code-bg: #192127;
  --cat-1: #1F3A52;
  --cat-2: #4A3322;
  --cat-3: #28412B;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--paper-2);
}
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }
::selection { background: var(--mark-soft); color: var(--ink); }
strong, b { font-weight: 600; }
sub, sup { line-height: 0; }

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- masthead ---------- */
.masthead {
  background-color: var(--paper-2);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  border-bottom: 1px solid var(--rule);
}
.masthead .wrap { padding-block: 16px 40px; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.topbar a { color: var(--ink); text-decoration: none; font-weight: 600; }
.topbar a:hover { color: var(--accent-ink); text-decoration: underline; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.eyebrow {
  margin: 44px 0 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 1.25rem + 3.4vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.005em;
  text-wrap: balance;
  max-width: 24ch;
}
.lede { margin: 16px 0 0; max-width: 62ch; font-size: 1.17rem; line-height: 1.55; color: var(--ink-2); }
.meta {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  font-family: var(--font-display);
  font-size: 0.98rem;
  color: var(--ink-2);
}
.meta b { color: var(--ink); font-weight: 600; }
.meta code { font-size: 0.86em; }

/* ---------- page layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-block: 28px 72px; }
@media (min-width: 1100px) {
  .layout { grid-template-columns: 232px minmax(0, 1fr); gap: 56px; }
}

/* ---------- contents ---------- */
.toc {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.3;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  min-width: 0;
}
.toc summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-size: 1.2rem; line-height: 1; }
.toc[open] summary::after { content: "\2013"; }
.toc ol { margin: 0; padding: 0 14px 14px; list-style: none; counter-reset: t; display: grid; gap: 1px; }
.toc li { counter-increment: t; }
.toc a {
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr);
  padding: 5px 0;
  color: var(--ink-2);
  text-decoration: none;
}
.toc a::before { content: counter(t) "."; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); font-weight: 600; }
.toc a.is-active::before { color: var(--accent); }
@media (min-width: 1100px) {
  .toc {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 20px);
    align-self: start;
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: transparent;
    border: 0;
  }
  .toc summary { padding: 0 0 10px; cursor: default; pointer-events: none; }
  .toc summary::after { content: none; }
  .toc ol { padding: 0; }
}

/* ---------- article ---------- */
.notes { min-width: 0; counter-reset: sec; }
.notes > * { max-width: var(--measure); }
.notes > figure,
.notes > .table-wrap,
.notes > .lab,
.notes > .compare,
.notes > .wide { max-width: none; }
.notes > pre { max-width: 84ch; }
.notes h2 {
  counter-increment: sec;
  counter-reset: sub;
  margin: 3.4rem 0 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem);
  line-height: 1.15;
  text-wrap: balance;
}
.notes h2::before {
  content: counter(sec) ".";
  margin-right: 0.45em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.notes > h2:first-child { margin-top: 0; }
.notes h3 {
  counter-increment: sub;
  margin: 2.1rem 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.2;
  text-wrap: balance;
}
.notes h3::before {
  content: counter(sec) "." counter(sub);
  margin-right: 0.55em;
  color: var(--ink-3);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.notes h4 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.25;
}
.notes p { margin: 0 0 1rem; }
.notes ul, .notes ol { margin: 0 0 1.1rem; padding-left: 1.35em; }
.notes li { margin: 0.3rem 0; }
.notes li::marker { color: var(--ink-3); }
.en { font-style: italic; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 0.92rem; }

dl.terms { margin: 0 0 1.2rem; display: grid; gap: 12px; }
dl.terms dt { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; line-height: 1.3; }
dl.terms dd { margin: 2px 0 0; }

/* ---------- callouts ---------- */
.box {
  margin: 1.5rem 0;
  padding: 14px 18px 4px;
  background: var(--paper-2);
  border-top: 2px solid var(--ink-3);
  border-radius: 0 0 var(--radius) var(--radius);
}
.box > .label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.box p:last-child, .box ul:last-child, .box ol:last-child { margin-bottom: 0.9rem; }
.box.tanim { background: var(--accent-soft); border-top-color: var(--accent); }
.box.tanim > .label { color: var(--accent-ink); }
.box.onemli { background: var(--mark-soft); border-top-color: var(--mark); }
.box.onemli > .label { color: var(--mark-ink); }
.box.dikkat { background: var(--warn-soft); border-top-color: var(--warn); }
.box.dikkat > .label { color: var(--warn); }
blockquote.quote {
  margin: 1.6rem 0;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.85rem);
  line-height: 1.2;
  text-wrap: balance;
}
blockquote.quote::before { content: "\201C"; color: var(--mark); }
blockquote.quote::after { content: "\201D"; color: var(--mark); }

/* ---------- comparisons ---------- */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 14px;
  margin: 1.4rem 0;
}
.compare > div {
  min-width: 0;
  padding: 16px 18px 6px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.compare .kicker {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.compare p { font-size: 0.98rem; }

/* ---------- steps (real sequences only) ---------- */
ol.steps { list-style: none; padding: 0; margin: 1.2rem 0 1.4rem; counter-reset: st; display: grid; gap: 8px; }
ol.steps > li {
  counter-increment: st;
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0 10px;
  align-items: baseline;
  margin: 0;
}
ol.steps > li::before {
  content: counter(st);
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-ink);
  align-self: start;
}
ol.steps .loop {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--warn);
}
ol.flow, ul.flow { display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: center; margin: 1.2rem 0; padding: 0; list-style: none; }
.flow li {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
}
.flow li small { display: block; font-weight: 500; color: var(--ink-3); font-size: 0.8rem; letter-spacing: 0.04em; }
.flow li.last { background: var(--accent-soft); border-color: var(--accent); }
.flow .arrow { padding: 0; border: 0; background: none; color: var(--ink-3); font-weight: 500; }

ul.ozet { list-style: none; padding: 0; }
ul.ozet li { position: relative; padding-left: 1.7em; margin: 0.55rem 0; }
ul.ozet li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
}

/* ---------- figures ---------- */
figure { margin: 1.8rem 0; }
.fig-frame {
  padding: 14px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow-x: auto;
}
.fig-frame svg { display: block; width: 100%; height: auto; min-width: 460px; }
figcaption { margin-top: 10px; max-width: var(--measure); font-size: 0.93rem; line-height: 1.5; color: var(--ink-2); }
figcaption b { color: var(--ink); font-family: var(--font-display); font-weight: 600; letter-spacing: 0.02em; }

svg .ax { stroke: var(--ink-2); stroke-width: 1.4; fill: none; }
svg .ah { fill: var(--ink-2); }
svg .curve { stroke: var(--ink); stroke-width: 2.2; fill: none; stroke-linecap: round; }
svg .region { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.6; }
svg .region-2 { fill: var(--mark-soft); stroke: var(--mark); stroke-width: 1.6; }
svg .dot { fill: var(--ink); }
svg .opt { fill: var(--mark); stroke: var(--paper-2); stroke-width: 2; }
svg .loc { fill: var(--accent); stroke: var(--paper-2); stroke-width: 2; }
svg .node { fill: var(--paper); stroke: var(--ink-2); stroke-width: 1.6; }
svg .edge { stroke: var(--ink-2); stroke-width: 2; fill: none; }
svg .edge-del { stroke: var(--warn); stroke-width: 2.2; stroke-dasharray: 6 5; fill: none; }
svg .edge-add { stroke: var(--accent); stroke-width: 3; fill: none; }
svg .map { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 6 5; fill: none; }
svg .jump { stroke: var(--warn); stroke-width: 2; stroke-dasharray: 6 5; fill: none; }
svg .descend { stroke: var(--accent); stroke-width: 2.6; fill: none; }
svg .ah-warn { fill: var(--warn); }
svg .ah-acc { fill: var(--accent); }
svg .t { fill: var(--ink); font-family: var(--font-display); font-size: 15px; font-weight: 600; }
svg .t2 { fill: var(--ink-2); font-family: var(--font-display); font-size: 14px; }
svg .tm { fill: var(--ink); font-family: var(--font-body); font-style: italic; font-size: 16px; }
svg .t-warn { fill: var(--warn); }
svg .t-acc { fill: var(--accent-ink); }
svg .t-mark { fill: var(--mark-ink); }

/* ---------- diagram & chart vocabulary ---------- */
:root {
  --c-1: #00897A;
  --c-2: #C9650F;
  --seq-1: #6FB3A8;
  --seq-2: #2C8A7D;
  --seq-3: #0B4F47;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --c-1: #2FA393; --c-2: #CC7F26; --seq-1: #1F6B61; --seq-2: #45A698; --seq-3: #93DCD0; }
}
:root[data-theme="dark"] { --c-1: #2FA393; --c-2: #CC7F26; --seq-1: #1F6B61; --seq-2: #45A698; --seq-3: #93DCD0; }

.fig-narrow .fig-frame svg { max-width: 600px; min-width: 400px; margin-inline: auto; }
svg .t3 { fill: var(--ink-2); font-family: var(--font-display); font-size: 12.5px; }
svg .t-num { fill: var(--ink); font-family: var(--font-mono); font-size: 12px; }
svg .t-num-b { fill: var(--ink); font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
svg .t-axis { fill: var(--ink-3); font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; }
svg .t-on { fill: var(--paper); }
svg .ah-mark { fill: var(--mark); }
svg .ah-ink { fill: var(--ink); }
svg .box { fill: var(--paper); stroke: var(--ink-3); stroke-width: 1.3; }
svg .box-acc { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
svg .box-mark { fill: var(--mark-soft); stroke: var(--mark); stroke-width: 1.5; }
svg .box-dash { fill: none; stroke: var(--ink-3); stroke-width: 1.3; stroke-dasharray: 5 4; }
svg .label-bg { fill: var(--paper-2); stroke: var(--rule); stroke-width: 1; }
svg .tabu-tag { fill: var(--warn-soft); stroke: var(--warn); stroke-width: 1; }
svg .bar { fill: var(--ink-3); fill-opacity: 0.42; }
svg .bar-acc { fill: var(--accent); }
svg .bar-acc-soft { fill: var(--accent); fill-opacity: 0.45; }
svg .bar-mark { fill: var(--mark); }
svg .bar-ghost { fill: none; stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 4 3; }
svg .arrow { stroke: var(--ink-2); stroke-width: 1.5; fill: none; stroke-linejoin: round; }
svg .arrow-acc { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linecap: round; }
svg .arrow-acc-dash { stroke: var(--accent); stroke-width: 2; fill: none; stroke-dasharray: 6 4; }
svg .arrow-acc-thick { stroke: var(--accent); stroke-width: 2.6; fill: none; }
svg .arrow-mark { stroke: var(--mark); stroke-width: 2; fill: none; stroke-linecap: round; }
svg .arrow-warn { stroke: var(--warn); stroke-width: 2; fill: none; stroke-dasharray: 6 4; }
svg .arrow-warn-thick { stroke: var(--warn); stroke-width: 2.6; fill: none; stroke-dasharray: 7 5; }
svg .edge-cand { stroke: var(--ink-3); stroke-width: 1.3; stroke-dasharray: 3 4; }
svg .edge-conflict { stroke: var(--warn); stroke-width: 3.2; }
svg .edge-mark { stroke: var(--mark); stroke-width: 2.2; fill: none; }
svg .node-acc { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.8; }
svg .node-mark { fill: var(--mark-soft); stroke: var(--mark); stroke-width: 1.8; }
svg .ring-mark { fill: none; stroke: var(--mark); stroke-width: 2.5; }
svg .dot-acc { fill: var(--accent); stroke: var(--paper-2); stroke-width: 2; }
svg .dot-hollow { fill: var(--paper); stroke: var(--warn); stroke-width: 2; }
svg .dot-muted { fill: var(--ink-3); fill-opacity: 0.6; }
svg .dot-c2 { fill: var(--c-2); stroke: var(--paper-2); stroke-width: 2; }
svg .dot-hollow-c2 { fill: var(--paper-2); stroke: var(--c-2); stroke-width: 2; }
svg .contour { fill: none; stroke: var(--ink-3); stroke-width: 1; stroke-opacity: 0.55; }
svg .contour-hi { fill: none; stroke: var(--mark); stroke-width: 1.4; stroke-dasharray: 5 4; }
svg .cross { stroke: var(--warn); stroke-width: 2.2; stroke-linecap: round; }
svg .infeasible-bg { fill: var(--warn-soft); }
svg .grid { stroke: var(--rule); stroke-width: 1; }
svg .ref { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 4 4; }
svg .s1 { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
svg .s-muted { stroke: var(--ink-3); stroke-width: 1.1; fill: none; stroke-opacity: 0.8; stroke-linejoin: round; }
svg .s-ink { stroke: var(--ink-2); stroke-width: 2; fill: none; stroke-linejoin: round; }
svg .seq1 { stroke: var(--seq-1); stroke-width: 2; fill: none; stroke-linejoin: round; }
svg .seq2 { stroke: var(--seq-2); stroke-width: 2; fill: none; stroke-linejoin: round; }
svg .seq3 { stroke: var(--seq-3); stroke-width: 2; fill: none; stroke-linejoin: round; }
svg .c1 { stroke: var(--c-1); stroke-width: 2.2; fill: none; stroke-linejoin: round; }
svg .c2 { stroke: var(--c-2); stroke-width: 2.2; fill: none; stroke-linejoin: round; }
svg .hit { fill: transparent; stroke: none; }
svg .bracket { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
svg .leader { stroke: var(--ink-3); stroke-width: 1; }
svg .lattice { stroke: var(--rule); stroke-width: 1.4; }
svg .nbhd { fill: var(--accent-soft); fill-opacity: 0.5; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 5 4; }
svg .cell { fill: none; stroke: var(--rule); stroke-width: 1; }
svg .cell-heat { fill: var(--accent); }
svg .cat1 { fill: var(--cat-1); stroke: var(--ink-3); stroke-width: 1.2; }
svg .cat2 { fill: var(--cat-2); stroke: var(--ink-3); stroke-width: 1.2; }
svg .cat3 { fill: var(--cat-3); stroke: var(--ink-3); stroke-width: 1.2; }
svg .spoke { stroke: var(--ink-3); stroke-width: 1.2; }
svg .hublink { stroke: var(--mark); stroke-width: 5; stroke-linecap: round; }
svg .flow-path { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
svg .route-a { fill: none; stroke: var(--c-1); stroke-width: 2.4; stroke-linejoin: round; }
svg .route-b { fill: none; stroke: var(--c-2); stroke-width: 2.4; stroke-linejoin: round; stroke-dasharray: 7 4; }
svg .flow-a { fill: none; stroke: var(--accent); stroke-opacity: 0.55; }
svg .flow-b { fill: none; stroke: var(--mark); stroke-opacity: 0.5; }
svg .shift { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.4; }
svg .req { stroke: var(--mark); stroke-width: 2.5; stroke-linecap: round; }

/* ---------- static LP plots ---------- */
.lp-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.lp-pair figure { margin: 0; }
svg.lp-static { display: block; width: 100%; height: auto; max-width: 460px; background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; }
svg .lp-part { fill: var(--accent-soft); fill-opacity: 0.55; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 4; }
svg .lp-clabel-opt { fill: var(--ink); font: 600 12.5px var(--font-display); }
svg .lp-int { fill: var(--ink-3); }
svg .lp-intopt { fill: none; stroke: var(--warn); stroke-width: 2.4; }
svg .lp-intlabel { fill: var(--warn); font: 600 12px var(--font-display); }

/* ---------- annotated sentence ---------- */
.anat { margin: 1.4rem 0; padding: 18px 20px 14px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.anat p { margin: 0; font-size: 1.12rem; line-height: 3.2; }
.anat .k {
  position: relative;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 0.3em;
}
.anat .k::before {
  content: attr(data-k);
  position: absolute;
  left: 0;
  bottom: 1.75em;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.66em;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.anat .k-dv { text-decoration-color: var(--accent); }
.anat .k-dv::before { color: var(--accent-ink); }
.anat .k-obj { text-decoration-color: var(--mark); }
.anat .k-obj::before { color: var(--mark-ink); }
.anat .k-con { text-decoration-color: var(--warn); }
.anat .k-con::before { color: var(--warn); }
.anat .k-dom { text-decoration-color: var(--ink-3); text-decoration-style: dashed; }
.anat .k-dom::before { color: var(--ink-2); }

/* ---------- encodings ---------- */
.cells { display: inline-flex; flex-wrap: wrap; gap: 3px; margin: 4px 0 8px; font-family: var(--font-mono); font-size: 0.95rem; }
.cells span {
  display: inline-grid;
  place-items: center;
  min-width: 2.1em;
  height: 2.1em;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 2px;
}
.cells .on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cells .k1 { background: var(--cat-1); }
.cells .k2 { background: var(--cat-2); }
.cells .k3 { background: var(--cat-3); }

/* ---------- tables ---------- */
.table-wrap { margin: 1.4rem 0; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink-2);
}
th, td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
thead th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1.5px solid var(--ink-3);
  vertical-align: bottom;
}
tbody th { font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.c, th.c { text-align: center; }
tr.hl > * { background: var(--mark-soft); }
tr.sub > * { background: var(--paper-2); font-family: var(--font-display); font-weight: 600; color: var(--ink-2); }
table.tight th, table.tight td { padding: 6px 9px; }
.check { color: var(--accent); font-weight: 700; }

/* ---------- code & algorithms ---------- */
pre {
  margin: 1.4rem 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: var(--code-bg);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.62;
  tab-size: 4;
}
code { font-family: var(--font-mono); font-size: 0.88em; }
:not(pre) > code { background: var(--code-bg); padding: 0.06em 0.32em; border-radius: 2px; }
pre .kw { color: var(--accent-ink); font-weight: 600; }
pre .cm { color: var(--ink-3); font-style: italic; }
pre .fn { color: var(--mark-ink); }
.algo-name {
  display: block;
  margin: 1.4rem 0 -1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- math ---------- */
mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; max-width: 100%; margin: 1.1rem 0 !important; padding-block: 3px; }
mjx-container { color: inherit; }

/* ---------- exercises ---------- */
.ex {
  margin: 1.8rem 0 0.6rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--rule);
}
.ex > .label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mark-ink);
}
details.cozum { margin: 0.8rem 0 1.6rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
details.cozum > summary {
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent-ink);
}
details.cozum > summary::-webkit-details-marker { display: none; }
details.cozum > summary::before {
  content: "\25B8";
  display: inline-block;
  width: 1.1em;
  transition: transform 0.15s ease;
}
details.cozum[open] > summary::before { transform: rotate(90deg); }
details.cozum > .inner { padding: 12px 18px 4px; border-top: 1px solid var(--rule); min-width: 0; }

/* ---------- pager & footer ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 3.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  max-width: none;
}
.pager a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  text-decoration: none;
}
.pager a:hover { border-color: var(--accent); }
.pager small {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pager span { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; line-height: 1.25; }
.pager .next { grid-column: 2; text-align: right; }
@media (max-width: 560px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: auto; }
}
.site-foot { border-top: 1px solid var(--rule); background: var(--paper-2); }
.site-foot .wrap { padding-block: 22px 30px; font-size: 0.92rem; color: var(--ink-2); }
.site-foot p { margin: 0; max-width: 80ch; }

/* ---------- LP lab ---------- */
.lab {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 18px;
  margin: 1.8rem 0;
  padding: 16px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
@media (max-width: 780px) { .lab { grid-template-columns: minmax(0, 1fr); } }
.lab-plot { min-width: 0; }
.lab-plot svg { display: block; width: 100%; height: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; }
.lab-panel { min-width: 0; display: grid; gap: 14px; align-content: start; font-size: 0.96rem; }
.lab .lab-head, .lab .lab-obj, .lab .lab-status, .lab .lab-cons, .lab .table-wrap { margin: 0; }
.lab .lab-cons { padding: 0; }
.lab .lab-cons li { margin: 0; }
.lab-head { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.lab-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-presets button {
  appearance: none;
  padding: 6px 11px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font: 600 0.92rem/1.2 var(--font-display);
  cursor: pointer;
}
.lab-presets button:hover { border-color: var(--accent); }
.lab-presets button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.lab-sliders { display: grid; gap: 8px; }
.lab-sliders label { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) 2.6rem; gap: 10px; align-items: center; font-family: var(--font-display); font-weight: 600; }
.lab-sliders output { text-align: right; font-family: var(--font-mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.lab-sliders input[type="range"] { width: 100%; accent-color: var(--accent); }
.lab-obj { margin: 0; font-family: var(--font-mono); font-size: 0.92rem; }
.lab-cons { margin: 0; padding: 0; list-style: none; font-family: var(--font-mono); font-size: 0.88rem; display: grid; gap: 2px; }
.lab-cons span { color: var(--ink-3); display: inline-block; min-width: 2.2em; }
.lab-status {
  margin: 0;
  padding: 9px 12px;
  border-radius: 2px;
  background: var(--mark-soft);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.35;
}
.lab-status.bad { background: var(--warn-soft); }
.lab-table td, .lab-table th { padding: 5px 8px; }
.lab-table { font-size: 0.9rem; }

svg .lp-grid { stroke: var(--rule); stroke-width: 1; }
svg .lp-axis { stroke: var(--ink-2); stroke-width: 1.4; }
svg .lp-tick { fill: var(--ink-3); font: 11px var(--font-mono); }
svg .lp-axlabel { fill: var(--ink-2); font: italic 15px var(--font-body); }
svg .lp-feas { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
svg .lp-con { stroke: var(--ink-3); stroke-width: 1.3; }
svg .lp-conlabel { fill: var(--ink-2); font: 600 13px var(--font-display); }
svg .lp-iso { stroke: var(--mark); stroke-width: 2.2; stroke-dasharray: 8 5; }
svg .lp-corner { fill: var(--paper); stroke: var(--accent); stroke-width: 2; }
svg .lp-opt { fill: var(--mark); stroke: var(--paper); stroke-width: 2; }
svg .lp-clabel { fill: var(--ink); font: 11.5px var(--font-mono); }
svg .lp-msg { fill: var(--warn); font: 700 16px var(--font-display); }
svg .lp-ray { stroke: var(--mark); stroke-width: 2.2; }

/* ---------- index page ---------- */
.course-code {
  display: block;
  font-size: clamp(3.2rem, 1.6rem + 7vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
}
.course-name { display: block; margin-top: 6px; font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); font-weight: 600; color: var(--ink-2); }
.home-main { padding-block: 12px 72px; }
.home-main > section { margin-top: 3rem; }
.home-main h2 {
  margin: 0 0 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem);
  line-height: 1.15;
}
.home-main h3 { margin: 0 0 0.5rem; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.home-main p { margin: 0 0 1rem; max-width: var(--measure); }
.home-main ul, .home-main ol { margin: 0 0 1rem; padding-left: 1.3em; max-width: var(--measure); }
.home-main li { margin: 0.3rem 0; }
.home-main .weeks, .home-main .track, .home-main .jumplinks { padding: 0; max-width: none; }
.home-main .week, .home-main .track > li { margin: 0; }
.jumplinks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-family: var(--font-display); font-weight: 600; }
.jumplinks a { text-decoration: none; }
.jumplinks a:hover { text-decoration: underline; }

.weeks { list-style: none; margin: 0; padding: 0; }
.week {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 6px 28px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.week:first-child { border-top: 1px solid var(--rule); }
@media (max-width: 640px) { .week { grid-template-columns: minmax(0, 1fr); } }
.week-when { font-family: var(--font-display); color: var(--ink-2); line-height: 1.25; }
.week-when b { display: block; font-size: 1.35rem; color: var(--ink); }
.week-notes { display: grid; gap: 4px; min-width: 0; }
.note-link {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0 12px;
  padding: 10px 0;
  color: inherit;
  text-decoration: none;
}
.note-link .num { font-family: var(--font-mono); font-weight: 600; color: var(--accent); padding-top: 3px; }
.note-link h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1.2; color: var(--ink); }
.note-link:hover h3 { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.note-link p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.98rem; max-width: 70ch; }
.note-link .src { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-3); overflow-wrap: anywhere; }
.week.pending .week-notes p { margin: 8px 0 0; color: var(--ink-3); font-family: var(--font-display); }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 28px 40px; }
.two-col > div { min-width: 0; }
.grade-bar { display: flex; margin: 8px 0 12px; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; font-family: var(--font-display); font-weight: 600; }
.grade-bar span { flex: var(--w) 1 0; min-width: 0; padding: 12px 10px; line-height: 1.15; }
.grade-bar span small { display: block; font-size: 1.5rem; font-weight: 700; }
.grade-bar .g1 { background: var(--accent-soft); color: var(--accent-ink); }
.grade-bar .g2 { background: var(--mark-soft); color: var(--mark-ink); border-inline: 1px solid var(--rule); }
.grade-bar .g3 { background: var(--paper-2); color: var(--ink-2); }

.track { list-style: none; margin: 1rem 0 1.4rem; padding: 0; display: grid; gap: 0; }
.track > li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 4px 24px;
  margin: 0;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}
@media (max-width: 640px) { .track > li { grid-template-columns: minmax(0, 1fr); } }
.track .when { font-family: var(--font-display); color: var(--ink-2); line-height: 1.25; }
.track .when b { display: block; color: var(--mark-ink); font-size: 1.15rem; }
.track h3 { margin: 0 0 4px; }
.track p, .track ul { margin: 0 0 0.4rem; }

tr.holiday > * { color: var(--ink-3); font-style: italic; background: var(--paper-2); }
tr.covered td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 2px;
  background: var(--mark-soft);
  color: var(--mark-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}
.badge.acc { background: var(--accent-soft); color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
