:root {
  color-scheme: dark;
  /* Exact Studio surface, type and interaction tokens. Legacy schedule names
     remain aliases so all existing workspace controls keep their contracts. */
  --ui-bg-base: #0d0d0f;
  --ui-bg-surface: #141416;
  --ui-bg-elevated: #242428;
  --ui-bg-overlay: #242428;
  --ui-bg-control: #27272b;
  --ui-bg-input: #1a1a1d;
  --ui-border-subtle: rgba(255, 255, 255, 0.06);
  --ui-border-default: rgba(255, 255, 255, 0.10);
  --ui-border-strong: rgba(255, 255, 255, 0.18);
  --ui-text-primary: #f0f0f2;
  --ui-text-secondary: #8b8b96;
  --ui-text-muted: #5c5c68;
  --ui-accent: #7c6af7;
  --ui-accent-hover: #9181f8;
  --ui-accent-muted: rgba(124, 106, 247, 0.16);
  --ui-accent-ring: rgba(124, 106, 247, 0.35);
  --ui-success: #b8f0d0;
  --ui-radius-sm: 7px;
  --ui-radius-md: 10px;
  --ui-radius-lg: 13px;
  --ui-shadow-sm: 0 1px 2px rgba(0,0,0,.28), 0 1px 3px rgba(0,0,0,.18);
  --ui-shadow-md: 0 4px 12px rgba(0,0,0,.34), 0 2px 6px rgba(0,0,0,.22);
  --ui-shadow-lg: 0 12px 32px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.28);
  --ui-inset-highlight: inset 0 1px 0 rgba(255,255,255,.05);
  --ui-transition: border-color .15s cubic-bezier(.16,1,.3,1), background-color .15s cubic-bezier(.16,1,.3,1), color .15s cubic-bezier(.16,1,.3,1), filter .15s cubic-bezier(.16,1,.3,1), opacity .15s cubic-bezier(.16,1,.3,1), box-shadow .15s cubic-bezier(.16,1,.3,1);
  --bg: var(--ui-bg-base);
  --surface: var(--ui-bg-surface);
  --surface-2: var(--ui-bg-control);
  --surface-3: var(--ui-bg-overlay);
  --line: var(--ui-border-default);
  --line-strong: var(--ui-border-strong);
  --text: var(--ui-text-primary);
  --text-2: var(--ui-text-secondary);
  /* Existing schedule labels use `--muted`; keep them at Studio's readable
     secondary contrast instead of compounding the tertiary muted token. */
  --muted: var(--ui-text-secondary);
  --mint: var(--ui-accent);
  --blue: var(--ui-accent-hover);
  --violet: #9f91ff;
  --amber: #e0b76e;
  --danger: #ef8b8b;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, monospace;
  --sans: Inter, Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-family: var(--sans);
}

* { box-sizing: border-box; }
.sg-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.sg-shell [hidden] { display: none !important; }

html,
body {
  width: 100%;
  min-width: 900px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button,
input { font: inherit; }

button { color: inherit; }

.sg-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 62px minmax(0, 1fr);
  background:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
}
.sg-shell.is-generator-open { grid-template-rows: 62px minmax(0, 1fr); }

.sg-topbar {
  display: grid;
  grid-template-columns: auto minmax(210px, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 18, 0.96);
}

.sg-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.sg-brand img { width: 32px; height: 32px; border-radius: 7px; }
.sg-brand > span { display: grid; gap: 3px; }
.sg-brand strong { font-size: 14px; line-height: 1; }
.sg-brand small { color: var(--muted); font: 7px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.sg-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.sg-title > span,
.sg-card-header > div > span,
.sg-output-hero > div > span,
.sg-rulebar-heading > span {
  color: var(--muted);
  font: 700 8px/1 var(--mono);
  letter-spacing: .09em;
}

.sg-title h1 { margin: 0; font-size: 17px; font-weight: 640; letter-spacing: -.02em; }
.sg-title em { padding: 3px 6px; border: 1px solid rgba(117,222,195,.25); border-radius: 999px; color: var(--mint); font: normal 700 7px/1 var(--mono); text-transform: uppercase; }

.sg-rulebar label > span { color: var(--muted); font: 700 8px/1.2 var(--mono); text-transform: uppercase; }

.sg-rulebar input,
.sg-edit-table input {
  border: 1px solid var(--line);
  background: #090d13;
  color: var(--text);
  outline: none;
}

.sg-rulebar input:focus,
.sg-edit-table input:focus { border-color: rgba(126,181,242,.55); box-shadow: 0 0 0 2px rgba(126,181,242,.09); }

.sg-top-actions,
.sg-card-actions,
.sg-result-actions { display: flex; align-items: center; gap: 7px; }

.sg-generate-toggle { height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: var(--text-2); cursor: pointer; font-size: 10px; font-weight: 650; white-space: nowrap; }
.sg-generate-toggle:hover { border-color: var(--line-strong); background: var(--surface-3); color: var(--text); }
.sg-generate-toggle input { width: 14px; height: 14px; margin: 0; accent-color: var(--mint); cursor: pointer; }
.sg-generate-toggle:has(input:checked) { border-color: rgba(117,222,195,.36); background: rgba(117,222,195,.1); color: #c8f5e9; }

.sg-empty-actions { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 9px; }

.sg-button,
.sg-icon-button,
.sg-source-tabs button,
.sg-view-tabs button,
.sg-pagination button {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.sg-button { height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; color: inherit; font-size: 10px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.sg-button-quiet { color: var(--text-2); }
.sg-button-primary { min-width: 94px; border-color: rgba(117,222,195,.32); background: rgba(117,222,195,.13); color: #c8f5e9; }
.sg-button-spark { color: var(--mint); margin-right: 3px; }
.sg-button:hover:not(:disabled),
.sg-icon-button:hover:not(:disabled),
.sg-pagination button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-3); color: var(--text); }
.sg-button-primary:hover:not(:disabled) { border-color: rgba(117,222,195,.55); background: rgba(117,222,195,.2); }
.sg-button[aria-busy="true"] { opacity: .55; pointer-events: none; }
button:disabled { opacity: .38; cursor: default; }

.sg-rulebar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 9px 8px;
  padding: 10px;
  border: 0;
  background: transparent;
}

.sg-rulebar-heading { min-width: 0; grid-column: 1 / -1; display: grid; gap: 5px; padding-top: 9px; border-top: 1px solid var(--line); }
.sg-rulebar-heading p { overflow: hidden; margin: 0; color: var(--text-2); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.sg-rulebar label { min-width: 0; display: grid; gap: 5px; }
.sg-rulebar label > div { display: grid; grid-template-columns: minmax(0,1fr) 39px; align-items: center; }
.sg-rulebar label > small { min-height: 22px; color: var(--muted); font-family: inherit; font-size: 8px; font-weight: 500; line-height: 1.35; }
.sg-rulebar input { width: 100%; height: 27px; padding: 0 7px; border-radius: 3px 0 0 3px; text-align: right; font: 10px/1 var(--mono); }
.sg-rulebar label b { height: 27px; display: grid; place-items: center; border: 1px solid var(--line); border-left: 0; border-radius: 0 3px 3px 0; color: var(--muted); font: 700 8px/1 var(--mono); }
.sg-rulebar-note { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; color: var(--muted); font: 700 8px/1 var(--mono); white-space: nowrap; }
.sg-rulebar-note i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px rgba(117,222,195,.55); }

.sg-workspace {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 28fr) minmax(0, 72fr);
  overflow: hidden;
}
.sg-shell:not(.is-generator-open) .sg-workspace { grid-template-columns: minmax(0, 1fr); }
.sg-shell:not(.is-generator-open) .sg-input-pane { display: none; }
.sg-shell:not(.is-generator-open) .sg-output-pane { grid-column: 1; }

.sg-pane { min-width: 0; min-height: 0; overflow: auto; scrollbar-color: rgba(255,255,255,.16) rgba(0,0,0,.2); scrollbar-width: thin; }
.sg-input-pane { display: flex; flex-direction: column; padding: 12px; border-right: 1px solid var(--line); }
.sg-output-pane { display: flex; flex-direction: column; padding: 12px; overflow: hidden; background: rgba(5,8,12,.38); }
.sg-input-pane .sg-profile-card { width: 100%; }
.sg-generator-settings-card > .sg-card-header .sg-collapse-control { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); }
.sg-generator-settings-card > .sg-card-header .sg-collapse-control small { font: 600 7px/1.3 var(--mono); text-align: right; }
.sg-collapsible-card-header { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.sg-collapsible-card-header:hover { background: rgba(255,255,255,.025); }
.sg-collapsible-card-header:focus-visible { outline: 1px solid rgba(117,222,195,.6); outline-offset: -2px; }
.sg-collapse-control i { width: 8px; height: 8px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .16s ease; }
.sg-collapsible-card-header[aria-expanded="true"] .sg-collapse-control i { transform: rotate(225deg) translate(-1px,-1px); }
.sg-generator-settings-card { flex: 0 0 auto; }
.sg-input-pane .sg-profile-table-wrap { max-height: 54vh; }

.sg-generate-fab {
  position: absolute;
  z-index: 18;
  left: max(360px, 28%);
  top: 56%;
  width: 70px;
  height: 70px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(117,222,195,.58);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(117,222,195,.3), rgba(19,59,54,.96) 72%);
  color: #d9fff5;
  box-shadow: 0 0 0 6px rgba(8,11,16,.88), 0 12px 34px rgba(0,0,0,.5), 0 0 22px rgba(117,222,195,.18);
  cursor: pointer;
}
.sg-generate-fab span { color: var(--mint); font-size: 17px; line-height: 1; }
.sg-generate-fab strong { font-size: 9px; line-height: 1; letter-spacing: .01em; }
.sg-generate-fab:hover:not(:disabled) { border-color: var(--mint); background: radial-gradient(circle at 35% 28%, rgba(117,222,195,.42), rgba(20,78,68,.98) 72%); box-shadow: 0 0 0 6px rgba(8,11,16,.88), 0 14px 38px rgba(0,0,0,.55), 0 0 28px rgba(117,222,195,.3); }
.sg-generate-fab:disabled { opacity: .42; cursor: default; }
.sg-generate-fab[aria-busy="true"] { opacity: 1; pointer-events: none; border: 4px solid transparent; background: radial-gradient(circle at 35% 28%, rgba(117,222,195,.3), rgba(19,59,54,.98) 72%) padding-box, conic-gradient(var(--mint) calc(var(--generation-progress,0) * 1%), rgba(117,222,195,.12) 0) border-box; }
.sg-generate-fab[aria-busy="true"] span { animation: sg-progress-spin 1.2s linear infinite; }
@keyframes sg-progress-spin { to { transform: rotate(360deg); } }
.sg-shell:not(.is-generator-open) .sg-generate-fab { display: none; }

