:root {
  color-scheme: dark;
  --bg: #080d16;
  --bg-elevated: #0c1320;
  --surface: #101927;
  --surface-raised: #152131;
  --surface-soft: #0d1624;
  --input: #0a121f;
  --border: #263447;
  --border-strong: #35465e;
  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;
  --muted-strong: #aebace;
  --primary: #4f8ef7;
  --primary-hover: #73a5fa;
  --primary-soft: rgba(79, 142, 247, .14);
  --success: #38d27a;
  --success-soft: rgba(56, 210, 122, .12);
  --warning: #f3b84b;
  --warning-soft: rgba(243, 184, 75, .13);
  --danger: #f06464;
  --danger-hover: #f47d7d;
  --danger-soft: rgba(240, 100, 100, .13);
  --focus: #8ab4ff;
  --sidebar-width: 264px;
  --content-max: 1540px;
  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .28);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, .22);
  --shadow-drawer: 18px 0 54px rgba(0, 0, 0, .48);
  --z-sidebar: 30;
  --z-header: 40;
  --z-backdrop: 50;
  --z-drawer: 60;
  --z-skip: 100;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 88% -10%, rgba(79, 142, 247, .09), transparent 29rem),
    linear-gradient(180deg, #0a101b 0, var(--bg) 25rem);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(79, 142, 247, .18);
}
body.nav-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, select, input[type="checkbox"] { touch-action: manipulation; }
a { color: #79a9fa; text-decoration: none; }
a:hover { color: #a2c4ff; }
p { margin: 0 0 1rem; color: var(--text-soft); }
ul { color: var(--text-soft); }
code, pre, .live-cell, td[data-numeric] {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}
code {
  padding: .14rem .35rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--input);
  color: #c8dcff;
  font-size: .88em;
  overflow-wrap: anywhere;
}
img, svg { display: block; }
[hidden], .hidden { display: none !important; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
::selection { background: rgba(79, 142, 247, .34); color: #fff; }

.skip-link {
  position: fixed;
  z-index: var(--z-skip);
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #0a101c;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}
.skip-link:focus { transform: translateY(0); }

.layout { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: var(--z-sidebar);
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 20px 16px 18px;
  border-right: 1px solid var(--border);
  background: rgba(8, 14, 24, .96);
  box-shadow: 1px 0 0 rgba(255, 255, 255, .015);
  overscroll-behavior: contain;
}
.sidebar-head { display: flex; align-items: center; min-width: 0; margin-bottom: 22px; padding: 0 7px; }
.brand, .mobile-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--text);
}
.brand:hover, .mobile-brand:hover { color: #fff; }
.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(79, 142, 247, .42);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(79, 142, 247, .24), rgba(79, 142, 247, .08));
  color: #9fc1ff;
  font: 700 14px/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: -.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.brand > span:last-child { min-width: 0; }
.brand strong { display: block; color: var(--text); font-size: 15px; line-height: 1.2; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .105em; text-transform: uppercase; }
.nav-close { display: none; }
.nav-list { min-height: 0; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.nav-label {
  margin: 18px 10px 7px;
  color: #718198;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.nav-list .nav-label:first-child { margin-top: 2px; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  margin: 2px 0;
  padding: 9px 12px 9px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--muted-strong);
  font-size: 13.5px;
  font-weight: 610;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.nav-link::before {
  content: "";
  position: absolute;
  left: 6px;
  width: 3px;
  height: 16px;
  border-radius: 4px;
  background: transparent;
}
.nav-link:hover { border-color: rgba(79, 142, 247, .15); background: rgba(79, 142, 247, .07); color: #fff; }
.nav-link.active { border-color: rgba(79, 142, 247, .22); background: var(--primary-soft); color: #e9f1ff; }
.nav-link.active::before { background: var(--primary); box-shadow: 0 0 14px rgba(79, 142, 247, .55); }
.sidebar-foot { padding-top: 14px; border-top: 1px solid var(--border); }
.environment-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.environment-badge i, .page-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(56, 210, 122, .11); }
.logout-link { color: #d9a5a5; }
.mobile-header, .nav-backdrop { display: none; }

.content {
  width: calc(100% - var(--sidebar-width));
  max-width: var(--content-max);
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding: 30px clamp(24px, 3vw, 46px) 60px;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 24px;
}
.eyebrow {
  margin: 0 0 5px;
  color: #7597ce;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}
h1, h2, h3 { color: var(--text); text-wrap: balance; scroll-margin-top: 90px; }
h1 { margin: 0; font-size: clamp(25px, 2.5vw, 36px); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.015em; }
.page-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(16, 25, 39, .75);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.panel, .card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 29, 45, .96), rgba(13, 22, 35, .96));
  box-shadow: var(--shadow-sm);
}
.all-live-summary {
  position: relative;
  min-width: 0;
  min-height: 142px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding: clamp(22px, 2.6vw, 32px);
  overflow: hidden;
  border: 1px solid rgba(56, 210, 122, .38);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 92% 12%, rgba(56, 210, 122, .16), transparent 20rem),
    linear-gradient(125deg, rgba(18, 43, 43, .98), rgba(13, 27, 38, .98) 58%, rgba(14, 36, 35, .98));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .045);
}
.all-live-summary::after {
  content: "";
  position: absolute;
  right: -58px;
  bottom: -94px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(56, 210, 122, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(56, 210, 122, .025), 0 0 0 68px rgba(56, 210, 122, .018);
  pointer-events: none;
}
.all-live-summary-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}
.all-live-indicator {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 7px rgba(56, 210, 122, .11), 0 0 24px rgba(56, 210, 122, .45);
  animation: live-pulse 1.8s ease-in-out infinite;
}
.all-live-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #8de8b1;
  font-size: 10.5px;
  font-weight: 780;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.all-live-summary h2 { margin: 0; font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -.03em; }
.all-live-summary p { margin: 7px 0 0; color: #aebfd0; font-size: 12.5px; }
.all-live-value {
  position: relative;
  z-index: 1;
  min-width: clamp(190px, 19vw, 280px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-left: 28px;
  border-left: 1px solid rgba(56, 210, 122, .24);
  text-align: right;
}
.all-live-value strong {
  color: #effff5;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(38px, 5vw, 68px);
  font-variant-numeric: tabular-nums;
  font-weight: 820;
  line-height: .95;
  letter-spacing: -.07em;
}
.all-live-value span {
  margin-top: 10px;
  color: #8de8b1;
  font-size: 10.5px;
  font-weight: 760;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.panel {
  min-width: 0;
  margin-bottom: 18px;
  padding: clamp(18px, 2.2vw, 26px);
  border-radius: var(--radius-lg);
}
.panel > h2:first-child { margin-bottom: 6px; }
.panel > h2 + p { max-width: 82ch; margin-top: 8px; }
.panel > :last-child { margin-bottom: 0; }
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.card { position: relative; min-width: 0; min-height: 116px; padding: 19px 20px; border-radius: var(--radius-lg); overflow: hidden; }
.card::after { content: ""; position: absolute; inset: auto -20px -34px auto; width: 88px; height: 88px; border-radius: 50%; background: rgba(79, 142, 247, .055); }
.card span { display: block; margin-bottom: 12px; color: var(--muted-strong); font-size: 11px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.card strong { display: block; color: #f8fbff; font-size: clamp(27px, 3vw, 38px); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }

.grid-form, fieldset {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 17px 16px;
}
.grid-form > label, fieldset > label { grid-column: span 4; }
.grid-form.compact { max-width: 880px; }
.grid-form.compact > label { grid-column: span 6; }
.grid-form .full, fieldset .full, fieldset.full, .grid-form > fieldset { grid-column: 1 / -1; }
.grid-form > button:not(.table-sort-button) { grid-column: span 4; align-self: end; }
label:not(.checkbox) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: .015em;
}
.field-label { display: block; margin-bottom: 7px; color: var(--text-soft); font-size: 12px; font-weight: 680; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--input);
  color: var(--text);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .2);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
input:hover, select:hover, textarea:hover { border-color: #49617e; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #0c1726; box-shadow: 0 0 0 3px rgba(79, 142, 247, .15); outline: none; }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .58; background: #0b111a; }
input[readonly] { color: #9fc1f8; background: #0b1522; cursor: default; }
input::placeholder, textarea::placeholder { color: #687891; opacity: 1; }
select { padding-right: 34px; cursor: pointer; }
option { background: #101927; color: var(--text); }
textarea { min-height: 126px; resize: vertical; line-height: 1.55; }
textarea[rows="8"] { min-height: 188px; }
fieldset {
  margin: 4px 0 0;
  padding: 22px 18px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(7, 13, 23, .26);
}
legend { padding: 0 8px; color: #bdd1f4; font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.checkbox, label:has(> input[type="checkbox"]) {
  display: flex;
  min-height: 44px;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  align-self: end;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 640;
}
input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; padding: 0; accent-color: var(--primary); cursor: pointer; }
.hint { color: var(--muted); font-size: 12.5px; font-weight: 450; line-height: 1.55; text-wrap: pretty; }

button, .button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid #5f9afd;
  border-radius: var(--radius-sm);
  background: #397bdf;
  color: #fff;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}
button:hover, .button:hover { border-color: #83b1ff; background: var(--primary); color: #fff; }
button:active, .button:active { background: #316bc2; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
button:disabled { cursor: not-allowed; opacity: .58; }
button[aria-busy="true"] { cursor: wait; }
.button.secondary, button.secondary { border-color: var(--border-strong); background: #1a293b; color: #dce7f5; }
.button.secondary:hover, button.secondary:hover { border-color: #526983; background: #21334a; color: #fff; }
button.danger, .button.danger { border-color: #9f4545; background: #872f35; color: #fff; }
button.danger:hover, .button.danger:hover { border-color: var(--danger-hover); background: #a23d43; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions > input { width: auto; min-width: 150px; flex: 1 1 180px; }
.page-actions { margin-bottom: 16px; }
.inline-form { display: inline-flex; }
.panel-followup { margin-top: 16px; }
.deploy-actions { padding-top: 4px; }
.deploy-actions .hint { max-width: 62ch; }
.deploy-actions button { min-width: 170px; }

.alert {
  position: relative;
  margin: 0 0 16px;
  padding: 13px 15px 13px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.alert::before { content: "i"; position: absolute; left: 14px; top: 13px; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font: 700 11px/1 Georgia, serif; }
.alert.success { border-color: rgba(56, 210, 122, .43); background: var(--success-soft); color: #baf2d0; }
.alert.success::before { content: "✓"; font-family: inherit; }
.alert.error { border-color: rgba(240, 100, 100, .5); background: var(--danger-soft); color: #ffc4c4; }
.alert.error::before { content: "!"; font-family: inherit; }

.table-scroll {
  width: 100%;
  max-width: 100%;
  margin-top: 14px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(6, 11, 19, .28);
  scrollbar-color: #40536d transparent;
}
.table-scroll:focus-visible { outline-offset: 2px; }
table { width: 100%; min-width: 680px; border-collapse: collapse; border-spacing: 0; }
th, td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #111c2b;
  color: #aebdd1;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 140ms ease; }
tbody tr:hover { background: rgba(79, 142, 247, .045); }
td a { overflow-wrap: anywhere; }
td.url-cell, td.url-cell a { white-space: nowrap; overflow-wrap: normal; }
[data-sortable-table] th.time-cell, [data-sortable-table] td.time-cell {
  min-width: 17ch;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
td .button, table .button.secondary, td button { min-height: 36px; padding: 7px 11px; font-size: 11.5px; }
.deployment-actions { min-width: 132px; gap: 7px; flex-wrap: nowrap; }
.deployment-actions > * { flex: 0 0 auto; }
.table-sort-button {
  min-height: 32px;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  white-space: nowrap;
}
.table-sort-button:hover { border: 0; background: transparent; color: #fff; }
.sort-indicator { color: var(--muted); font-size: 10px; }
th[aria-sort="ascending"] .sort-indicator, th[aria-sort="descending"] .sort-indicator { color: var(--success); }

.source-badge, .live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid rgba(79, 142, 247, .3);
  border-radius: 999px;
  background: var(--primary-soft);
  color: #b9d3ff;
  font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif;
  font-size: 10.5px;
  font-weight: 720;
  white-space: nowrap;
}
.source-badge.discovered, .live-badge { border-color: rgba(56, 210, 122, .32); background: var(--success-soft); color: #b7efcd; }
.live-cell { min-width: 84px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.live-controls { margin: 12px 0 14px; }
.live-controls .hint { margin: 0; }
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); animation: live-pulse 1.8s ease-in-out infinite; }
.live-badge.stale { border-color: rgba(243, 184, 75, .35); background: var(--warning-soft); color: #f8d995; }
.live-badge.stale::before { background: var(--warning); animation: none; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.deployment-group { margin-top: 20px; }
.deployment-group:first-of-type { margin-top: 12px; }
.deployment-group-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.deployment-group-header h3 {
  margin: 0;
  color: #dce7f5;
  font-size: 13.5px;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
}
.deployment-group-count {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 9px;
  border: 1px solid rgba(79, 142, 247, .3);
  border-radius: 999px;
  background: var(--primary-soft);
  color: #b9d3ff;
  font-size: 10.5px;
  font-weight: 720;
  white-space: nowrap;
}
.group-live-total-row td {
  padding: 0;
  border-top: 2px solid rgba(243, 184, 75, .5);
  border-bottom: 0;
  background: linear-gradient(90deg, rgba(243, 184, 75, .13), rgba(243, 184, 75, .045) 48%, rgba(8, 14, 24, .18));
}
.group-live-total-summary {
  width: max-content;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 12px 14px;
}
.group-live-total-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #f8d995;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .075em;
  text-transform: uppercase;
  white-space: nowrap;
}
.group-live-total-indicator {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border: 2px solid #f3b84b;
  border-radius: 3px;
  background: rgba(243, 184, 75, .24);
  box-shadow: 0 0 0 4px rgba(243, 184, 75, .08);
}
.group-live-total-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 11px;
  border: 1px solid rgba(243, 184, 75, .38);
  border-radius: 999px;
  background: rgba(8, 14, 24, .64);
  color: #f8d995;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.group-live-total-badge strong {
  color: #fff3d0;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -.025em;
  text-transform: none;
}
.deployment-group.unassigned .deployment-group-header h3 { color: var(--muted); }
.deployment-group.unassigned .deployment-group-count {
  border-color: var(--border);
  background: rgba(6, 11, 19, .4);
  color: var(--muted);
}

.folder-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.folder-chip {
  min-height: 38px;
  padding: 7px 11px;
  border-color: var(--border-strong);
  border-radius: 999px;
  background: #162335;
  color: var(--text-soft);
  box-shadow: none;
  font-size: 11.5px;
}
.folder-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.folder-chip.known { border-color: rgba(56, 210, 122, .42); }
.folder-chip .badge { margin-left: 5px; padding: 2px 6px; border-radius: 999px; background: rgba(79, 142, 247, .17); color: #b7d0fb; font-size: 8.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.folder-chip.known .badge { background: var(--success-soft); color: #b8efcc; }
.tabs { display: flex; gap: 8px; margin: 0; padding: 4px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(6, 11, 19, .3); }
.tab { min-height: 40px; display: inline-flex; align-items: center; padding: 7px 14px; border-radius: var(--radius-sm); color: var(--muted-strong); font-size: 12px; font-weight: 680; white-space: nowrap; }
.tab:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.tab.active { background: var(--primary-soft); color: #c6dbff; box-shadow: inset 0 0 0 1px rgba(79, 142, 247, .25); }

#deployResult, #syncResult {
  min-height: 132px;
  max-height: 520px;
  margin: 14px 0 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #070d16;
  color: #bcd0e9;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}
.script1-only, .script2-only, .script3-only, .script4-only, .script5-only, .script6-only, .gallery-shared-only, .reels-shared-only, .video-gate-only { display: none; }
body.script1-selected .script1-only, body.script1-selected .gallery-shared-only, body.script2-selected .script2-only, body.script2-selected .reels-shared-only, body.script3-selected .script2-only, body.script3-selected .script3-only, body.script3-selected .reels-shared-only, body.script3-selected .video-gate-only, body.script4-selected .script4-only, body.script4-selected .reels-shared-only, body.script4-selected .video-gate-only, body.script5-selected .script5-only, body.script5-selected .reels-shared-only, body.script6-selected .script6-only, body.script6-selected .gallery-shared-only { display: flex; }
body.script3-selected p.script3-only, body.script3-selected p.video-gate-only, body.script4-selected p.video-gate-only, body.script6-selected p.script6-only { display: block; }
.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.meta-grid > div { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(7, 13, 23, .28); }
.meta-grid span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 720; letter-spacing: .07em; text-transform: uppercase; }
.meta-grid strong { display: block; color: var(--text-soft); font-size: 12.5px; overflow-wrap: anywhere; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 8%, rgba(79, 142, 247, .14), transparent 29rem),
    radial-gradient(circle at 88% 90%, rgba(56, 210, 122, .06), transparent 25rem),
    var(--bg);
}
.login-card { width: min(440px, 100%); padding: clamp(26px, 6vw, 40px); border: 1px solid var(--border); border-radius: var(--radius-xl); background: linear-gradient(180deg, rgba(18, 29, 45, .97), rgba(10, 17, 28, .98)); box-shadow: 0 28px 80px rgba(0, 0, 0, .38); }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.login-card h1 { font-size: 27px; }
.login-card > p { margin-top: 8px; color: var(--muted); }
.login-card form { display: grid; gap: 14px; margin-top: 22px; }
.login-card .hint { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }

.delete-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #152131, #0d1624);
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .62);
}
.delete-dialog::backdrop { background: rgba(2, 6, 12, .78); backdrop-filter: blur(3px); }
.delete-dialog form { display: grid; gap: 17px; padding: clamp(20px, 5vw, 30px); }
.delete-dialog-head h2 { margin-top: 3px; font-size: 23px; }
.delete-dialog p { margin: 0; }
.delete-target { display: grid; gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--border); }
.delete-target > div { min-width: 0; padding: 11px 13px; background: var(--surface-soft); }
.delete-target dt { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.delete-target dd { margin: 3px 0 0; color: var(--text-soft); overflow-wrap: anywhere; }
.delete-dialog-status { min-height: 1.55em; color: var(--muted); font-size: 13px; }
.delete-dialog-status.error { color: #ffc4c4; }
.delete-dialog-status.success { color: #baf2d0; }
.delete-dialog-actions { justify-content: flex-end; }
.deletion-page-status { margin-top: -8px; }
body:has(.delete-dialog[open]) { overflow: hidden; }

@media (max-width: 1260px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-form > label, fieldset > label { grid-column: span 6; }
  .grid-form > button:not(.table-sort-button) { grid-column: span 6; }
}

@media (max-width: 1099px) {
  .mobile-header {
    position: sticky;
    z-index: var(--z-header);
    top: 0;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px max(16px, env(safe-area-inset-right)) 9px max(16px, env(safe-area-inset-left));
    border-bottom: 1px solid var(--border);
    background: rgba(8, 14, 24, .91);
    backdrop-filter: blur(16px);
  }
  .mobile-brand { font-size: 14px; font-weight: 720; }
  .mobile-brand .brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; font-size: 12px; }
  .nav-toggle, .nav-close { width: 44px; height: 44px; min-height: 44px; padding: 11px; border-color: var(--border); background: #121e2d; box-shadow: none; }
  .nav-toggle svg, .nav-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .nav-close { display: inline-flex; margin-left: auto; }
  .sidebar { z-index: var(--z-drawer); width: min(320px, calc(100vw - 48px)); padding-top: max(18px, env(safe-area-inset-top)); transform: translateX(-105%); box-shadow: var(--shadow-drawer); transition: transform 210ms cubic-bezier(.2, .8, .2, 1); }
  .sidebar-head { padding-left: 2px; }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-backdrop { position: fixed; z-index: var(--z-backdrop); inset: 0; display: block; border: 0; background: rgba(2, 6, 12, .72); backdrop-filter: blur(2px); }
  .content { width: 100%; max-width: none; margin-left: 0; padding: 25px clamp(18px, 3.2vw, 32px) max(46px, env(safe-area-inset-bottom)); }
  .page-header { align-items: center; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .mobile-header { height: 60px; }
  .content { padding: 20px 14px 42px; }
  .page-header { margin-bottom: 18px; }
  .page-status { display: none; }
  h1 { font-size: 27px; }
  .all-live-summary { min-height: 0; align-items: flex-start; gap: 20px; padding: 20px 18px; }
  .all-live-summary-copy { align-items: flex-start; gap: 14px; }
  .all-live-indicator { margin-top: 8px; }
  .all-live-summary p { max-width: 34ch; }
  .all-live-value { min-width: 150px; padding-left: 20px; }
  .all-live-value strong { font-size: 42px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { min-height: 100px; padding: 16px; }
  .card span { margin-bottom: 10px; font-size: 9.5px; }
  .card strong { font-size: 29px; }
  .panel { padding: 18px 15px; border-radius: 14px; }
  .grid-form, fieldset { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .grid-form > label, .grid-form.compact > label, fieldset > label, .grid-form > button:not(.table-sort-button), .grid-form .full, fieldset .full, fieldset.full, .grid-form > fieldset { grid-column: 1; }
  input, select, textarea { font-size: 16px; }
  textarea { min-height: 118px; }
  textarea[rows="8"] { min-height: 164px; }
  fieldset { padding: 19px 12px 14px; }
  .actions { align-items: stretch; }
  .page-actions .button, .grid-form > .actions > button, .grid-form > .actions > .button { flex: 1 1 100%; }
  .table-scroll { margin-right: 0; border-radius: 10px; }
  table { min-width: 620px; }
  th, td { padding: 11px 12px; }
  [data-sortable-table] td { white-space: nowrap; overflow-wrap: normal; }
  td .button, table .button.secondary, td button, .table-sort-button { min-height: 44px; }
  .deployment-actions { min-width: 154px; }
  .meta-grid { grid-template-columns: 1fr; }
  .tabs { margin-inline: 0; }
  #deployResult, #syncResult { min-height: 112px; max-height: 360px; }
}

@media (max-width: 420px) {
  .all-live-summary { flex-direction: column; }
  .all-live-value { width: 100%; min-width: 0; align-items: flex-start; padding: 18px 0 0; border-top: 1px solid rgba(56, 210, 122, .24); border-left: 0; text-align: left; }
  .all-live-value strong { font-size: 46px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .card { min-height: 94px; padding: 14px; }
  .card strong { font-size: 26px; }
  .panel { padding-inline: 13px; }
  .actions:not(td .actions):not(.delete-dialog-actions) > * { width: 100%; }
  .delete-dialog-actions { display: grid; grid-template-columns: 1fr; }
  .delete-dialog-actions > * { width: 100%; }
  .login-page { padding: 14px; }
  .login-card { padding: 25px 19px; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .sidebar, .mobile-header, .page-actions, .nav-backdrop { display: none !important; }
  .content { width: 100%; margin: 0; padding: 0; }
  body { background: #fff; color: #111; }
  .panel, .card { break-inside: avoid; border-color: #bbb; background: #fff; box-shadow: none; }
}
