:root {
  --bg: #f4f7fe;
  --surface: #ffffff;
  --surface-soft: #f7f9fe;
  --text: #223a57;
  --muted: #6d7f96;
  --line: #d8e3f2;
  --line-strong: #c4d5ea;
  --teal: #6f9fe8;
  --teal-dark: #3e68b0;
  --teal-soft: #eaf1ff;
  --blue: #4f82d8;
  --blue-soft: #edf3ff;
  --danger: #b83d4c;
  --shadow: 0 9px 28px rgba(22, 55, 59, .065);
  --radius: 13px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
.icon { width: 1em; height: 1em; display: inline-block; flex: 0 0 auto; }

.topbar {
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  width: min(100% - 32px, 1380px);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 230px 1fr 230px;
  align-items: center;
  gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; width: fit-content; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 11px; background: var(--teal); color: #fff; font-size: 20px;
}
.brand-text { display: grid; line-height: 1.02; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.page-name { justify-self: center; color: #45648a; font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.topbar-spacer { width: 1px; justify-self: end; }

.app-shell {
  width: min(100% - 32px, 1380px);
  margin: 18px auto 24px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.sidebar, .workspace {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sidebar {
  position: sticky;
  top: 86px;
  border-radius: var(--radius);
  overflow: hidden;
}
.sidebar-head {
  min-height: 76px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}
.section-icon {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; background: var(--teal-soft); color: var(--teal-dark); font-size: 19px;
}
.kicker { display: block; margin-bottom: 3px; color: #8a9b9e; font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0; color: var(--text); letter-spacing: -.025em; }
h1 { font-size: 17px; }
h2 { font-size: 19px; }

.control-form { padding: 17px; }
.form-section { margin: 0 0 18px; padding: 0; border: 0; }
.form-section-title {
  width: 100%; margin: 0 0 8px; padding: 0; color: #607a9e;
  font-size: 10px; font-weight: 850; letter-spacing: .025em;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span:first-child { color: #6d7f96; font-size: 10px; font-weight: 750; }
.input-unit {
  height: 42px; display: flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: 9px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-unit:focus-within { border-color: #8fb2ea; box-shadow: 0 0 0 3px rgba(111,159,232,.12); }
.input-unit input {
  min-width: 0; width: 100%; height: 100%; padding: 0 8px 0 11px;
  border: 0; outline: 0; background: transparent; color: var(--text);
  font-weight: 800; font-variant-numeric: tabular-nums;
}
.input-unit em { padding-right: 10px; color: #8da0a3; font-size: 10px; font-style: normal; font-weight: 800; }

.position-choices { display: grid; gap: 7px; }
.position-choice { position: relative; min-width: 0; cursor: pointer; }
.position-choice input { position: absolute; opacity: 0; pointer-events: none; }
.position-choice > span { pointer-events: none; }
.position-choice {
  min-height: 58px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.position-choice:hover { border-color: #b9d3d4; background: #fbfefe; }
.position-choice:has(input:checked) { border-color: #8fc5c6; background: #f3fbfa; box-shadow: inset 0 0 0 1px rgba(10,146,148,.03); }
.position-choice:has(input:focus-visible) { outline: 3px solid rgba(10,146,148,.18); outline-offset: 2px; }
.choice-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: #f3f7f7; color: #668184; font-size: 16px;
}
.position-choice:has(input:checked) .choice-mark { background: var(--teal-soft); color: var(--teal-dark); }
.choice-copy { min-width: 0; display: grid; gap: 3px; }
.choice-copy strong { color: #36595c; font-size: 10px; line-height: 1.25; }
.choice-copy small { overflow: hidden; color: #819497; font-size: 9px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }

.action-button {
  width: 100%; height: 44px; display: flex; justify-content: center; align-items: center; gap: 8px;
  border: 0; border-radius: 9px; background: var(--teal); color: #fff;
  font-size: 11px; font-weight: 850; cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.action-button:hover { background: var(--teal-dark); }
.action-button:active { transform: translateY(1px); }
.action-button:focus-visible, .icon-button:focus-visible { outline: 3px solid rgba(10,146,148,.22); outline-offset: 2px; }

.summary-card {
  margin: 0 17px 17px; min-height: 68px; padding: 10px 10px 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid #cce4e4; border-radius: 10px; background: #f2faf9;
}
.summary-card > div { min-width: 0; display: grid; gap: 3px; }
.summary-card span { color: #71898b; font-size: 9px; font-weight: 750; }
.summary-card strong { color: #315d60; font-size: 10px; font-weight: 850; font-variant-numeric: tabular-nums; }
.summary-card small { color: #799093; font-size: 8px; font-weight: 750; }
.summary-card b {
  width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 50%; background: var(--teal); color: #fff; font-size: 13px;
}
.summary-card.zero { border-color: #e1e6e7; background: #f8fafa; }
.summary-card.zero b { background: #93a5a7; }
.status-card { margin: 0 17px 17px; padding: 11px; display: flex; gap: 8px; border-radius: 9px; font-size: 10px; line-height: 1.45; }
.status-card.error { color: #8e3340; background: #fff4f5; border: 1px solid #f2ccd2; }

.workspace { min-width: 0; border-radius: var(--radius); overflow: hidden; }
.workspace-toolbar {
  min-height: 76px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line); background: #fff;
}
.math-chip, .angle-badge {
  display: inline-flex; align-items: center; white-space: nowrap;
  border: 1px solid #c9e0e1; background: #f5fbfb; color: #2d6f72;
  font-weight: 850; font-variant-numeric: tabular-nums;
}
.math-chip { min-height: 34px; padding: 0 11px; border-radius: 8px; font-size: 10px; }

.diagram-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.diagram-grid.single { grid-template-columns: minmax(0, 760px); justify-content: center; }
.math-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.math-card-head {
  min-height: 50px; padding: 8px 10px 8px 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line); background: #fff;
}
.math-card-head > div:first-child { display: grid; gap: 2px; }
.math-card-head span { color: #829598; font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.math-card-head strong { color: #284d50; font-size: 11px; }
.card-actions { display: flex; align-items: center; gap: 6px; }
.angle-badge { min-height: 28px; padding: 0 8px; border-radius: 7px; font-size: 9px !important; letter-spacing: 0 !important; text-transform: none !important; }
.icon-button {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: #648084; cursor: pointer; font-size: 15px;
}
.icon-button:hover { background: #f2f7f7; color: var(--teal-dark); }

.triangle-svg {
  display: block; width: 100%; height: auto; min-height: 330px;
  background-color: #fbfdfd;
  background-image:
    linear-gradient(#edf2f2 1px, transparent 1px),
    linear-gradient(90deg, #edf2f2 1px, transparent 1px);
  background-size: 24px 24px;
  touch-action: pan-y pinch-zoom;
  overscroll-behavior: auto;
  user-select: none;
}
.helper-axis { stroke: #a9babb; stroke-width: 1.4; stroke-dasharray: 6 6; }
.helper-circle { fill: none; stroke: #66aeb0; stroke-width: 1.6; stroke-dasharray: 7 6; opacity: .72; }
.helper-radius { stroke: #8db5b7; stroke-width: 1.4; stroke-dasharray: 4 5; opacity: .85; }
.helper-projection { stroke: #73999c; stroke-width: 1.5; stroke-dasharray: 5 4; }
.right-angle { fill: none; stroke: #7f999c; stroke-width: 1.5; }
.helper-text, .projection-name { fill: #668285; font-size: 10px; font-weight: 780; paint-order: stroke; stroke: #fbfdfd; stroke-width: 4px; stroke-linejoin: round; }
.projection-point { fill: #fff; stroke: #7e9a9d; stroke-width: 1.8; }
.triangle-fill { fill: rgba(10,146,148,.085); }
.edge { fill: none; stroke-width: 3.2; stroke-linecap: round; }
.edge-a { stroke: #079093; }
.edge-b { stroke: #146cc8; }
.edge-c { stroke: #587d82; }
.angle-arc { fill: none; stroke: #43a5a8; stroke-width: 2.1; }
.angle-text, .side-label, .vertex-name { paint-order: stroke; stroke: #fbfdfd; stroke-width: 4px; stroke-linejoin: round; }
.angle-text { fill: #286d70; font-size: 12px; font-weight: 850; }
.side-label { fill: #225f83; font-size: 10.5px; font-weight: 850; text-anchor: middle; }
.vertex-name { fill: #173e42; font-size: 12px; font-weight: 900; }
.vertex { vector-effect: non-scaling-stroke; }
.vertex.fixed { fill: #1c4d51; stroke: #1c4d51; }
.drag-hit { fill: transparent; stroke: transparent; pointer-events: all; cursor: grab; touch-action: none; }
.vertex.drag-handle { fill: #fff; stroke: var(--teal); stroke-width: 3; cursor: grab; pointer-events: none; }
.vertex.drag-handle:focus-visible { outline: none; filter: drop-shadow(0 0 4px rgba(10,146,148,.45)); }

.trig-row { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: #f8fbfb; }
.trig-row > div { min-width: 0; padding: 10px 11px; display: grid; gap: 3px; border-right: 1px solid var(--line); }
.trig-row > div:last-child { border-right: 0; }
.trig-row span { color: #648084; font-size: 9px; font-weight: 900; }
.trig-row strong { color: #1f6064; font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.trig-row small { color: #8c9ea0; font-size: 8px; font-weight: 750; }

.metric-row { display: grid; grid-template-columns: 1.45fr 1.75fr 1fr 1fr; border-top: 1px solid var(--line); }
.metric-row > div { min-width: 0; padding: 9px 10px; display: grid; gap: 3px; border-right: 1px solid var(--line); }
.metric-row > div:last-child { border-right: 0; }
.metric-row span { color: #839699; font-size: 8px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.metric-row strong { overflow: hidden; text-overflow: ellipsis; color: #35585c; font-size: 9px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.math-card.is-edited .math-card-head { background: #fbfefe; }
.math-card.is-edited .angle-badge { background: #fff8e9; border-color: #eadba8; color: #795f20; }

.rule-card {
  margin: 0 18px 12px;
  padding: 11px 12px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid #dce8e9; border-radius: 9px; background: #f9fbfb;
}
.rule-card.compact { margin-top: 0; }
.rule-icon {
  width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-size: 17px;
}
.rule-card > div { min-width: 0; display: grid; gap: 2px; }
.rule-card span:not(.rule-icon) { color: #819497; font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.rule-card strong { color: #34585c; font-size: 10px; }
.rule-card small { color: #6f878a; font-size: 9px; font-weight: 700; line-height: 1.4; font-variant-numeric: tabular-nums; }
.canvas-note {
  margin: 0 18px 18px; min-height: 36px; padding: 8px 12px;
  display: flex; align-items: center; gap: 8px; border-radius: 8px;
  background: #f6f9f9; color: #6e8588; font-size: 9px; line-height: 1.45;
}
.canvas-note .icon { color: var(--teal); font-size: 14px; }
.empty-state { min-height: 360px; padding: 40px 20px; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; color: #7e9295; }
.empty-state .icon { width: 34px; height: 34px; color: #a4b7b9; }
.empty-state strong { color: #3b5d60; font-size: 14px; }
.empty-state span { max-width: 420px; font-size: 11px; line-height: 1.5; }
.no-triangle .icon { color: #91a6a8; }

[data-mobile-section] { scroll-margin-top: 82px; }
.mobile-nav { display: none; }

.footer { padding: 0 16px 24px; color: #819598; font-size: 9px; }
.footer-inner { width: min(100%, 1380px); margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 7px; text-align: center; line-height: 1.5; }
.footer-inner span { white-space: nowrap; }
.footer-separator { color: #b0bec0; }

.fatal-wrap { min-height: 100vh; padding: 24px; display: grid; place-items: center; background: var(--bg); }
.fatal-card { width: min(100%, 420px); padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.fatal-icon { width: 44px; height: 44px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 12px; background: #fff1f3; color: var(--danger); font-size: 22px; }
.fatal-card h1 { margin-bottom: 8px; }
.fatal-card p { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.fatal-link { display: inline-flex; height: 38px; padding: 0 14px; align-items: center; justify-content: center; border-radius: 8px; background: var(--teal); color: #fff; text-decoration: none; font-size: 11px; font-weight: 800; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 300px minmax(0,1fr); }
  .diagram-grid { grid-template-columns: 1fr; }
  .diagram-grid.single { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .topbar-inner { grid-template-columns: 1fr auto; }
  .page-name { justify-self: end; }
  .topbar-spacer { display: none; }
  .app-shell { display: block; }
  .sidebar { position: static; margin-bottom: 14px; }
  .diagram-grid { padding: 12px; }
  .workspace-toolbar { min-height: 68px; }
  [data-mobile-section] { scroll-margin-top: 74px; }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(360px, calc(100% - 24px));
    min-height: 58px;
    padding: 5px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    border: 1px solid rgba(197, 218, 220, .95);
    border-radius: 17px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 12px 34px rgba(22,55,59,.16);
    backdrop-filter: blur(14px);
  }
  .mobile-nav-link {
    min-height: 48px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 12px; border: 0; background: transparent; color: #6d7f96;
    cursor: pointer; font-family: inherit; font-size: 11px; font-weight: 850;
    transition: background .18s ease, color .18s ease, transform .18s ease;
  }
  .mobile-nav-link .icon { width: 18px; height: 18px; }
  .mobile-nav-link.is-active { color: var(--teal-dark); background: var(--teal-soft); }
  .mobile-nav-link:active { transform: scale(.98); }
  .footer { padding-bottom: 12px; }
  .footer-inner { flex-wrap: wrap; gap: 3px 6px; }
  .footer-separator { display: none; }
}

@media (max-width: 560px) {
  .topbar { height: 62px; }
  .topbar-inner { width: min(100% - 20px, 1380px); }
  .brand-text small { display: none; }
  .page-name { font-size: 11px; }
  .app-shell { width: min(100% - 20px, 1380px); margin-top: 10px; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .workspace-toolbar { align-items: flex-start; }
  .math-chip { display: none; }
  .diagram-grid { gap: 10px; }
  .triangle-svg { min-height: 280px; }
  .trig-row strong { font-size: 11px; }
  .metric-row { grid-template-columns: 1fr 1fr; }
  .metric-row > div:nth-child(2) { border-right: 0; }
  .metric-row > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .rule-card { margin: 0 12px 10px; }
  .canvas-note { margin: 0 12px 12px; }
}

@media (max-width: 390px) {
  .choice-copy small { white-space: normal; }
  .trig-row > div { padding: 9px 8px; }
  .trig-row strong { font-size: 10px; }
}
.helper-point { fill: #fff; stroke: #4f9fa2; stroke-width: 1.8; }

/* Konstruksi tiga posisi sudut */
.condition-list { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); display: grid; gap: 7px; }
.condition-title { padding: 0 1px 4px; display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.condition-title span { color: #4f6d70; font-size: 10px; font-weight: 900; }
.condition-title small { color: #91a2a4; font-size: 8px; font-weight: 750; }
.condition-item {
  width: 100%; min-height: 58px; padding: 8px 9px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto;
  align-items: center; gap: 9px; text-align: left; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: inherit; cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.condition-item:hover { border-color: #aacfd0; background: #fbfefe; }
.condition-item.is-active { border-color: #78bfc1; background: #f0faf9; box-shadow: inset 3px 0 0 var(--teal); }
.condition-item.is-disabled { cursor: default; opacity: .7; background: #f8fafa; }
.condition-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #eef7f7; color: #127b7e; font-size: 13px; font-weight: 900; }
.condition-item.is-active .condition-number { background: var(--teal); color: #fff; }
.condition-copy { min-width: 0; display: grid; gap: 3px; }
.condition-copy strong { color: #31585b; font-size: 10px; font-weight: 900; }
.condition-copy small { color: #7f9496; font-size: 8.5px; line-height: 1.35; font-weight: 720; }
.condition-action { color: #6b888b; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.condition-item.is-active .condition-action { color: var(--teal-dark); }

.angle-summary { margin: 18px 18px 0; min-height: 66px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #cfe3e4; border-radius: 11px; background: #f6fbfb; }
.angle-summary > div { min-width: 0; display: grid; gap: 4px; }
.angle-summary span:first-child { color: #7b9093; font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.angle-summary strong { color: #245c60; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.sample-angle { flex: 0 0 auto; padding: 7px 9px; border: 1px solid #c7dfe0; border-radius: 8px; background: #fff; color: #2d6c6f !important; font-size: 9px !important; font-weight: 900 !important; letter-spacing: 0 !important; text-transform: none !important; }

.construction-grid { padding: 14px 18px 18px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; align-items: stretch; }
.construction-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.construction-card.panel-blue { border-top: 3px solid #4a9ad8; }
.construction-card.panel-green { border-top: 3px solid #4dbb7a; }
.construction-card.panel-amber { border-top: 3px solid #e7a83a; }
.construction-head { min-height: 58px; padding: 9px 11px; display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 8px; border-bottom: 1px solid var(--line); background: #f8fbff; }
.step-number { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: #eef6f7; color: #386d71; font-size: 11px; font-weight: 900; }
.panel-green .step-number { background: #edf8f0; color: #39885a; }
.panel-amber .step-number { background: #fff7e8; color: #a96f10; }
.construction-head > div { min-width: 0; display: grid; gap: 3px; }
.construction-head strong { color: #244b4e; font-size: 10px; line-height: 1.25; }
.construction-head small { color: #839699; font-size: 8px; font-weight: 800; }

.construction-svg { width: 100%; height: auto; display: block; background: #fcfefe; touch-action: pan-y pinch-zoom; user-select: none; }
.panel-blue .construction-svg { background: #f7fbfe; }
.panel-green .construction-svg { background: #f8fdf9; }
.panel-amber .construction-svg { background: #fffcf7; }
.axis-line { stroke: #aabbbc; stroke-width: 1.3; stroke-dasharray: 5 5; }
.construction-circle { fill: none; stroke: #e54b4b; stroke-width: 2.2; stroke-dasharray: 8 6; opacity: .88; }
.panel-amber .construction-circle { stroke: #3087d8; }
.angle-ray { stroke: #263f43; stroke-width: 3; stroke-linecap: round; }
.triangle-fill { fill: rgba(31, 151, 154, .10); }
.solution-2 { fill: rgba(44, 111, 203, .08); }
.solid-edge, .base-edge { stroke: #1f4549; stroke-width: 3; stroke-linecap: round; }
.opposite-edge { stroke: #0a9194; }
.base-edge { stroke: #1f4549; }
.vertex-point, .origin-point, .center-point { fill: #173e42; stroke: #fff; stroke-width: 2; }
.vertex-label { fill: #16383b; font-size: 12px; font-weight: 900; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.measure-label, .circle-label, .no-intersection { fill: #4c668f; font-size: 12px; font-weight: 900; text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 5px; }
.circle-label { text-anchor: end; fill: #6287bf; font-size: 11px; }
.panel-amber .circle-label { fill: #5a84c2; }
.no-intersection { fill: #8a555e; font-size: 11px; }
.angle-arc { fill: none; stroke: #27a0a3; stroke-width: 2.4; }
.angle-symbol { fill: #147b7e; font-size: 13px; font-weight: 900; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.trig-projection { stroke: #97aaac; stroke-width: 1.4; stroke-dasharray: 4 5; opacity: .8; }

.construction-result { min-height: 64px; padding: 10px 12px; display: grid; align-content: center; gap: 3px; border-top: 1px solid var(--line); background: #fff; text-align: center; }
.construction-result strong { color: #214f53; font-size: 14px; font-weight: 950; }
.construction-result span { color: #789093; font-size: 8.5px; font-weight: 740; line-height: 1.35; }
.panel-green .construction-result strong { color: #2f7e50; }
.panel-amber .construction-result strong { color: #a46b0d; }

.trig-summary { margin: 0 18px 14px; display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #f8fbff; }
.trig-summary > div { min-width: 0; padding: 10px 12px; display: grid; gap: 3px; border-right: 1px solid var(--line); }
.trig-summary > div:last-child { border-right: 0; }
.trig-summary span { color: #668184; font-size: 9px; font-weight: 900; }
.trig-summary strong { color: #245f63; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.trig-summary small { color: #91a1a3; font-size: 8px; font-weight: 750; }

.conclusion-card { margin: 0 18px 18px; min-height: 70px; padding: 11px 13px; display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 11px; align-items: center; border: 1px solid #d8d9ef; border-radius: 11px; background: #faf9ff; }
.conclusion-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #efedfb; color: #6758a5; font-size: 17px; }
.conclusion-card > div { min-width: 0; display: grid; gap: 3px; }
.conclusion-card span:not(.conclusion-icon) { color: #80799f; font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.conclusion-card strong { color: #51497a; font-size: 11px; font-weight: 900; }
.conclusion-card small { color: #8c87a2; font-size: 8.5px; font-weight: 720; }

@media (max-width: 1180px) {
  .construction-grid { grid-template-columns: 1fr 1fr; }
  .construction-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .angle-summary { margin: 12px 12px 0; align-items: flex-start; flex-direction: column; gap: 8px; }
  .angle-summary strong { font-size: 11px; line-height: 1.45; }
  .construction-grid { padding: 10px 12px 14px; grid-template-columns: 1fr; }
  .construction-card:last-child { grid-column: auto; }
  .construction-svg { max-height: 430px; }
  .trig-summary { margin: 0 12px 12px; }
  .conclusion-card { margin: 0 12px 14px; }
}

@media (max-width: 520px) {
  .condition-item { min-height: 62px; }
  .condition-copy small { white-space: normal; }
  .math-chip { max-width: 54vw; overflow: hidden; text-overflow: ellipsis; }
  .trig-summary > div { padding: 9px 8px; }
  .trig-summary strong { font-size: 11px; }
  .construction-svg { min-height: 0; }
}

/* Keterbacaan dan penjelasan batas sudut */
.derivation-card {
  margin: 14px 18px 2px;
  padding: 16px;
  border: 1px solid #cfe3e4;
  border-radius: 12px;
  background: #fbfefe;
}
.derivation-head {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr);
  gap: 11px;
  align-items: center;
  margin-bottom: 14px;
}
.derivation-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 20px;
}
.derivation-head > div { min-width: 0; display: grid; gap: 2px; }
.derivation-head span:not(.derivation-icon) {
  color: #6d8588;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.derivation-head h3 {
  margin: 0;
  color: #244d50;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -.015em;
}
.derivation-formula {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.derivation-formula > div {
  min-width: 0;
  padding: 13px 14px;
  display: grid;
  gap: 6px;
  align-content: start;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.derivation-formula > div:nth-child(2n) { border-right: 0; }
.derivation-formula > div:nth-last-child(-n+2) { border-bottom: 0; }
.derivation-formula span {
  color: #688285;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}
.derivation-formula strong {
  color: #254f53;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.derivation-formula .derivation-answer {
  background: #f0f9f8;
}
.derivation-formula .derivation-answer strong { color: #087476; font-size: 15px; }
.interval-explanation {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 4px solid #71bfc0;
  border-radius: 0 9px 9px 0;
  background: #f3f9f9;
  color: #496a6d;
}
.interval-explanation p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  font-weight: 650;
}
.interval-explanation p + p { margin-top: 7px; }
.interval-explanation strong { color: #24595d; }
.interval-explanation b { color: #087476; font-weight: 900; }

/* Ukuran teks utama: nyaman dibaca tanpa memperbesar browser */
.brand-text strong { font-size: 17px; }
.brand-text small { font-size: 10px; }
.page-name { font-size: 14px; }
.kicker { font-size: 10px; }
h1 { font-size: 19px; }
h2 { font-size: 21px; }
.form-section-title { font-size: 12px; }
.field > span:first-child { font-size: 11px; }
.input-unit input { font-size: 15px; }
.input-unit em { font-size: 11px; }
.action-button { font-size: 12px; }
.condition-title span { font-size: 12px; }
.condition-title small { font-size: 10px; }
.condition-number { font-size: 15px; }
.condition-copy strong { font-size: 12px; }
.condition-copy small { font-size: 10.5px; line-height: 1.45; }
.condition-action { font-size: 9.5px; }
.math-chip { font-size: 11px; }
.angle-summary span:first-child { font-size: 10px; }
.angle-summary strong { font-size: 16px; line-height: 1.45; }
.sample-angle { font-size: 11px !important; }
.construction-head strong { font-size: 12px; }
.construction-head small { font-size: 10px; }
.step-number { font-size: 13px; }
.vertex-label { font-size: 17px; stroke-width: 5px; }
.measure-label { font-size: 16px; stroke-width: 5px; }
.circle-label { font-size: 14px; stroke-width: 5px; }
.no-intersection { font-size: 15px; stroke-width: 5px; }
.angle-symbol { font-size: 18px; stroke-width: 5px; }
.construction-result strong { font-size: 17px; }
.construction-result span { font-size: 11px; line-height: 1.5; }
.trig-summary span { font-size: 11px; }
.trig-summary strong { font-size: 16px; }
.trig-summary small { font-size: 10px; }
.conclusion-card span:not(.conclusion-icon) { font-size: 10px; }
.conclusion-card strong { font-size: 14px; line-height: 1.5; }
.conclusion-card small { font-size: 11px; line-height: 1.5; }
.footer { font-size: 10px; }

@media (min-width: 1500px) {
  .topbar-inner, .app-shell { width: min(100% - 48px, 1540px); }
  .app-shell { grid-template-columns: 360px minmax(0,1fr); }
}

@media (max-width: 980px) {
  .derivation-formula { grid-template-columns: 1fr; }
  .derivation-formula > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .derivation-formula > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .derivation-formula > div:last-child { border-bottom: 0; }
}

@media (max-width: 860px) {
  .derivation-card { margin: 12px 12px 2px; padding: 14px; }
  .derivation-head h3 { font-size: 16px; }
  .derivation-formula strong { font-size: 14px; }
  .interval-explanation p { font-size: 12px; }
  .angle-summary strong { font-size: 15px; }
  .construction-head strong { font-size: 13px; }
  .construction-head small { font-size: 11px; }
  .construction-result span { font-size: 11px; }
}

@media (max-width: 520px) {
  .derivation-card { padding: 12px; }
  .derivation-head { grid-template-columns: 38px minmax(0,1fr); gap: 9px; }
  .derivation-icon { width: 38px; height: 38px; font-size: 18px; }
  .derivation-head span:not(.derivation-icon) { font-size: 10px; }
  .derivation-head h3 { font-size: 15px; }
  .derivation-formula > div { padding: 11px 12px; }
  .derivation-formula span { font-size: 11px; }
  .derivation-formula strong { font-size: 13px; }
  .derivation-formula .derivation-answer strong { font-size: 14px; }
  .interval-explanation { padding: 11px 12px; }
  .interval-explanation p { font-size: 12px; line-height: 1.6; }
  .condition-copy strong { font-size: 12px; }
  .condition-copy small { font-size: 10.5px; }
  .construction-svg { min-height: 300px; }
  .trig-summary strong { font-size: 14px; }
}

/* Dialog kondisi yang tidak mungkin */
.condition-item.is-impossible { background: #fbfcfc; border-style: dashed; }
.condition-item.is-impossible:hover,
.condition-item.is-impossible:focus-visible { border-color: #8bbfc1; background: #f4fafa; outline: none; box-shadow: 0 0 0 3px rgba(10,146,148,.08); }
.condition-item.is-impossible .condition-action { color: var(--teal-dark); }
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px;
  background: rgba(16, 39, 42, .48); backdrop-filter: blur(4px);
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  position: relative; width: min(100%, 520px); padding: 24px;
  border: 1px solid #d4e4e5; border-radius: 16px; background: #fff;
  box-shadow: 0 24px 70px rgba(17, 45, 48, .24);
}
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: #f1f6f6; color: #496b6e;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-close:hover, .modal-close:focus-visible { background: #e8f3f3; color: var(--teal-dark); outline: 2px solid rgba(10,146,148,.2); outline-offset: 2px; }
.modal-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 13px; background: var(--teal-soft); color: var(--teal-dark); font-size: 24px; }
.modal-card h2 { margin: 3px 44px 14px 0; font-size: 22px; line-height: 1.25; }
.modal-copy { color: #526f72; font-size: 14px; line-height: 1.65; }
.modal-copy p { margin: 0; }
.modal-copy p + p { margin-top: 12px; }
.modal-equation { margin: 16px 0; display: grid; grid-template-columns: repeat(3,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.modal-equation span { padding: 12px; display: grid; gap: 5px; text-align: center; border-right: 1px solid var(--line); background: #f8fbff; font-size: 12px; font-weight: 750; }
.modal-equation span:last-child { border-right: 0; }
.modal-equation b { color: var(--teal-dark); font-size: 14px; }
.modal-result { padding: 12px 14px; border-radius: 10px; background: var(--teal-soft); color: #245e61; text-align: center; }
.modal-result strong { font-size: 18px; }
.modal-primary { width: 100%; min-height: 44px; margin-top: 20px; border: 0; border-radius: 10px; background: var(--teal); color: #fff; font-size: 13px; font-weight: 850; cursor: pointer; }
.modal-primary:hover { background: var(--teal-dark); }

/* Kesimpulan dibuat sebagai penjelasan, bukan angka yang berdiri sendiri */
.conclusion-card { align-items: start; padding: 15px 16px; }
.conclusion-content { gap: 8px !important; }
.conclusion-content > span { margin-bottom: 1px; }
.conclusion-card p { margin: 0; color: #655f80; font-size: 13px; line-height: 1.6; font-weight: 680; }
.conclusion-card p strong { color: #51497a; font-size: inherit; }
.conclusion-lead { color: #51497a !important; }
.conclusion-breakdown { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: hidden; border: 1px solid #deddf0; border-radius: 9px; background: #fff; }
.conclusion-breakdown span { padding: 9px 10px; display: flex; justify-content: space-between; gap: 8px; border-right: 1px solid #deddf0; color: #716b8d !important; font-size: 11px !important; font-weight: 760 !important; letter-spacing: 0 !important; text-transform: none !important; }
.conclusion-breakdown span:last-child { border-right: 0; }
.conclusion-breakdown b { color: #51497a; font-size: 13px; }

/* Tidak lagi menampilkan panel nilai sin/cos/tan terpisah. */
.trig-summary { display: none; }

@media (max-width: 620px) {
  .modal-card { padding: 20px; border-radius: 14px; }
  .modal-card h2 { font-size: 20px; }
  .modal-equation { grid-template-columns: 1fr; }
  .modal-equation span { border-right: 0; border-bottom: 1px solid var(--line); text-align: left; grid-template-columns: 1fr auto; align-items: center; }
  .modal-equation span:last-child { border-bottom: 0; }
  .conclusion-breakdown { grid-template-columns: 1fr; }
  .conclusion-breakdown span { border-right: 0; border-bottom: 1px solid #deddf0; }
  .conclusion-breakdown span:last-child { border-bottom: 0; }
  .conclusion-card p { font-size: 12.5px; }
}

/* Notasi matematika: pecahan ditulis sebagai pembilang/pernyebut, bukan simbol bagi. */
.math-frac {
  display: inline-grid;
  grid-template-rows: auto auto;
  min-width: 2.15em;
  margin: 0 .12em;
  text-align: center;
  vertical-align: middle;
  line-height: 1.05;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.math-frac-top {
  display: block;
  padding: 0 .22em .12em;
  border-bottom: 1.6px solid currentColor;
}
.math-frac-bottom {
  display: block;
  padding: .12em .22em 0;
}
.math-lines {
  display: grid !important;
  gap: 4px;
}
.math-lines > span { display: block; }
.math-lines em {
  margin-left: 7px;
  color: #789093;
  font-size: .78em;
  font-style: normal;
  font-weight: 750;
}
.math-lines var,
.conclusion-card var {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
}
.math-expression {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  line-height: 1.25 !important;
}
.inline-math {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  white-space: normal;
}
.derivation-formula .math-frac { font-size: 1.05em; }
.conclusion-card .math-frac { font-size: .96em; }

@media (max-width: 520px) {
  .math-expression { gap: 3px; }
  .math-lines em { display: block; margin: 2px 0 0; }
}

/* =========================================================
   Aksesibilitas tampilan
   ========================================================= */
:root {
  --reading-scale: 1;
  --focus-ring: rgba(10,146,148,.24);
}

html[data-text-size="large"] { --reading-scale: 1.12; }
html[data-text-size="xlarge"] { --reading-scale: 1.24; }

/* Ukuran dasar dibuat lebih nyaman dibaca, termasuk pada layar besar. */
body { font-size: calc(16px * var(--reading-scale)); line-height: 1.5; }
.brand-text strong { font-size: calc(18px * var(--reading-scale)); }
.brand-text small { font-size: calc(11px * var(--reading-scale)); }
.page-name { font-size: calc(15px * var(--reading-scale)); }
.kicker { font-size: calc(11px * var(--reading-scale)); }
h1 { font-size: calc(20px * var(--reading-scale)); line-height: 1.25; }
h2 { font-size: calc(22px * var(--reading-scale)); line-height: 1.25; }
.form-section-title { font-size: calc(13px * var(--reading-scale)); }
.field > span:first-child { font-size: calc(12.5px * var(--reading-scale)); }
.input-unit { min-height: 48px; height: auto; }
.input-unit input { font-size: calc(16px * var(--reading-scale)); padding-block: 10px; }
.input-unit em { font-size: calc(12px * var(--reading-scale)); }
.action-button { min-height: 48px; height: auto; padding: 10px 14px; font-size: calc(13.5px * var(--reading-scale)); }
.condition-title span { font-size: calc(13px * var(--reading-scale)); }
.condition-title small { font-size: calc(11px * var(--reading-scale)); }
.condition-item { min-height: 66px; }
.condition-number { font-size: calc(15px * var(--reading-scale)); }
.condition-copy strong { font-size: calc(13px * var(--reading-scale)); line-height: 1.3; }
.condition-copy small { font-size: calc(11.5px * var(--reading-scale)); line-height: 1.45; }
.condition-action { font-size: calc(10.5px * var(--reading-scale)); }
.math-chip { font-size: calc(12px * var(--reading-scale)); }
.angle-summary span:first-child { font-size: calc(11px * var(--reading-scale)); }
.angle-summary strong { font-size: calc(17px * var(--reading-scale)); }
.sample-angle { font-size: calc(12px * var(--reading-scale)) !important; }
.derivation-head span:not(.derivation-icon) { font-size: calc(11.5px * var(--reading-scale)); }
.derivation-head h3 { font-size: calc(19px * var(--reading-scale)); }
.derivation-formula span { font-size: calc(13px * var(--reading-scale)); }
.derivation-formula strong { font-size: calc(16px * var(--reading-scale)); line-height: 1.55; }
.derivation-formula .derivation-answer strong { font-size: calc(17px * var(--reading-scale)); }
.interval-explanation p { font-size: calc(13.5px * var(--reading-scale)); line-height: 1.65; }
.construction-head strong { font-size: calc(13px * var(--reading-scale)); }
.construction-head small { font-size: calc(11px * var(--reading-scale)); }
.step-number { font-size: calc(13px * var(--reading-scale)); }
.construction-result strong { font-size: calc(18px * var(--reading-scale)); }
.construction-result span { font-size: calc(12.5px * var(--reading-scale)); line-height: 1.5; }
.conclusion-content > span { font-size: calc(11px * var(--reading-scale)) !important; }
.conclusion-card p { font-size: calc(14px * var(--reading-scale)); line-height: 1.65; }
.conclusion-breakdown span { font-size: calc(12px * var(--reading-scale)) !important; }
.conclusion-breakdown b { font-size: calc(14px * var(--reading-scale)); }
.footer { font-size: calc(11px * var(--reading-scale)); }
.modal-card h2 { font-size: calc(22px * var(--reading-scale)); }
.modal-copy { font-size: calc(14px * var(--reading-scale)); }
.modal-equation span { font-size: calc(12px * var(--reading-scale)); }
.modal-equation b { font-size: calc(14px * var(--reading-scale)); }
.modal-result strong { font-size: calc(18px * var(--reading-scale)); }
.modal-primary { font-size: calc(13px * var(--reading-scale)); }
.mobile-nav-link { font-size: calc(12px * var(--reading-scale)); }

/* Label pada gambar juga ikut terbaca lebih jelas. */
.vertex-label { font-size: calc(16px * var(--reading-scale)); stroke-width: 5px; }
.measure-label { font-size: calc(15px * var(--reading-scale)); stroke-width: 5px; }
.circle-label { font-size: calc(13px * var(--reading-scale)); stroke-width: 5px; }
.no-intersection { font-size: calc(14px * var(--reading-scale)); stroke-width: 5px; }
.angle-symbol { font-size: calc(17px * var(--reading-scale)); stroke-width: 5px; }

/* Tombol tampilan */
.accessibility-wrap { position: relative; justify-self: end; }
.accessibility-trigger {
  min-height: 40px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: #46676a;
  cursor: pointer;
  font-size: calc(12px * var(--reading-scale));
  font-weight: 850;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.accessibility-trigger .icon { width: 18px; height: 18px; color: var(--teal-dark); }
.accessibility-trigger:hover { border-color: #a8cbcd; background: var(--surface-soft); color: var(--teal-dark); }
.accessibility-trigger:active { transform: translateY(1px); }
.accessibility-trigger:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.accessibility-trigger[aria-expanded="true"] { border-color: #82bec0; background: var(--teal-soft); color: var(--teal-dark); }

.accessibility-panel {
  position: absolute;
  z-index: 70;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  padding: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 18px 52px rgba(19,50,53,.18);
}
.accessibility-panel[hidden] { display: none; }
.accessibility-head { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 10px; align-items: center; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.accessibility-head-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--teal-soft); color: var(--teal-dark); font-size: 20px; }
.accessibility-head > div { display: grid; gap: 2px; }
.accessibility-head strong { color: var(--text); font-size: calc(14px * var(--reading-scale)); }
.accessibility-head small { color: var(--muted); font-size: calc(11px * var(--reading-scale)); }
.accessibility-group { padding-top: 13px; display: grid; gap: 8px; }
.accessibility-label { display: inline-flex; align-items: center; gap: 7px; color: #526f72; }
.accessibility-label .icon { width: 17px; height: 17px; color: var(--teal-dark); }
.accessibility-label b { font-size: calc(12px * var(--reading-scale)); }
.accessibility-options { display: grid; gap: 7px; }
.text-options { grid-template-columns: repeat(3, minmax(0,1fr)); }
.theme-options { grid-template-columns: repeat(2, minmax(0,1fr)); }
.accessibility-options button {
  min-width: 0;
  min-height: 50px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: #587477;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}
.accessibility-options button:hover { border-color: #9ec7c8; }
.accessibility-options button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.accessibility-options button[aria-pressed="true"] { border-color: #6db8ba; background: var(--teal-soft); color: var(--teal-dark); box-shadow: inset 0 0 0 1px rgba(10,146,148,.05); }
.accessibility-options button b { min-width: 0; font-size: calc(11px * var(--reading-scale)); line-height: 1.2; }
.text-options button span { line-height: 1; font-weight: 900; }
.text-options button:nth-child(1) span { font-size: 14px; }
.text-options button:nth-child(2) span { font-size: 18px; }
.text-options button:nth-child(3) span { font-size: 22px; }
.theme-options button .icon { width: 19px; height: 19px; flex: 0 0 auto; }

/* Tema gelap lembut: kontras cukup tanpa latar hitam pekat. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #172224;
  --surface: #1f2d2f;
  --surface-soft: #253537;
  --text: #eef7f6;
  --muted: #b2c4c4;
  --line: #35494b;
  --line-strong: #486163;
  --teal: #159b9b;
  --teal-dark: #69d0cd;
  --teal-soft: #173e40;
  --blue: #6eafea;
  --blue-soft: #22384c;
  --danger: #ff8e9b;
  --shadow: 0 12px 34px rgba(0,0,0,.22);
  --focus-ring: rgba(105,208,205,.28);
}
html[data-theme="dark"] body,
html[data-theme="dark"] .fatal-wrap { background: var(--bg); color: var(--text); }
html[data-theme="dark"] .topbar { background: rgba(31,45,47,.96); }
html[data-theme="dark"] .page-name,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] .workspace-toolbar,
html[data-theme="dark"] .sidebar-head,
html[data-theme="dark"] .construction-head strong,
html[data-theme="dark"] .condition-copy strong,
html[data-theme="dark"] .derivation-head h3 { color: var(--text); }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .workspace,
html[data-theme="dark"] .workspace-toolbar,
html[data-theme="dark"] .sidebar-head,
html[data-theme="dark"] .math-card,
html[data-theme="dark"] .math-card-head,
html[data-theme="dark"] .construction-card,
html[data-theme="dark"] .construction-head,
html[data-theme="dark"] .construction-result,
html[data-theme="dark"] .derivation-card,
html[data-theme="dark"] .derivation-formula,
html[data-theme="dark"] .condition-item,
html[data-theme="dark"] .input-unit,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .fatal-card { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .sidebar-head,
html[data-theme="dark"] .construction-head { background: #223234; }
html[data-theme="dark"] .input-unit input { color: var(--text); }
html[data-theme="dark"] .input-unit em,
html[data-theme="dark"] .field > span:first-child,
html[data-theme="dark"] .form-section-title,
html[data-theme="dark"] .kicker,
html[data-theme="dark"] .condition-copy small,
html[data-theme="dark"] .condition-title small,
html[data-theme="dark"] .construction-head small,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .derivation-head span:not(.derivation-icon),
html[data-theme="dark"] .derivation-formula span,
html[data-theme="dark"] .accessibility-head small { color: var(--muted); }
html[data-theme="dark"] .condition-title span,
html[data-theme="dark"] .accessibility-trigger,
html[data-theme="dark"] .accessibility-label,
html[data-theme="dark"] .accessibility-options button { color: #c8d9d9; }
html[data-theme="dark"] .condition-item:hover,
html[data-theme="dark"] .condition-item.is-impossible,
html[data-theme="dark"] .accessibility-options button,
html[data-theme="dark"] .accessibility-trigger { background: var(--surface-soft); }
html[data-theme="dark"] .condition-item.is-active,
html[data-theme="dark"] .accessibility-trigger[aria-expanded="true"],
html[data-theme="dark"] .accessibility-options button[aria-pressed="true"] { background: var(--teal-soft); }
html[data-theme="dark"] .angle-summary,
html[data-theme="dark"] .math-chip,
html[data-theme="dark"] .summary-card { background: #203638; border-color: #375457; }
html[data-theme="dark"] .angle-summary strong,
html[data-theme="dark"] .math-chip,
html[data-theme="dark"] .sample-angle { color: #a7e6e3 !important; }
html[data-theme="dark"] .sample-angle { background: #24383a; border-color: #486466; }
html[data-theme="dark"] .derivation-formula .derivation-answer { background: #1b3a3b; }
html[data-theme="dark"] .derivation-formula strong,
html[data-theme="dark"] .derivation-formula .derivation-answer strong { color: #d8f2f0; }
html[data-theme="dark"] .interval-explanation { background: #203638; color: #c3d7d7; border-left-color: #58bcbc; }
html[data-theme="dark"] .interval-explanation strong { color: #e4f6f5; }
html[data-theme="dark"] .interval-explanation b { color: #7bd9d5; }
html[data-theme="dark"] .panel-blue .construction-svg,
html[data-theme="dark"] .panel-green .construction-svg,
html[data-theme="dark"] .panel-amber .construction-svg,
html[data-theme="dark"] .construction-svg,
html[data-theme="dark"] .triangle-svg { background-color: #1c292b; background-image: none; }
html[data-theme="dark"] .triangle-fill { fill: rgba(36,176,174,.14); }
html[data-theme="dark"] .axis-line,
html[data-theme="dark"] .helper-axis { stroke: #617779; }
html[data-theme="dark"] .vertex-label,
html[data-theme="dark"] .measure-label,
html[data-theme="dark"] .circle-label,
html[data-theme="dark"] .no-intersection,
html[data-theme="dark"] .angle-symbol,
html[data-theme="dark"] .angle-text,
html[data-theme="dark"] .side-label,
html[data-theme="dark"] .vertex-name,
html[data-theme="dark"] .helper-text,
html[data-theme="dark"] .projection-name { stroke: #1c292b; }
html[data-theme="dark"] .vertex-label,
html[data-theme="dark"] .vertex-name { fill: #f1fbfa; }
html[data-theme="dark"] .measure-label,
html[data-theme="dark"] .helper-text,
html[data-theme="dark"] .projection-name { fill: #c1d6d6; }
html[data-theme="dark"] .angle-symbol,
html[data-theme="dark"] .angle-text { fill: #75d8d4; }
html[data-theme="dark"] .conclusion-card { background: #29283a; border-color: #45435c; }
html[data-theme="dark"] .conclusion-card p,
html[data-theme="dark"] .conclusion-lead,
html[data-theme="dark"] .conclusion-card p strong,
html[data-theme="dark"] .conclusion-content > span { color: #dedaf4 !important; }
html[data-theme="dark"] .conclusion-breakdown { background: #222d35; border-color: #454b5c; }
html[data-theme="dark"] .conclusion-breakdown span { color: #d3d7e8 !important; border-color: #454b5c; }
html[data-theme="dark"] .conclusion-breakdown b { color: #f0edff; }
html[data-theme="dark"] .modal-backdrop { background: rgba(5,12,13,.68); }
html[data-theme="dark"] .modal-copy { color: #c5d6d6; }
html[data-theme="dark"] .modal-equation { border-color: var(--line); }
html[data-theme="dark"] .modal-equation span { background: #243335; border-color: var(--line); }
html[data-theme="dark"] .modal-result { background: var(--teal-soft); color: #c8eeec; }
html[data-theme="dark"] .modal-close { background: #2a3b3d; color: #d8e8e8; }
html[data-theme="dark"] .accessibility-panel { background: #1f2d2f; box-shadow: 0 18px 58px rgba(0,0,0,.42); }
html[data-theme="dark"] .mobile-nav { background: rgba(31,45,47,.96); border-color: #42595b; }
html[data-theme="dark"] .mobile-nav-link { color: #aebfc0; }
html[data-theme="dark"] .mobile-nav-link.is-active { color: #9de0dd; background: var(--teal-soft); }

@media (max-width: 860px) {
  .accessibility-trigger span { display: inline; }
  .accessibility-trigger { min-height: 42px; padding: 0 14px; gap: 8px; }
  .accessibility-panel { position: fixed; top: 72px; right: 12px; }
  .condition-copy strong { font-size: calc(13.5px * var(--reading-scale)); }
  .condition-copy small { font-size: calc(12px * var(--reading-scale)); }
  .derivation-head h3 { font-size: calc(18px * var(--reading-scale)); }
  .derivation-formula span { font-size: calc(13px * var(--reading-scale)); }
  .derivation-formula strong { font-size: calc(15.5px * var(--reading-scale)); }
  .interval-explanation p { font-size: calc(13.5px * var(--reading-scale)); }
}

@media (max-width: 560px) {
  .topbar-inner { grid-template-columns: 1fr auto auto; gap: 8px; }
  .page-name { font-size: calc(12.5px * var(--reading-scale)); }
  .accessibility-panel { top: 66px; left: 10px; right: 10px; width: auto; }
  .text-options { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .accessibility-options button b { font-size: calc(10.5px * var(--reading-scale)); }
  .derivation-formula > div { padding: 13px; }
  .construction-result strong { font-size: calc(17px * var(--reading-scale)); }
  .construction-result span { font-size: calc(12px * var(--reading-scale)); }
  .conclusion-card p { font-size: calc(13.5px * var(--reading-scale)); }
}

@media (max-width: 390px) {
  .page-name { display: none; }
  .topbar-inner { grid-template-columns: 1fr auto; }
  .accessibility-trigger span { display: inline; font-size: calc(12px * var(--reading-scale)); }
  .accessibility-options button { padding-inline: 5px; }
  .text-options button b { font-size: calc(9.5px * var(--reading-scale)); }
}

@media (max-width: 860px) {
  .topbar-inner { grid-template-columns: 1fr auto auto; gap: 10px; }
  .accessibility-wrap { grid-column: auto; }
}

html[data-theme="dark"] .angle-ray,
html[data-theme="dark"] .solid-edge,
html[data-theme="dark"] .base-edge { stroke: #d5e8e8; }
html[data-theme="dark"] .opposite-edge { stroke: #3bc5c3; }
html[data-theme="dark"] .vertex-point,
html[data-theme="dark"] .origin-point,
html[data-theme="dark"] .center-point { fill: #e3f4f3; stroke: #1c292b; }
html[data-theme="dark"] .circle-label { fill: #ffb6b8; }
html[data-theme="dark"] .panel-amber .circle-label { fill: #9fcdf6; }
html[data-theme="dark"] .no-intersection { fill: #ffadb7; }
html[data-theme="dark"] .construction-result strong { color: #e6f5f4; }
html[data-theme="dark"] .construction-result span { color: #b7caca; }
html[data-theme="dark"] .panel-green .construction-result strong { color: #89dfab; }
html[data-theme="dark"] .panel-amber .construction-result strong { color: #ffd07d; }
html[data-theme="dark"] .conclusion-icon { background: #393552; color: #c8bdf7; }

/* =========================================================
   Sistem warna biru pastel + tema gelap biru (v39)
   ========================================================= */
:root {
  --bg: #f2f6fc;
  --surface: #fbfdff;
  --surface-soft: #f1f6fc;
  --text: #1c3552;
  --muted: #6f8399;
  --line: #d8e4f0;
  --line-strong: #bfd2e5;
  --teal: #6f9fe8;
  --teal-dark: #436fb8;
  --teal-soft: #e7f0fb;
  --blue: #4f82c3;
  --blue-soft: #edf4fc;
  --danger: #b65166;
  --shadow: 0 10px 30px rgba(53, 86, 126, .08);
  --focus-ring: rgba(91, 143, 216, .26);
}

body { background: var(--bg); color: var(--text); }
.topbar { background: rgba(251,253,255,.96); border-color: var(--line); }
.brand-mark { background: #6f9fe8; box-shadow: 0 5px 14px rgba(68,116,178,.18); }
.brand-text small, .kicker { color: #748aa2; }
.page-name { color: #405d7d; }
.sidebar, .workspace { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow); }
.sidebar-head, .workspace-toolbar, .construction-head { background: #f7faff; border-color: var(--line); }
.section-icon, .derivation-icon, .conclusion-icon, .modal-icon {
  background: #e6f0fb;
  color: #3e73b6;
}
.form-section-title, .field > span:first-child, .condition-title span { color: #607a96; }
.input-unit { background: #fff; border-color: var(--line-strong); }
.input-unit:focus-within { border-color: #7fa7d8; box-shadow: 0 0 0 3px rgba(91,143,216,.12); }
.input-unit em { color: #8094aa; }
.action-button { background: #6f9fe8; box-shadow: 0 5px 14px rgba(65,111,169,.14); }
.action-button:hover { background: #477fc6; }

.condition-item { background: #fcfdff; border-color: var(--line); }
.condition-item:hover { background: #f4f8fd; border-color: #b9cde2; }
.condition-item.is-active { background: #eaf2fc; border-color: #91b4df; box-shadow: inset 3px 0 0 #6f9fe8; }
.condition-number { background: #eaf2fb; color: #426f9f; }
.condition-item.is-active .condition-number { background: #6f9fe8; color: #fff; }
.condition-copy strong { color: #31506f; }
.condition-copy small, .condition-title small { color: #7c90a5; }
.condition-action, .condition-item.is-active .condition-action, .condition-item.is-impossible .condition-action { color: #4273ad; }
.condition-item.is-impossible { background: #f8fbff; border-color: #ccdaea; }
.condition-item.is-impossible:hover, .condition-item.is-impossible:focus-visible { background: #edf4fc; border-color: #9db9d9; box-shadow: 0 0 0 3px rgba(91,143,216,.10); }

.angle-summary, .summary-card, .math-chip { background: #eef5fc; border-color: #ccdef0; }
.angle-summary strong, .math-chip, .sample-angle { color: #315f96 !important; }
.sample-angle { background: #fbfdff; border-color: #c4d7eb; }

.derivation-card { border-color: #d2e0ee; background: #fbfdff; }
.derivation-formula { border-color: #d4e1ef; background: #fbfdff; }
.derivation-formula > div { border-color: #d4e1ef; }
.derivation-formula > div:nth-child(odd) { background: #fbfdff; }
.derivation-formula > div:nth-child(even) { background: #f5f9fe; }
.derivation-formula .derivation-answer { background: #edf4fc; }
.derivation-formula strong, .derivation-formula .derivation-answer strong { color: #315f96; }
.interval-explanation { background: #f0f6fd; border-left-color: #7ea7d6; color: #48647f; }
.interval-explanation strong { color: #284e78; }
.interval-explanation b { color: #356eaf; }

/* Tiga konstruksi tetap dibedakan, tetapi semuanya berada dalam keluarga biru pastel. */
.construction-card { background: #fbfdff; border-color: var(--line); }
.construction-card.panel-blue { border-top-color: #6798d3; }
.construction-card.panel-green { border-top-color: #7fa6cd; }
.construction-card.panel-amber { border-top-color: #8e9fd1; }
.step-number { background: #eaf2fb; color: #426f9f; }
.panel-green .step-number { background: #edf4fb; color: #52769b; }
.panel-amber .step-number { background: #eff1fb; color: #5f6f9f; }
.panel-blue .construction-svg { background: #f4f8fd; }
.panel-green .construction-svg { background: #f5f8fc; }
.panel-amber .construction-svg { background: #f7f7fc; }
.triangle-fill { fill: rgba(91,143,216,.12); }
.solution-2 { fill: rgba(108,139,198,.10); }
.opposite-edge { stroke: #6f9fe8; }
.angle-arc { stroke: #6c9ad0; }
.angle-symbol { fill: #356eaf; }
.vertex-point, .origin-point, .center-point { fill: #244b73; }
.measure-label { fill: #4f6e96; }
.panel-green .construction-result strong { color: #496f97; }
.panel-amber .construction-result strong { color: #596b9c; }
.construction-result { background: #fbfdff; border-color: var(--line); }
.construction-result strong { color: #315574; }
.construction-result span { color: #788da3; }

.conclusion-card { background: #f2f5fc; border-color: #d7deed; }
.conclusion-icon { background: #e5ecfa; color: #536fa9; }
.conclusion-card p, .conclusion-lead, .conclusion-card p strong, .conclusion-content > span { color: #4f6282 !important; }
.conclusion-breakdown { background: #fbfdff; border-color: #d8e2ef; }
.conclusion-breakdown span { color: #61758f !important; border-color: #d8e2ef; }
.conclusion-breakdown b { color: #3e5576; }

/* Aksesibilitas: ikon yang jelas dan tidak terlihat polos. */
.accessibility-trigger {
  background: #edf4fc;
  border-color: #b8cee5;
  color: #315f96;
}
.accessibility-trigger .icon { width: 19px; height: 19px; color: #3d73b6; }
.accessibility-trigger:hover, .accessibility-trigger[aria-expanded="true"] { background: #e2edf9; border-color: #89add6; color: #285b94; }
.accessibility-panel { background: #fbfdff; border-color: #c5d7e8; box-shadow: 0 18px 54px rgba(55,83,119,.20); }
.accessibility-head-icon { background: #e5effb; color: #3d73b6; }
.accessibility-head-icon .icon { width: 22px; height: 22px; }
.accessibility-label { color: #526d89; }
.accessibility-label .icon { color: #4f7fb8; }
.accessibility-options button {
  min-height: 56px;
  background: #f4f8fd;
  border-color: #d2dfec;
  color: #4f6882;
}
.accessibility-options button:hover { background: #edf4fc; border-color: #aac1dc; }
.accessibility-options button[aria-pressed="true"] { background: #e5effb; border-color: #83a9d4; color: #2f619a; box-shadow: inset 0 0 0 1px rgba(91,143,216,.05); }
.accessibility-options .option-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: #e7eff9;
  color: #4c78ad;
}
.accessibility-options .option-icon .icon { width: 20px; height: 20px; }
.accessibility-options button[aria-pressed="true"] .option-icon { background: #d5e5f7; color: #2f619a; }
.text-options button, .theme-options button { flex-direction: column; gap: 5px; }
.text-options button b, .theme-options button b { font-size: calc(11px * var(--reading-scale)); }
.theme-options button .option-icon .icon { width: 21px; height: 21px; }

.modal-result { background: #e8f1fb; color: #315f96; }
.modal-primary { background: #6f9fe8; }
.modal-primary:hover { background: #477fc6; }
.modal-close:hover, .modal-close:focus-visible { background: #e8f1fb; color: #356eaf; outline-color: rgba(91,143,216,.22); }
.mobile-nav-link.is-active { color: #356eaf; background: #e7f0fb; }

/* Gelap lembut: navy gelap, bukan hijau/teal. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1320;
  --surface: #111d2d;
  --surface-soft: #17263a;
  --text: #e8f0fa;
  --muted: #9bacc0;
  --line: #263b55;
  --line-strong: #35516f;
  --teal: #6f9fd8;
  --teal-dark: #9bc2ef;
  --teal-soft: #1a3150;
  --blue: #82ade0;
  --blue-soft: #172b45;
  --danger: #f08a9c;
  --shadow: 0 14px 36px rgba(0,0,0,.30);
  --focus-ring: rgba(126,174,230,.30);
}
html[data-theme="dark"] body,
html[data-theme="dark"] .fatal-wrap { background: #0b1320; color: var(--text); }
html[data-theme="dark"] .topbar { background: rgba(13,23,37,.97); border-color: #24394f; }
html[data-theme="dark"] .brand-mark { background: #507fba; box-shadow: none; }
html[data-theme="dark"] .page-name { color: #d5e1ef; }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .workspace,
html[data-theme="dark"] .workspace-toolbar,
html[data-theme="dark"] .sidebar-head,
html[data-theme="dark"] .math-card,
html[data-theme="dark"] .math-card-head,
html[data-theme="dark"] .construction-card,
html[data-theme="dark"] .construction-head,
html[data-theme="dark"] .construction-result,
html[data-theme="dark"] .derivation-card,
html[data-theme="dark"] .derivation-formula,
html[data-theme="dark"] .condition-item,
html[data-theme="dark"] .input-unit,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .fatal-card { background: #111d2d; border-color: #263b55; }
html[data-theme="dark"] .sidebar-head,
html[data-theme="dark"] .workspace-toolbar,
html[data-theme="dark"] .construction-head { background: #142236; }
html[data-theme="dark"] .section-icon,
html[data-theme="dark"] .derivation-icon,
html[data-theme="dark"] .conclusion-icon,
html[data-theme="dark"] .modal-icon { background: #1b3555; color: #9bc2ef; }
html[data-theme="dark"] .condition-item:hover,
html[data-theme="dark"] .condition-item.is-impossible { background: #16263a; border-color: #35516f; }
html[data-theme="dark"] .condition-item.is-active { background: #1a3150; border-color: #527dab; box-shadow: inset 3px 0 0 #6f9fd8; }
html[data-theme="dark"] .condition-number { background: #1c3049; color: #a7c5e8; }
html[data-theme="dark"] .condition-item.is-active .condition-number { background: #6f9fd8; color: #0b1320; }
html[data-theme="dark"] .condition-copy strong,
html[data-theme="dark"] .construction-head strong,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] .derivation-head h3 { color: #e8f0fa; }
html[data-theme="dark"] .condition-copy small,
html[data-theme="dark"] .condition-title small,
html[data-theme="dark"] .construction-head small,
html[data-theme="dark"] .field > span:first-child,
html[data-theme="dark"] .form-section-title,
html[data-theme="dark"] .kicker,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .derivation-formula span,
html[data-theme="dark"] .accessibility-head small { color: #9bacc0; }
html[data-theme="dark"] .input-unit input { color: #edf4fc; }
html[data-theme="dark"] .angle-summary,
html[data-theme="dark"] .math-chip,
html[data-theme="dark"] .summary-card { background: #162a43; border-color: #31506f; }
html[data-theme="dark"] .angle-summary strong,
html[data-theme="dark"] .math-chip,
html[data-theme="dark"] .sample-angle { color: #b6d2f1 !important; }
html[data-theme="dark"] .sample-angle { background: #17273b; border-color: #35516f; }
html[data-theme="dark"] .derivation-formula > div:nth-child(odd) { background: #111d2d; }
html[data-theme="dark"] .derivation-formula > div:nth-child(even) { background: #142236; }
html[data-theme="dark"] .derivation-formula .derivation-answer { background: #182d48; }
html[data-theme="dark"] .derivation-formula strong,
html[data-theme="dark"] .derivation-formula .derivation-answer strong { color: #c7dcf5; }
html[data-theme="dark"] .interval-explanation { background: #162a43; color: #b8c9dc; border-left-color: #719bc9; }
html[data-theme="dark"] .interval-explanation strong { color: #dbe8f7; }
html[data-theme="dark"] .interval-explanation b { color: #9bc2ef; }
html[data-theme="dark"] .panel-blue .construction-svg,
html[data-theme="dark"] .panel-green .construction-svg,
html[data-theme="dark"] .panel-amber .construction-svg,
html[data-theme="dark"] .construction-svg,
html[data-theme="dark"] .triangle-svg { background: #0f1a29; background-image: none; }
html[data-theme="dark"] .triangle-fill { fill: rgba(111,159,216,.16); }
html[data-theme="dark"] .solution-2 { fill: rgba(136,157,211,.12); }
html[data-theme="dark"] .angle-ray,
html[data-theme="dark"] .solid-edge,
html[data-theme="dark"] .base-edge { stroke: #d7e3f0; }
html[data-theme="dark"] .opposite-edge { stroke: #80aee2; }
html[data-theme="dark"] .axis-line,
html[data-theme="dark"] .helper-axis { stroke: #556b84; }
html[data-theme="dark"] .vertex-point,
html[data-theme="dark"] .origin-point,
html[data-theme="dark"] .center-point { fill: #dce9f6; stroke: #0f1a29; }
html[data-theme="dark"] .vertex-label,
html[data-theme="dark"] .measure-label,
html[data-theme="dark"] .circle-label,
html[data-theme="dark"] .no-intersection,
html[data-theme="dark"] .angle-symbol,
html[data-theme="dark"] .angle-text,
html[data-theme="dark"] .side-label,
html[data-theme="dark"] .vertex-name,
html[data-theme="dark"] .helper-text,
html[data-theme="dark"] .projection-name { stroke: #0f1a29; }
html[data-theme="dark"] .vertex-label,
html[data-theme="dark"] .vertex-name { fill: #f0f5fb; }
html[data-theme="dark"] .measure-label,
html[data-theme="dark"] .helper-text,
html[data-theme="dark"] .projection-name { fill: #c1d1e3; }
html[data-theme="dark"] .angle-symbol,
html[data-theme="dark"] .angle-text { fill: #9bc2ef; }
html[data-theme="dark"] .panel-green .construction-result strong,
html[data-theme="dark"] .panel-amber .construction-result strong,
html[data-theme="dark"] .construction-result strong { color: #c8d9ed; }
html[data-theme="dark"] .construction-result span { color: #9aadc1; }
html[data-theme="dark"] .conclusion-card { background: #151f33; border-color: #2b3d59; }
html[data-theme="dark"] .conclusion-card p,
html[data-theme="dark"] .conclusion-lead,
html[data-theme="dark"] .conclusion-card p strong,
html[data-theme="dark"] .conclusion-content > span { color: #ccd8ea !important; }
html[data-theme="dark"] .conclusion-breakdown { background: #111d2d; border-color: #2c405b; }
html[data-theme="dark"] .conclusion-breakdown span { color: #b7c6d9 !important; border-color: #2c405b; }
html[data-theme="dark"] .conclusion-breakdown b { color: #e1e9f4; }
html[data-theme="dark"] .accessibility-panel { background: #111d2d; border-color: #35516f; box-shadow: 0 20px 62px rgba(0,0,0,.48); }
html[data-theme="dark"] .accessibility-trigger { background: #16273d; border-color: #3d5b7b; color: #c7daf0; }
html[data-theme="dark"] .accessibility-trigger .icon { color: #9bc2ef; }
html[data-theme="dark"] .accessibility-trigger:hover,
html[data-theme="dark"] .accessibility-trigger[aria-expanded="true"] { background: #1a3150; border-color: #5b82ad; color: #e1ecf8; }
html[data-theme="dark"] .accessibility-head-icon { background: #1a3150; color: #9bc2ef; }
html[data-theme="dark"] .accessibility-label { color: #b8c7da; }
html[data-theme="dark"] .accessibility-label .icon { color: #9bc2ef; }
html[data-theme="dark"] .accessibility-options button { background: #17263a; border-color: #2f4762; color: #c0cfe0; }
html[data-theme="dark"] .accessibility-options button:hover { background: #1b2d44; border-color: #486a8f; }
html[data-theme="dark"] .accessibility-options button[aria-pressed="true"] { background: #1c3555; border-color: #668fbe; color: #e5eef9; }
html[data-theme="dark"] .accessibility-options .option-icon { background: #1d314a; color: #9bc2ef; }
html[data-theme="dark"] .accessibility-options button[aria-pressed="true"] .option-icon { background: #294b72; color: #d5e6f8; }
html[data-theme="dark"] .modal-result { background: #1a3150; color: #c9dcf2; }
html[data-theme="dark"] .modal-close { background: #17263a; color: #c9d7e8; }
html[data-theme="dark"] .mobile-nav { background: rgba(17,29,45,.97); border-color: #2e455f; }
html[data-theme="dark"] .mobile-nav-link { color: #9bacc0; }
html[data-theme="dark"] .mobile-nav-link.is-active { color: #c2d9f4; background: #1a3150; }


/* Label panjang sisi: latar halus menjaga angka tetap terbaca tanpa bertabrakan dengan garis. */
.edge-measure { pointer-events: none; }
.edge-measure-box {
  fill: rgba(251,253,255,.94);
  stroke: #c8d8ec;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}
.edge-measure .measure-label {
  fill: #385b86;
  font-size: calc(13px * var(--reading-scale));
  font-weight: 900;
  dominant-baseline: middle;
  paint-order: normal;
  stroke: none;
}
html[data-theme="dark"] .edge-measure-box { fill: rgba(18,31,48,.95); stroke: #3c5878; }
html[data-theme="dark"] .edge-measure .measure-label { fill: #d9e8fa; stroke: none; }


/* v1.0 accessibility trigger + screen-reader text */
.sr-only { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.accessibility-trigger { width:44px; min-width:44px; min-height:44px; padding:0; justify-content:center; gap:0; }
.accessibility-trigger .sr-only { display:block; }
.accessibility-trigger .icon { width:19px; height:19px; }

/* v1.0 — identitas pengembang */
.footer-author {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 3px;
}
.footer-author:hover,
.footer-author:focus-visible {
  color: var(--teal-dark);
  text-decoration: underline;
}
html[data-theme="dark"] .footer-author:hover,
html[data-theme="dark"] .footer-author:focus-visible {
  color: #b8d4f5;
}