.sg-card {
  min-width: 0;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(14,18,25,.94);
}

.sg-card-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}

.sg-card-header-compact { min-height: 42px; }
.sg-card-header > div:first-child:not(.sg-view-tabs) { display: grid; gap: 4px; }
.sg-card-header > .sg-view-tabs { display: flex; flex-direction: row; gap: 0; }
.sg-card-header h2 { margin: 0; font-size: 12px; font-weight: 620; }
.sg-card-header > b { color: var(--muted); font: 600 8px/1 var(--mono); }

.sg-profile-legend { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 600 8px/1 var(--mono); }
.sg-profile-legend span { display: flex; align-items: center; gap: 4px; }
.sg-profile-legend small { padding-left: 9px; border-left: 1px solid var(--line); color: #687681; font: 600 7px/1 var(--mono); }
.sg-profile-legend i { width: 6px; height: 6px; border-radius: 50%; }
.sg-profile-legend .is-current { background: var(--blue); }
.sg-profile-legend .is-target { background: var(--amber); }
.sg-profile-legend .is-generated { background: var(--mint); }

.sg-profile-table-wrap { max-height: calc(100vh - 410px); overflow: auto; }
.sg-profile-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sg-profile-table th,
.sg-profile-table td { height: 27px; padding: 0 8px; border-right: 1px solid rgba(221,231,240,.06); border-bottom: 1px solid rgba(221,231,240,.06); font: 9px/1 var(--mono); }
.sg-profile-table th { position: sticky; z-index: 2; top: 0; background: #151a22; color: var(--muted); text-align: right; text-transform: uppercase; }
.sg-profile-table th:first-child { width: 56%; text-align: left; }
.sg-profile-table th:nth-child(2),
.sg-profile-table th:nth-child(3) { width: 22%; }
.sg-profile-table.has-generated th:first-child { width: 46%; }
.sg-profile-table.has-generated th:nth-child(2),
.sg-profile-table.has-generated th:nth-child(3),
.sg-profile-table.has-generated th:nth-child(4) { width: 18%; }
.sg-profile-table td:first-child { color: var(--text-2); font-family: inherit; }
.sg-profile-table td:not(:first-child) { text-align: right; }
.sg-profile-table tr[data-group-start="true"] td { border-top: 1px solid var(--line-strong); }
.sg-profile-table .sg-current-value { color: #a9d0fb; }
.sg-profile-table .sg-generated-value { color: #b2f2e1; }
.sg-profile-table input { width: 100%; height: 21px; padding: 0 4px; border: 1px solid rgba(224,183,110,.18); border-radius: 3px; background: rgba(224,183,110,.05); color: #f1d39e; text-align: right; font: 9px/1 var(--mono); outline: none; }
.sg-profile-table input:focus { border-color: rgba(224,183,110,.55); }
.sg-profile-table td[data-target-mode="editable"] { background: rgba(224,183,110,.018); }
.sg-derived-target { color: var(--muted); }
.sg-profile-table td[data-target-mode="dependent"] .sg-derived-target::before { content: "AUTO"; margin-right: 6px; color: #6f8291; font-size: 6px; letter-spacing: .05em; }

.sg-peak-chart-tabs { display: flex; align-items: center; gap: 5px; padding: 8px 8px 0; }
.sg-peak-chart-tabs button { min-height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: var(--muted); cursor: pointer; font: 700 8px/1 var(--mono); }
.sg-peak-chart-tabs button[aria-selected="true"] { border-color: rgba(124,106,247,.48); background: rgba(124,106,247,.16); color: #ded9ff; }
.sg-chart-grid { display: block; padding: 8px; }
.sg-chart-grid figure { min-width: 0; margin: 0; padding: 10px 10px 6px; border: 1px solid rgba(221,231,240,.06); border-radius: 4px; background: #090d13; }
.sg-chart-grid figure[hidden] { display: none; }
.sg-chart-grid figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: var(--muted); font: 700 8px/1 var(--mono); text-transform: uppercase; }
.sg-chart-grid figcaption b { overflow: hidden; color: #53616c; font: 600 6px/1 var(--mono); white-space: nowrap; text-overflow: ellipsis; }
.sg-chart-grid canvas { display: block; width: 100%; height: 76px; }
.sg-chart-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; }
.sg-chart-legend i { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font: 700 7px/1 var(--mono); font-style: normal; }
.sg-chart-legend i::before { content: ""; width: 12px; height: 2px; border-radius: 2px; background: currentColor; }
.sg-chart-legend .is-total { color: #c4cad1; }
.sg-chart-legend .is-arr { color: #66a9ef; }
.sg-chart-legend .is-dep { color: #9f91ff; }
.sg-chart-legend .is-od { color: #a7b0ba; }
.sg-chart-legend .is-transfer { color: #a7b0ba; }
.sg-chart-legend .is-transfer::before { height: 0; border-top: 2px dashed currentColor; background: transparent; }

.sg-icon-button { min-height: 26px; padding: 0 8px; color: var(--text-2); font-size: 9px; font-weight: 650; }
.sg-icon-button span { color: var(--mint); }
.sg-icon-button.sg-danger { color: var(--danger); }
.sg-filter-pill { width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid rgba(126,181,242,.28); border-radius: 50%; background: rgba(126,181,242,.08); color: #b9d8fa; cursor: pointer; font: 650 7px/1 var(--mono); }
.sg-filter-pill:hover:not(:disabled) { border-color: rgba(126,181,242,.55); background: rgba(126,181,242,.16); }
.sg-table-meta { min-height: 28px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border-bottom: 1px solid rgba(221,231,240,.06); color: var(--muted); font: 600 8px/1 var(--mono); }
.sg-schedule-table-wrap { width: 100%; overflow: auto; }
.sg-schedule-card .sg-schedule-table-wrap { max-height: 320px; }
.sg-schedule-table { min-width: 0; width: 3400px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.sg-schedule-table th,
.sg-schedule-table td { height: 34px; padding: 0 7px; border-right: 1px solid rgba(221,231,240,.06); border-bottom: 1px solid rgba(221,231,240,.06); overflow: hidden; color: var(--text-2); font: 10px/1 var(--mono); white-space: nowrap; text-overflow: ellipsis; }
.sg-schedule-table th { position: sticky; z-index: 2; top: 0; background: #171c25; color: #8d99a4; text-align: left; text-transform: uppercase; }
.sg-schedule-table th:first-child,
.sg-schedule-table td:first-child { position: sticky; z-index: 4; left: 0; width: 30px; min-width: 30px; max-width: 30px; padding: 0; background: #121720; color: var(--muted); text-align: center; }
.sg-schedule-table th:nth-child(2),
.sg-schedule-table td:nth-child(2) { position: sticky; z-index: 3; left: 30px; width: 42px; min-width: 42px; max-width: 42px; background: #121720; color: var(--muted); text-align: center; }
.sg-schedule-table tr.sg-color-row > td:first-child::before { content: ""; position: absolute; top: 50%; left: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--row-color); transform: translateY(-50%); }
.sg-schedule-table .sg-row-origin-head,
.sg-schedule-table .sg-row-origin { width: 62px; min-width: 62px; max-width: 62px; padding: 0 5px; text-align: center; }
.sg-generated-row-badge { display: inline-flex; min-width: 42px; height: 17px; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(255,255,255,.045); color: #9aa7b4; font: 750 7px/1 var(--mono); letter-spacing: .05em; }
.sg-schedule-table th[data-field="sibt"],
.sg-schedule-table th[data-field="sobt"] { width: 145px; }
.sg-schedule-table th[data-field="reg"] { width: 110px; }
.sg-schedule-table th[data-field="airline"] { width: 92px; }
.sg-schedule-table th[data-field="icaoCat"],
.sg-schedule-table th[data-field="arrIntDom"],
.sg-schedule-table th[data-field="depIntDom"],
.sg-schedule-table th[data-field="primary"] { width: 105px; }
.sg-schedule-table th[data-field="icaoCode"] { width: 190px; }
.sg-schedule-table th[data-field="airlineGroup"] { width: 105px; }
.sg-schedule-table th[data-field="arrBuilding"],
.sg-schedule-table th[data-field="depBuilding"] { width: 115px; }
.sg-schedule-table th[data-field="arrFlight"],
.sg-schedule-table th[data-field="depFlight"] { width: 95px; }
.sg-schedule-table th[data-field="totalPax"] { color: var(--mint); }
.sg-column-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.sg-column-head > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sg-column-head > .sg-column-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 3px; overflow: visible; }
.sg-column-head small { margin-left: 3px; color: var(--amber); font-size: 7px; text-transform: none; }
.sg-column-bulk { width: 18px; height: 18px; flex: 0 0 18px; padding: 0; border: 1px solid rgba(126,181,242,.28); border-radius: 50%; background: rgba(126,181,242,.08); color: #b9d8fa; cursor: pointer; font: 800 10px/1 var(--mono); }
.sg-column-bulk:hover { border-color: rgba(126,181,242,.65); background: rgba(126,181,242,.18); }
.sg-column-resolve { height: 18px; padding: 0 5px; border: 1px solid rgba(255,142,151,.5); border-radius: 999px; background: rgba(255,103,116,.12); color: #ffc7cc; cursor: pointer; font: 700 7px/1 var(--mono); text-transform: none; }
.sg-column-resolve:hover { border-color: rgba(255,157,166,.9); background: rgba(255,103,116,.24); }
.sg-column-assume { height: 18px; padding: 0 4px; border: 0; border-radius: 3px; background: rgba(224,183,110,.08); color: #f1d39e; cursor: pointer; font: 650 7px/1 var(--mono); }
.sg-edit-table input { width: 100%; height: 27px; padding: 0 5px; border-color: transparent; background: transparent; font: 10px/1 var(--mono); }
.sg-edit-table input:hover { border-color: var(--line); background: #090d13; }
.sg-edit-table select { width: 100%; height: 27px; padding: 0 20px 0 4px; border: 1px solid rgba(117,222,195,.16); border-radius: 3px; background: #0b1217; color: var(--mint); font: 9px/1 var(--mono); outline: none; }
.sg-edit-table select:focus { border-color: rgba(117,222,195,.55); box-shadow: 0 0 0 2px rgba(117,222,195,.08); }
.sg-edit-table td[data-readonly="true"] { color: var(--mint); text-align: right; background: transparent; }
.sg-edit-table td[data-dependent="true"] { color: #b9d8fa; text-align: center; background: transparent; }
.sg-row-action-head, .sg-row-number-head, .sg-row-number { color: var(--muted); font: 700 8px/1 var(--mono); }
.sg-cell-content { width: 100%; min-width: 0; display: flex; align-items: center; gap: 4px; }
.sg-cell-content > input, .sg-cell-content > select, .sg-cell-content > .sg-readonly-value { min-width: 0; flex: 1 1 auto; }
.sg-schedule-table tr.sg-color-row > td.sg-cell-error { background: #491b23; box-shadow: inset 0 0 0 1px rgba(255,92,106,.72); color: #ffd8dc; }
.sg-schedule-table tr.sg-color-row > td.sg-cell-warning { background: #44351b; box-shadow: inset 0 0 0 1px rgba(231,184,108,.58); color: #ffe7bd; }
.sg-schedule-table tr.sg-color-row > td.sg-cell-unassigned { background: #392d19; box-shadow: inset 0 0 0 1px rgba(231,184,108,.42); color: #ffe0a8; }
.sg-schedule-table td.sg-cell-unassigned select { border-color: rgba(231,184,108,.5); background: #211b12; color: #ffd99a; }
.sg-schedule-table td.sg-cell-error input,
.sg-schedule-table td.sg-cell-error select { color: #fff0f2; }
.sg-issue-resolve { min-width: 38px; height: 19px; flex: 0 0 auto; padding: 0 5px; border: 1px solid rgba(255,150,158,.68); border-radius: 999px; background: rgba(255,103,116,.18); color: #ffd4d8; cursor: pointer; font: 700 7px/1 var(--mono); }
.sg-issue-resolve:hover { border-color: #ff9da6; background: rgba(255,103,116,.3); }
.sg-cell-alert { width: 16px; height: 16px; flex: 0 0 16px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,103,116,.2); color: #ffc3c9; font: 800 9px/1 var(--mono); }
.sg-column-resize { position: absolute; z-index: 5; top: 0; right: -3px; bottom: 0; width: 7px; cursor: col-resize; touch-action: none; }
.sg-column-resize::after { content: ""; position: absolute; top: 7px; bottom: 7px; left: 3px; width: 1px; background: transparent; }
.sg-column-resize:hover::after,
body.is-resizing-schedule-column .sg-column-resize::after { background: rgba(126,181,242,.7); }
body.is-resizing-schedule-column { cursor: col-resize; user-select: none; }
.sg-row-remove { width: 19px; height: 19px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer; }
.sg-row-remove:hover { background: rgba(239,139,139,.1); color: var(--danger); }

.sg-table-footer { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border-top: 1px solid rgba(221,231,240,.06); background: #0c1118; }
.sg-input-table-footer { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
.sg-table-primary-actions { min-width: 0; display: flex; align-items: center; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.sg-table-primary-actions::-webkit-scrollbar { display: none; }
.sg-input-table-footer .sg-pagination { justify-self: end; }
.sg-pagination { min-height: 28px; display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 0; color: var(--muted); font: 8px/1 var(--mono); }
.sg-pagination button { height: 22px; padding: 0 7px; font-size: 8px; }
.sg-table-download { min-height: 28px; padding: 0 13px; border: 1px solid rgba(117,222,195,.36); border-radius: 999px; background: linear-gradient(135deg, rgba(117,222,195,.18), rgba(126,181,242,.12)); color: #d8fff4; cursor: pointer; font: 700 8px/1 var(--mono); letter-spacing: .02em; }
.sg-table-download span { margin-right: 4px; color: var(--mint); font-size: 11px; }
.sg-table-download:hover:not(:disabled) { border-color: rgba(117,222,195,.7); box-shadow: 0 0 18px rgba(117,222,195,.1); }
.sg-table-download:disabled { opacity: .35; cursor: default; }
.sg-table-delete-all { min-height: 28px; padding: 0 12px; border: 1px solid rgba(255,103,116,.48); border-radius: 999px; background: rgba(255,103,116,.13); color: #ffc7cc; cursor: pointer; font: 700 8px/1 var(--mono); letter-spacing: .02em; }
.sg-table-delete-all:hover:not(:disabled) { border-color: rgba(255,143,152,.9); background: rgba(255,103,116,.24); box-shadow: 0 0 18px rgba(255,103,116,.09); }
.sg-table-delete-all:disabled { opacity: .3; cursor: default; }
.sg-table-utility { flex: 0 0 auto; min-height: 28px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(126,181,242,.28); border-radius: 999px; background: rgba(126,181,242,.08); color: #c8d9ec; cursor: pointer; text-decoration: none; white-space: nowrap; font: 700 8px/1 var(--mono); letter-spacing: .02em; }
.sg-table-utility:hover { border-color: rgba(126,181,242,.6); background: rgba(126,181,242,.15); color: #eff7ff; }
.sg-table-sample-xlsx span { margin-right: 4px; color: var(--blue); font-size: 11px; }
.sg-table-add-row { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(117,222,195,.6); border-radius: 50%; background: linear-gradient(145deg, rgba(117,222,195,.22), rgba(126,181,242,.14)); color: #e5fff8; cursor: pointer; box-shadow: 0 5px 16px rgba(0,0,0,.26); font: 500 22px/1 var(--sans); }
.sg-table-add-row:hover { border-color: var(--mint); background: linear-gradient(145deg, rgba(117,222,195,.34), rgba(126,181,242,.22)); transform: translateY(-1px); }

.sg-output-hero {
  flex: 0 0 auto;
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(0,1fr) 176px minmax(0,1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(110deg, rgba(126,181,242,.08), rgba(117,222,195,.035) 56%, rgba(14,18,25,.9));
}
.sg-result-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0; }
.sg-result-card > .sg-card-header { flex: 0 0 auto; }
.sg-output-hero > div:first-child { display: grid; gap: 5px; }
.sg-output-hero h2 { margin: 0; font-size: 19px; font-weight: 620; letter-spacing: -.025em; }
.sg-output-hero p { margin: 0; color: var(--muted); font-size: 10px; }
.sg-generation-progress { width: min(520px,100%); display: grid; grid-template-columns: minmax(120px,1fr) minmax(160px,auto) 36px; align-items: center; gap: 8px; margin-top: 3px; }
.sg-generation-progress[hidden] { display: none; }
.sg-generation-progress > i { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.sg-generation-progress > i > b { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--blue),var(--mint)); box-shadow: 0 0 12px rgba(117,222,195,.36); transition: width .2s ease; }
.sg-generation-progress > span { overflow: hidden; color: var(--text-2); font: 650 8px/1.2 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.sg-generation-progress > strong { color: var(--mint); font: 750 9px/1 var(--mono); text-align: right; }
.sg-source-tabs { width: 176px; display: grid; grid-template-columns: 1fr 1fr; justify-self: center; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: #090d13; }
.sg-source-tabs button { min-width: 0; height: 30px; border: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 680; }
.sg-source-tabs button.is-active { background: rgba(126,181,242,.12); color: #cfe4fb; box-shadow: inset 0 0 0 1px rgba(126,181,242,.2); }
.sg-output-kpis { display: flex; align-items: stretch; justify-self: end; }
.sg-output-kpis > div { min-width: 66px; display: grid; gap: 5px; padding: 5px 8px; border-left: 1px solid var(--line); }
.sg-output-kpis span { color: var(--muted); font: 700 7px/1 var(--mono); text-transform: uppercase; }
.sg-output-kpis strong { color: var(--text); font: 600 15px/1 var(--mono); }

.sg-view-tabs { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: #090d13; }
.sg-view-tabs button { min-width: 61px; height: 24px; border: 0; background: transparent; color: var(--muted); font-size: 9px; font-weight: 650; }
.sg-view-tabs button.is-active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.sg-gantt-zoom,
.sg-table-color { min-height: 28px; display: flex; align-items: center; gap: 5px; margin-left: 8px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 4px; background: #090d13; }
.sg-gantt-zoom label,
.sg-table-color label { display: flex; align-items: center; gap: 5px; }
.sg-gantt-zoom label > span,
.sg-table-color label > span { color: var(--muted); font: 700 7px/1 var(--mono); text-transform: uppercase; }
.sg-gantt-zoom select,
.sg-table-color select { height: 23px; padding: 0 5px; border: 1px solid var(--line); border-radius: 3px; background: #111720; color: var(--text-2); font: 9px/1 var(--mono); }
.sg-gantt-zoom i { width: 1px; height: 16px; margin: 0 2px; background: var(--line); }
.sg-gantt-zoom button { min-width: 25px; height: 23px; padding: 0 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-2); color: var(--text-2); cursor: pointer; font: 650 10px/1 var(--mono); }
.sg-gantt-zoom button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); }
.sg-gantt-zoom output { min-width: 38px; color: #b9d8fa; text-align: center; font: 700 8px/1 var(--mono); }
.sg-result-actions { margin-left: auto; }
.sg-result-actions > span { color: var(--muted); font: 600 8px/1 var(--mono); }
.sg-result-actions > div { display: flex; align-items: center; gap: 7px; }
.sg-explorer-toolbar { flex-wrap: wrap; }
.sg-gantt-selection-editor { min-height: 42px; flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 5px 10px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(126,181,242,.08), rgba(117,222,195,.035)); }
.sg-gantt-selection-editor > strong { max-width: 210px; overflow: hidden; color: var(--text); font: 700 9px/1 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.sg-gantt-selection-editor label { display: flex; align-items: center; gap: 5px; }
.sg-gantt-selection-editor label span { color: var(--muted); font: 700 7px/1 var(--mono); }
.sg-gantt-selection-editor input { width: 168px; height: 28px; padding: 0 7px; border: 1px solid var(--line); border-radius: 4px; background: #090d13; color: var(--text-2); font: 8px/1 var(--mono); }
.sg-gantt-selection-editor button { height: 28px; padding: 0 9px; border: 1px solid rgba(126,181,242,.3); border-radius: 999px; background: rgba(126,181,242,.09); color: #cee6ff; cursor: pointer; font: 700 8px/1 var(--mono); }
.sg-gantt-selection-editor button:hover { border-color: rgba(126,181,242,.68); background: rgba(126,181,242,.18); }
.sg-gantt-selection-editor #applyGanttTimes.is-pending { border-color: rgba(255,86,86,.82); background: rgba(180,36,42,.34); color: #ffd8d8; box-shadow: 0 0 0 2px rgba(255,68,68,.1); }
.sg-gantt-selection-editor #applyGanttTimes.is-pending:hover { border-color: #ff6969; background: rgba(202,42,49,.48); }
.sg-gantt-selection-editor #applyGanttTimes.is-updating { border-color: rgba(224,183,110,.65); background: rgba(224,183,110,.14); color: #ffe2ac; }
.sg-gantt-selection-editor #applyGanttTimes.is-updated { border-color: rgba(117,222,195,.48); background: rgba(117,222,195,.12); color: #bff8e8; opacity: 1; }
.sg-gantt-selection-editor.has-pending-update { border-bottom-color: rgba(255,86,86,.42); background: linear-gradient(90deg, rgba(255,72,72,.08), rgba(117,222,195,.02)); }
.sg-gantt-selection-editor small { margin-left: auto; color: var(--muted); font: 7px/1.3 var(--mono); }

.sg-gantt { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; background: #090d13; }
.sg-empty-state { min-height: 100%; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--muted); }
.sg-empty-state > span { color: rgba(126,181,242,.55); font-size: 35px; }
.sg-empty-state strong { color: var(--text-2); font-size: 12px; font-weight: 600; }
.sg-empty-state p { margin: 0; font-size: 9px; }
.sg-gantt-inner { position: relative; min-width: 900px; contain: layout paint style; }
.sg-gantt-axis { position: sticky; z-index: 20; top: 0; height: 40px; margin-left: 128px; border-bottom: 1px solid var(--line); background: #11161e; box-shadow: 0 2px 0 rgba(4,7,11,.9); }
.sg-gantt-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(221,231,240,.12); color: var(--muted); font: 9px/1.2 var(--mono); }
.sg-gantt-tick span { position: absolute; top: 8px; left: 5px; width: 58px; white-space: normal; }
.sg-gantt-row { min-height: 34px; display: grid; grid-template-columns: 128px minmax(520px,1fr); border-bottom: 1px solid rgba(221,231,240,.055); content-visibility: auto; contain-intrinsic-size: auto 42px; }
.sg-gantt-parent-row { height: 28px; display: grid; grid-template-columns: 128px minmax(520px,1fr); border-top: 1px solid rgba(124,106,247,.16); border-bottom: 1px solid rgba(124,106,247,.1); background: #17171a; }
.sg-gantt-parent-label { position: sticky; z-index: 6; left: 0; display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 0 8px; border-right: 1px solid var(--line); background: #141b25; }
.sg-gantt-parent-label strong { overflow: hidden; color: #d8eaff; font: 800 8px/1 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.sg-gantt-parent-label span { color: var(--muted); font: 700 6px/1 var(--mono); white-space: nowrap; }
.sg-gantt-parent-row.is-contact .sg-gantt-parent-label { box-shadow: inset 3px 0 #75dec3; }
.sg-gantt-parent-row.is-remote .sg-gantt-parent-label { box-shadow: inset 3px 0 #7eb5f2; }
.sg-gantt-parent-row.is-custom .sg-gantt-parent-label { box-shadow: inset 3px 0 #c38bf2; }
.sg-gantt-parent-track { background: rgba(126,181,242,.018); }
.sg-gantt-label { position: sticky; z-index: 3; left: 0; display: grid; align-content: center; gap: 5px; padding: 0 9px; border-right: 1px solid var(--line); background: #11161e; }
.sg-gantt-label strong { overflow: hidden; color: var(--text); font: 700 9px/1 var(--mono); white-space: nowrap; text-overflow: ellipsis; }
.sg-gantt-track { position: relative; min-height: 34px; background-image: linear-gradient(90deg, rgba(221,231,240,.055) 1px, transparent 1px); background-size: calc(100% / 12) 100%; }
.sg-gantt-row:nth-child(even) .sg-gantt-track { background-color: rgba(255,255,255,.008); }
.sg-gantt-connectors { position: absolute; z-index: 4; top: 40px; left: 128px; overflow: visible; pointer-events: none; }
.sg-gantt-connectors path { fill: none; stroke: rgba(255,116,116,.58); stroke-width: 1; stroke-dasharray: 3 5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sg-gantt-connectors path.is-chain-selected { stroke: #ff5151; stroke-width: 2; stroke-dasharray: 4 3; filter: drop-shadow(0 0 3px rgba(255,81,81,.65)); }
.sg-gantt-bar { position: absolute; z-index: 5; top: 4px; height: 24px; min-width: 4px; display: flex; align-items: center; padding: 0 7px; overflow: hidden; border: 1px solid var(--bar-color); border-radius: 3px; background: var(--bar-fill); color: #fff; opacity: 1; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); cursor: grab; touch-action: none; user-select: none; font: 800 10px/1 "Segoe UI", Inter, Arial, sans-serif; letter-spacing: .01em; white-space: nowrap; text-rendering: geometricPrecision; -webkit-font-smoothing: antialiased; text-shadow: 0 1px 1px rgba(0,0,0,.95); will-change: transform, width, left; }
.sg-gantt-new-badge { flex: 0 0 auto; margin-right: 5px; padding: 2px 4px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px; background: rgba(0,0,0,.2); color: #fff; font: 800 6px/1 var(--mono); letter-spacing: .05em; text-shadow: none; }
.sg-gantt-bar.is-chain-selected { z-index: 8; border-color: #ff8b8b; background: #c83f47; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 0 0 2px rgba(255,81,81,.28), 0 0 12px rgba(255,81,81,.35); }
.sg-gantt-bar.is-selected { z-index: 8; border-color: #ff8b8b; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 0 0 2px rgba(255,81,81,.25), 0 0 10px rgba(255,81,81,.3); }
.sg-gantt-bar-label { min-width: 0; overflow: hidden; pointer-events: none; text-overflow: ellipsis; }
.sg-gantt-resize-handle { position: absolute; z-index: 2; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.sg-gantt-resize-handle.is-start { left: 0; border-left: 2px solid rgba(255,255,255,.76); }
.sg-gantt-resize-handle.is-end { right: 0; border-right: 2px solid rgba(255,255,255,.76); }
body.is-dragging-gantt-bar, body.is-dragging-gantt-bar * { cursor: grabbing !important; user-select: none !important; }
.sg-result-table { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.sg-result-table > section { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.sg-result-table .sg-schedule-table-wrap { min-height: 0; max-height: none; overflow: auto; }
.sg-peak-profile { flex: 1 1 auto; min-height: 0; overflow: auto; background: #090d13; }
.sg-peak-profile .sg-chart-grid { min-height: 420px; }
.sg-peak-profile .sg-chart-grid figure { min-height: 400px; }
.sg-peak-profile .sg-chart-grid canvas { height: 350px; }

.sg-alternatives-card { margin-bottom: 0; }
.sg-alternatives-list { min-height: 48px; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 7px; padding: 8px; }
.sg-alternatives-list > p { grid-column: 1 / -1; margin: 8px; color: var(--muted); font-size: 9px; }
.sg-alternative { display: grid; gap: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: #0d0d0f; }
.sg-alternative.is-best { border-color: rgba(117,222,195,.32); background: rgba(117,222,195,.045); }
.sg-alternative span { color: var(--muted); font: 700 7px/1 var(--mono); text-transform: uppercase; }
.sg-alternative strong { color: var(--text-2); font: 600 12px/1 var(--mono); }
.sg-alternative small { color: var(--muted); font: 7px/1.3 var(--mono); }

.sg-toast { position: fixed; z-index: 20; right: 18px; bottom: 18px; max-width: 420px; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 5px; background: #171d26; box-shadow: 0 16px 42px rgba(0,0,0,.38); color: var(--text-2); font-size: 10px; }
.sg-toast.is-error { border-color: rgba(239,139,139,.45); color: #f3b5b5; }

.sg-assumptions-card { border-color: rgba(224,183,110,.28); }
.sg-assumptions-body { display: grid; gap: 9px; padding: 10px; }
.sg-assumption-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.sg-assumption-grid label { min-width: 0; display: grid; gap: 5px; }
.sg-assumption-grid label > span { color: var(--muted); font: 700 7px/1 var(--mono); text-transform: uppercase; }
.sg-assumption-grid input,
.sg-assumption-grid select,
.sg-import-column-map select,
.sg-import-value-map select { width: 100%; height: 29px; border: 1px solid var(--line); border-radius: 4px; background: #090d13; color: var(--text-2); padding: 0 7px; font: 9px/1 var(--mono); }
.sg-import-advanced { padding: 8px 0; }
.sg-import-advanced > summary { color: var(--blue); font: 650 9px/1.2 var(--mono); cursor: pointer; }
.sg-import-advanced[open] > summary { margin-bottom: 9px; }
.sg-column-assumption-panel { width: min(620px, 92vw); }
.sg-column-bulk-panel { width: min(680px, 92vw); }
.sg-column-assumption-body, .sg-column-bulk-body, .sg-quality-modal-body { min-height: 0; overflow: auto; padding: 16px; }
.sg-column-assumption-body > p { margin: 0 0 12px; color: var(--text-2); font-size: 10px; line-height: 1.5; }
.sg-column-bulk-body > p { margin: 0 0 12px; color: var(--text-2); font-size: 10px; line-height: 1.5; }
.sg-column-assumption-body label { display: grid; gap: 6px; margin-bottom: 10px; color: var(--muted); font: 700 8px/1.2 var(--mono); text-transform: uppercase; }
.sg-column-assumption-body input, .sg-column-assumption-body select,
.sg-column-bulk-body input[type="text"], .sg-column-bulk-body input[type="number"], .sg-column-bulk-body select { width: 100%; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; background: #090d13; color: var(--text); }
#columnBulkControls > label { display: grid; gap: 6px; margin-bottom: 10px; color: var(--muted); font: 700 8px/1.2 var(--mono); text-transform: uppercase; }
#columnBulkGroupingFields[multiple] { height: auto; min-height: 88px; padding: 5px; }
#columnBulkGroupingFields[multiple] option { padding: 5px 7px; border-radius: 3px; }
#columnBulkGroupingFields[multiple] option:checked { background: linear-gradient(rgba(126,181,242,.22),rgba(126,181,242,.22)); color: #d9ecff; }
#columnBulkGroupingWrap small { color: var(--muted); font: 7px/1.35 var(--mono); letter-spacing: 0; text-transform: none; }
.sg-bulk-mode-help { color: var(--muted); font: 7px/1.35 var(--mono); letter-spacing: 0; text-transform: none; }
.sg-bulk-empty { padding: 12px; border: 1px dashed var(--line); border-radius: 4px; color: var(--muted); text-align: center; }
.sg-bulk-group-map { max-height: 250px; display: grid; gap: 6px; overflow: auto; margin-top: 8px; }
.sg-bulk-group-map label { display: grid; grid-template-columns: minmax(180px,.9fr) minmax(0,1.1fr); align-items: center; gap: 8px; color: var(--text-2); font: 650 9px/1.3 var(--mono); }
.sg-bulk-group-preview { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); }
.sg-bulk-group-preview h3 { margin: 0 0 4px; color: var(--text-2); font-size: 10px; }
.sg-bulk-group-preview p { margin: 0 0 8px; color: var(--muted); font: 8px/1.35 var(--mono); }
.sg-bulk-group-preview table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sg-bulk-group-preview th,
.sg-bulk-group-preview td { padding: 6px 7px; border: 1px solid rgba(221,231,240,.08); overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; font: 8px/1.2 var(--mono); }
.sg-bulk-group-preview th { background: #151b24; color: var(--muted); text-transform: uppercase; }
.sg-bulk-group-preview td { color: var(--text-2); }
.sg-bulk-group-preview th:nth-child(2), .sg-bulk-group-preview td:nth-child(2) { width: 54px; text-align: right; }
.sg-quality-panel { width: min(760px, 92vw); }
#openQualityReview b { margin-left: 4px; color: var(--mint); font: inherit; }
.sg-schedule-table th.is-assumption-pending { background: rgba(224,183,110,.12); }
.sg-schedule-table th.is-assumption-pending .sg-column-assume { color: #f1d39e; }
.sg-schedule-table th.is-policy-available .sg-column-assume { color: var(--blue); }
.sg-assumption-note { color: var(--muted); font-size: 9px; line-height: 1.4; }
.sg-assumption-advanced { border-top: 1px solid var(--line); padding-top: 7px; }
.sg-assumption-advanced summary { color: var(--text-2); cursor: pointer; font: 650 9px/1.4 var(--mono); }
.sg-assumption-advanced[open] summary { margin-bottom: 8px; }
.sg-quality-issues { max-height: 190px; overflow: auto; padding: 8px; }
.sg-quality-issues > p { margin: 5px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.sg-quality-issue { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 7px; padding: 6px; border-bottom: 1px solid rgba(221,231,240,.06); font-size: 9px; line-height: 1.35; }
.sg-quality-issue b { color: var(--danger); font: 700 7px/1.4 var(--mono); text-transform: uppercase; }
.sg-quality-issue.is-warning b { color: var(--amber); }
.sg-quality-issue.is-info b { color: var(--blue); }
.sg-quality-issue span { color: var(--text-2); }

.sg-modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; }
.sg-modal-backdrop { position: absolute; inset: 0; background: rgba(2,5,9,.78); backdrop-filter: blur(4px); }
.sg-modal-panel { position: relative; width: min(1040px, 94vw); max-height: 90vh; display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px; background: #0e1219; box-shadow: 0 24px 80px rgba(0,0,0,.55); }
.sg-contract-panel { width: min(1320px, 96vw); }
.sg-filter-panel { width: min(680px, 92vw); }
.sg-modal-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.sg-modal-head > div { display: grid; gap: 5px; }
.sg-modal-head span { color: var(--muted); font: 700 8px/1 var(--mono); letter-spacing: .09em; }
.sg-modal-head h2 { margin: 0; font-size: 15px; }
.sg-modal-body { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; overflow: auto; padding: 13px; }
.sg-contract-panel .sg-modal-body { display: block; }
.sg-filter-body { grid-template-columns: minmax(180px,.45fr) minmax(0,1.55fr); align-items: start; }
.sg-filter-body label { display: grid; gap: 6px; }
.sg-filter-body label > span { color: var(--muted); font: 700 8px/1 var(--mono); text-transform: uppercase; }
.sg-filter-body input,
.sg-filter-body select { height: 34px; border: 1px solid var(--line); border-radius: 4px; background: #090d13; color: var(--text-2); padding: 0 8px; }
.sg-filter-body select[multiple] { min-height: 156px; padding: 5px; }
.sg-filter-body select[multiple] option { padding: 5px 7px; border-radius: 3px; }
.sg-filter-body select[multiple] option:checked { background: linear-gradient(rgba(126,181,242,.22),rgba(126,181,242,.22)); color: #d9ecff; }
#scheduleFilterControls { min-width: 0; display: grid; gap: 9px; }
.sg-filter-range { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.sg-filter-help { margin: 0; color: var(--muted); font: 8px/1.4 var(--mono); }
.sg-filter-restore { min-height: 27px; padding: 0 10px; border: 1px solid rgba(239,139,139,.34); border-radius: 999px; background: rgba(239,139,139,.08); color: #f4b6b6; cursor: pointer; font: 700 8px/1 var(--mono); }
.sg-filter-restore:hover { border-color: rgba(239,139,139,.65); background: rgba(239,139,139,.14); }
.sg-modal-body h3 { margin: 0 0 4px; font-size: 11px; }
.sg-modal-body p { margin: 0 0 9px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.sg-modal-actions { min-height: 52px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 9px 13px; border-top: 1px solid var(--line); }
.sg-modal-actions > span { flex: 1; color: var(--muted); font: 600 8px/1.35 var(--mono); }
.sg-import-map-row { display: grid; grid-template-columns: minmax(120px,.8fr) 20px minmax(160px,1.2fr); align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid rgba(221,231,240,.05); }
.sg-import-map-row > span { color: var(--text-2); font-size: 9px; }
.sg-import-map-row > span small { display: block; margin-top: 2px; color: var(--mint); font: 7px/1.2 var(--mono); }
.sg-import-map-row > i { color: var(--muted); text-align: center; font-style: normal; }
.sg-import-map-row.is-required > span::after { content: " *"; color: var(--danger); }
.sg-import-match-control { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px; }
.sg-import-match-control select { width: 100%; min-width: 0; }
.sg-match-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 18px; padding: 0 6px; border: 1px solid; border-radius: 3px; font: 700 7px/1 var(--mono); letter-spacing: .05em; white-space: nowrap; }
.sg-match-badge.is-exact,
.sg-match-badge.is-alias { border-color: rgba(103,211,157,.5); background: rgba(103,211,157,.1); color: #8fe1b8; }
.sg-match-badge.is-similar { border-color: rgba(236,164,82,.55); background: rgba(236,164,82,.11); color: #f0b66f; }
.sg-match-group { margin: 0 0 7px; border: 1px solid rgba(221,231,240,.08); border-radius: 5px; background: rgba(7,11,16,.34); }
.sg-match-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; padding: 0 8px; cursor: pointer; color: var(--text-2); font: 700 9px/1 var(--mono); }
.sg-match-group > summary b { color: var(--mint); font-size: 7px; text-transform: uppercase; }
.sg-match-group > .sg-import-map-row { margin: 0 8px; }
.sg-contract-table { width: 100%; border-collapse: collapse; font: 8px/1.35 var(--mono); }
.sg-contract-table th,
.sg-contract-table td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sg-contract-table th { position: sticky; top: 0; background: #171c25; color: var(--muted); text-transform: uppercase; }
.sg-contract-table td { color: var(--text-2); }

body.is-studio-workspace .sg-brand { cursor: pointer; }
body.is-studio-workspace .sg-brand small { color: var(--mint); }

@media (max-width: 1400px) {
  .sg-topbar { gap: 12px; }
  .sg-title > span { display: none; }
  .sg-rulebar { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
}

/* Studio parity layer -----------------------------------------------------
   Presentation-only overrides: all IDs, buttons, inputs and application
   flows above remain unchanged. */
html { background: var(--ui-bg-base); }
body {
  background:
    radial-gradient(circle at 68% 20%, rgba(124,106,247,.055), transparent 32%),
    linear-gradient(145deg, #0d0d0f 0%, #141416 52%, #0d0d0f 100%);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.sg-shell {
  background:
    radial-gradient(circle at 68% 18%, rgba(124,106,247,.05), transparent 33%),
    linear-gradient(145deg, rgba(20,20,22,.98), rgba(13,13,15,.99));
}
.sg-topbar {
  border-color: var(--ui-border-subtle);
  background: color-mix(in srgb, var(--ui-bg-elevated) 82%, transparent);
  box-shadow: var(--ui-shadow-sm), var(--ui-inset-highlight);
  backdrop-filter: blur(18px) saturate(124%);
  -webkit-backdrop-filter: blur(18px) saturate(124%);
}
.sg-brand img {
  border: 1px solid color-mix(in srgb, var(--ui-accent) 28%, var(--ui-border-default));
  border-radius: var(--ui-radius-sm);
  background: var(--ui-accent-muted);
  box-shadow: var(--ui-inset-highlight);
}
.sg-title { border-left-color: var(--ui-border-subtle); }
.sg-title em {
  border-color: var(--ui-accent-ring);
  background: var(--ui-accent-muted);
  color: var(--ui-accent-hover);
}
.sg-input-pane {
  border-right-color: var(--ui-border-subtle);
  background: color-mix(in srgb, var(--ui-bg-surface) 44%, transparent);
}
.sg-output-pane {
  background: color-mix(in srgb, var(--ui-bg-base) 58%, transparent);
}
.sg-card,
.sg-output-hero {
  border-color: var(--ui-border-default);
  border-radius: var(--ui-radius-md);
  background: color-mix(in srgb, var(--ui-bg-elevated) 88%, transparent);
  box-shadow: var(--ui-shadow-sm), var(--ui-inset-highlight);
  backdrop-filter: blur(14px) saturate(114%);
  -webkit-backdrop-filter: blur(14px) saturate(114%);
}
.sg-output-hero {
  background:
    linear-gradient(112deg, rgba(124,106,247,.10), rgba(124,106,247,.025) 52%, rgba(36,36,40,.88));
}
.sg-card-header,
.sg-table-meta,
.sg-table-footer,
.sg-modal-head,
.sg-modal-actions { border-color: var(--ui-border-subtle); }
.sg-card-header,
.sg-table-footer { background: color-mix(in srgb, var(--ui-bg-elevated) 68%, transparent); }
.sg-card-header h2,
.sg-output-hero h2,
.sg-title h1 { color: var(--ui-text-primary); }
.sg-card-header > div > span,
.sg-output-hero > div > span,
.sg-title > span { color: var(--ui-text-muted); }
.sg-button,
.sg-icon-button,
.sg-source-tabs button,
.sg-view-tabs button,
.sg-peak-chart-tabs button,
.sg-pagination button,
.sg-generate-toggle,
.sg-gantt-zoom button {
  border-color: var(--ui-border-default);
  border-radius: var(--ui-radius-sm);
  background: color-mix(in srgb, var(--ui-bg-control) 90%, transparent);
  color: var(--ui-text-secondary);
  font-family: var(--sans);
  transition: var(--ui-transition);
  box-shadow: var(--ui-inset-highlight);
}
.sg-button-primary {
  border-color: var(--ui-accent-ring);
  background: var(--ui-accent-muted);
  color: #ded9ff;
}
.sg-button:hover:not(:disabled),
.sg-icon-button:hover:not(:disabled),
.sg-pagination button:hover:not(:disabled),
.sg-gantt-zoom button:hover:not(:disabled) {
  border-color: var(--ui-border-strong);
  background: var(--ui-bg-overlay);
  color: var(--ui-text-primary);
}
.sg-button-primary:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--ui-accent) 58%, var(--ui-border-default));
  background: color-mix(in srgb, var(--ui-accent) 19%, var(--ui-bg-control));
  color: #f0efff;
}
.sg-source-tabs,
.sg-view-tabs,
.sg-gantt-zoom,
.sg-table-color {
  border-color: var(--ui-border-subtle);
  border-radius: var(--ui-radius-md);
  background: color-mix(in srgb, var(--ui-bg-control) 78%, transparent);
  box-shadow: var(--ui-inset-highlight);
}
.sg-source-tabs button,
.sg-view-tabs button { border-color: transparent; box-shadow: none; background: transparent; }
.sg-source-tabs button.is-active,
.sg-view-tabs button.is-active,
.sg-peak-chart-tabs button[aria-selected="true"] {
  border-color: var(--ui-accent-ring);
  background: var(--ui-accent-muted);
  color: var(--ui-accent-hover);
  box-shadow: inset 0 0 0 1px rgba(124,106,247,.08);
}
.sg-generate-toggle:has(input:checked) {
  border-color: var(--ui-accent-ring);
  background: var(--ui-accent-muted);
  color: var(--ui-accent-hover);
}
.sg-generate-toggle input { accent-color: var(--ui-accent); }
.sg-generate-fab {
  width: 64px;
  height: 64px;
  border-color: color-mix(in srgb, var(--ui-accent) 52%, var(--ui-border-default));
  border-radius: var(--ui-radius-lg);
  background: linear-gradient(145deg, rgba(124,106,247,.28), rgba(39,39,43,.96));
  color: #f0efff;
  box-shadow: 0 0 0 6px rgba(13,13,15,.84), var(--ui-shadow-lg), var(--ui-inset-highlight);
}
.sg-generate-fab span { color: var(--ui-accent-hover); }
.sg-generate-fab:hover:not(:disabled) {
  border-color: var(--ui-accent-hover);
  background: linear-gradient(145deg, rgba(124,106,247,.38), rgba(48,44,72,.98));
  box-shadow: 0 0 0 6px rgba(13,13,15,.84), 0 16px 38px rgba(0,0,0,.52), 0 0 24px rgba(124,106,247,.18);
}
.sg-generate-fab[aria-busy="true"] {
  background: linear-gradient(145deg, rgba(124,106,247,.28), rgba(39,39,43,.98)) padding-box, conic-gradient(var(--ui-accent) calc(var(--generation-progress,0) * 1%), rgba(124,106,247,.12) 0) border-box;
}
.sg-rulebar input,
.sg-edit-table input,
.sg-edit-table select,
.sg-assumption-grid input,
.sg-assumption-grid select,
.sg-import-column-map select,
.sg-import-value-map select,
.sg-column-assumption-body input,
.sg-column-assumption-body select,
.sg-column-bulk-body input[type="text"],
.sg-column-bulk-body input[type="number"],
.sg-column-bulk-body select,
.sg-filter-body input,
.sg-filter-body select,
.sg-gantt-selection-editor input,
.sg-gantt-zoom select,
.sg-table-color select {
  border-color: var(--ui-border-default);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-bg-input);
  color: var(--ui-text-primary);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.18);
}
.sg-rulebar input:focus,
.sg-edit-table input:focus,
.sg-edit-table select:focus,
.sg-assumption-grid input:focus,
.sg-assumption-grid select:focus,
.sg-filter-body input:focus,
.sg-filter-body select:focus {
  border-color: var(--ui-accent-ring);
  box-shadow: 0 0 0 2px var(--ui-accent-muted), inset 0 1px 2px rgba(0,0,0,.18);
  outline: none;
}
.sg-profile-table th,
.sg-schedule-table th,
.sg-contract-table th,
.sg-bulk-group-preview th,
.sg-gantt-axis {
  background: color-mix(in srgb, var(--ui-bg-overlay) 92%, var(--ui-bg-elevated));
  color: var(--ui-text-secondary);
}
.sg-schedule-table th:first-child,
.sg-schedule-table td:first-child,
.sg-schedule-table th:nth-child(2),
.sg-schedule-table td:nth-child(2),
.sg-gantt-label,
.sg-gantt-parent-label {
  background: color-mix(in srgb, var(--ui-bg-elevated) 94%, var(--ui-bg-base));
}
.sg-gantt,
.sg-peak-profile,
.sg-chart-grid figure,
.sg-alternative {
  background: color-mix(in srgb, var(--ui-bg-input) 92%, transparent);
}
.sg-empty-state > span { color: var(--ui-accent-hover); }
.sg-modal-backdrop {
  background: rgba(0,0,0,.76);
  backdrop-filter: blur(8px) saturate(108%);
  -webkit-backdrop-filter: blur(8px) saturate(108%);
}
.sg-modal-panel,
.sg-toast {
  border-color: var(--ui-border-strong);
  border-radius: var(--ui-radius-lg);
  background: color-mix(in srgb, var(--ui-bg-elevated) 94%, transparent);
  box-shadow: 0 24px 80px rgba(0,0,0,.55), var(--ui-inset-highlight);
  backdrop-filter: blur(22px) saturate(118%);
  -webkit-backdrop-filter: blur(22px) saturate(118%);
}
:where(button, a, input, select, textarea):focus-visible {
  outline: none;
  border-color: var(--ui-accent-ring);
  box-shadow: 0 0 0 2px var(--ui-accent-muted);
}
* { scrollbar-color: rgba(255,255,255,.16) rgba(0,0,0,.78); }

.sg-table-meta-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline dotted rgba(221,231,240,.35);
  text-underline-offset: 3px;
}
.sg-table-meta-link:hover,
.sg-table-meta-link:focus-visible { color: var(--text); outline: none; text-decoration-color: var(--mint); }
