:root {
  color-scheme: light;
  --ink: #092235;
  --ink-2: #16394d;
  --navy: #062b42;
  --navy-deep: #031e30;
  --blue: #2f6f94;
  --teal: #4caab5;
  --teal-soft: #dceee8;
  --cream: #f7f4ec;
  --paper: #fffdf8;
  --white: #ffffff;
  --amber: #e6aa4d;
  --coral: #b85c45;
  --coral-soft: #fff2ee;
  --line: #d8e0e2;
  --line-strong: #b8c7cd;
  --muted: #62747f;
  --success: #187e78;
  --shadow: 0 18px 50px rgba(4, 34, 53, 0.09);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid rgba(76, 170, 181, 0.42); outline-offset: 3px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
}
.brand-lockup > img { width: 46px; height: 46px; object-fit: contain; }
.brand-lockup span { display: grid; line-height: 1.05; }
.brand-lockup strong { font-size: 19px; letter-spacing: -0.02em; }
.brand-lockup small { margin-top: 4px; color: #a7d5d8; font-size: 13px; }
.brand-lockup.compact > img { width: 40px; height: 40px; }

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
}
.icon-button img { width: 18px; height: 18px; opacity: 0.8; }
.icon-button.light { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); }
.icon-button.light img { filter: invert(1); }

