/* Copyright 2026 Michael Schroeder. SPDX-License-Identifier: Apache-2.0 */
.e278-section {
  --e-surface: #fffefa; --e-soft: #eeede6; --e-track: #e4e3da;
  --e-a: #326c91; --e-b: #c87942; --e-c: #568478; --e-d: #9770a4; --e-e: #af5769;
  --e-active: #244e64; --e-positive: #22664c;
  border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 2.5rem;
  scroll-margin-top: 1.5rem; font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .e278-section {
  --e-surface: #272724; --e-soft: #30312e; --e-track: #42433e;
  --e-a: #79b4d7; --e-b: #edac79; --e-c: #89bcae; --e-d: #c5a0d2; --e-e: #e194a4;
  --e-active: #96c3d6; --e-positive: #96cdb4;
}
.e278-jump { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .9rem; margin: 1.4rem 0; }
.e278-jump a { font-weight: 600; }
.e278-jump > span { color: var(--muted); }
.e278-heading h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: .35rem 0 .8rem; }
.e278-section .e278-kicker { text-transform: uppercase; font-size: .69rem; font-weight: 700; letter-spacing: .14em; color: var(--muted); margin: 0 0 .4rem; }
.e278-intro { max-width: 44rem; color: var(--copy); margin: .5rem 0 1.7rem; }
.e278-section button, .e278-section input { font: inherit; }
.e278-section button { cursor: pointer; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 5px; padding: .58rem .8rem; line-height: 1.3; min-height: 44px; transition: background .15s, border-color .15s; }
.e278-section button:hover { background: var(--e-soft); border-color: var(--muted); }
.e278-section button:focus-visible, .e278-section input:focus-visible, .e278-section summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.e278-section button:disabled { cursor: wait; opacity: .6; }
.e278-section [hidden] { display: none !important; }
.e278-section .e278-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.e278-section .e278-primary:hover { background: var(--blue); border-color: var(--blue); }
.e278-section button[aria-pressed="true"] { border-color: var(--e-active); background: color-mix(in srgb, var(--e-active) 8%, transparent); }
.e278-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.e278-presets button { text-align: left; padding: .9rem .7rem; border-radius: 6px; position: relative; }
.e278-presets button[aria-pressed="true"]::after { content: ""; position: absolute; bottom: 0; left: .7rem; right: .7rem; height: 3px; background: var(--e-active); }
.e278-presets span { display: block; font-size: .72rem; color: var(--muted); margin-bottom: .55rem; }
.e278-presets strong { font-weight: 400; font-size: .92rem; white-space: nowrap; }
.e278-prompt { color: var(--copy); font-size: .9rem; min-height: 3em; margin: 1rem 0; }
.e278-workspace { display: grid; grid-template-columns: minmax(210px, .75fr) minmax(0, 1.25fr); background: var(--e-surface); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.e278-control-panel { padding: 1.3rem; border-right: 1px solid var(--line); }
.e278-section h3 { font: 400 1.28rem/1.3 Georgia, "Times New Roman", serif; letter-spacing: -.015em; margin: 0 0 .35rem; }
.e278-section .e278-hint { font-size: .77rem; color: var(--muted); line-height: 1.6; margin: .5rem 0; }
.e278-control { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .8rem; }
.e278-control-title { display: flex; align-items: baseline; gap: .45rem; font-size: .85rem; }
.e278-letter { background: color-mix(in srgb, var(--class-color) 20%, transparent); color: var(--ink); font-weight: 700; border-radius: 50%; font-size: .7rem; display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }
.e278-control-title output { margin-left: auto; font-weight: 600; color: var(--ink); }
.e278-slider-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: .5rem; align-items: center; margin-top: .5rem; }
.e278-section .e278-step { min-height: 44px; padding: .2rem; font-size: 1.2rem; border: 0; }
.e278-slider-row input { width: 100%; accent-color: var(--class-color); cursor: pointer; min-height: 44px; margin: 0; }
.e278-actions { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: 1.25rem; }
.e278-actions button { font-size: .76rem; }
.e278-actions .e278-primary { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.e278-best { font-size: .77rem; line-height: 1.55 !important; margin: .9rem 0 0; color: var(--e-positive); }
.e278-visual-panel { padding: 1.1rem .8rem 1.25rem; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.e278-figure-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem; font-size: .72rem; color: var(--muted); padding: 0 .35rem; }
#e278-wheel { display: block; width: 100%; max-width: 440px; margin: .3rem auto; overflow: visible; }
.e278-arc { fill: var(--e-track); transition: fill .18s, opacity .18s; }
.e278-arc[data-x] { cursor: crosshair; }
.e278-arc.e278-union-covered { fill: var(--e-active); }
.e278-arc.e278-class-covered { fill: var(--class-color); }
.e278-ring-label { fill: var(--muted); font: 11px Arial, sans-serif; text-anchor: middle; }
.e278-ring-tick { stroke: var(--muted); stroke-width: 1; }
.e278-wheel-overline { fill: var(--muted); font: 10px Arial, sans-serif; text-anchor: middle; letter-spacing: 2.5px; }
.e278-wheel-density { fill: var(--ink); font: 50px Georgia, serif; text-anchor: middle; }
.e278-wheel-density.e278-long-fraction { font-size: 37px; }
.e278-wheel-percent { fill: var(--muted); font: 14px Arial, sans-serif; text-anchor: middle; }
.e278-selected-ray { fill: none; stroke: var(--ink); stroke-width: 1.4; pointer-events: none; }
.e278-wheel-key { display: flex; justify-content: center; flex-wrap: wrap; gap: .3rem .7rem; font-size: .72rem; color: var(--muted); }
.e278-wheel-key > span { display: flex; align-items: center; gap: .3rem; }
.e278-wheel-key i { width: .65rem; height: .65rem; border-radius: 50%; display: inline-block; }
.e278-key-covered { background: var(--e-active); }
.e278-key-hole { background: var(--e-track); border: 1px dashed var(--muted); }
.e278-period-view { margin-top: 1.5rem; }
.e278-strip-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .3rem; }
.e278-strip-heading > span { font-size: .72rem; color: var(--muted); }
.e278-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 5px; margin: .85rem 0; }
.e278-section .e278-integer { min-width: 0; padding: .5rem .1rem .35rem; border-radius: 4px; background: var(--e-soft); border-color: transparent; font-size: .76rem; position: relative; }
.e278-section .e278-integer.e278-hole { border: 1px dashed var(--line); background: transparent; }
.e278-section .e278-integer[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.e278-marks { display: flex; justify-content: center; gap: 2px; height: 5px; margin-top: 5px; }
.e278-marks i { width: 5px; height: 5px; border-radius: 1px; background: var(--class-color); }
.e278-grid-pages { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .7rem; }
.e278-grid-pages button { font-size: .7rem; }
.e278-inspection { padding: .7rem .85rem; background: var(--e-soft); border-radius: 4px; font-size: .8rem; min-height: 3.2em; }
.e278-insight { border-top: 1px solid var(--line); padding-top: 1.5rem; margin: 1.6rem 0; display: grid; grid-template-columns: minmax(0, 1fr) 205px; gap: 2rem; }
.e278-insight h3 { font-size: 1.42rem; }
.e278-insight p:not(.e278-kicker):not(.e278-hint) { font-size: .9rem; margin: .75rem 0; }
.e278-graph { margin: 0; text-align: center; }
.e278-graph svg { width: 100%; display: block; }
.e278-graph figcaption { font-size: .73rem; }
.e278-graph figcaption span { color: var(--muted); font-size: .73rem; line-height: 1.5; }
.e278-graph-edge { stroke: var(--e-active); stroke-width: 2.5; }
.e278-graph-edge.disjoint { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 5; }
.e278-graph-node { fill: var(--e-surface); stroke: var(--class-color); stroke-width: 2; }
.e278-graph-label { fill: var(--ink); text-anchor: middle; font: 16px Georgia, serif; }
.e278-details { margin: 0; border-top: 1px solid var(--line); }
.e278-section .e278-details summary { padding: .95rem 0; font-weight: 400; font-size: .85rem; }
.e278-detail-body { padding-bottom: 1rem; font-size: .85rem; }
.e278-table-wrap { overflow-x: auto; }
.e278-pair-table { border-collapse: collapse; width: 100%; font-size: .8rem; }
.e278-pair-table caption { text-align: left; color: var(--muted); padding: .7rem 0; }
.e278-pair-table th, .e278-pair-table td { border-bottom: 1px solid var(--line); text-align: left; padding: .45rem .6rem .45rem 0; }
.e278-histogram { display: grid; gap: .4rem; margin: 1.2rem 0; }
.e278-hist-row { display: grid; grid-template-columns: 4rem minmax(0, 1fr) 4rem; gap: .8rem; align-items: center; font-size: .72rem; }
.e278-hist-row > i { height: .7rem; background: var(--e-soft); }
.e278-hist-row i i { height: 100%; background: var(--e-active); display: block; }
.e278-hist-row > span:last-child { text-align: right; }
.e278-custom { font-size: .85rem; padding: .3rem 0 1rem; }
.e278-custom label { display: block; margin-bottom: .4rem; }
.e278-custom > div { display: flex; gap: .7rem; }
.e278-custom input { min-width: 0; width: 100%; border: 1px solid var(--line); background: var(--e-surface); color: var(--ink); padding: .6rem .75rem; border-radius: 4px; font-size: 16px; }
#e278-error { color: var(--e-e); margin: .5rem 0 0; }
#e278-error:empty { display: none; }
.e278-star { margin-top: 2.2rem; padding-top: 2.2rem; border-top: 1px solid var(--line); }
.e278-star h3 { font-size: clamp(1.65rem, 3vw, 2.15rem); margin: .5rem 0 1rem; }
.e278-star > p { font-size: .9rem; }
.e278-star-toolbar { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: 1.3rem 0; }
.e278-star-toolbar > div { display: flex; gap: .4rem; }
.e278-star-toolbar button { font-size: .75rem; }
.e278-fibre-zero { background: var(--e-active); color: var(--paper); display: flex; justify-content: space-between; gap: .7rem; padding: .75rem 1rem; border-radius: 5px; font-size: .8rem; }
.e278-fibre-zero strong { font-weight: 400; }
.e278-fibres { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.e278-fibre { background: var(--e-surface); border: 1px solid var(--line); border-radius: 6px; padding: .8rem 1rem; min-width: 0; }
.e278-fibre-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: .7rem; }
.e278-fibre h4 { font: 400 1.15rem Georgia, serif; margin: 0; }
.e278-fibre-heading > span { font-size: .72rem; color: var(--muted); }
.e278-cofactors { display: flex; flex-wrap: wrap; align-content: flex-start; gap: .5rem; min-height: 125px; padding: .9rem 0 .5rem; }
.e278-cofactors button { font-size: .76rem; flex: 0 1 auto; border-radius: 4px; }
.e278-cofactors .e278-empty { align-self: center; font-size: .8rem; color: var(--muted); }
.e278-cofactor-small { display: block; font-size: .7rem; color: var(--muted); margin-bottom: .15rem; }
.e278-cofactors button span:last-child { margin-left: .5rem; color: var(--muted); }
.e278-fibre > p { font-size: .75rem; color: var(--muted); margin: .5rem 0 0; border-top: 1px solid var(--line); padding-top: .6rem; }
.e278-star-results { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.2rem 0; }
.e278-star-results > div { display: grid; align-content: start; gap: .25rem; }
.e278-star-results span { font-size: .74rem; color: var(--muted); }
.e278-star-results strong { font: 400 clamp(1.45rem, 3vw, 2.1rem)/1.25 Georgia, serif; color: var(--ink); }
.e278-star-results small { font-size: .71rem; color: var(--muted); }
.e278-star-formula { display: grid; gap: .5rem; background: var(--e-soft); padding: 1rem; border-radius: 5px; }
.e278-star-formula > span { color: var(--muted); font-size: .7rem; }
.e278-star-formula strong { font: 400 1rem/1.6 Georgia, serif; }
.e278-exact { display: grid; gap: .5rem; }
.e278-exact dt { font-weight: 600; margin-top: .5rem; }
.e278-exact dd { margin: 0; overflow-wrap: anywhere; font: .8rem/1.7 ui-monospace, monospace; }
.e278-star-takeaway { border-left: 3px solid var(--e-active); padding-left: 1rem; margin: 1.3rem 0 1.7rem; color: var(--copy); }
.e278-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 650px) {
  .e278-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .e278-presets span { font-size: .69rem; }
  .e278-workspace { grid-template-columns: 1fr; }
  .e278-visual-panel { grid-row: 1; padding: 1rem .7rem; border-bottom: 1px solid var(--line); }
  #e278-wheel { max-width: 390px; }
  .e278-ring-label { font-size: 15px; }
  .e278-wheel-overline { font-size: 13px; }
  .e278-wheel-percent { font-size: 17px; }
  .e278-control-panel { border-right: 0; }
  .e278-control { margin-top: .7rem; padding-top: .6rem; }
  .e278-control-title { font-size: .95rem; }
  .e278-actions .e278-primary { width: auto; flex: 1 0 100%; }
  .e278-insight { grid-template-columns: 1fr; gap: .7rem; }
  .e278-graph { max-width: 230px; margin: 0 auto; }
  .e278-strip-heading { align-items: start; }
  .e278-fibre { padding: .7rem; }
  .e278-fibres { gap: .6rem; }
  .e278-fibre-zero { flex-wrap: wrap; }
  .e278-fibre-zero > span:nth-child(2) { order: 3; width: 100%; }
  .e278-cofactors { min-height: 210px; }
  .e278-cofactors button { width: 100%; font-size: .73rem; }
  .e278-star-results { grid-template-columns: 1fr; gap: 1rem; }
  .e278-star-formula strong { font-size: .88rem; }
}
@media (prefers-reduced-motion: reduce) { .e278-section *, .e278-section *::before, .e278-section *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .e278-section { break-before: page; } .e278-actions, .e278-custom, .e278-star-toolbar, .e278-jump { display: none; } .e278-workspace { break-inside: avoid; } }
