:root {
  color-scheme: dark;
  --background: #080f19;
  --foreground: #edf4fc;
  --muted-foreground: #a8bacd;
  --border: #293c50;
  --primary: #6be1ea;
  --primary-foreground: #06151e;
  --destructive: #ffb597;
  --viz-series-1: #6be1ea;
  --viz-series-2: #f1c078;
  --viz-series-3: #a7a8ff;
  --viz-series-4: #ffa899;
  --font-sans: "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--background); }
body {
  margin: 0; color: var(--foreground); font: 1rem/1.55 var(--font-sans);
  background: radial-gradient(ellipse at 12% 0, #11313d80, transparent 48%),
    radial-gradient(ellipse at 95% 45%, #17223e55, transparent 48%), var(--background);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
main { max-width: 1232px; margin: 0 auto; padding: 36px 32px 56px; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button { color: inherit; }
button:disabled, select:disabled { cursor: not-allowed; }
a { color: var(--primary); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
button, select, input, summary, a { -webkit-tap-highlight-color: transparent; }
:is(button, select, input, summary, a):focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.text-small { font-size: .875rem; line-height: 1.5; }
.text-muted { color: var(--muted-foreground); }
.text-destructive, .text-warning { color: var(--destructive); }
.tabular-nums { font-variant-numeric: tabular-nums; }
.viz-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.viz-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.form-label { display: grid; gap: 9px; min-width: 0; font-size: .9375rem; font-weight: 550; }
.form-select, .form-control {
  display: block; width: 100%; min-width: 0; min-height: 2.875rem; height: auto; padding: 10px 38px 10px 13px;
  border: 1px solid #385069; border-radius: 8px; color: var(--foreground); background-color: #0a1421;
  font-size: 1rem; font-weight: 400; transition: border-color .15s, background-color .15s;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23aac0d4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.form-select:hover, .form-control:hover { border-color: #638399; }
.form-select:focus, .form-control:focus { border-color: var(--primary); }
.form-select:disabled { color: #a1b1c2; border-color: #2c3b4c; background-color: #101a27; }
select option, select optgroup { color: var(--foreground); background: #101a27; }
select option:disabled { color: #899bac; }
.form-control { padding-right: 13px; }
.form-control::placeholder { color: #9badc0; }
.form-check { display: flex; gap: 12px; align-items: center; font-size: 1rem; font-weight: 500; }
.form-check-input { width: 20px; height: 20px; accent-color: var(--primary); flex: 0 0 auto; margin: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; border: 1px solid #3b536b; border-radius: 8px; padding: 9px 14px;
  background: #18283a; color: #edf4fc; font-size: .9375rem; font-weight: 550; line-height: 1.4;
  text-align: center; transition: background .15s, border-color .15s;
}
.btn:hover { background: #20384a; border-color: #6d9bad; }
.btn-primary, .btn[aria-pressed="true"] { background: #173d49; border-color: #6be1ea; color: #a5f6f7; }
.btn-ghost { background: #112838; color: #a1eaf1; border-color: #315568; }
.btn-ghost:hover { background: #1a3849; border-color: #6be1ea; }
.viz-tile { display: block; width: 100%; min-width: 0; min-height: 44px; overflow-wrap: anywhere; }
.sw-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.sw-heading > div { min-width: 0; }
.sw-brand-mark { width: 54px; height: 54px; display: grid; place-items: center; flex: 0 0 auto; background: #12313e; border: 1px solid #365c6b; border-radius: 12px; }
.sw-brand-mark svg { width: 31px; height: 31px; color: var(--primary); }
.sw-eyebrow { display: block; color: #a6becd; font-size: .8125rem; font-weight: 600; letter-spacing: .15em; line-height: 1.6; }
.sw-heading h1 { font-size: clamp(1.625rem, 2.8vw, 2.125rem); letter-spacing: -.035em; line-height: 1.25; font-weight: 650; overflow-wrap: anywhere; }
.sw-build-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 5rem), 1fr)); gap: 14px; margin-bottom: 24px; }
.sw-stat { padding: 17px 20px 15px; background: #111e2bcc; border: 1px solid #2c4357; border-radius: 12px; }
.sw-stat-label { display: block; color: #b5c5d5; font-size: .875rem; font-weight: 550; overflow-wrap: anywhere; }
.sw-stat-value { display: block; margin: 5px 0; font-size: 1.875rem; font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
.sw-stat-value small { color: #99adc1; font-size: 1.125rem; font-weight: 450; }
.sw-stat-note { display: block; color: #a8bbcc; font-size: .875rem; margin-top: 7px; overflow-wrap: anywhere; }
.sw-meter { height: 3px; border-radius: 2px; background: #293b4d; overflow: hidden; margin-top: 11px; }
.sw-meter i { display: block; height: 100%; background: var(--primary); transition: width .2s ease; }
.sw-stat:nth-child(2) .sw-meter i { background: var(--viz-series-3); }
.sw-stat-mastery .sw-meter i { background: var(--viz-series-2); }
.sw-stat-mastery .sw-stat-value { color: #f4ce92; }
.nav { display: flex; gap: 6px; padding: 6px; background: #0e1926; border: 1px solid var(--border); border-radius: 11px; margin-bottom: 18px; }
.nav-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex: 1; min-width: 0;
  min-height: 45px; padding: 10px 16px; border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: #b5c5d6; font-size: 1rem; font-weight: 550; transition: background .15s;
}
.nav-link svg { width: 19px; height: 19px; flex: 0 0 auto; }
.nav-link span { min-width: 0; overflow-wrap: anywhere; }
.nav-link:hover { background: #192a3b; color: #edf4fc; }
.nav-link.active { color: #aaf2f4; background: #18333f; border-color: #3a6876; box-shadow: inset 0 1px #6be1ea26; }
.sw-panel { background: #101b29; border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: 0 12px 30px #0000001c; }
.sw-panel-actions { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.sw-clear-button { color: #efc3af; border-color: #665348; background: #302a28; }
.sw-clear-button:hover { color: #ffe0cb; border-color: #ba9076; background: #403129; }
.btn:disabled { color: #96aabd; border-color: #304154; background: #142130; }
.sw-code-tools { margin-bottom: 18px; }
.sw-code-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; }
.sw-code-panel { margin-top: 14px; padding: 18px; border: 1px solid #3b596f; border-radius: 10px; background: #111f2e; }
.sw-code-input { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .875rem; line-height: 1.6; padding: 12px; min-height: 6rem; resize: vertical; overflow-wrap: anywhere; }
.sw-code-status { margin-top: 12px; color: #c2edf0; }
.sw-code-status:empty { display: none; }
.sw-code-status.text-destructive { color: var(--destructive); }
.sw-action-feedback { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid #3b6575; border-radius: 9px; background: #122d3a; color: #d4edf3; font-size: .9375rem; }
.sw-identity { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .65fr); gap: 20px; align-items: end; border-bottom: 1px solid var(--border); padding-bottom: 23px; margin-bottom: 24px; }
.sw-identity .form-check { min-height: 46px; padding: 10px 15px; border: 1px solid #2b4156; border-radius: 8px; background: #132233; }
.sw-section-label { color: #edf4fc; font-size: 1.0625rem; font-weight: 600; margin: 24px 0 8px; }
.sw-section-label:first-child { margin-top: 0; }
.sw-section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin: 0 0 8px; }
.sw-section-heading h2 { font-size: 1.125rem; font-weight: 600; letter-spacing: -.015em; }
.sw-space { margin-top: 16px; }
.sw-choice-card { position: relative; align-content: start; padding: 14px; background: #142233; border: 1px solid #304356; border-radius: 10px; }
.sw-choice-heading { color: #cad8e5; font-size: .875rem; font-weight: 550; }
.sw-choice-card[data-filled="true"] { border-color: #44717c; background: #142c3a; }
.sw-choice-card[data-filled="true"] .sw-choice-heading { color: #a6edf0; }
.sw-choice-card[data-state="locked"] { background: #111d2b; border-style: dashed; }
.sw-choice-card[data-state="invalid"] { border-color: #d48b6c; background: #30242a; }
.sw-field-status { display: block; font-size: .875rem; color: #b1c1d2; line-height: 1.45; font-weight: 400; overflow-wrap: anywhere; }
.sw-field-status:empty { display: none; }
.sw-choice-card .text-destructive { color: var(--destructive); }
#swlor-allocated-fields:empty { display: none; }
#swlor-allocated-fields .btn { min-height: 36px; font-size: .875rem; border-radius: 7px; }
.sw-focus { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; padding: 15px 18px; background: #102e3a; border: 1px solid #365967; border-left: 3px solid var(--primary); border-radius: 8px; }
.sw-focus > span { flex: 1 1 440px; min-width: 0; }
#swlor-free-section { margin-top: 24px; padding-top: 1px; border-top: 1px solid var(--border); }
#swlor-free-section > .text-muted { margin-top: 12px; }
.sw-mastery-shell { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); align-items: center; gap: 24px; margin-top: 24px; padding: 22px; border: 1px solid #655333; border-radius: 10px; background: linear-gradient(100deg, #332b1c80, #18222f); }
.sw-mastery-shell h2 { color: #f4d09a; font-size: 1.125rem; font-weight: 600; margin-bottom: 6px; }
.sw-mastery-shell .form-select { border-color: #65583f; }
.sw-mastery-shell .sw-field-status { color: #d2c4ad; }
.sw-build-issues, .sw-warning { border: 1px solid #b27c63; background: #33232a; color: #ffc5ae; border-radius: 9px; padding: 14px 18px; margin-bottom: 18px; }
.sw-build-issues > span { font-size: 1rem; font-weight: 600; }
.sw-build-issues ul { margin: 8px 0 0; padding-left: 20px; }
.sw-build-issues li { margin: 4px 0; }
#swlor-feat-counts { padding: 12px 16px; border: 1px solid #365366; background: #132a3a; border-radius: 8px; color: #c2e7ed; }
#swlor-fluff-slots, #swlor-custom-fluff-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
details { margin-top: 22px; border: 1px solid #33495d; border-radius: 10px; padding: 14px 17px; background: #101e2d; }
summary { color: #d4e1ed; font-weight: 550; line-height: 1.5; }
details[open] summary { margin-bottom: 16px; }
.sw-extra-row { display: grid; gap: 10px; margin-top: 14px; }
.sw-extra-row .viz-controls { grid-template-columns: minmax(0, 1fr); }
.sw-cap { margin-top: 14px; }
#swlor-panel-explore > .viz-controls { grid-template-columns: minmax(0, 1fr); margin-bottom: 24px; }
.sw-topic { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 10px; }
.sw-topic-name { font-size: 1.4375rem; font-weight: 600; letter-spacing: -.02em; }
.sw-topic > .text-small { color: #b6c8d8; }
.sw-availability { color: #bfe6eb; font-size: .9375rem; }
.sw-diagram { position: relative; margin: 22px 0 16px; padding: 24px 16px; border: 1px solid #294259; border-radius: 11px; background-color: #0a1523; background-image: linear-gradient(#1a2e4040 1px, transparent 1px), linear-gradient(90deg, #1a2e4040 1px, transparent 1px); background-size: 24px 24px; }
.sw-content { position: relative; z-index: 1; }
.sw-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.sw-links path { fill: none; stroke: #587c94; stroke-width: 1.5; }
.sw-links path.sw-uncertain { stroke-dasharray: 4 4; }
.sw-links circle { stroke: none; }
.sw-ladder { display: grid; gap: 24px; }
.sw-rank-row { display: grid; grid-template-columns: 114px minmax(0, 1fr); gap: 42px; align-items: start; min-height: 46px; }
.sw-rank-label { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; text-align: center; }
.sw-branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 186px), 1fr)); gap: 14px 18px; align-items: start; }
.sw-node { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; text-align: center; align-content: start; padding: 13px; background: #101e2de8; border: 1px solid #30485e; border-radius: 10px; }
.sw-node .text-small { overflow-wrap: anywhere; }
.sw-node .btn { background: #1b3044; }
.sw-node .btn-primary { background: #19424d; border-color: #6be1ea; }
.sw-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; color: #c0cddd; }
.sw-dot { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; }
.sw-1 { background: var(--viz-series-1); }
.sw-2 { background: var(--viz-series-2); }
.sw-3 { background: var(--viz-series-3); }
.sw-4 { background: var(--viz-series-4); }
.sw-expression { display: grid; gap: 32px; padding-inline: 8px; }
.sw-children { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 144px), 1fr)); align-items: end; gap: 32px 28px; }
.sw-operator { justify-self: center; padding: 6px 14px; color: #b6f1f3; background: #143040; border: 1px solid #517080; border-radius: 6px; font-weight: 650; text-align: center; }
.sw-target { display: grid; justify-items: center; gap: 4px; padding-top: 34px; }
.sw-condition { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; justify-items: center; padding: 14px; min-width: 0; text-align: center; overflow-wrap: anywhere; background: #10202e; border: 1px solid #385166; border-radius: 8px; }
.sw-target-button { width: min(100%, 340px); }
.sw-rank-label [data-select-rank="4"] { color: #f5d099; border-color: #756240; background: #332c22; }
.sw-detail { padding: 16px 18px; border: 1px solid #3b6174; background: #122c3b; border-radius: 9px; color: #d8edf6; line-height: 1.65; }
.sw-detail:empty { display: none; }
.sw-warning { display: flex; align-items: baseline; gap: 8px; margin-top: 16px; }
.sw-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 18px 0 10px; }
.sw-legend-label { display: inline-flex; align-items: center; gap: 7px; color: #c4d2df; }
.sw-rule-list { display: grid; gap: 14px; margin: 16px 0; }
.sw-rule { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 14px; font-size: .9375rem; }
.sw-rule dt { color: #a6bdcf; font-weight: 550; }
.sw-rule dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sw-sources { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; }
.sw-synergies { display: grid; gap: 14px; padding-top: 24px; }
.sw-synergy-row { display: grid; grid-template-columns: 114px minmax(0, 1fr); gap: 42px; align-items: center; }
.sw-synergy-heading { text-align: center; color: #b4c4d2; }
@media (max-width: 900px) {
  main { padding: 28px 20px 40px; }
  .viz-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sw-panel { padding: 20px; }
  .sw-stat { padding: 15px; }
}
@media (max-width: 600px) {
  main { padding: 24px 12px 32px; }
  .sw-heading { gap: 12px; margin-bottom: 22px; }
  .sw-brand-mark { width: 44px; height: 44px; border-radius: 10px; }
  .sw-brand-mark svg { width: 27px; height: 27px; }
  .sw-eyebrow { font-size: .75rem; letter-spacing: .1em; }
  .sw-build-status { gap: 8px; margin-bottom: 18px; }
  .sw-stat { padding: 12px 10px; border-radius: 9px; }
  .sw-stat-label { font-size: .875rem; }
  .sw-stat-value { font-size: 1.5rem; margin-top: 8px; }
  .sw-stat-value small { font-size: .9375rem; }
  .sw-stat-note { font-size: .8125rem; }
  .sw-panel { padding: 17px 14px; border-radius: 11px; }
  .nav { gap: 3px; padding: 4px; }
  .nav-link { padding: 10px 8px; gap: 7px; }
  .nav-link svg { width: 17px; height: 17px; }
  .sw-identity { grid-template-columns: minmax(0, 1fr); gap: 15px; padding-bottom: 20px; margin-bottom: 20px; }
  .sw-mastery-shell { grid-template-columns: minmax(0, 1fr); padding: 17px; gap: 16px; }
  .sw-choice-card { padding: 13px; }
  .sw-rule { grid-template-columns: 82px minmax(0, 1fr); gap: 10px; }
  .sw-rank-row, .sw-synergy-row { grid-template-columns: 90px minmax(0, 1fr); gap: 24px; }
  .sw-diagram { padding: 20px 10px; }
  .sw-node { padding: 10px; }
}
@media (max-width: 480px) {
  .viz-controls, #swlor-fluff-slots, #swlor-custom-fluff-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sw-stat-value { font-size: 1.3125rem; }
  .sw-stat-note { line-height: 1.5; }
  .sw-focus { padding: 14px; }
  .sw-children { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .sw-expression { padding-inline: 0; }
  .sw-rank-row, .sw-synergy-row { grid-template-columns: 80px minmax(0, 1fr); gap: 16px; }
  .sw-rank-label .btn { font-size: .875rem; padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