/* Password gate */
.login-page { background: var(--navy-deep); }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); }
.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: clamp(42px, 6vw, 86px);
  color: var(--paper);
  background-color: #16394d;
  background-image: url('/static/brand/lawlabs-hero-particle-monument.webp');
  background-blend-mode: multiply;
  background-size: cover;
  background-position: center;
}
.login-wordmark { width: min(360px, 65%); filter: brightness(0) invert(1); }
.login-brand-copy { max-width: 650px; padding-top: 25vh; }
.login-brand-copy h1 { margin: 0; font-size: clamp(48px, 5vw, 76px); line-height: .98; letter-spacing: -.055em; }
.login-brand-copy > p:last-child { max-width: 540px; margin: 26px 0 0; color: #c6d9df; font-size: 18px; line-height: 1.65; }
.login-panel { display: grid; place-items: center; padding: 42px; background: var(--cream); }
.login-card { width: min(430px, 100%); }
.login-mark { width: 58px; height: 58px; margin-bottom: 32px; object-fit: contain; }
.login-card h2 { margin: 0; font-size: 38px; letter-spacing: -.04em; }
.login-intro { margin: 12px 0 30px; color: var(--muted); line-height: 1.55; }
.login-card label, .edit-form label, .reject-form label { display: block; margin: 18px 0 8px; font-size: 13px; font-weight: 760; }
.login-card label small, .edit-form label small, .reject-form label small { color: var(--muted); font-weight: 500; }
.password-field { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--white); transition: border-color .16s, box-shadow .16s; }
.password-field:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(76,170,181,.12); }
.password-field img { width: 18px; margin-left: 15px; opacity: .45; }
.password-field input { width: 100%; padding: 15px 14px; border: 0; outline: 0; background: transparent; }
.login-submit { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: 18px; padding: 15px 17px; border: 1px solid var(--navy); border-radius: var(--radius); color: var(--white); background: var(--navy); font-weight: 760; cursor: pointer; }
.login-submit:hover { background: var(--ink-2); }
.login-submit img { width: 18px; filter: invert(1); }
.login-security { display: flex; gap: 9px; align-items: center; margin: 22px 0 0; color: var(--muted); font-size: 12px; }
.login-security img { width: 16px; opacity: .55; }
.form-error { margin: 14px 0; padding: 11px 13px; border-left: 3px solid var(--coral); color: #873a2a; background: var(--coral-soft); font-size: 13px; line-height: 1.45; }

/* Multi-channel shell */
.control-room-page { min-height: 100vh; background: var(--cream); }
.control-header { display: flex; align-items: center; justify-content: space-between; min-height: 82px; padding: 0 clamp(24px, 5vw, 72px); background: var(--navy); }
.control-room { width: min(1040px, calc(100% - 48px)); margin: 0 auto; padding: 12vh 0 80px; }
.control-copy { max-width: 760px; }
.control-copy h1 { margin: 0; font-size: clamp(48px, 7vw, 84px); line-height: .96; letter-spacing: -.06em; }
.control-copy > p:last-child { max-width: 650px; margin: 28px 0 58px; color: var(--muted); font-size: 19px; line-height: 1.65; }
.channel-row { display: grid; grid-template-columns: 64px 1fr auto 28px; gap: 22px; align-items: center; padding: 26px 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); text-decoration: none; transition: transform .15s, border-color .15s; }
.channel-row:hover { transform: translateY(-2px); border-color: var(--teal); }
.channel-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 10px; background: #0a66c2; }
.channel-icon img { width: 28px; filter: invert(1); }
.channel-main { display: grid; }
.channel-main small { margin-bottom: 5px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.channel-main strong { font-size: 22px; }
.channel-main span { margin-top: 4px; color: var(--muted); font-size: 14px; }
.channel-state { display: flex; align-items: center; gap: 8px; color: var(--success); font-size: 13px; font-weight: 750; }
.channel-state img { width: 15px; filter: invert(38%) sepia(34%) saturate(1102%) hue-rotate(127deg); }
.row-arrow { width: 22px; opacity: .5; }
.future-note { margin: 22px 3px 0; color: var(--muted); font-size: 13px; }

/* Publication Studio */
.desk-page { overflow-x: hidden; background: var(--paper); }
.desk-header {
  display: grid;
  grid-template-columns: 225px 1fr auto auto 42px;
  gap: 28px;
  align-items: center;
  min-height: 76px;
  padding: 0 24px;
  color: var(--paper);
  background: var(--navy-deep);
}
.breadcrumb { display: flex; gap: 13px; align-items: center; color: #c7d7dc; font-size: 15px; }
.breadcrumb a { color: #9db8c1; text-decoration: none; }
.breadcrumb strong { color: var(--paper); }
.mode-switch { display: flex; padding: 3px; border: 1px solid rgba(255,255,255,.24); border-radius: var(--radius); }
.mode-switch button { min-width: 106px; padding: 9px 15px; border: 0; border-radius: 6px; color: #c9d9df; background: transparent; cursor: pointer; }
.mode-switch button.active { color: var(--white); background: var(--teal); box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset; }
.live-gate { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 6px; color: #dfe8eb; background: rgba(255,255,255,.1); font-size: 12px; white-space: nowrap; }
.live-gate img { width: 14px; filter: invert(1); opacity: .8; }

.publication-studio { display: grid; min-height: calc(100vh - 76px); grid-template-columns: 240px minmax(500px, 1.55fr) minmax(360px, .95fr); background: var(--paper); }
.queue-rail { position: relative; display: flex; flex-direction: column; padding: 28px 14px 22px; color: var(--paper); background: var(--navy); }
.queue-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 0 7px 18px; border-bottom: 1px solid rgba(255,255,255,.13); }
.queue-heading span { font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.queue-heading strong { display: block; max-width: 100%; color: #9fdae0; font-size: 12px; line-height: 1.3; }
.queue-list { display: grid; gap: 11px; padding-top: 15px; }
.queue-item { display: grid; grid-template-columns: 28px 64px 1fr; gap: 9px; align-items: center; min-height: 82px; padding: 8px; border: 1px solid transparent; border-radius: var(--radius); color: var(--paper); background: transparent; text-align: left; cursor: pointer; }
.queue-item:hover { background: rgba(255,255,255,.06); }
.queue-item.active { border-color: var(--teal); background: rgba(76,170,181,.1); box-shadow: 0 0 0 1px rgba(76,170,181,.2) inset; }
.queue-number { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 4px; color: var(--navy); background: var(--paper); font-size: 12px; font-weight: 850; }
.queue-thumb { width: 64px; height: 64px; border-radius: 5px; object-fit: cover; background: #dce8e9; }
.queue-copy { min-width: 0; }
.queue-copy strong { display: -webkit-box; overflow: hidden; color: var(--paper); font-size: 12px; font-weight: 680; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.queue-copy span { display: block; margin-top: 6px; color: #a8c6cf; font-size: 11px; line-height: 1.25; }
.timezone-note { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 18px 7px 0; border-top: 1px solid rgba(255,255,255,.13); color: #b7ced5; font-size: 11px; line-height: 1.4; }
.timezone-note img { width: 20px; filter: invert(69%) sepia(43%) saturate(517%) hue-rotate(138deg); }
.timezone-note strong { color: var(--paper); font-weight: 600; }

.public-stage, .editorial-inspector { min-width: 0; padding: 25px clamp(22px, 2.2vw, 34px) 38px; }
.public-stage { background: #fbfaf6; }
.editorial-inspector { border-left: 1px solid var(--line); background: var(--paper); }
.section-label { display: flex; gap: 9px; align-items: center; margin-bottom: 13px; color: #188b99; font-size: 11px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.section-label img { width: 17px; filter: invert(49%) sepia(35%) saturate(1018%) hue-rotate(139deg); }

.linkedin-preview { width: min(720px, 100%); margin: 0 auto; overflow: hidden; border: 1px solid #d6dedf; border-radius: 12px; background: var(--white); box-shadow: 0 12px 30px rgba(9,34,53,.04); }
.post-inner { padding: clamp(20px, 2vw, 28px); }
.profile-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; }
.profile-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.profile-copy { display: grid; gap: 2px; }
.profile-copy strong { font-size: 17px; }
.profile-copy span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.post-menu { color: var(--muted); font-size: 22px; letter-spacing: 2px; }
.post-text { margin: 20px 0 18px; font-size: clamp(14px, 1.08vw, 16px); line-height: 1.5; white-space: pre-wrap; }
.post-text.collapsed { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 8; }
.expand-text { padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 13px; cursor: pointer; }
.post-image { width: 100%; aspect-ratio: 1; margin-top: 17px; border-radius: 9px; object-fit: cover; background: var(--teal-soft); }
.post-byline { margin: 14px 0 0; font-size: 13px; line-height: 1.45; }
.post-hashtags { margin: 12px 0 0; color: #0a66c2; font-size: 13px; font-weight: 690; }
.linkedin-actions { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.linkedin-actions span { display: inline-flex; gap: 6px; align-items: center; justify-content: center; text-align: center; }
.linkedin-actions img { width: 15px; height: 15px; opacity: .62; }
.preview-loading { padding: 45px; color: var(--muted); text-align: center; }

.inspector-block { padding: 18px 0; border-bottom: 1px solid var(--line); }
.inspector-block:first-child { padding-top: 4px; }
.inspector-title { margin: 0 0 14px; color: var(--ink-2); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.status-timeline { display: grid; gap: 0; }
.status-step { position: relative; display: grid; min-height: 52px; grid-template-columns: 28px 1fr; gap: 10px; }
.status-step::after { position: absolute; top: 22px; bottom: -5px; left: 9px; width: 1px; content: ""; background: var(--line-strong); }
.status-step:last-child::after { display: none; }
.status-dot { position: relative; z-index: 1; display: grid; width: 19px; height: 19px; place-items: center; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--paper); }
.status-step.done .status-dot, .status-step.current .status-dot { border-color: transparent; background: transparent; }
.status-dot img { width: 19px; filter: invert(49%) sepia(35%) saturate(1018%) hue-rotate(139deg); }
.status-copy strong { display: block; font-size: 13px; font-weight: 680; }
.status-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.status-step.current .status-copy strong { color: #118796; }
.image-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.image-option { position: relative; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 7px; background: var(--teal-soft); cursor: pointer; }
.image-option.active { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(76,170,181,.14); }
.image-option img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.image-option span { position: absolute; top: 4px; left: 4px; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 4px; color: var(--ink); background: rgba(255,255,255,.9); font-size: 10px; font-weight: 850; }
.fact-list { display: grid; gap: 11px; }
.fact-row { display: grid; grid-template-columns: 112px 1fr; gap: 15px; align-items: baseline; font-size: 12px; }
.fact-row span:first-child { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.fact-row strong, .fact-row a { justify-self: end; text-align: right; }
.fact-row a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.fact-row .deadline { color: var(--coral); }
.version-history { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.version-chip { padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #faf9f4; font-size: 10px; }
.version-chip.current { border-color: var(--teal); color: var(--success); background: #f0faf8; }
.inspector-actions { display: grid; gap: 10px; padding-top: 20px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink); background: var(--paper); font-weight: 720; cursor: pointer; }
.button img { width: 17px; opacity: .72; }
.button:hover { border-color: var(--teal); }
.button.primary { border-color: var(--teal); color: #087c89; }
.button.primary img { filter: invert(43%) sepia(46%) saturate(958%) hue-rotate(139deg); }
.button.secondary { background: #faf9f4; }
.button.success { border-color: #6aaea8; color: var(--success); }
.button.success img { filter: invert(40%) sepia(31%) saturate(1037%) hue-rotate(128deg); }
.button.danger { border-color: #e49a88; color: #ad3e29; background: var(--coral-soft); }
.button.danger img { filter: invert(30%) sepia(78%) saturate(1028%) hue-rotate(336deg); }
.button:disabled { opacity: .48; cursor: not-allowed; }
.reviewed-note { display: flex; gap: 8px; align-items: center; padding: 10px 12px; color: var(--success); background: #edf8f5; font-size: 12px; }
.reviewed-note img { width: 16px; filter: invert(38%) sepia(34%) saturate(1102%) hue-rotate(127deg); }

body[data-mode="read"] .editorial-inspector { display: none; }
body[data-mode="read"] .publication-studio { grid-template-columns: 240px minmax(540px, 1fr); }
body[data-mode="read"] .public-stage { padding-inline: clamp(30px, 8vw, 150px); }

/* Dialogs */
dialog { max-width: calc(100vw - 32px); border: 0; border-radius: 12px; color: var(--ink); background: var(--paper); box-shadow: 0 26px 90px rgba(3,30,48,.28); }
dialog::backdrop { background: rgba(3,30,48,.64); }
.edit-dialog { width: min(720px, calc(100vw - 32px)); padding: 0; }
.edit-form { padding: 28px; }
.edit-form header { display: flex; align-items: flex-start; justify-content: space-between; }
.edit-form h2, .reject-form h2 { margin: 0; font-size: 26px; letter-spacing: -.035em; }
.edit-explainer { margin: 16px 0 22px; padding: 11px 13px; border-left: 3px solid var(--amber); color: var(--muted); background: #fff9ed; font-size: 13px; line-height: 1.5; }
.edit-form textarea, .edit-form input, .reject-form input { width: 100%; padding: 12px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink); background: var(--white); outline: 0; }
.edit-form textarea { min-height: 270px; resize: vertical; line-height: 1.5; }
.edit-form textarea:focus, .edit-form input:focus, .reject-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(76,170,181,.1); }
.edit-meta { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 11px; }
.edit-form footer, .reject-form footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.reject-dialog { width: min(460px, calc(100vw - 32px)); padding: 0; }
.reject-form { padding: 30px; text-align: center; }
.reject-form > p { color: var(--muted); line-height: 1.55; }
.reject-form label { text-align: left; }
.dialog-alert-icon { width: 42px; margin: 0 auto 16px; filter: invert(39%) sepia(35%) saturate(1379%) hue-rotate(331deg); }
.toast-region { position: fixed; z-index: 20; right: 24px; bottom: 24px; display: grid; gap: 10px; }
.toast { max-width: 360px; padding: 13px 15px; border-radius: var(--radius); color: var(--paper); background: var(--navy); box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: #803a2d; }

@media (max-width: 1180px) {
  .desk-header { grid-template-columns: 200px 1fr auto 42px; gap: 18px; }
  .live-gate { display: none; }
  .publication-studio { grid-template-columns: 190px minmax(450px, 1.35fr) minmax(330px, .9fr); }
  .queue-item { grid-template-columns: 24px 52px 1fr; }
  .queue-thumb { width: 52px; height: 52px; }
  .public-stage, .editorial-inspector { padding-inline: 20px; }
}

@media (max-width: 1020px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 280px; padding: 34px; }
  .login-brand-copy { padding-top: 40px; }
  .login-brand-copy h1 { font-size: 48px; }
  .login-brand-copy > p:last-child { font-size: 15px; }
  .login-panel { min-height: calc(100vh - 280px); }
  .desk-header { grid-template-columns: 1fr auto auto; padding-inline: 16px; }
  .breadcrumb, .desk-header .brand-lockup small { display: none; }
  .desk-header .brand-lockup { width: 48px; overflow: hidden; }
  .publication-studio { grid-template-columns: 1fr; }
  .queue-rail { position: sticky; z-index: 4; top: 0; display: block; padding: 10px 14px; overflow-x: auto; }
  .queue-heading, .timezone-note { display: none; }
  .queue-list { display: flex; width: max-content; gap: 8px; padding: 0; }
  .queue-item { width: 240px; min-height: 62px; grid-template-columns: 24px 46px 1fr; }
  .queue-thumb { width: 46px; height: 46px; }
  .public-stage { padding: 20px clamp(16px, 5vw, 44px) 26px; }
  .editorial-inspector { padding: 22px clamp(16px, 5vw, 44px) 34px; border-top: 1px solid var(--line); border-left: 0; }
  body[data-mode="read"] .publication-studio { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .login-panel { padding: 32px 22px; }
  .login-brand { min-height: 235px; }
  .login-wordmark { width: 220px; }
  .login-brand-copy { padding-top: 26px; }
  .login-brand-copy h1 { font-size: 38px; }
  .login-brand-copy > p:last-child { display: none; }
  .login-card h2 { font-size: 32px; }
  .control-header { padding-inline: 18px; }
  .control-room { width: calc(100% - 36px); padding-top: 10vh; }
  .control-copy h1 { font-size: 48px; }
  .channel-row { grid-template-columns: 52px 1fr 20px; gap: 14px; padding: 19px; }
  .channel-icon { width: 50px; height: 50px; }
  .channel-state { display: none; }
  .desk-header { min-height: 66px; }
  .desk-header .brand-lockup > img { width: 34px; height: 34px; }
  .mode-switch button { min-width: auto; padding-inline: 12px; font-size: 12px; }
  .desk-header form { display: none; }
  .publication-studio { min-height: calc(100vh - 66px); }
  .public-stage { padding-inline: 12px; }
  .section-label { margin-left: 4px; }
  .linkedin-preview { border-radius: 9px; }
  .post-inner { padding: 17px; }
  .profile-row { grid-template-columns: 46px 1fr auto; }
  .profile-avatar { width: 46px; height: 46px; }
  .profile-copy strong { font-size: 15px; }
  .post-text { font-size: 14px; }
  .linkedin-actions { font-size: 10px; }
  .editorial-inspector { padding-inline: 17px; padding-bottom: 104px; }
  .inspector-actions { position: sticky; z-index: 3; bottom: 0; margin: 14px -17px -104px; padding: 12px 17px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,253,248,.96); }
  .inspector-actions .button.success, .reviewed-note { display: none; }
  .image-options { gap: 6px; }
  .fact-row { grid-template-columns: 92px 1fr; }
  .edit-form { padding: 21px; }
  .edit-meta { display: grid; gap: 3px; }
  .edit-form footer, .reject-form footer { display: grid; grid-template-columns: 1fr 1fr; }
  .toast-region { right: 12px; bottom: 12px; left: 12px; }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
