:root {
  color-scheme: light;
  --ink-950: #0b1020;
  --ink-900: #11182c;
  --ink-700: #34405b;
  --ink-500: #68728a;
  --ink-300: #b9c1d1;
  --surface: #ffffff;
  --canvas: #f3f6fb;
  --line: #dfe4ee;
  --blue: #315cff;
  --blue-soft: #e9eeff;
  --cyan: #66e1ff;
  --green: #0d8a61;
  --green-soft: #e6f7f0;
  --amber: #9a5b00;
  --amber-soft: #fff2d8;
  --red: #b42336;
  --red-soft: #ffeaed;
  --shadow: 0 18px 50px rgba(19, 30, 57, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink-950);
  background: var(--canvas);
  font-size: 1rem;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid rgba(49, 92, 255, 0.34);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.boot-screen,
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 18% 12%, rgba(102, 225, 255, 0.16), transparent 28rem),
    radial-gradient(circle at 82% 78%, rgba(49, 92, 255, 0.24), transparent 30rem),
    var(--ink-950);
  color: white;
}

.boot-screen { align-content: center; gap: 0.8rem; }
.boot-screen p { color: var(--ink-300); margin: 0; }

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 0.85rem 0.85rem 0.85rem 0.3rem;
  color: var(--ink-950);
  background: var(--cyan);
  font-weight: 850;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 28px rgba(102, 225, 255, 0.18);
}

