/* The Veyra system page (system.html). Builds on site.css tokens (--panel, --line, --text, --muted, --accent, --accent-2, --radius). */

main [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- on-this-page links ---------- */
.sy-toc { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.sy-toc a { font-size: .875rem; padding: .4375rem .875rem; border: 1px solid var(--line); border-radius: 62.4375rem; color: var(--muted); background: rgba(14, 21, 38, .7); }
.sy-toc a:hover { color: var(--text); border-color: var(--accent-2); text-decoration: none; }

/* ---------- colour dots per body ---------- */
.sy-dot { display: inline-block; width: .625rem; height: .625rem; border-radius: 50%; margin-right: .5rem; vertical-align: .05em; background: var(--c, #8d9ab5); flex: none; }
.sy-dot.tellurin { --c: #3f8fe0; } .sy-dot.kheron { --c: #a49b92; } .sy-dot.cindral { --c: #ff8a3d; } .sy-dot.hesk { --c: #cfeaff; }
.sy-dot.orvane { --c: #d4a56a; } .sy-dot.saelis { --c: #c9d6e8; } .sy-dot.veyra { --c: #ffd36b; box-shadow: 0 0 .5rem rgba(255, 200, 90, .7); }
.sy-dot.rock { --c: #9aa3b5; border-radius: 30% 55% 40% 60%; }

/* ---------- the orrery ---------- */
.sy-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem); gap: 1.25rem; align-items: start; margin-top: 1.5rem; }
.sy-stagecol { min-width: 0; }
.sy-stage { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 12rem;
  background: radial-gradient(ellipse 60% 55% at 50% 50%, rgba(70, 90, 210, .1), transparent 70%), rgba(3, 5, 10, .82); }
.sy-stage canvas { display: block; width: 100%; height: clamp(22rem, 66vh, 40rem); touch-action: none; cursor: grab; outline: none; }
.sy-stage canvas.drag { cursor: grabbing; }
.sy-stage canvas.arming { cursor: crosshair; }
.sy-stage canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-2); }
.sy-nojs { margin: 0; padding: 3rem 1.5rem; color: var(--muted); text-align: center; }
.sy-hud { position: absolute; left: .75rem; top: .625rem; right: .75rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem;
  pointer-events: none; font-size: .8125rem; color: var(--muted); text-shadow: 0 1px 3px #000; font-variant-numeric: tabular-nums; }
.sy-hud b { color: var(--text); font-weight: 700; }
.sy-muted { color: var(--muted); }
.sy-drophint { position: absolute; left: 50%; bottom: .75rem; transform: translateX(-50%); width: max-content; max-width: calc(100% - 1.5rem); pointer-events: none;
  padding: .375rem .875rem; border-radius: 62.4375rem; font-size: .8125rem; color: var(--text); text-align: center;
  background: rgba(8, 12, 22, .9); border: 1px solid rgba(255, 138, 61, .55); }

/* ---------- controls ---------- */
.sy-controls { margin-top: .875rem; display: grid; gap: .625rem; }
.sy-group { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.sy-btn { font: inherit; font-size: .9375rem; color: var(--text); background: rgba(14, 21, 38, .85); border: 1px solid var(--line); border-radius: 62.4375rem;
  padding: .4375rem .9375rem; min-height: 2.75rem; min-width: 2.75rem; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.sy-btn:hover:not(:disabled) { border-color: #2f4270; background: rgba(24, 34, 60, .9); }
.sy-btn:focus-visible, .sy-seg input:focus-visible + span, .sy-check input:focus-visible, .sy-chips input:focus-visible + span,
.sy-field select:focus-visible, .sy-field input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.sy-btn:disabled { opacity: .45; cursor: not-allowed; }
.sy-btn.sy-primary { border-color: rgba(255, 138, 61, .65); background: rgba(255, 138, 61, .12); }
.sy-btn[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 138, 61, .22); box-shadow: inset 0 0 0 1px rgba(255, 138, 61, .5); }
.sy-warp { display: inline-block; min-width: 7.5rem; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); }
.sy-seg { display: inline-flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; border: 0; }
.sy-seg legend { font-size: .8125rem; color: var(--muted); margin-bottom: .375rem; padding: 0; }
.sy-seg label { position: relative; display: inline-flex; }
.sy-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sy-seg span { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .4375rem .875rem; font-size: .875rem; color: var(--muted); cursor: pointer;
  background: rgba(14, 21, 38, .85); border: 1px solid var(--line); margin-left: -1px; }
.sy-seg label:first-of-type span { border-radius: 62.4375rem 0 0 62.4375rem; margin-left: 0; }
.sy-seg label:last-of-type span { border-radius: 0 62.4375rem 62.4375rem 0; }
.sy-seg input:checked + span { color: var(--text); background: rgba(78, 201, 255, .14); border-color: var(--accent-2); position: relative; z-index: 1; }
.sy-check { display: inline-flex; align-items: center; gap: .375rem; min-height: 2.75rem; padding: 0 .375rem; font-size: .875rem; color: #c3cde2; cursor: pointer; }
.sy-check input { width: 1.125rem; height: 1.125rem; accent-color: var(--accent); }
.sy-scalenote { margin: 0; font-size: .8125rem; color: var(--muted); }
.sy-keys { list-style: none; margin: .875rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .375rem 1.125rem; font-size: .8125rem; color: var(--muted); }
kbd { font: 700 .75rem ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--text); background: rgba(14, 21, 38, .9); border: 1px solid #2f4270;
  border-bottom-width: 2px; border-radius: .3125rem; padding: .0625rem .375rem; }

/* ---------- info card ---------- */
.sy-card { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--accent-2)); border-radius: var(--radius); padding: 1.125rem 1.25rem; }
.sy-card h3 { margin: .125rem 0 .5rem; font-size: 1.5rem; line-height: 1.15; }
.sy-card-kind { margin: 0; color: var(--accent); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.sy-card-here { margin: 0 0 .625rem; font-size: .875rem; color: var(--accent-2); }
.sy-card-line { margin: .875rem 0 0; color: #c3cde2; font-size: .9375rem; }
.sy-facts, .sy-read { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3125rem .875rem; font-size: .875rem; }
.sy-facts dt, .sy-read dt { color: var(--muted); }
.sy-facts dd, .sy-read dd { margin: 0; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- sections ---------- */
.sy-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; margin-top: 1.5rem; }
.sy-split > div > p:first-child { margin-top: 0; }
.sy-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.375rem; min-width: 0; }
#light .sy-panel { margin-top: 1.5rem; }
.sy-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.sy-howto { margin: 0; padding-left: 1.375rem; color: #c3cde2; }
.sy-howto li { margin-bottom: .5rem; }
.sy-howto b { color: var(--text); }
.sy-chips { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: .375rem; }
.sy-chips legend { font-size: .8125rem; color: var(--muted); margin-bottom: .5rem; padding: 0; }
.sy-chips label { position: relative; display: inline-flex; }
.sy-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sy-chips span { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .375rem .8125rem; font-size: .875rem; color: var(--muted); cursor: pointer;
  background: rgba(14, 21, 38, .85); border: 1px solid var(--line); border-radius: 62.4375rem; }
.sy-chips span small { margin-left: .375rem; color: #6f7c97; font-size: .75rem; }
.sy-chips input:checked + span { color: var(--text); border-color: var(--accent); background: rgba(255, 138, 61, .12); }
.sy-status { margin: 1rem 0 0; font-size: .9375rem; color: #c3cde2; min-height: 3em; }
.sy-status-line { color: #c3cde2; font-size: .9375rem; }
.sy-status-line .pill { margin-right: .375rem; vertical-align: .1em; }
.sy-formula { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--accent-2); font-weight: 700; overflow-wrap: anywhere; }
p.sy-formula { margin: 0 0 1rem; font-size: 1rem; }
.sy-field { display: grid; gap: .375rem; margin-top: 1rem; min-width: 0; }
.sy-field label { font-size: .875rem; color: var(--muted); }
.sy-field output { color: var(--text); font-weight: 700; }
.sy-field input[type="range"] { width: 100%; min-height: 2.75rem; accent-color: var(--accent); }
.sy-field select { font: inherit; font-size: .9375rem; color: var(--text); background: rgba(5, 7, 13, .8); border: 1px solid var(--line); border-radius: .5rem;
  padding: .5rem .625rem; min-height: 2.75rem; width: 100%; cursor: pointer; }
.sy-tripick { margin-top: 0; }
.sy-tripick .sy-field { flex: 1 1 8rem; margin-top: 0; }
.sy-thrust { margin-top: 1rem; }
.sy-big { margin: 1.125rem 0 .75rem; font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 800; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.sy-small { margin: .875rem 0 0; font-size: .8125rem; color: var(--muted); }
.sy-read dd.warn { color: var(--accent); }
.sy-read dd.ok { color: #7fe0a8; }
.sy-checkread { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: .875rem 1.25rem; }
.sy-checkread > div { border-top: 1px solid var(--line); padding-top: .625rem; }
.sy-checkread dt { font-size: .8125rem; }
.sy-checkread dd { text-align: left; font-size: 1.375rem; font-weight: 800; margin-top: .125rem; }

/* ---------- tables ---------- */
.sy-tablewrap { max-width: 100%; overflow-x: auto; }
.sy-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9375rem; }
.sy-table caption { caption-side: top; text-align: left; color: var(--muted); font-size: .875rem; padding: 0 0 .75rem; }
.sy-table th, .sy-table td { padding: .5625rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.sy-table thead th { font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); background: rgba(5, 7, 13, .45); }
.sy-table tbody th { color: var(--text); white-space: nowrap; font-weight: 700; }
.sy-table td { color: #c3cde2; font-variant-numeric: tabular-nums; }
.sy-table tbody tr:last-child > * { border-bottom: 0; }
.sy-numbers { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 1.25rem; }
.sy-numbers td { white-space: nowrap; }
.sy-numbers td:first-of-type { white-space: normal; }
@media (max-width: 1100px) {
  .sy-numbers { border: 0; background: none; overflow: visible; }
  .sy-numbers thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sy-numbers, .sy-numbers tbody, .sy-numbers tr, .sy-numbers th, .sy-numbers td { display: block; }
  .sy-numbers tbody { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
  .sy-numbers tr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; }
  .sy-numbers tbody th { border: 0; padding: 0 0 .375rem; font-size: 1.125rem; }
  .sy-numbers td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .25rem 0; text-align: right; white-space: normal; }
  .sy-numbers td::before { content: attr(data-label); color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; text-align: left; padding-top: .15em; flex: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .sy-layout, .sy-split { grid-template-columns: minmax(0, 1fr); }
  .sy-card { order: 2; }
}
@media (max-width: 480px) {
  .sy-stage canvas { height: clamp(20rem, 58vh, 30rem); }
  .sy-hud { font-size: .75rem; }
  .sy-seg span { padding: .4375rem .625rem; font-size: .8125rem; }
  .sy-warp { min-width: 6rem; }
  .sy-panel { padding: 1rem; }
  .sy-table th, .sy-table td { padding: .5rem .5rem; }
  #sy-light-table { font-size: .875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sy-btn, .sy-seg span { transition: none; }
}
