:root {
  color-scheme: dark;
  --shell-bg: #0e1117;
  --shell-panel: #171b23;
  --shell-border: #303744;
  --shell-text: #f0f3f6;
  --shell-muted: #a5afbd;
  --shell-blue: #1688e8;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { background: var(--shell-bg); color: var(--shell-text); margin: 0; min-height: 100%; }
body { padding-top: 58px; }
a { color: #69b6ff; }
button { font: inherit; }
.app-nav { align-items: center; background: #26272f; box-shadow: 0 2px 8px #0005; display: flex; height: 58px; inset: 0 0 auto; padding: 8px min(24px, 5vw); position: fixed; z-index: 500; }
.brand { align-items: center; color: inherit; display: flex; gap: 10px; line-height: 1.15; text-decoration: none; }
.brand:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.brand:focus-visible { border-radius: 4px; outline: 2px solid #58a6ff; outline-offset: 4px; }
.brand img { border-radius: 4px; height: 27px; width: 27px; }
.brand span { display: grid; gap: 1px; }
.brand strong { font-size: 1rem; }
.brand small { color: #c9d1d9; font-size: .72rem; }
.nav-step { color: #c9d1d9; font-size: .82rem; font-weight: 600; letter-spacing: .02em; margin-left: auto; text-transform: uppercase; }
#app-root { min-height: calc(100vh - 188px); }
.landing { margin: 0 auto; max-width: 1240px; padding: clamp(42px, 8vh, 88px) clamp(18px, 5vw, 60px) 45px; }
.landing-copy { max-width: 760px; }
.eyebrow { color: #70b7ff; font-size: .75rem; font-weight: 700; letter-spacing: .13em; }
.landing h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -.035em; line-height: 1.08; margin: 13px 0; }
.landing-copy p { color: #bac4d0; font-size: 1.05rem; max-width: 660px; }
.flow-cards { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 38px 0 26px; }
.flow-card { background: linear-gradient(145deg, #191f29, #141820); border: 1px solid var(--shell-border); border-radius: 12px; display: flex; flex-direction: column; min-height: 248px; padding: 21px; }
.flow-card .card-index { color: #5f6c7d; font-size: .85rem; font-weight: 700; letter-spacing: .1em; }
.flow-card h2 { font-size: 1.17rem; margin: 20px 0 5px; }
.flow-card p { color: var(--shell-muted); flex: 1; margin: 7px 0 18px; }
.flow-card button, .folder-buttons button, .shell-step { background: #232a35; border: 1px solid #4b5565; border-radius: 7px; color: var(--shell-text); cursor: pointer; min-height: 39px; padding: 8px 12px; }
.flow-card button { align-items: center; background: #1479d0; border-color: #3297ed; display: flex; font-weight: 650; justify-content: space-between; }
.flow-card button:hover, .folder-buttons button:hover, .shell-step:hover { filter: brightness(1.15); }
button:focus-visible, a:focus-visible { outline: 2px solid #58a6ff; outline-offset: 2px; }
button:disabled { cursor: not-allowed !important; opacity: .5; }
.annotation-link { color: var(--shell-muted); margin-top: 35px; }
.folder-panel { background: #131820; border-bottom: 1px solid var(--shell-border); display: grid; gap: 1px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.folder-choice { align-items: center; background: #151a22; display: flex; gap: 12px; justify-content: space-between; min-width: 0; padding: 13px clamp(14px, 3vw, 34px); }
.folder-choice > div:first-child { display: grid; min-width: 0; }
.folder-choice strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-choice small { color: var(--shell-muted); font-size: .75rem; }
.folder-choice .eyebrow { font-size: .66rem; }
.folder-buttons { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.folder-buttons button { font-size: .8rem; min-height: 33px; padding: 5px 9px; }
.folder-buttons .quiet { color: #c3a2a2; }
.shell-step { align-items: center; display: inline-flex; gap: 7px; }
.shell-step span { align-items: center; background: #353f4d; border-radius: 50%; display: inline-flex; height: 22px; justify-content: center; width: 22px; }
.shell-step.active { border-color: #58a6ff; color: #a7d4ff; }
.shell-error { margin: 30px auto; max-width: 800px; padding: 20px; }
.kinematics-page { margin: 0 auto; max-width: none; min-height: calc(100vh - 180px); padding: 52px clamp(22px, 5.5vw, 84px) 36px; width: 100%; }
.kinematics-page h1 { font-size: clamp(2rem, 3.4vw, 2.65rem); letter-spacing: -.025em; margin: 0 0 14px; }
.kinematics-page > p { color: #c4ccd6; line-height: 1.55; }
.kinematics-page .muted { color: var(--shell-muted); }
.kinematics-page .notice { background: #17283a; border-left: 3px solid #4e9de0; border-radius: 3px; padding: 10px 13px; }
.kinematics-page .warning { background: #352918; border-left: 3px solid #d19b43; border-radius: 3px; padding: 10px 13px; }
.kinematics-page .metrics { display: grid; gap: 5px; margin: 24px 0; max-width: 760px; }
.kinematics-page .stat { display: grid; gap: 3px; grid-template-columns: 1fr; min-width: 0; padding: 4px 0; }
.kinematics-page .stat span { color: var(--shell-muted); font-size: .88rem; }
.kinematics-page .stat strong { font-size: 2.25rem; font-weight: 400; line-height: 1.2; }
.kinematics-page .actions { display: grid; gap: 10px; grid-template-columns: 3fr 4fr 3fr; margin-top: 28px; }
.kinematics-page .actions > button:first-child { grid-column: 1; }
.kinematics-page .actions > button:last-child { grid-column: 3; }
.kinematics-page .actions > button:only-child { grid-column: 2; }
.kinematics-page button { background: #232a35; border: 1px solid #4b5565; border-radius: 7px; color: var(--shell-text); cursor: pointer; min-height: 40px; padding: 9px 14px; }
.kinematics-page button.primary { background: #58a6ff; border-color: #79bdff; color: #fff; font-weight: 700; }
.kinematics-page .actions > button { justify-self: stretch; width: 100%; }
.kinematics-page .actions > button:not(.primary) { background: transparent; border-color: transparent; }
.kinematics-page .warning-list { background: #352918; border-left: 3px solid #d19b43; border-radius: 3px; margin: 16px 0; padding: 8px 13px; }
.kinematics-page .warning-list p { margin: 8px 0; }
.kinematics-page .warning-list .warning-detail { color: #c4ccd6; margin: 4px 0; }
.kinematics-page progress { accent-color: #2995e8; height: 12px; width: 100%; }
.kinematics-page details { background: #111720; border: 1px solid #303a48; border-radius: 8px; margin: 18px 0; padding: 12px 15px; }
.kinematics-page details summary { cursor: pointer; font-weight: 650; }
.kinematics-page code { overflow-wrap: anywhere; }
.runtime-status { background: #1b2940; border: 1px solid #315b87; border-radius: 8px; margin: 8px auto; max-width: min(760px, calc(100vw - 24px)); padding: 9px 14px; }
.runtime-status[data-kind="error"] { background: #381d22; border-color: #b34a53; color: #ffd4d7; }
.app-footer { border-top: 1px solid #252d39; color: #8994a1; font-size: .82rem; line-height: 1.45; margin: 24px auto 0; max-width: 1240px; padding: 18px 22px 26px; text-align: center; }
.app-footer p { margin: 4px; }
@media (max-width: 820px) {
  .flow-cards { grid-template-columns: 1fr; }
  .flow-card { min-height: 205px; }
  .folder-panel { grid-template-columns: 1fr; }
  .folder-choice { align-items: flex-start; flex-direction: column; }
  .folder-buttons { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .nav-step { font-size: .68rem; max-width: 48vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .folder-buttons button { flex: 1; }
  .folder-buttons { width: 100%; }
  .kinematics-page { min-height: calc(100vh - 140px); padding: 30px 16px; }
  .kinematics-page .actions { grid-template-columns: 1fr; }
  .kinematics-page .actions > button:first-child, .kinematics-page .actions > button:last-child, .kinematics-page .actions > button:only-child { grid-column: 1; justify-self: stretch; }
  .kinematics-page .actions > button { flex: 1 1 100%; }
}
