:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #10111a;
  color: #efeff9;
  --canvas: #10111a;
  --nav: #11121c;
  --panel: #171924;
  --line: #2a2d3d;
  --subtle-line: #242736;
  --text: #efeff9;
  --muted: #a8acc1;
  --quiet: #858aa6;
  --lilac: #b4b8ff;
  --mint: #78dfbd;
  --peach: #ffae9d;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; font-size: 1rem; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 3px;
}
button, a, input, select { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
button { color: inherit; }
[hidden] { display: none !important; }
.skip { position: fixed; z-index: 3; top: 10px; left: 10px; background: var(--lilac); color: #1c1a2e; padding: 10px 17px; border-radius: 6px; transform: translateY(-150%); }
.skip:focus { transform: translateY(0); }
.icon { display: inline-grid; width: 1.15em; flex: 0 0 1.15em; place-items: center; line-height: 1; font-family: system-ui, sans-serif; font-weight: 500; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--nav);
  border-right: 1px solid var(--subtle-line);
  padding: 24px 16px 20px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 1px 6px; }
.brand-mark { width: 37px; height: 37px; border-radius: 11px; background: #a6acff url('favicon.png') center / 43px no-repeat; flex: 0 0 auto; box-shadow: 0 3px 17px #777df330; }
.brand strong { display: block; font-size: 1.19rem; letter-spacing: -.045em; font-weight: 760; line-height: 1.15; }
.brand strong span { color: var(--lilac); }
.brand small { display: block; font-size: .75rem; color: var(--quiet); margin-top: 4px; }
.sidebar-main { margin-top: 43px; min-height: 0; overflow: auto; padding: 3px; scrollbar-width: thin; }
.side-header { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px 8px; }
.side-header h2 { font-size: .75rem; color: var(--quiet); font-weight: 650; letter-spacing: .09em; text-transform: uppercase; }
.icon-button { display: inline-grid; place-items: center; width: 31px; height: 31px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); font-size: 1.19rem; line-height: 1; }
.icon-button:hover { border-color: var(--line); background: var(--panel); color: var(--text); }
#plan-list { display: grid; gap: 5px; }
.plan-link { display: flex; align-items: center; gap: 10px; text-align: left; min-height: 43px; padding: 8px 9px; width: 100%; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: .875rem; }
.plan-link span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-link:hover { color: var(--text); background: #1b1e2c; }
.plan-link.selected { color: #dcddff; border-color: #393b62; background: #252640; font-weight: 650; }
.plan-link.selected .icon { color: var(--lilac); }
.sidebar-footer { display: flex; gap: 8px; align-items: center; margin-top: auto; border-top: 1px solid var(--subtle-line); padding: 17px 5px 0; color: var(--quiet); font-size: .78rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); flex: 0 0 auto; }
#workspace:focus { outline: none; }
.topbar { display: flex; align-items: center; min-height: 69px; gap: 14px; justify-content: space-between; padding: 12px 29px; border-bottom: 1px solid var(--subtle-line); }
.top-label { color: #c5c8da; display: flex; align-items: center; gap: 9px; font-size: .875rem; font-weight: 600; }
.top-label .icon { color: var(--quiet); }
.top-actions, .section-actions { display: flex; align-items: center; gap: 8px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; min-height: 39px; padding: 7px 13px; line-height: 1.2; font-size: .875rem; font-weight: 720; white-space: nowrap; transition: background-color .16s, border-color .16s; }
.button.primary { color: #1b1934; background: #adb2fc; border-color: #bdc0ff; }
.button.primary:hover { background: #c6c9ff; }
.button.secondary { color: #dedff0; background: #1c1e2b; border-color: #333647; }
.button.secondary:hover:enabled { background: #26293a; border-color: #4d5070; }
.button.small { min-height: 33px; padding: 6px 10px; font-size: .81rem; }
.button.danger { color: var(--peach); border-color: #643c42; background: #33232e; margin-right: auto; }
.button.danger:hover { background: #502c37; }
.content { width: 100%; max-width: 1460px; margin: 0 auto; padding: 22px 29px 34px; }
.hero { border: 1px solid #353951; border-radius: 15px; min-height: 200px; position: relative; overflow: hidden; isolation: isolate; background-color: #181a37; background-image: linear-gradient(90deg,#1b1d38 0%,#1b1d38ed 30%,#1b1d389e 55%,#15183013 100%), url('junction.webp'); background-size: cover; background-position: center, right 52%; }
.hero-content { padding: 25px 30px 23px; position: relative; max-width: 750px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #c6c8ff; font-weight: 700; font-size: .71rem; text-transform: uppercase; letter-spacing: .12em; }
.eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: #b4b8ff; box-shadow: 0 0 12px #acb2fc85; }
.hero h1 { font-size: clamp(2.05rem, 4vw, 3.05rem); font-weight: 740; letter-spacing: -.058em; line-height: 1.06; margin-top: 7px; overflow-wrap: anywhere; }
.hero-goal { color: #d2d4e7; margin-top: 9px; font-size: .98rem; line-height: 1.5; overflow-wrap: anywhere; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 17px; }
.hero-meta > span { display: inline-flex; gap: 6px; align-items: center; border: 1px solid #484c6e; border-radius: 6px; background: #141528a8; color: #c9cbdf; padding: 5px 9px; font-size: .83rem; }
.hero-meta .icon { color: #b9beff; }
.hero-meta b { color: #eeeefa; font-variant-numeric: tabular-nums; font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 15px 0 17px; }
.metric { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 74px; border: 1px solid var(--line); background: var(--panel); border-radius: 11px; padding: 11px 14px; }
.metric-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; font-size: 1.24rem; border-radius: 9px; }
.metric-icon.lilac { background: #2b2d49; color: var(--lilac); }
.metric-icon.mint { background: #193934; color: var(--mint); }
.metric-icon.peach { background: #3d2a34; color: var(--peach); }
.metric > div { min-width: 0; }
.metric > div > span { display: block; color: var(--muted); font-size: .82rem; }
.metric strong { display: block; margin-top: 2px; font-size: 1.39rem; font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1.15; }
.metric small { color: var(--quiet); font-size: .85rem; font-weight: 550; letter-spacing: 0; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); gap: 15px; align-items: start; }
.right-column { display: grid; gap: 14px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 17px 12px; }
.panel-heading h2 { color: #f5f4ff; font-size: 1.125rem; font-weight: 720; letter-spacing: -.025em; line-height: 1.25; }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: .81rem; line-height: 1.35; }
.timeline { list-style: none; margin: 0 17px; padding: 0; }
.timeline-item { position: relative; border-top: 1px solid var(--subtle-line); }
.timeline-item:not(:last-child)::after { content: ''; position: absolute; z-index: 0; top: calc(50% + 8px); left: 13px; height: calc(100% - 15px); width: 1px; background: #3b415d; pointer-events: none; }
.step-row { display: grid; position: relative; grid-template-columns: 27px minmax(0, 1fr) auto 16px; align-items: center; gap: 10px; width: 100%; min-height: 62px; padding: 9px 0; border: 0; border-radius: 6px; text-align: left; background: transparent; }
.step-row:hover { background: #1e202e; }
.timeline-dot { display: grid; place-items: center; z-index: 1; width: 16px; height: 16px; justify-self: center; border-radius: 50%; background: #232640; border: 1px solid #777dc2; color: var(--lilac); font-size: .72rem; line-height: 1; }
.normal .timeline-dot::before, .delayed .timeline-dot::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.blocked .timeline-dot { color: var(--peach); border-color: #97594f; background: #392831; }
.backup .timeline-dot { color: var(--mint); border-color: #4d9b83; background: #1c3635; }
.delayed .timeline-dot { color: #f2ce8a; border-color: #927041; background: #392e2b; }
.step-content, .step-time { display: grid; gap: 3px; min-width: 0; }
.step-content strong, .step-time strong { font-size: .88rem; font-weight: 660; overflow-wrap: anywhere; }
.step-content > span, .step-time > span { font-size: .76rem; color: var(--quiet); line-height: 1.2; overflow-wrap: anywhere; }
.step-time { text-align: right; min-width: 59px; font-variant-numeric: tabular-nums; }
.blocked .step-time strong { color: var(--peach); }
.delayed .step-time strong { color: #f2ce8a; }
.backup .step-time strong { color: var(--mint); }
.step-edit { color: var(--quiet); text-align: center; }
.timeline-footer { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 7px 16px; padding: 11px 17px 12px; border-top: 1px solid var(--subtle-line); color: var(--muted); font-size: .74rem; }
.timeline-footer > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lilac); }
.legend-dot.delayed { background: #f2ce8a; }
.legend-dot.blocked { background: var(--peach); }
.legend-dot.backup { background: var(--mint); }
.empty { color: var(--muted); font-size: .91rem; padding: 26px 17px; display: grid; justify-items: start; gap: 11px; }
.empty.compact { padding: 5px 1px 12px; }
.scenarios { display: grid; gap: 6px; padding: 0 14px 12px; }
.scenario { display: grid; grid-template-columns: 30px minmax(0, 1fr) 34px; align-items: center; gap: 9px; border: 1px solid var(--subtle-line); border-radius: 8px; background: #191b27; padding: 5px 9px; min-height: 47px; }
.scenario.active { background: #232439; border-color: #424470; }
.scenario-symbol { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; font-size: 1.04rem; }
.scenario-symbol.block { background: #3d2936; color: var(--peach); }
.scenario-symbol.delay { background: #2b2b44; color: var(--lilac); }
.scenario-details { display: grid; gap: 2px; align-content: center; min-height: 35px; border: 0; padding: 0; min-width: 0; text-align: left; background: transparent; }
.scenario-details strong { font-size: .875rem; font-weight: 660; overflow-wrap: anywhere; }
.scenario-details:hover strong { color: var(--lilac); }
.scenario-details > span { color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; }
.switch { width: 34px; height: 21px; border-radius: 20px; background: #303347; border: 1px solid #505473; display: flex; align-items: center; padding: 2px; transition: background-color .16s; }
.switch span { width: 13px; height: 13px; border-radius: 50%; background: #b3b7ce; transition: transform .16s; }
.switch[aria-checked="true"] { background: #a9afff; border-color: #b5b9ff; }
.switch[aria-checked="true"] span { transform: translateX(13px); background: #222044; }
.text-button { display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 0; padding: 4px; border-radius: 4px; font-weight: 660; color: var(--lilac); font-size: .83rem; }
.text-button:hover { text-decoration: underline; }
.clear { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .73rem; font-weight: 740; border-radius: 20px; padding: 5px 8px; background: #292d3d; color: var(--muted); white-space: nowrap; }
.pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.risk { color: var(--peach); }
.safe { color: var(--mint); }
.pill.risk { background: #422a35; }
.pill.safe { background: #203a37; }
.comparison { display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); gap: 14px; padding: 9px 12px; margin: 0 14px; background: #131520; border: 1px solid var(--subtle-line); border-radius: 8px; }
.comparison div { display: grid; gap: 2px; }
.comparison div > span { color: var(--muted); font-size: .78rem; }
.comparison strong { font-size: 1.24rem; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.comparison-divider { background: var(--subtle-line); }
.result-summary { color: var(--muted); font-size: .81rem; line-height: 1.45; margin: 8px 15px 10px; overflow-wrap: anywhere; }
.recommendation { border: 1px solid #434672; background: #22243a; border-radius: 8px; padding: 9px; margin: 0 14px 9px; }
.recommendation-top, .recommendation-bottom { display: flex; align-items: center; gap: 8px; }
.recommendation-icon { display: grid; place-items: center; flex: 0 0 29px; height: 29px; background: #35395b; border-radius: 7px; color: var(--lilac); }
.recommendation h3 { color: #c8cbff; font-size: .74rem; font-weight: 720; }
.recommendation p { margin-top: 2px; font-weight: 650; font-size: .875rem; overflow-wrap: anywhere; }
.recommendation-bottom { justify-content: space-between; margin-top: 7px; }
.recommendation-bottom > span { color: #c5c8e7; font-size: .76rem; }
.backup-options { margin: 0 14px 4px; color: var(--muted); font-size: .8rem; }
.backup-options summary { cursor: pointer; padding: 4px 0; }
.backup-options label { display: flex; align-items: center; gap: 8px; padding: 7px 0; }
.backup-options label span { color: var(--text); overflow-wrap: anywhere; }
.backup-options input, .check-field input { accent-color: #adb2fc; width: 16px; height: 16px; margin: 0; flex: 0 0 16px; }
.backup-options small { margin-left: auto; white-space: nowrap; font-size: .78rem; }
.download { margin: 0 12px 9px; }
.dialog-header { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 15px; }
.dialog-header h2 { font-size: 1.35rem; letter-spacing: -.035em; }
#editor { max-width: 480px; width: calc(100% - 28px); max-height: calc(100dvh - 28px); border: 1px solid #494d6b; background: #191c2b; color: var(--text); border-radius: 15px; padding: 20px; box-shadow: 0 12px 60px #0008; }
#editor::backdrop { background: #060812b8; backdrop-filter: blur(3px); }
#editor-fields { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, legend { color: #e1e3f3; font-weight: 650; font-size: .875rem; }
.field input, .field select { width: 100%; min-height: 42px; color: var(--text); border: 1px solid #3b4058; background: #121421; border-radius: 7px; padding: 7px 9px; }
.field select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, #adb2fc 50%), linear-gradient(135deg, #adb2fc 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 11px) 52%; background-size: 4px 4px; background-repeat: no-repeat; }
.field input::placeholder { color: var(--quiet); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-field { display: flex; align-items: center; gap: 8px; font-size: .86rem; line-height: 1.35; min-height: 28px; overflow-wrap: anywhere; }
fieldset { min-width: 0; margin: 0; border: 1px solid #393d52; border-radius: 8px; padding: 8px 10px 10px; display: grid; gap: 8px; }
fieldset p { color: var(--muted); font-size: .8rem; }
.dependencies { max-height: 123px; overflow: auto; padding: 3px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.form-error { color: var(--peach); font-size: .87rem; margin-top: 10px; }
.toast { position: fixed; z-index: 2; bottom: 18px; right: 18px; max-width: calc(100vw - 36px); border: 1px solid #4b5075; border-radius: 9px; background: #282c42; color: var(--text); padding: 9px 14px; font-size: .875rem; box-shadow: 0 4px 14px #0006; }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 184px minmax(0, 1fr); }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .topbar, .content { padding-left: 20px; padding-right: 20px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 820px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--subtle-line); padding: 12px 17px; gap: 10px; }
  .brand { padding: 0; }
  .sidebar-main { margin-top: 0; padding: 2px; }
  .side-header, .sidebar-footer { display: none; }
  #plan-list { display: flex; gap: 6px; min-width: 0; }
  .plan-link { min-height: 35px; width: max-content; max-width: 210px; flex-shrink: 0; }
  .topbar { min-height: 60px; padding: 9px 17px; }
  .content { padding: 15px 17px 25px; }
  .hero-content { padding: 23px; }
}
@media (max-width: 620px) {
  .hero { background-position: center, 65% 50%; min-height: 180px; }
  .hero-content { padding: 18px; }
  .hero-goal { font-size: .9rem; }
  .workspace-grid { grid-template-columns: 1fr; }
  .metrics { gap: 6px; margin: 10px 0 12px; }
  .metric { padding: 8px; min-height: 68px; gap: 5px; }
  .metric-icon { flex-basis: 22px; height: 23px; font-size: .9rem; border-radius: 5px; }
  .metric > div > span { font-size: .7rem; line-height: 1.1; }
  .metric strong { font-size: 1.04rem; }
  .metric small { font-size: .66rem; }
  .panel-heading { padding: 13px 14px 10px; }
  .top-label { font-size: .8rem; }
  .top-actions .button { min-height: 36px; padding: 6px 8px; font-size: .8rem; }
}
@media (max-width: 345px) {
  .metric-icon { display: none; }
  .dialog-footer { gap: 5px; }
  .dialog-footer .button { padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