.login-card {
  width: min(100%, 27rem);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.5rem;
  background: rgba(17, 24, 44, 0.84);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

.login-brand { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 2.5rem; }
.login-brand strong { font-size: 1.1rem; letter-spacing: -0.02em; }
.login-card h1 { margin: 0 0 0.5rem; font-size: clamp(1.8rem, 8vw, 2.45rem); line-height: 1.08; letter-spacing: -0.045em; }
.login-card > p { margin: 0 0 1.75rem; color: var(--ink-300); }

.form-field { display: grid; gap: 0.45rem; margin-top: 1rem; }
.form-field label { color: #eef2ff; font-size: 0.9rem; font-weight: 650; }
.form-field input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #3a4562;
  border-radius: 0.75rem;
  color: white;
  background: #0c1326;
}
.form-field input::placeholder { color: #7f8aa4; }
.form-field input:focus { border-color: var(--cyan); }

.primary-button {
  min-height: 3rem;
  width: 100%;
  margin-top: 1.4rem;
  border: 0;
  border-radius: 0.75rem;
  color: white;
  background: var(--blue);
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(49, 92, 255, 0.26);
}
.primary-button:hover { background: #244ce9; }
.primary-button:disabled { cursor: wait; opacity: 0.62; }

.form-error {
  margin: 1rem 0 0;
  padding: 0.7rem 0.8rem;
  border-radius: 0.65rem;
  color: #ffd8de;
  background: rgba(180, 35, 54, 0.22);
  font-size: 0.9rem;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1rem;
  color: white;
  background: var(--ink-950);
}

.sidebar-brand { display: flex; align-items: center; gap: 0.75rem; padding: 0.25rem 0.5rem 1.75rem; }
.sidebar-brand strong { font-size: 1.08rem; letter-spacing: -0.025em; }

.nav-label { margin: 0.25rem 0.65rem 0.45rem; color: #77839f; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.09em; }
.nav { display: grid; gap: 0.3rem; }
.nav-item {
  min-height: 2.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 0.75rem;
  color: #aab4ca;
  background: transparent;
  text-align: left;
  text-decoration: none;
}
.nav-item svg { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }
.nav-item.active { color: white; background: #202a44; box-shadow: inset 3px 0 var(--cyan); }
.nav-item[aria-disabled="true"] { cursor: default; opacity: 0.62; }
.nav-soon { margin-left: auto; font-size: 0.72rem; color: #8792ac; }

.sidebar-footer { margin-top: auto; padding: 1rem 0.5rem 0; border-top: 1px solid #252d42; }
.user-block { display: grid; grid-template-columns: 2.25rem 1fr auto; align-items: center; gap: 0.65rem; min-width: 0; }
.avatar { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; background: #2e3a5c; color: var(--cyan); font-weight: 800; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 0.86rem; }
.user-copy span { color: #8490aa; font-size: 0.75rem; }
.icon-button { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border: 0; border-radius: 0.7rem; color: #aab4ca; background: transparent; }
.icon-button:hover { color: white; background: #202a44; }
.icon-button svg { width: 1.15rem; height: 1.15rem; }

.main { min-width: 0; padding: clamp(1.25rem, 3vw, 2.5rem); }
.content { width: min(100%, 86rem); margin: 0 auto; }

.demo-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #b9c9ff;
  border-radius: 0.75rem;
  color: #173493;
  background: var(--blue-soft);
  font-weight: 650;
  font-size: 0.88rem;
}

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.eyebrow { margin: 0 0 0.3rem; color: var(--blue); font-size: 0.78rem; font-weight: 850; letter-spacing: 0.12em; }
.page-header h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; letter-spacing: -0.055em; }
.page-meta { display: flex; align-items: center; gap: 0.45rem; color: var(--ink-500); font-size: 0.85rem; white-space: nowrap; }
.connection-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(13, 138, 97, 0.11); }
.connection-dot.offline { background: var(--red); box-shadow: 0 0 0 4px rgba(180, 35, 54, 0.11); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.8rem 0 1rem; }
.stat {
  min-width: 0;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}
.stat span { display: block; color: var(--ink-500); font-size: 0.82rem; font-weight: 700; }
.stat strong { display: block; margin-top: 0.2rem; font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.04em; }
.stat:first-child { color: white; border-color: var(--ink-900); background: var(--ink-900); }
.stat:first-child span { color: #aeb8cf; }

.inbox-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 1.15rem; background: var(--surface); box-shadow: var(--shadow); }
.toolbar { display: grid; grid-template-columns: minmax(14rem, 1fr) repeat(5, minmax(8.5rem, auto)); gap: 0.7rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.control { min-height: 2.8rem; width: 100%; padding: 0.62rem 0.75rem; border: 1px solid var(--line); border-radius: 0.7rem; color: var(--ink-900); background: #fbfcff; }
.control::placeholder { color: #8a94a8; }
.control:focus { border-color: var(--blue); }

.call-table { width: 100%; border-collapse: collapse; }
.call-table th { padding: 0.75rem 1rem; color: var(--ink-500); background: #f9faff; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.035em; text-align: left; }
.call-table td { padding: 0.95rem 1rem; border-top: 1px solid #edf0f5; vertical-align: middle; }
.call-table tbody tr { cursor: pointer; transition: background 120ms ease; }
.call-table tbody tr:hover { background: #f8faff; }
.caller { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); align-items: center; gap: 0.75rem; min-width: 12rem; }
.caller-icon { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 0.75rem; color: var(--blue); background: var(--blue-soft); font-weight: 800; }
.caller-copy strong, .caller-copy span { display: block; }
.caller-copy strong { font-size: 0.93rem; }
.caller-copy span { color: var(--ink-500); font-size: 0.78rem; }
.cell-main { display: block; color: var(--ink-900); font-size: 0.88rem; font-weight: 650; }
.cell-sub { display: block; margin-top: 0.1rem; color: var(--ink-500); font-size: 0.76rem; }

.pill { display: inline-flex; align-items: center; min-height: 1.75rem; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.76rem; font-weight: 800; white-space: nowrap; }
.pill.new { color: #2446bf; background: var(--blue-soft); }
.pill.review { color: var(--amber); background: var(--amber-soft); }
.pill.done { color: var(--green); background: var(--green-soft); }
.pill.failed { color: var(--red); background: var(--red-soft); }

.message-state { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-700); font-size: 0.84rem; font-weight: 650; }
.message-state svg { width: 1rem; height: 1rem; color: var(--blue); }

.empty-state,
.error-state { display: grid; justify-items: center; padding: 4.5rem 1.5rem; text-align: center; }
.empty-state h2, .error-state h2 { margin: 0.9rem 0 0.3rem; font-size: 1.2rem; }
.empty-state p, .error-state p { max-width: 28rem; margin: 0; color: var(--ink-500); }
.empty-symbol { width: 3.5rem; height: 3.5rem; display: grid; place-items: center; border-radius: 1rem; color: var(--blue); background: var(--blue-soft); font-size: 1.4rem; }
.retry-button { min-height: 2.7rem; margin-top: 1rem; padding: 0.55rem 1rem; border: 0; border-radius: 0.7rem; color: white; background: var(--ink-900); font-weight: 750; }

.skeleton-list { padding: 0.5rem 1rem; }
.skeleton-row { height: 4.9rem; margin: 0.5rem 0; border-radius: 0.75rem; background: linear-gradient(90deg, #f0f2f7 25%, #fafbfe 45%, #f0f2f7 65%); background-size: 300% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -100% 0; } }

.mobile-nav { display: none; }
.mobile-cards { display: none; }

.drawer-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(6, 10, 22, 0.52);
  backdrop-filter: blur(2px);
}

.call-drawer {
  width: min(100%, 42rem);
  height: 100%;
  overflow-y: auto;
  background: var(--surface);
  box-shadow: -24px 0 70px rgba(4, 10, 25, 0.22);
}

.drawer-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}
.drawer-header h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.1; letter-spacing: -0.045em; }
.drawer-header > div > p:last-child { margin: 0.3rem 0 0; color: var(--ink-500); }
.drawer-close { width: 2.75rem; height: 2.75rem; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 0.75rem; color: var(--ink-700); background: white; font-size: 1.7rem; line-height: 1; }
.drawer-body { padding: 0 clamp(1rem, 4vw, 2rem) 3rem; }
.drawer-loading { padding: 3rem 2rem; color: var(--ink-500); }
.detail-error { margin: 1rem 0 0; padding: 0.75rem 0.9rem; border-radius: 0.7rem; color: var(--red); background: var(--red-soft); font-weight: 650; }

.detail-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; padding: 1.25rem 0; }
.detail-summary > div { min-width: 0; padding: 0.9rem; border: 1px solid var(--line); border-radius: 0.8rem; background: #fafbfe; }
.detail-summary span, .recording-box span { display: block; color: var(--ink-500); font-size: 0.76rem; font-weight: 700; }
.detail-summary strong { display: block; margin-top: 0.2rem; overflow-wrap: anywhere; font-size: 0.9rem; }
.detail-section { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 0.9rem; font-size: 1rem; letter-spacing: -0.015em; }
.detail-muted { margin: 0; color: var(--ink-500); }
.recording-box { display: grid; gap: 0.75rem; padding: 1rem; border-radius: 0.9rem; background: var(--blue-soft); }
.recording-box audio { width: 100%; }
.preview-audio { margin: 0; color: var(--ink-500); font-size: 0.85rem; }
.download-link { width: max-content; color: var(--blue); font-size: 0.85rem; font-weight: 750; }

.work-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; align-items: end; }
.work-form label { color: var(--ink-500); font-size: 0.78rem; font-weight: 750; }
.work-form .control { display: block; margin-top: 0.35rem; color: var(--ink-900); font-weight: 500; }
.primary-button.compact { width: max-content; min-height: 2.8rem; margin: 0; padding: 0.55rem 1rem; box-shadow: none; }
.work-form .primary-button { grid-column: 1 / -1; }
.notes { display: grid; gap: 0.65rem; }
.notes article { padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: 0.75rem; }
.notes p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes span { display: block; margin-top: 0.45rem; color: var(--ink-500); font-size: 0.76rem; }
.note-form { display: grid; justify-items: end; gap: 0.6rem; margin-top: 0.8rem; }
.note-form textarea { min-height: 6rem; resize: vertical; }
.timeline { display: grid; gap: 0.85rem; margin: 0; padding: 0 0 0 1.25rem; }
.timeline li { padding-left: 0.2rem; }
.timeline strong, .timeline span { display: block; }
.timeline strong { font-size: 0.9rem; }
.timeline span { color: var(--ink-500); font-size: 0.76rem; }
.transcript { margin: 0; padding: 1rem; border-radius: 0.8rem; background: #f7f8fb; white-space: pre-wrap; overflow-wrap: anywhere; }

.settings-loading { margin-top: 1.5rem; padding: 3rem; border: 1px solid var(--line); border-radius: 1rem; color: var(--ink-500); background: white; text-align: center; }
.active-version { min-width: 7rem; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 0.8rem; background: white; text-align: right; }
.active-version span, .active-version strong { display: block; }
.active-version span { color: var(--ink-500); font-size: 0.72rem; font-weight: 750; }
.active-version strong { font-size: 1.05rem; }
.settings-message { margin: 1rem 0 0; padding: 0.8rem 1rem; border: 1px solid #bad9cd; border-radius: 0.75rem; color: var(--green); background: var(--green-soft); font-weight: 650; }
.settings-layout { display: grid; gap: 1rem; margin-top: 1.5rem; }
.settings-card { padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: 1rem; background: white; box-shadow: var(--shadow); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; }
.section-heading h2, .settings-card > h2 { margin: 0; font-size: 1.15rem; }
.section-heading p { margin: 0.2rem 0 0; color: var(--ink-500); }
.secondary-button { min-height: 2.65rem; padding: 0.5rem 0.85rem; border: 1px solid var(--line); border-radius: 0.7rem; color: var(--ink-700); background: white; font-weight: 700; white-space: nowrap; }
.secondary-button:hover { border-color: #aeb9cd; background: #f8faff; }
.upload-form { display: grid; grid-template-columns: minmax(10rem, 0.7fr) minmax(14rem, 1.5fr) auto; align-items: end; gap: 0.75rem; padding: 1rem; border-radius: 0.9rem; background: #f7f9fd; }
.upload-form label, .flow-form label, .flow-option label { min-width: 0; color: var(--ink-500); font-size: 0.78rem; font-weight: 750; }
.upload-form .control, .flow-form label > .control, .flow-option .control { display: block; margin-top: 0.35rem; color: var(--ink-900); font-weight: 500; }
.file-control { padding: 0.45rem; background: white; }
.file-control::file-selector-button { min-height: 2rem; margin-right: 0.65rem; padding: 0.3rem 0.7rem; border: 0; border-radius: 0.5rem; color: var(--blue); background: var(--blue-soft); font-weight: 750; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.65rem; margin-top: 1rem; }
.asset-card { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; min-width: 0; padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: 0.75rem; }
.asset-card > div { min-width: 0; }
.asset-card span, .asset-card strong, .asset-card small { display: block; }
.asset-card > div span, .asset-card small { color: var(--ink-500); font-size: 0.72rem; }
.asset-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.asset-status { flex: 0 0 auto; padding: 0.25rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 800; }
.asset-status.ready { color: var(--green); background: var(--green-soft); }
.asset-status.processing, .asset-status.uploaded { color: var(--amber); background: var(--amber-soft); }
.asset-status.failed { color: var(--red); background: var(--red-soft); }
.asset-status.retired { color: var(--ink-500); background: #edf0f5; }
.flow-form { display: grid; gap: 1.25rem; }
.flow-form fieldset { min-width: 0; margin: 0; padding: 1.1rem 0 0; border: 0; border-top: 1px solid var(--line); }
.flow-form legend { padding: 0 0.5rem 0 0; color: var(--ink-900); font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.compact-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#flow-options { display: grid; gap: 0.65rem; }
.flow-option { display: grid; grid-template-columns: 5rem minmax(10rem, 1fr) minmax(9rem, 0.8fr) minmax(12rem, 1fr) auto; align-items: end; gap: 0.65rem; padding: 0.8rem; border: 1px solid var(--line); border-radius: 0.8rem; background: #fafbfe; }
.remove-option { min-height: 2.8rem; padding: 0.45rem 0.7rem; border: 0; border-radius: 0.65rem; color: var(--red); background: var(--red-soft); font-size: 0.78rem; font-weight: 750; }
#add-option { margin-top: 0.75rem; }
.check-row { display: flex; align-items: center; gap: 0.55rem; min-height: 2.5rem; color: var(--ink-700) !important; }
.check-row input { width: 1.1rem; height: 1.1rem; accent-color: var(--blue); }
.schedule-grid { display: grid; gap: 0.45rem; margin-top: 0.8rem; }
.schedule-row { display: grid; grid-template-columns: minmax(9rem, 1fr) 8rem 8rem; align-items: center; gap: 0.65rem; }
.publish-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.publish-row p { margin: 0; color: var(--ink-500); }
.version-card { box-shadow: none; }
.management-layout { display: grid; grid-template-columns: minmax(18rem, 0.75fr) minmax(28rem, 1.5fr); align-items: start; gap: 1rem; margin-top: 1.5rem; }
.create-user-form { display: grid; gap: 0.75rem; }
.create-user-form label, .user-update-form label, .password-reset-form label { color: var(--ink-500); font-size: 0.78rem; font-weight: 750; }
.create-user-form .control, .user-update-form .control, .password-reset-form .control { display: block; margin-top: 0.3rem; color: var(--ink-900); font-weight: 500; }
.team-list { display: grid; gap: 0.75rem; }
.team-card { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 0.9rem; background: white; }
.team-identity { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; }
.team-identity strong, .team-identity span { display: block; }
.team-identity > div:nth-child(2) { min-width: 0; }
.team-identity > div:nth-child(2) strong, .team-identity > div:nth-child(2) span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-identity > div:nth-child(2) span { color: var(--ink-500); font-size: 0.78rem; }
.user-update-form { display: grid; grid-template-columns: minmax(10rem, 1fr) 9rem 9rem auto; align-items: end; gap: 0.65rem; margin-top: 0.9rem; }
.password-reset { margin-top: 0.8rem; color: var(--ink-500); font-size: 0.8rem; }
.password-reset summary { width: max-content; cursor: pointer; color: var(--blue); font-weight: 750; }
.password-reset-form { display: grid; grid-template-columns: minmax(12rem, 1fr) auto; align-items: end; gap: 0.65rem; margin-top: 0.65rem; padding: 0.75rem; border-radius: 0.7rem; background: #f7f9fd; }
.audit-panel { margin-top: 1.5rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.audit-cards { display: none; }
.readiness-banner { display: flex; align-items: flex-start; gap: 0.85rem; margin-top: 1.5rem; padding: 1rem 1.1rem; border: 1px solid #efb7c0; border-radius: 0.9rem; color: var(--red); background: var(--red-soft); }
.readiness-banner .status-indicator { margin-top: 0.3rem; }
.readiness-banner strong { display: block; }
.readiness-banner p { margin: 0.2rem 0 0; color: #7c2c3a; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.status-card { display: flex; align-items: flex-start; gap: 0.75rem; min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 0.9rem; background: white; box-shadow: var(--shadow); }
.status-card > div:last-child { min-width: 0; }
.status-card span, .status-card strong, .status-card small { display: block; overflow-wrap: anywhere; }
.status-card span { color: var(--ink-500); font-size: 0.75rem; font-weight: 750; }
.status-card strong { margin-top: 0.1rem; font-size: 0.95rem; }
.status-card small { margin-top: 0.25rem; color: var(--ink-500); }
.status-indicator { width: 0.7rem; height: 0.7rem; flex: 0 0 auto; border-radius: 999px; background: var(--ink-300); box-shadow: 0 0 0 4px rgba(185, 193, 209, 0.2); }
.status-indicator.good { background: var(--green); box-shadow: 0 0 0 4px rgba(13, 138, 97, 0.13); }
.status-indicator.warning { background: var(--amber); box-shadow: 0 0 0 4px rgba(154, 91, 0, 0.13); }
.status-indicator.bad { background: var(--red); box-shadow: 0 0 0 4px rgba(180, 35, 54, 0.13); }
.queue-card { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin-top: 1rem; }
.queue-card h2 { margin: 0; font-size: 1.1rem; }
.queue-card p { margin: 0.2rem 0 0; color: var(--ink-500); }
.queue-metrics { display: grid; grid-template-columns: repeat(4, minmax(4.5rem, 1fr)); gap: 0.7rem; }
.queue-metrics span { color: var(--ink-500); font-size: 0.72rem; text-align: center; }
.queue-metrics strong { display: block; color: var(--ink-900); font-size: 1.25rem; }
.system-timestamp { margin: 1rem 0 0; color: var(--ink-500); font-size: 0.78rem; }

@media (max-width: 900px) {
  .app-shell { display: block; padding-bottom: 5rem; }
  .sidebar { display: none; }
  .main { padding: 1.25rem 1rem; }
  .page-header { align-items: flex-start; }
  .page-meta { margin-top: 0.45rem; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
  .stat { padding: 0.9rem; }
  .stat strong { font-size: 1.45rem; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search { grid-column: 1 / -1; }
  .call-table { display: none; }
  .mobile-cards { display: grid; gap: 0; }
  .call-card { padding: 1rem; border-top: 1px solid #edf0f5; background: white; }
  .call-card:first-child { border-top: 0; }
  .call-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
  .call-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; margin-top: 1rem; }
  .call-card-grid > div { min-width: 0; }
  .mobile-nav {
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 0.45rem max(0.45rem, env(safe-area-inset-right)) calc(0.45rem + env(safe-area-inset-bottom)) max(0.45rem, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
  }
  .mobile-nav button { min-height: 3.4rem; display: grid; justify-items: center; align-content: center; gap: 0.15rem; border: 0; color: var(--ink-500); background: transparent; font-size: 0.7rem; font-weight: 700; }
  .mobile-nav button.active { color: var(--blue); }
  .mobile-nav svg { width: 1.2rem; height: 1.2rem; }
  .upload-form { grid-template-columns: 1fr 1fr; }
  .upload-form .primary-button { width: 100%; }
  .form-grid, .compact-grid { grid-template-columns: 1fr 1fr; }
  .flow-option { grid-template-columns: 5rem 1fr; }
  .flow-option label:nth-child(2), .flow-option label:nth-child(4) { grid-column: span 1; }
  .management-layout { grid-template-columns: 1fr; }
  .user-update-form { grid-template-columns: 1fr 1fr; }
  .user-update-form label:first-child { grid-column: 1 / -1; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .queue-card { align-items: flex-start; flex-direction: column; }
  .queue-metrics { width: 100%; }
}

@media (max-width: 560px) {
  .page-header { display: block; }
  .page-header h1 { font-size: 2.25rem; }
  .stats { grid-template-columns: 1fr; }
  .stat { display: flex; justify-content: space-between; align-items: center; }
  .stat strong { margin: 0; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .search { grid-column: auto; }
  .call-drawer { width: 100%; }
  .detail-summary, .work-form { grid-template-columns: 1fr; }
  .work-form .primary-button { grid-column: auto; width: 100%; }
  .upload-form, .form-grid, .compact-grid, .flow-option { grid-template-columns: 1fr; }
  .flow-option label:nth-child(2), .flow-option label:nth-child(4) { grid-column: auto; }
  .schedule-row { grid-template-columns: 1fr 1fr; }
  .schedule-row .check-row { grid-column: 1 / -1; }
  .publish-row { display: grid; }
  .publish-row .primary-button { width: 100%; }
  .user-update-form, .password-reset-form { grid-template-columns: 1fr; }
  .user-update-form label:first-child { grid-column: auto; }
  .user-update-form .secondary-button, .password-reset-form .secondary-button { width: 100%; }
  .audit-panel .call-table { display: none; }
  .audit-cards { display: grid; }
  .audit-cards article { display: grid; gap: 0.2rem; padding: 1rem; border-top: 1px solid var(--line); }
  .audit-cards article:first-child { border-top: 0; }
  .audit-cards span, .audit-cards small { color: var(--ink-500); }
  .audit-cards span { font-size: 0.8rem; }
  .audit-cards small { font-size: 0.72rem; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
  .status-grid { grid-template-columns: 1fr; }
  .queue-metrics { grid-template-columns: 1fr 1fr; }
}

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