:root {
  color-scheme: light;
  --navy-950: #071826;
  --navy-900: #0b2132;
  --navy-800: #17374a;
  --ivory: #f6f2e9;
  --paper: #fffdf8;
  --line: #d8d2c4;
  --ink: #17242d;
  --muted: #65717a;
  --gold: #ba8b3d;
  --gold-dark: #7f5b22;
  --danger: #a13e38;
  --warning: #9a671f;
  --success: #34715d;
  --focus: #f2b84b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--ivory);
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--ivory); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a, input, select, textarea { outline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); }
[hidden] { display: none !important; }
.skip-link { position: fixed; inset: 8px auto auto 8px; z-index: 20; transform: translateY(-150%); background: var(--paper); color: var(--ink); padding: 10px 14px; }
.skip-link:focus { transform: none; }
.eyebrow { margin: 0 0 4px; color: var(--gold-dark); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, var(--navy-950), var(--navy-800)); }
.login-panel { width: min(440px, 100%); background: var(--paper); border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 34px; box-shadow: 0 26px 70px rgba(0,0,0,.28); }
.login-logo { width: 58px; height: 58px; object-fit: contain; margin-bottom: 18px; }
.login-panel h1 { margin: 0; color: var(--navy-900); font-family: Georgia, "Times New Roman", serif; font-size: 32px; line-height: 1.1; }
.login-copy { color: var(--muted); line-height: 1.55; }
.login-panel form { display: grid; gap: 16px; margin-top: 24px; }
.private-beta { margin: 22px 0 0; color: var(--muted); font-size: 13px; }
label { display: grid; gap: 6px; color: var(--navy-900); font-weight: 700; font-size: 14px; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid #aeb7ba; border-radius: 5px; background: #fff; color: var(--ink); padding: 10px 12px; }
textarea { min-height: 96px; resize: vertical; }
input:disabled { background: #ecebe7; color: var(--muted); }
.button, .icon-button { min-height: 44px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-weight: 750; }
.button { padding: 9px 15px; }
.button.primary { background: var(--gold); color: #17130d; }
.button.secondary { background: var(--paper); border-color: var(--gold-dark); color: var(--gold-dark); }
.button.quiet { background: transparent; border-color: currentColor; color: inherit; }
.button.danger { background: #fff4f2; border-color: var(--danger); color: var(--danger); }
.button:disabled, .icon-button:disabled { cursor: not-allowed; opacity: .55; }
.icon-button { inline-size: 44px; padding: 0; background: transparent; color: inherit; font-size: 23px; }
.operations-app { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.rail { position: sticky; inset-block-start: 0; height: 100vh; display: flex; flex-direction: column; background: var(--navy-950); color: #f8f3e8; padding: 22px 16px; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand img { inline-size: 42px; block-size: 42px; object-fit: contain; }
.brand strong, .brand span { display: block; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 18px; }
.brand span { color: #c9d0d3; font-size: 12px; }
.rail nav { display: grid; gap: 4px; padding-block: 18px; overflow: auto; }
.nav-button { width: 100%; min-height: 44px; border: 0; border-inline-start: 3px solid transparent; border-radius: 4px; padding: 10px 12px; background: transparent; color: #dce3e5; text-align: start; cursor: pointer; font-weight: 650; }
.nav-button:hover { background: rgba(255,255,255,.07); }
.nav-button[aria-current="page"] { border-inline-start-color: var(--gold); background: rgba(186,139,61,.14); color: #fff; }
.rail-footer { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.signed-in-user { margin-bottom: 12px; color: #dce3e5; font-size: 13px; overflow-wrap: anywhere; }
.app-column { min-width: 0; }
.utility-bar { position: sticky; inset-block-start: 0; z-index: 4; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px clamp(18px, 3vw, 42px); background: rgba(255,253,248,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.utility-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.workspace { width: min(1500px, 100%); margin: 0 auto; padding: clamp(20px, 3vw, 42px); }
.status-region { min-height: 0; }
.view-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.view-header h1 { margin: 0; color: var(--navy-900); font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 3vw, 42px); }
.view-header p { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; }
.metric { min-height: 112px; padding: 18px; }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 10px; color: var(--navy-900); font-size: 26px; }
.panel { padding: 20px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 14px; color: var(--navy-900); font-size: 19px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.overview-module { min-height: 172px; margin: 0; }
.overview-module .metrics { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.overview-module .metric { min-height: 88px; padding: 14px; }
.overview-module .metric strong { font-size: 21px; }
.segmented-control { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.brain-monitor-panel { min-height: 180px; }
.compact-list { margin-top: 22px; }
.compact-list dl { display: grid; gap: 8px; margin: 0; }
.compact-list dl div { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.compact-list dt, .compact-list dd { margin: 0; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; gap: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 14px; border-bottom: 1px solid #e6e1d7; text-align: start; vertical-align: top; }
th { position: sticky; inset-block-start: 0; background: #eee9df; color: var(--navy-900); font-size: 12px; text-transform: uppercase; }
tbody tr:hover { background: #fbf7ee; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions .button { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.status { display: inline-flex; align-items: center; min-height: 26px; border: 1px solid currentColor; border-radius: 4px; padding: 2px 7px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.status.published, .status.reviewed, .status.active, .status.healthy { color: var(--success); }
.status.flagged, .status.disabled, .status.archived { color: var(--danger); }
.status.draft, .status.not-yet-reviewed, .status.unpublished, .status.unavailable { color: var(--warning); }
.empty-state { padding: 34px; color: var(--muted); text-align: center; }
.error-summary { border-inline-start: 4px solid var(--danger); background: #fff0ee; color: #6d2824; padding: 12px 14px; margin-bottom: 14px; }
.notice { border-inline-start: 4px solid var(--gold); background: #fff8e7; padding: 12px 14px; margin-bottom: 16px; }
.success-receipt { border-inline-start: 4px solid var(--success); background: #edf8f2; padding: 12px 14px; margin-bottom: 16px; overflow-wrap: anywhere; }
.dialog { width: min(860px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--paper); }
.dialog::backdrop { background: rgba(3, 16, 25, .68); }
.dialog-header, .dialog-footer { position: sticky; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--paper); padding: 16px 20px; }
.dialog-header { inset-block-start: 0; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; color: var(--navy-900); }
.dialog-footer { inset-block-end: 0; justify-content: flex-end; border-top: 1px solid var(--line); }
.form-body { padding: 20px; overflow: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .wide { grid-column: 1 / -1; }
.schedule-list { display: grid; gap: 10px; }
.schedule-row { display: grid; grid-template-columns: 1fr 1fr 1fr 90px auto; gap: 8px; align-items: end; border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.schedule-row label { font-size: 12px; }
.schedule-applicable-days { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; border: 0; padding: 0; margin: 2px 0; }
.schedule-applicable-days[hidden] { display: none; }
.schedule-applicable-days legend { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.schedule-applicable-days label { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; }
.schedule-applicable-days input { width: 20px; height: 20px; flex: 0 0 auto; }
.details-list { display: grid; grid-template-columns: minmax(140px, .35fr) 1fr; gap: 8px 16px; margin: 0; }
.details-list dt { color: var(--muted); font-weight: 700; }
.details-list dd { margin: 0; overflow-wrap: anywhere; }
.toast { position: fixed; inset: auto 20px 20px auto; z-index: 30; max-width: 420px; background: var(--navy-900); color: white; padding: 13px 16px; border-radius: 5px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
[dir="rtl"] .eyebrow { text-transform: none; }
[dir="rtl"] .row-actions, [dir="rtl"] .actions { flex-direction: row-reverse; justify-content: flex-start; }
@media (max-width: 900px) {
  .operations-app { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(300px, 88vw); transform: translateX(-105%); transition: transform .18s ease; box-shadow: 15px 0 40px rgba(0,0,0,.3); }
  [dir="rtl"] .rail { inset: 0 0 0 auto; transform: translateX(105%); box-shadow: -15px 0 40px rgba(0,0,0,.3); }
  .rail.open { transform: translateX(0); }
  .menu-toggle { display: inline-grid; place-items: center; }
  .utility-bar { padding-inline: 14px; }
  .workspace { padding: 20px 14px 34px; }
  .view-header { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 620px) {
  .login-panel { padding: 24px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .schedule-row { grid-template-columns: 1fr 1fr; }
  .schedule-applicable-days { grid-template-columns: 1fr 1fr; }
  .details-list { grid-template-columns: 1fr; }
  .details-list dd { margin-bottom: 8px; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  table, thead, tbody, tr, th, td { display: block; min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody { display: grid; gap: 12px; }
  tbody tr { padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
  tbody td { display: grid; grid-template-columns: minmax(100px, .4fr) minmax(0, 1fr); gap: 10px; padding: 8px 2px; border-bottom: 1px solid #ece6dc; overflow-wrap: anywhere; word-break: break-word; }
  tbody td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
  tbody td:last-child { border: 0; }
  .row-actions { grid-column: 1 / -1; }
  .dialog-footer { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
