:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #dce3ed;
  --muted: #64748b;
  --text: #172033;
  --purple: #6d42d8;
  --blue: #2563eb;
  --cyan: #0891b2;
  --green: #059669;
  --amber: #b45309;
  --shadow: 0 18px 45px rgb(51 65 85 / 10%);
  --font-sans: "Open Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  font-family: var(--font-sans);
  font-size: 14px;
  font-synthesis: none;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  font-weight: 400;
  color: var(--text);
  background: radial-gradient(circle at 90% -10%, rgb(124 58 237 / 9%), transparent 34%), var(--bg);
}

a { color: inherit; text-decoration: none; }
strong, b { font-weight: 600; }
img, video, svg { max-width: 100%; }
.menu-backdrop, .mobile-menu-toggle { display: none; }
.mobile-menu-toggle {
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  place-items: center;
  background: #fff;
  cursor: pointer;
}
.mobile-menu-toggle span { display: block; width: 19px; height: 2px; border-radius: 2px; background: #334155; }
.mobile-menu-toggle:focus-visible { outline: 3px solid rgb(109 66 216 / 20%); outline-offset: 2px; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-width: 0; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 18px;
  background: rgb(255 255 255 / 94%);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; }
.brand > span:last-child, .sidebar-foot > span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 18px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.brand small, .sidebar-foot small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  font-weight: 700;
  color: white;
  background: linear-gradient(145deg, #7c3aed, #2563eb);
  box-shadow: 0 10px 28px rgb(124 58 237 / 30%);
}

.main-nav { display: grid; gap: 5px; }
.main-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; color: #59677c; font-size: 14px; }
.main-nav a span { width: 20px; color: #7c8aa0; text-align: center; }
.main-nav a:hover, .main-nav a.active { color: #4c1d95; background: #f1edff; }
.main-nav a.active { box-shadow: inset 3px 0 var(--purple); }
.main-nav a.active span { color: #6d42d8; }

.sidebar-foot { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; font-size: 12px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }

.workspace, .topbar, .topbar > div, .top-actions, main, .hero-panel, .metric-card, .panel { min-width: 0; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 96px; padding: 20px 38px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 86%); backdrop-filter: blur(18px); }
.topbar h1 { margin: 4px 0 0; font-size: 30px; font-weight: 500; letter-spacing: -.02em; line-height: 1.25; }
.eyebrow { display: block; color: #536176; font-size: 10px; font-weight: 600; letter-spacing: .12em; line-height: 1.4; }
.eyebrow.accent { color: #6d42d8; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.environment-pill { padding: 7px 10px; border: 1px solid #f3c57b; border-radius: 999px; color: var(--amber); background: #fff8e8; font-size: 10px; font-weight: 600; letter-spacing: .08em; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.3; cursor: pointer; }
.button-primary { color: white; background: #6d3fe1; box-shadow: 0 10px 26px rgb(109 63 225 / 22%); }
.button-primary:hover { background: #7c4dff; }
.button-ghost { border-color: var(--line); color: #475569; background: white; }
.button-ghost:hover { border-color: #b8c3d1; background: #f8fafc; }
.inline-form { margin: 0; }

.auth-shell { display: grid; min-height: calc(100vh - 214px); place-items: center; }
.auth-card { width: min(470px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow); }
.auth-card h1 { margin: 8px 0; font-size: 30px; font-weight: 500; letter-spacing: -.02em; line-height: 1.3; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); line-height: 1.6; }
.stack-form { display: grid; }
.check-row { display: flex; gap: 9px; align-items: center; }
.check-row input { width: 17px; min-height: 17px; }
.btn-primary { display: inline-flex; justify-content: center; margin-top: 16px; padding: 13px 18px; border: 0; border-radius: 9px; color: white; background: #6d3fe1; font: inherit; font-weight: 600; line-height: 1.35; cursor: pointer; }
.validation-summary, .field-validation-error { color: #be123c; font-size: 12px; }

main { width: min(1480px, 100%); margin: 0 auto; padding: 30px 38px 50px; }
.hero-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 27px 30px; border: 1px solid #ddd6fe; border-radius: 16px; background: linear-gradient(110deg, #f3efff, #eff6ff 52%, #ffffff 90%); box-shadow: var(--shadow); }
.hero-panel h2 { margin: 7px 0; font-size: clamp(25px, 3vw, 32px); font-weight: 600; letter-spacing: -.025em; line-height: 1.25; }
.hero-panel p { max-width: 760px; margin: 0; color: #607089; font-size: 14px; line-height: 1.65; }
.autopilot-state { display: flex; align-items: center; gap: 12px; min-width: 178px; padding: 15px; border: 1px solid #d7dfeb; border-radius: 12px; background: rgb(255 255 255 / 78%); }
.autopilot-state > span:last-child { display: flex; flex-direction: column; }
.autopilot-state small { margin-top: 3px; color: var(--muted); }
.pulse { width: 11px; height: 11px; border: 2px solid white; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgb(5 150 105 / 12%); }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 20px 0; }
.metric-card, .panel { border: 1px solid var(--line); background: white; box-shadow: 0 12px 30px rgb(51 65 85 / 7%); }
.metric-card { display: grid; grid-template-columns: 42px 1fr; gap: 0 12px; padding: 18px; border-radius: 14px; }
.metric-icon { grid-row: 1 / 4; display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; font-weight: 600; }
.metric-icon.purple { color: #6d28d9; background: rgb(139 92 246 / 15%); }
.metric-icon.blue { color: #1d4ed8; background: rgb(59 130 246 / 15%); }
.metric-icon.cyan { color: #0e7490; background: rgb(34 211 238 / 13%); }
.metric-icon.green { color: #047857; background: rgb(52 211 153 / 13%); }
.metric-card > span { color: #526177; font-size: 12px; }
.metric-card > strong { margin-top: 2px; font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.metric-card > small { margin-top: 3px; color: #5b687a; font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr); gap: 20px; }
.panel { border-radius: 14px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 21px 16px; border-bottom: 1px solid var(--line); }
.panel-heading h3 { margin: 5px 0 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.panel-heading > a { color: #6d42d8; font-size: 12px; }
.schedule-row { display: grid; grid-template-columns: 66px 60px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 17px 20px; border-bottom: 1px solid #e7ecf3; }
.schedule-row:last-child { border-bottom: 0; }
.schedule-row time { display: flex; gap: 8px; align-items: center; }
.schedule-row time strong { font-size: 24px; font-weight: 600; line-height: 1.2; }
.schedule-row time span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.schedule-row > div:nth-child(3), .connection-row > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.schedule-row small, .connection-row small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.content-chip { padding: 6px 7px; border-radius: 7px; font-size: 9px; font-weight: 600; text-align: center; letter-spacing: .05em; }
.content-chip.image { color: #1d4ed8; background: rgb(37 99 235 / 14%); }
.content-chip.reel { color: #6d28d9; background: rgb(124 58 237 / 15%); }
.content-chip.story { color: #0e7490; background: rgb(8 145 178 / 15%); }
.state { padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 600; white-space: nowrap; }
.state.planned, .state.healthy { color: #047857; background: rgb(16 185 129 / 12%); }
.state.waiting { color: #92400e; background: rgb(245 158 11 / 11%); }
.connection-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 17px 20px; border-bottom: 1px solid #e7ecf3; }
.provider-logo { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 10px; font-weight: 700; }
.provider-logo.meta { color: #2563eb; background: #eaf2ff; }
.provider-logo.video { color: #6d42d8; background: #f0ebff; }
.provider-note { margin: 18px; padding: 15px; border: 1px solid #ddd6fe; border-radius: 10px; background: #f8f5ff; }
.provider-note strong { color: #6d42d8; font-size: 12px; font-weight: 600; }
.provider-note p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.settings-shell { max-width: 1080px; margin: 0 auto; }
.settings-intro { margin-bottom: 22px; }
.settings-intro h2 { margin: 7px 0 5px; font-size: 30px; font-weight: 500; letter-spacing: -.02em; line-height: 1.3; }
.settings-intro p { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.6; }
.settings-form { display: grid; gap: 18px; }
.settings-card { overflow: hidden; }
.settings-card-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.settings-card-head > div { display: flex; min-width: 0; gap: 13px; align-items: center; }
.settings-card-head h3 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; }
.settings-card-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.provider-badge { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 10px; font-size: 12px; font-weight: 700; }
.provider-badge.openai { color: #0f766e; background: #e6fffa; }
.provider-badge.runway { color: #6d42d8; background: #f0ebff; }
.secret-status { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 600; }
.secret-status.configured { color: #047857; background: #ecfdf5; }
.secret-status.missing { color: #b45309; background: #fff7ed; }
.settings-fields { padding: 4px 22px 24px; }
.settings-savebar { position: sticky; z-index: 10; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; border: 1px solid #d8cdfc; border-radius: 12px; background: rgb(255 255 255 / 94%); box-shadow: 0 16px 40px rgb(51 65 85 / 14%); backdrop-filter: blur(18px); }
.settings-savebar p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.settings-savebar .button { flex: 0 0 auto; }

.wizard-shell { max-width: 920px; margin: 0 auto; }
.wizard-steps { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 22px; padding: 0; list-style: none; }
.wizard-steps li { position: relative; display: flex; gap: 8px; align-items: center; color: #58677b; font-size: 11px; }
.wizard-steps li::after { position: absolute; z-index: -1; top: 13px; right: 8px; left: 35px; height: 1px; background: var(--line); content: ""; }
.wizard-steps li:last-child::after { display: none; }
.wizard-steps span { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); }
.wizard-steps .active { color: #4c1d95; }
.wizard-steps .active span { border-color: var(--purple); background: var(--purple); }
.form-panel { padding: 32px; }
.form-panel h2, .success-panel h2 { margin: 8px 0; font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.form-panel > p, .success-panel > p { margin: 0 0 28px; color: var(--muted); }
form label { display: block; margin: 18px 0 7px; color: #475569; font-size: 13px; font-weight: 600; line-height: 1.4; }
input, select, textarea { width: 100%; min-width: 0; min-height: 46px; padding: 0 13px; border: 1px solid #cbd5e1; border-radius: 9px; outline: none; color: #172033; background: white; font: inherit; }
textarea { padding-block: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgb(139 92 246 / 12%); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.thirds { grid-template-columns: repeat(3, 1fr); }
.form-grid.quarters { grid-template-columns: repeat(4, 1fr); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
.form-actions.centered { justify-content: center; }
.validation { display: block; margin-top: 6px; color: #be123c; font-size: 11px; }
.success-panel { max-width: 680px; margin: 40px auto; padding: 45px; text-align: center; }
.success-mark { display: grid; width: 54px; height: 54px; margin: 0 auto 20px; place-items: center; border-radius: 50%; color: var(--green); background: rgb(16 185 129 / 12%); font-size: 25px; }
.wizard-steps .done { color: #047857; }
.wizard-steps .done span { border-color: #86d9b8; color: #047857; background: #ecfdf5; }
.notice { margin-top: 18px; padding: 12px 14px; border: 1px solid #d8e0eb; border-radius: 9px; color: #53637a; background: #f8fafc; font-size: 12px; line-height: 1.55; }
.notice.success { border-color: #a7e2c8; color: #047857; background: #ecfdf5; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 20px; }
.choice-grid.three { grid-template-columns: repeat(3, 1fr); }
.choice-card { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 18px; border: 1px solid #d7dfeb; border-radius: 11px; background: #ffffff; cursor: pointer; }
.choice-card:has(input:checked) { border-color: #7c3aed; background: #f5f1ff; }
.choice-card input, .day-grid input, .inline-checks input { width: 17px; min-height: 17px; margin: 2px 0 0; }
.choice-card span { display: flex; flex-direction: column; }
.choice-card small { margin-top: 5px; color: var(--muted); line-height: 1.4; }
.day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.day-grid label { display: flex; gap: 6px; align-items: center; margin: 0; padding: 9px; border: 1px solid #d7dfeb; border-radius: 8px; background: white; }
.inline-checks { display: flex; gap: 18px; align-items: center; min-height: 45px; }
.inline-checks label { display: flex; gap: 7px; align-items: center; margin: 0; }
.inline-checks.spacious { margin-top: 20px; }
.success-panel.wide { max-width: 880px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 25px 0; text-align: left; }
.summary-grid > div { display: flex; min-width: 0; flex-direction: column; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.summary-grid small { color: var(--muted); }
.summary-grid strong { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; }
.credit-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 30px; border: 1px solid #ddd6fe; border-radius: 16px; background: linear-gradient(120deg, #f3efff, #ffffff 70%); }
.credit-hero h2 { margin: 6px 0; font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.credit-hero p { margin: 0; color: var(--muted); }
.balance-figure { display: flex; min-width: 210px; flex-direction: column; padding: 18px; border: 1px solid #d8cdfc; border-radius: 12px; background: rgb(255 255 255 / 82%); }
.balance-figure small { color: var(--muted); }
.balance-figure strong { margin-top: 5px; font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.credit-metrics { grid-template-columns: repeat(3, 1fr); }
.credit-form { margin-top: 20px; }
.report-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 18px; }
.report-filter { display: flex; align-items: end; gap: 12px; }
.report-filter label { margin: 0; }
.report-filter input { min-width: 170px; }
.report-exports { display: flex; gap: 12px; color: #6d42d8; font-size: 12px; }
.report-section { margin-top: 20px; overflow: hidden; }
.empty-state { padding: 24px; color: var(--muted); }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 15px; padding: 18px; }
.library-card { overflow: hidden; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.library-card img, .library-card video { width: 100%; height: 190px; border-radius: 8px; object-fit: cover; background: #e2e8f0; }
.library-card h3 { margin: 10px 0 4px; font-size: 15px; }
.library-card p, .library-card small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.library-card a { color: #6d42d8; font-size: 12px; }
.table-scroll { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.report-table th, .report-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.report-table th { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.report-table form { margin: 0; }
.content-detail { overflow: hidden; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 18px; }
.detail-grid > div { padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.detail-grid dt { color: var(--muted); font-size: 10px; }
.detail-grid dd { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 12px; }
.content-detail > h3, .content-detail > ul, .content-detail > article { margin-inline: 18px; }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .workspace { min-height: 100vh; }
  .sidebar { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(310px, 86vw); height: 100dvh; overflow-y: auto; padding: 22px 18px; border-right: 1px solid var(--line); background: #fff; box-shadow: 18px 0 48px rgb(15 23 42 / 18%); transform: translateX(-105%); transition: transform 180ms ease; }
  .menu-backdrop { position: fixed; z-index: 55; inset: 0; border: 0; background: rgb(15 23 42 / 42%); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
  .mobile-menu-toggle { display: grid; flex: 0 0 auto; }
  body.menu-open { overflow: hidden; }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open .menu-backdrop { display: block; opacity: 1; pointer-events: auto; }
  .main-nav { display: grid; gap: 5px; overflow: visible; }
  .main-nav a { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 10px 13px; font-size: 14px; white-space: normal; }
  .main-nav a span { width: 20px; font-size: 15px; }
  .brand { display: flex; }
  body:has(.auth-shell) .sidebar { display: none; }
  body:has(.auth-shell) .mobile-menu-toggle { display: none; }
  .topbar { position: static; min-height: auto; gap: 14px; flex-wrap: wrap; padding: 16px; }
  .topbar .eyebrow, .environment-pill { display: none; }
  .topbar h1 { font-size: 23px; font-weight: 500; }
  .top-actions { max-width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .top-actions .button { min-height: 44px; padding-inline: 13px; }
  main { padding: 16px; }
  .auth-shell { min-height: calc(100vh - 88px); }
  .auth-card { padding: 24px 20px; }
  .hero-panel { align-items: flex-start; flex-direction: column; }
  .hero-panel > div:first-child { min-width: 0; }
  .hero-panel h2, .hero-panel p { overflow-wrap: anywhere; }
  .autopilot-state { width: 100%; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { grid-template-columns: 42px minmax(0, 1fr); }
  .panel-heading { gap: 12px; flex-wrap: wrap; }
  .schedule-row { grid-template-columns: 55px minmax(0, 1fr); }
  .schedule-row > .content-chip { grid-row: 2; }
  .schedule-row > div:nth-child(3) { grid-column: 2; }
  .schedule-row > .state { grid-column: 2; justify-self: start; }
  .connection-row { grid-template-columns: 42px minmax(0, 1fr); }
  .connection-row > .state { grid-column: 2; justify-self: start; }
  .wizard-steps { grid-template-columns: repeat(5, auto); }
  .wizard-steps li { font-size: 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .form-grid.thirds, .form-grid.quarters, .choice-grid, .choice-grid.three, .summary-grid { grid-template-columns: 1fr; }
  .day-grid { grid-template-columns: repeat(4, 1fr); }
  .report-toolbar, .report-filter { align-items: stretch; flex-direction: column; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .button, .form-actions .btn-primary { min-width: min(180px, 100%); }
  .credit-hero { align-items: stretch; flex-direction: column; }
  .balance-figure { min-width: 0; }
  .report-exports { flex-wrap: wrap; }
  .detail-grid { grid-template-columns: 1fr; }
  .settings-card-head { align-items: flex-start; flex-direction: column; }
  .settings-fields { padding-inline: 18px; }
  .settings-savebar { position: static; align-items: stretch; flex-direction: column; }
  .settings-savebar .button { width: 100%; }
}

@media (max-width: 430px) {
  .topbar { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
  .topbar-title { min-width: 0; }
  .top-actions { grid-column: 1 / -1; width: 100%; justify-content: space-between; }
  .top-actions .button { flex: 1; }
  .top-actions .inline-form { display: flex; flex: 1; }
  .top-actions .inline-form .button { width: 100%; }
  .hero-panel, .form-panel, .success-panel { padding: 22px 18px; }
  .metric-card { padding: 16px; }
  .schedule-row, .connection-row { padding: 15px 16px; }
  .day-grid { grid-template-columns: repeat(2, 1fr); }
  .report-filter input { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .menu-backdrop { transition: none; }
}
