:root {
  --bg: #f6f9fe;
  --surface: #ffffff;
  --surface-soft: #eef4fc;
  --text: #182338;
  --muted: #6a7890;
  --line: #dce5f2;
  --line-soft: #edf2f8;
  --accent: #3367d6;
  --accent-soft: #e8f0fe;
  --blue: #2f6fed;
  --black: #182338;
  --orange: #b45309;
  --pink: #be185d;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px 18px;
  background: rgba(255, 255, 255, .96);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #dce7f5;
  box-shadow: 0 8px 18px rgba(39, 103, 177, .12);
}

.brand-logo {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.brand-wordmark {
  color: #1c2b46;
  font-size: 18px;
  letter-spacing: -.02em;
}

.brand-mark {
  font-size: 0;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-button,
.refresh-button,
.chip,
.icon-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-button {
  width: 100%;
  padding: 11px 14px;
  border-radius: 11px;
  text-align: left;
  color: #344054;
}

.nav-button:hover,
.nav-button.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.nav-separator {
  height: 1px;
  background: var(--line-soft);
  margin: 10px 8px;
}

.acting-as {
  margin-top: auto;
  padding: 10px 12px 0;
  display: grid;
  gap: 6px;
}

.acting-as label {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

.detail-actions {
  margin-top: 10px;
}

/* Detail forms are not filter toolbars. Keeping them out of the sticky toolbar
   treatment prevents the white panel that appeared inside dark-mode drawers. */
.detail-block .filters.detail-actions {
  position: static;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.detail-block .filters.detail-actions > .input,
.detail-block .filters.detail-actions > .select,
.detail-block .filters.detail-actions > .action {
  width: 100%;
  min-width: 0;
}

.detail-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.detail-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.detail-field-wide { margin-top: 10px; }
.detail-field-wide .textarea { width: 100%; }

/* Production brief editor: explicit grids prevent control overlap at every
   drawer width and keep the long creative direction readable. */
.brief-editor { display: grid; gap: 14px; }
.brief-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.brief-editor-heading h3 { margin: 3px 0 0; }
.brief-editor-hint { max-width: 235px; color: #7083a0; font-size: 11px; line-height: 1.4; text-align: right; }
.brief-editor .detail-field-wide { margin-top: 0; }
.brief-editor .textarea,
.brief-editor .input,
.brief-editor .select,
.brief-editor .action { box-sizing: border-box; }
.brief-editor .textarea { min-height: 230px; padding: 13px 14px; line-height: 1.55; }
.brief-form-grid,
.brief-assignment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.brief-assignment-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, .7fr); align-items: end; }
.brief-save-button { width: 100%; min-height: 44px; white-space: normal; }
.brief-assignment-note { align-self: center; color: #7083a0; font-size: 12px; line-height: 1.45; }

.calendar-day-event {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.refresh-button {
  padding: 10px 12px;
  border-radius: var(--radius);
  border-color: var(--line);
  background: var(--surface);
  color: #38506f;
}

.refresh-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 249, 254, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  padding: 22px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar h1,
.section-title h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.035em;
  letter-spacing: 0;
}

.topbar p,
.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.topbar.calendar-topbar {
  min-height: 66px;
  padding: 13px 30px;
}

.topbar.calendar-topbar h1 {
  font-size: 20px;
}

.topbar.calendar-topbar p {
  display: none;
}

.view {
  padding: 30px 34px 42px;
  display: grid;
  gap: 22px;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.two-col {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calendar-grid {
  grid-template-columns: repeat(7, minmax(210px, 1fr));
  overflow-x: auto;
}

.panel,
.stat-card,
.item-card,
.drawer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(48, 74, 112, .035);
}

.panel {
  padding: 18px;
}

.panel-header,
.filters,
.tabs,
.calendar-toolbar,
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-header {
  margin-bottom: 14px;
}

.panel-header h2,
.item-card h3 {
  margin: 0;
  font-size: 16px;
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.list {
  display: grid;
  gap: 10px;
}

.item-card {
  padding: 14px;
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.item-card:hover {
  border-color: #b8c6d3;
  transform: translateY(-1px);
}

.meta,
.tags,
.thread-parts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.muted,
.meta {
  color: var(--muted);
  font-size: 13px;
}

.preview {
  margin: 0;
  line-height: 1.55;
  color: #344054;
}

.topbar-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.badge,
.score,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: var(--surface-soft);
  color: #475467;
}

.platform-linkedin {
  background: #e7f0fb;
  color: var(--blue);
}

.platform-x {
  background: #eceff3;
  color: var(--black);
}

.platform-reddit {
  background: #fff0e3;
  color: var(--orange);
}

.platform-instagram {
  background: #fde7f1;
  color: var(--pink);
}

.platform-facebook {
  background: #e8f0fe;
  color: #1877f2;
}

.content-brand {
  background: #eef2f6;
  color: #475467;
}

.content-founder_led {
  background: #ecfdf3;
  color: #027a48;
}

.status-draft {
  background: #eef2f6;
  color: #475467;
}

.status-pending_approval {
  background: #fff7ed;
  color: #c2410c;
}

.status-approved,
.status-scheduled {
  background: #e3f4f0;
  color: var(--accent);
}

.status-rejected,
.status-cancelled {
  background: #fef3f2;
  color: #b42318;
}

.status-published {
  background: #e8f3ff;
  color: var(--blue);
}

.status-missed {
  background: #eef0f3;
  color: #68727e;
}

.status-failed {
  background: #fdecec;
  color: #b42318;
}

.status-ready_to_publish {
  background: #fff7ed;
  color: #c2410c;
}

.status-simulated {
  background: #edf4ff;
  color: #2d61bd;
}

.workspace-badge {
  background: #eef4fc;
  color: #526987;
}

.score-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.qa-status-review {
  background: #fffaeb;
  color: #b54708;
}

.qa-status-revise {
  background: #fff7ed;
  color: #c2410c;
}

.qa-status-blocked {
  background: #fef3f2;
  color: #b42318;
}

.score {
  background: #ecfdf3;
  color: #027a48;
}

.score.medium {
  background: #fffaeb;
  color: #b54708;
}

.score.low {
  background: #fef3f2;
  color: #b42318;
}

.score-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}

.score-meter span {
  display: block;
  height: 100%;
  width: var(--score);
  background: var(--accent);
}

.filters,
.tabs {
  position: sticky;
  top: 74px;
  z-index: 8;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.input,
.select {
  height: 38px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
}

.input {
  min-width: 260px;
}

.chip {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: var(--radius);
  border-color: var(--line);
  background: var(--surface);
}

.chip.active,
.chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(8, minmax(100px, 1fr));
  gap: 10px;
}

.pipeline-step {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.pipeline-step strong {
  display: block;
  margin-bottom: 4px;
}

.calendar-day {
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.calendar-day h3 {
  margin: 0;
  font-size: 15px;
}

.calendar-post {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 10px;
  display: grid;
  gap: 8px;
  background: #fcfdff;
  cursor: pointer;
}

.calendar-status-pending_approval {
  border-left: 3px solid #f97316;
}

.calendar-status-approved {
  border-left: 3px solid var(--accent);
}

.calendar-status-scheduled {
  border-left: 3px solid #2b6cb0;
}

.calendar-status-published {
  border-left: 3px solid #027a48;
}

.calendar-status-rejected,
.calendar-status-cancelled,
.calendar-status-failed {
  border-left: 3px solid #b42318;
}

.calendar-status-ready_to_publish {
  border-left: 3px solid #c2410c;
}

.post-text {
  white-space: pre-wrap;
  line-height: 1.55;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.26);
  display: flex;
  justify-content: flex-end;
}

.drawer {
  width: min(720px, 100%);
  height: 100%;
  overflow: auto;
  border-radius: 0;
  padding: 22px;
  box-shadow: -12px 0 32px rgba(16, 24, 40, 0.14);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.drawer h2 {
  margin: 8px 0 4px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-block {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  margin-top: 14px;
}

.approval-actions {
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.approval-note {
  color: var(--text);
  font-weight: 700;
}

.action {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--surface);
}

.action.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.action.secondary:hover,
.action.primary:hover {
  transform: translateY(-1px);
}

.detail-block h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.audio-video-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft, var(--surface));
}

.audio-video-card .detail-field {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.audio-library-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.audio-library-controls .detail-field {
  flex: 1 1 260px;
}

.audio-library-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.audio-library-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.audio-rights-confirm {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.audio-rights-confirm input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border-color: var(--line);
}

.empty,
.loading,
.error {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.skeleton {
  height: 96px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #eef2f6, #f7f8fb, #eef2f6);
  background-size: 180% 100%;
  animation: shimmer 1.2s ease infinite;
}

/* Section navigation is usually fast. A slim progress state avoids flashing
   full-width white skeleton cards while the next workspace loads. */
.workspace-loading {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 96px;
  padding: 28px 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.workspace-loading-track {
  display: block;
  width: min(260px, 72vw);
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 82%, transparent);
}

.workspace-loading-track i {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: workspace-loading-slide 0.92s ease-in-out infinite;
}

@keyframes workspace-loading-slide {
  from { transform: translateX(-120%); }
  to { transform: translateX(360%); }
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 1180px) {
  .stats-grid,
  .three-col,
  .two-col,
  .pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main,
  .topbar,
  .view {
    min-width: 0;
  }

  .topbar,
  .view {
    padding: 18px;
  }

  .stats-grid,
  .three-col,
  .two-col,
  .pipeline,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .filters,
  .tabs {
    position: static;
  }

  .input,
  .select {
    width: 100%;
    min-width: 0;
  }
}

/* Production calendar workspace */
.production-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 0;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.production-hero h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.04em;
}

.production-hero p {
  max-width: 680px;
  margin: 8px 0 0;
  font-size: 15px;
}

.production-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.production-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #c8dafa;
  border-radius: 12px;
  background: linear-gradient(90deg, #f1f6ff, #fbfdff);
  color: #294d8e;
}

.production-notice strong,
.production-notice span {
  display: block;
}

.production-notice span:not(.notice-dot) {
  margin-top: 3px;
  color: #52736e;
  font-size: 13px;
}

.notice-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #3c73e8;
  box-shadow: 0 0 0 4px #deebff;
}

.production-stats {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.production-stat {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.production-stat:hover {
  border-color: var(--accent);
  box-shadow: 0 5px 16px rgba(19, 111, 99, .08);
}

.production-stat span,
.production-stat strong {
  display: block;
}

.production-stat span {
  color: var(--muted);
  font-size: 12px;
}

.production-stat strong {
  margin-top: 7px;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.production-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 15px 0 0;
  border-top: 1px solid var(--line-soft);
}

.production-toolbar strong,
.production-toolbar .muted {
  display: block;
}

.production-toolbar .muted {
  margin-top: 3px;
}

.production-weekdays,
.production-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  min-width: 980px;
}

.production-weekdays {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.production-calendar-grid {
  gap: 8px;
  overflow-x: auto;
}

.production-day {
  min-height: 208px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.production-day:hover {
  border-color: #9ccdc4;
  box-shadow: 0 8px 18px rgba(16, 24, 40, .07);
  transform: translateY(-1px);
}

.production-day-empty {
  min-height: 0;
  border-color: transparent;
  background: transparent;
  cursor: default;
}

.production-day-empty:hover {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.production-day.weekend {
  background: #fbfcfe;
}

.production-day.has-festival {
  border-color: #e8c27a;
  background: linear-gradient(180deg, #fffaf0, #fff);
}

.production-day-head,
.production-slot-top,
.production-slot-foot,
.asset-track,
.deliverable-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.production-day-head {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
}

.day-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: #38557e;
  font-weight: 800;
}

.production-slot {
  display: grid;
  gap: 9px;
  padding-top: 11px;
}

.production-slot h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
}

.slot-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf2f7;
  color: #52606d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.slot-type.festival {
  background: #fff0c9;
  color: #95620c;
}

.slot-brief,
.festival-label {
  margin: 0;
  color: #586779;
  font-size: 12px;
  line-height: 1.45;
}

.slot-brief {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.festival-label {
  color: #9a6714;
  font-weight: 700;
}

.asset-track {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.asset-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #f5f7fa;
  color: #7a8695;
  font-size: 10px;
  font-weight: 700;
}

.asset-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b7c0cc;
}

.asset-pill.ready {
  background: #e7f7ef;
  color: #157347;
}

.asset-pill.ready i {
  background: #22a06b;
}

.production-slot-foot {
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10px;
}

.production-empty-slot {
  margin-top: 80px;
  color: #98a2b3;
  font-size: 12px;
  text-align: center;
}

.production-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.production-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b7c0cc;
}

.legend-swatch.festival { background: #d99e28; }
.legend-swatch.image { background: #22a06b; }
.legend-swatch.video { background: #2b6cb0; }
.legend-swatch.review { background: #f97316; }

.production-note {
  margin: 10px 0;
  padding: 10px;
  border-left: 3px solid #e8c27a;
  border-radius: 0 8px 8px 0;
  background: #fffaf0;
}

.production-note p {
  margin: 7px 0 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.45;
}

.textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.deliverable-row {
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.deliverable-row strong,
.deliverable-row .muted {
  display: block;
}

.deliverable-row .muted {
  margin-top: 4px;
  max-width: 350px;
}

.file-action {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}

.file-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.production-next-step {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 13px;
  border-radius: 10px;
  background: #edf4ff;
  color: #2e5caf;
  font-size: 13px;
}

.production-next-step span {
  color: #607aa8;
  line-height: 1.45;
}

/* Production detail: compact, aligned handoff sections. */
.publication-summary,
.deliverables-section,
.review-section {
  display: grid;
  gap: 12px;
}

.publication-summary h3,
.deliverables-section h3,
.review-section h3 {
  margin: 2px 0 0;
}

.publication-summary > .muted,
.deliverables-section > .muted {
  margin: -4px 0 0;
  line-height: 1.45;
}

.publication-link,
.drive-file-link {
  width: 100%;
  min-height: 40px;
  justify-content: space-between;
  align-items: center;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.publication-actions {
  display: grid;
  gap: 8px;
}

.publication-actions .action { width: fit-content; }
.publication-actions .muted { margin: 0; line-height: 1.45; }

.deliverables-list,
.notes-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
}

.deliverable-row {
  min-height: 72px;
  padding: 12px;
  align-items: center;
  background: var(--surface);
}

.deliverable-row + .deliverable-row { border-top: 1px solid var(--line-soft); }
.deliverable-row:last-child { border-bottom: 0; }
.deliverable-row > div { min-width: 0; display: grid; gap: 3px; }
.deliverable-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.deliverable-row .muted { max-width: none; margin: 0; }
.asset-name { color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.drive-file-link { width: auto; min-width: 168px; }

.status-chip,
.note-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip.locked { color: #966a18; background: #fff8e7; border-color: #efcf88; }
.status-chip.pending { color: #6b7e9b; }
.note-count { min-width: 28px; color: var(--accent); }

.notes-list { border: 0; overflow: visible; }
.production-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #f0cf84;
  border-left: 4px solid #dca32d;
  border-radius: 10px;
  background: #fffaf0;
}
.production-note .badge { margin-top: 5px; }
.production-note p { margin: 9px 0 0; }

.note-compose {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface-soft);
}

.note-compose .textarea { background: var(--surface); min-height: 94px; }
.note-recipient { color: #4d6f9e; font-size: 11px; font-weight: 800; }
.note-compose-actions { display: grid; grid-template-columns: minmax(0, 1fr) 190px auto; gap: 8px; }
.note-compose-actions .action { min-width: 96px; }

[data-theme="dark"] .deliverables-list,
[data-theme="dark"] .note-compose { border-color: #303030; }
[data-theme="dark"] .detail-block .filters.detail-actions { background: transparent; }
[data-theme="dark"] .brief-editor-hint { color: #a5b4ca; }
[data-theme="dark"] .brief-assignment-note { color: #a5b4ca; }
[data-theme="dark"] .note-recipient { color: #a9c8ff; }
[data-theme="dark"] .deliverable-row { background: #111; }
[data-theme="dark"] .deliverable-row + .deliverable-row { border-color: #303030; }
[data-theme="dark"] .status-chip { background: #171717; border-color: #343434; color: #b9c5d6; }
[data-theme="dark"] .status-chip.locked { background: #2a2213; border-color: #6f5527; color: #e5bd61; }
[data-theme="dark"] .production-note { background: #241e13; border-color: #725627; border-left-color: #dca32d; }

@media (max-width: 620px) {
  .deliverable-row { align-items: flex-start; flex-direction: column; }
  .deliverable-actions { width: 100%; }
  .deliverable-actions .action { width: 100%; }
  .drive-file-link { width: 100%; }
  .note-compose-actions { grid-template-columns: 1fr; }
  .note-compose-actions .action { width: 100%; }
}

@media (max-width: 1180px) {
  .production-stats { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
}

@media (max-width: 760px) {
  .production-hero { align-items: flex-start; flex-direction: column; }
  .production-stats { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}

/* Configurable content calendar */
.calendar-workspace {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.calendar-sidebar-panel,
.calendar-stage,
.calendar-customize-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 12px 32px rgba(39, 73, 124, .055);
}

.calendar-sidebar-panel {
  position: sticky;
  top: 104px;
  padding: 14px;
}

.calendar-new-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #3367d6, #4b82ed);
  color: #fff;
  cursor: pointer;
  font-weight: 750;
  box-shadow: 0 7px 16px rgba(51, 103, 214, .18);
}

.calendar-new-button span { margin-right: 4px; font-size: 19px; vertical-align: -1px; }

.content-request-form { display: grid; gap: 13px; }
.content-request-form .action { margin-top: 4px; }
.request-platforms { display: flex; flex-wrap: wrap; gap: 10px; color: #4f6381; font-size: 12px; font-weight: 700; }
.request-platforms label { display: inline-flex; align-items: center; gap: 5px; }
.workflow-action-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.workflow-action-grid .action { flex: 1 1 145px; }

.calendar-client-switcher {
  display: grid;
  gap: 5px;
  margin-top: 13px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--line-soft);
}

.calendar-client-switcher > span {
  color: #7b8aa0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.calendar-client-switcher select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #d4dfed;
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: #344861;
  font-size: 12px;
  font-weight: 750;
}

.mini-calendar-head,
.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-calendar-head { margin: 20px 2px 13px; color: #34435c; font-size: 13px; }

.mini-arrow,
.sidebar-section-head button {
  border: 0;
  background: transparent;
  color: #60718b;
  cursor: pointer;
}

.mini-arrow { width: 24px; height: 24px; border-radius: 7px; font-size: 21px; line-height: 1; }
.mini-arrow:hover { background: #edf4ff; color: var(--accent); }

.mini-calendar-weekdays,
.mini-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.mini-calendar-weekdays { color: #8a97aa; font-size: 10px; font-weight: 800; }
.mini-calendar-days { margin-top: 6px; }

.mini-calendar-day {
  width: 27px;
  height: 27px;
  justify-self: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #52627b;
  cursor: pointer;
  font-size: 11px;
}

.mini-calendar-day:hover { background: #eef4ff; color: #2f64c7; }
.mini-calendar-day.selected { background: #3367d6; color: #fff; box-shadow: 0 3px 8px rgba(51, 103, 214, .24); }
.mini-calendar-day.festival:not(.selected) { color: #b17816; font-weight: 800; }
.mini-calendar-day.has-posted-content:not(.selected) { background: #e5f5e9; color: #21663a; box-shadow: inset 0 0 0 1px #9fceaa; font-weight: 800; }
.mini-calendar-day.has-pending-content:not(.selected) { background: #fff0ed; color: #9a3c35; box-shadow: inset 0 0 0 1px #e1aaa2; font-weight: 800; }
.mini-calendar-day.has-missed-content:not(.selected) { background: #eef0f3; color: #737b85; box-shadow: inset 0 0 0 1px #c7cdd4; font-weight: 800; }

.sidebar-section {
  display: grid;
  gap: 9px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.sidebar-section-head { color: #4c5d76; font-size: 12px; }
.sidebar-section-head button { color: #376bcf; font-size: 11px; font-weight: 750; }

.calendar-source {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #596a82;
  cursor: pointer;
  font-size: 12px;
}

.calendar-source input { position: absolute; opacity: 0; pointer-events: none; }
.calendar-source i { width: 13px; height: 13px; border: 2px solid var(--source-color); border-radius: 4px; background: #fff; }
.calendar-source input:checked + i { background: var(--source-color); box-shadow: inset 0 0 0 2px #fff; }

.calendar-role-card { gap: 3px; padding: 13px; border: 1px solid #dce8fa; border-radius: 12px; background: #f7faff; }
.calendar-role-label { color: #7788a1; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.calendar-role-card strong { color: #315caa; font-size: 13px; }
.calendar-role-card p { margin: 2px 0 0; color: #73839a; font-size: 11px; line-height: 1.42; }

.calendar-sidebar-summary { display: grid; gap: 3px; margin: 19px 2px 1px; color: #7f8fa6; font-size: 11px; }
.calendar-sidebar-summary strong { color: #41526d; font-size: 12px; }

.calendar-stage { min-width: 0; overflow: hidden; }

.calendar-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line-soft);
}

.calendar-navigation,
.calendar-command-actions,
.calendar-arrows,
.calendar-view-switcher,
.density-switch {
  display: flex;
  align-items: center;
  gap: 7px;
}

.calendar-navigation { min-width: 0; }
.calendar-month-title { display: flex; align-items: center; min-width: 0; gap: 9px; }
.calendar-month-title img { width: 31px; height: 36px; flex: 0 0 auto; object-fit: contain; }

.calendar-today,
.calendar-arrows button,
.calendar-customize-button,
.calendar-view-switcher button,
.calendar-select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #52627b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.calendar-today { padding: 0 12px; }
.calendar-arrows { gap: 2px; }
.calendar-arrows button { width: 29px; padding: 0; font-size: 20px; line-height: 1; }
.calendar-today:hover, .calendar-arrows button:hover, .calendar-customize-button:hover { border-color: #abc2ec; background: #f5f8ff; color: #315fb9; }

.calendar-navigation .eyebrow { margin: 0 0 2px 8px; font-size: 9px; }
.calendar-navigation h2 { margin: 0 0 0 8px; overflow: hidden; color: #263a5b; font-size: 21px; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }

.calendar-command-actions { justify-content: flex-end; flex-wrap: wrap; }
.calendar-select { min-width: 118px; padding: 0 28px 0 10px; }
.calendar-customize-button { display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; }
.calendar-customize-button.active { border-color: #a9c2f3; background: #edf4ff; color: #2e61bf; }

.calendar-view-switcher { gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.calendar-view-switcher button { min-width: 54px; border: 0; border-right: 1px solid var(--line-soft); border-radius: 0; background: transparent; }
.calendar-view-switcher button:last-child { border-right: 0; }
.calendar-view-switcher button.active { background: #3367d6; color: #fff; }

.calendar-context {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 13px 20px 0;
  color: #77879c;
  font-size: 11px;
}

.context-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--client-accent, #4d7ee2); box-shadow: 0 0 0 4px #edf4ff; }

.calendar-client-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-left: 3px solid var(--client-accent, #3367d6);
  background: #f6f8fc;
  color: #52647e;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.calendar-customize-panel {
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(420px, 1.4fr);
  gap: 20px;
  margin: 14px 18px 0;
  padding: 15px 16px;
  border-color: #d7e5fa;
  border-radius: 13px;
  background: linear-gradient(90deg, #f7faff, #fff);
  box-shadow: none;
}

.calendar-customize-panel .eyebrow { margin-bottom: 3px; font-size: 9px; }
.calendar-customize-panel h3 { margin: 0; color: #31466a; font-size: 15px; }
.calendar-customize-panel p { margin: 4px 0 0; color: #71829b; font-size: 11px; line-height: 1.42; }

.customize-controls { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); align-items: center; gap: 11px; }
.customize-density { display: grid; gap: 6px; color: #71809a; font-size: 11px; }
.density-switch { gap: 3px; padding: 3px; border: 1px solid #dbe6f4; border-radius: 8px; background: #fff; }
.density-switch button { min-height: 25px; flex: 1; border: 0; border-radius: 5px; background: transparent; color: #6a7c96; cursor: pointer; font-size: 10px; font-weight: 750; }
.density-switch button.active { background: #eaf1ff; color: #2f64c7; }

.calendar-preference { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: #5b6c85; cursor: pointer; font-size: 11px; }
.calendar-preference input { position: absolute; opacity: 0; }
.calendar-preference i { position: relative; width: 28px; height: 16px; border-radius: 999px; background: #cbd6e6; transition: background 150ms ease; }
.calendar-preference i::after { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .22); content: ""; transition: transform 150ms ease; }
.calendar-preference input:checked + i { background: #4a7ce0; }
.calendar-preference input:checked + i::after { transform: translateX(12px); }

.calendar-month-shell { width: 100%; min-width: 0; margin-top: 13px; }
.calendar-weekday-row,
.calendar-month-grid { display: grid; width: 100%; min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekday-row.weekdays-five,
.calendar-month-grid.weekdays-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.calendar-weekday-row { padding: 0 10px 8px; color: #7e8da2; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.calendar-weekday-row span { padding-left: 8px; }
.calendar-month-grid { overflow: hidden; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }

.month-day-cell {
  position: relative;
  min-height: 151px;
  padding: 8px;
  border-right: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.density-compact .month-day-cell { min-height: 114px; }
.month-day-cell.weekend { background: #fbfcff; }
.month-day-cell.festival-day { background: linear-gradient(145deg, #fffbf2, #fff); }
.month-day-cell.selected { z-index: 1; box-shadow: inset 0 0 0 2px #78a0ee; }
.month-day-cell.outside-month { min-height: 28px; background: #f8fafc; }
.month-day-cell.weekend-hidden, .calendar-weekday-row .weekend-hidden, .week-day-headings .weekend-hidden, .week-all-day-cell.weekend-hidden, .week-focus-column.weekend-hidden { visibility: hidden; pointer-events: none; }

.month-day-number { display: grid; width: 25px; height: 25px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #55667f; cursor: pointer; font-size: 12px; font-weight: 800; }
.month-day-cell.selected .month-day-number { background: #3367d6; color: #fff; }
.month-empty { display: block; margin: 44px 0 0 5px; color: #b0bac8; font-size: 10px; }

.calendar-event {
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 7px 7px 7px 0;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: #f3f7ff;
  color: #30425f;
  cursor: pointer;
  text-align: left;
}

.calendar-event:hover { background: #e9f1ff; }
.calendar-event.festival { background: #fff7e4; }
.calendar-event .event-accent { grid-row: 1 / span 3; width: 3px; border-radius: 0 3px 3px 0; background: #4a7de1; }
.calendar-event.festival .event-accent { background: #d39a29; }
.event-title { display: -webkit-box; overflow: hidden; color: #2f405b; font-size: 11px; font-weight: 800; line-height: 1.25; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.event-meta { display: flex; align-items: center; justify-content: flex-start; gap: 4px; margin-top: 7px; color: #8290a4; font-size: 9px; white-space: nowrap; }
.event-meta .badge { min-height: 17px; padding: 2px 5px; font-size: 8px; }

.calendar-week-shell { min-width: 720px; margin-top: 13px; border-top: 1px solid var(--line); }
.week-day-headings, .week-all-day-row { display: grid; grid-template-columns: 58px repeat(7, minmax(94px, 1fr)); }
.week-day-headings.weekdays-five,
.week-all-day-row.weekdays-five { grid-template-columns: 58px repeat(5, minmax(94px, 1fr)); }
.week-day-headings { border-bottom: 1px solid var(--line); background: #fbfcff; }
.week-day-headings button { display: grid; justify-items: center; gap: 3px; min-height: 53px; padding: 7px; border: 0; border-right: 1px solid var(--line-soft); background: transparent; color: #667793; cursor: pointer; }
.week-day-headings small { font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.week-day-headings strong { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; font-size: 12px; }
.week-day-headings button.selected { color: #3268d1; }
.week-day-headings button.selected strong { background: #3367d6; color: #fff; }

.week-all-day-row { min-height: 88px; border-bottom: 1px solid var(--line); }
.week-all-day-row > span { padding: 11px 7px; color: #8491a2; font-size: 10px; font-weight: 750; }
.week-all-day-cell { padding: 7px 5px; border-left: 1px solid var(--line-soft); }
.week-event { width: 100%; padding: 6px 7px; overflow: hidden; border: 0; border-left: 3px solid #4a7de1; border-radius: 5px; background: #eef4ff; color: #345078; cursor: pointer; font-size: 10px; font-weight: 800; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.week-event.festival { border-left-color: #d39a29; background: #fff6e2; color: #936515; }

.week-timeline { display: grid; grid-template-columns: 58px 1fr; min-height: 760px; }
.time-axis { display: grid; grid-template-rows: repeat(7, 1fr); color: #9aa5b4; font-size: 10px; text-align: right; }
.time-axis span { padding: 10px 8px 0 0; border-bottom: 1px solid var(--line-soft); }
.week-focus-grid { display: grid; grid-template-columns: repeat(7, minmax(94px, 1fr)); }
.week-focus-grid.weekdays-five { grid-template-columns: repeat(5, minmax(94px, 1fr)); }
.week-focus-column { position: relative; min-height: 760px; border-left: 1px solid var(--line-soft); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(14.285% - 1px), var(--line-soft) calc(14.285% - 1px), var(--line-soft) 14.285%); }
.week-focus-card { position: absolute; top: calc(var(--week-card-top) * 1%); right: 5px; left: 5px; display: grid; min-height: 54px; gap: 3px; padding: 5px 6px; border: 0; border-left: 3px solid #628de8; border-radius: 6px; background: #eff5ff; color: #3f5c82; cursor: pointer; text-align: left; }
.week-focus-card.festival { border-left-color: #d39a29; background: #fff7e5; color: #8b651d; }
.week-focus-card span { color: #7590bd; font-size: 9px; font-weight: 800; }
.week-focus-card strong { overflow: hidden; font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.week-focus-card .week-card-footer { display: flex; align-items: center; min-width: 0; gap: 4px; }
.week-focus-card .event-platforms { gap: 2px; flex-wrap: nowrap; }
.week-focus-card .platform-icon { width: 12px; height: 12px; }
.week-focus-card small { overflow: hidden; color: #8797ad; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.calendar-agenda { display: grid; gap: 2px; margin-top: 14px; }
.agenda-row { display: grid; grid-template-columns: 82px 1fr; gap: 11px; padding: 9px 19px; border-bottom: 1px solid var(--line-soft); }
.agenda-row.selected { background: #f7faff; }
.agenda-date { display: grid; align-content: start; gap: 2px; padding: 4px 0; border: 0; background: transparent; color: #73829a; cursor: pointer; text-align: left; }
.agenda-date strong { color: #3e70ce; font-size: 22px; line-height: 1; }
.agenda-date span { font-size: 10px; }
.agenda-event { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid #dfe8f5; border-left: 4px solid #4c7fe1; border-radius: 10px; background: #fff; color: #344760; cursor: pointer; text-align: left; }
.agenda-event:hover { border-color: #b5cbed; background: #fbfdff; }
.agenda-event.festival { border-left-color: #d49a27; background: #fffdf8; }
.agenda-event h3 { margin: 6px 0 0; font-size: 13px; }
.agenda-event p { display: -webkit-box; overflow: hidden; margin: 3px 0 0; color: #71829a; font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.agenda-event-meta { display: grid; justify-items: end; gap: 5px; min-width: 0; color: #8492a5; font-size: 10px; white-space: normal; text-align: right; }

@media (max-width: 1180px) {
  .calendar-workspace { grid-template-columns: 205px minmax(0, 1fr); gap: 14px; }
  .calendar-command-bar { align-items: flex-start; flex-direction: column; }
  .calendar-command-actions { justify-content: flex-start; }
  .calendar-customize-panel { grid-template-columns: 1fr; }
  .customize-controls { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .calendar-workspace { grid-template-columns: 1fr; }
  .calendar-sidebar-panel { position: static; }
  .calendar-sidebar-panel .mini-calendar-head, .calendar-sidebar-panel .mini-calendar-weekdays, .calendar-sidebar-panel .mini-calendar-days, .calendar-role-card, .calendar-sidebar-summary { display: none; }
  .calendar-sidebar-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; }
  .calendar-sidebar-panel .sidebar-section { grid-column: 1 / -1; margin-top: 0; padding-top: 12px; }
  .calendar-navigation { align-items: flex-start; }
  .calendar-navigation h2 { font-size: 18px; }
  .calendar-command-actions { width: 100%; }
  .calendar-customize-panel { margin: 12px; }
  .customize-controls { grid-template-columns: 1fr; }
  .calendar-month-shell, .calendar-week-shell { overflow-x: auto; }
  .agenda-row { grid-template-columns: 54px 1fr; padding: 8px 12px; }
  .agenda-event { align-items: flex-start; flex-direction: column; gap: 9px; }
  .agenda-event-meta { justify-items: start; }
}

/* Executive dashboard */
.dashboard-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-intro h2 {
  margin: 0;
  color: #172844;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -.045em;
}

.dashboard-intro p {
  margin: 7px 0 0;
  font-size: 14px;
}

.dashboard-intro-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-date {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .65);
  color: #5e6e88;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-kpi {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 14px rgba(48, 74, 112, .035);
}

.dashboard-kpi::after {
  position: absolute;
  right: -26px;
  bottom: -36px;
  width: 100px;
  height: 100px;
  border: 18px solid rgba(51, 103, 214, .05);
  border-radius: 50%;
  content: "";
}

.dashboard-kpi.violet::after { border-color: rgba(119, 92, 215, .06); }
.dashboard-kpi.amber::after { border-color: rgba(226, 154, 44, .08); }
.dashboard-kpi.green::after { border-color: rgba(31, 157, 105, .07); }

.kpi-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  background: #edf4ff;
  color: #3367d6;
  font-size: 16px;
  font-weight: 800;
}

.violet .kpi-icon { background: #f1efff; color: #7659c9; }
.amber .kpi-icon { background: #fff6df; color: #ba7a16; }
.green .kpi-icon { background: #eaf8f2; color: #218b63; }

.kpi-label {
  color: #71809a;
  font-size: 12px;
  font-weight: 750;
}

.dashboard-kpi > strong {
  display: block;
  margin-top: 15px;
  color: #172844;
  font-size: 31px;
  letter-spacing: -.05em;
}

.kpi-detail {
  display: block;
  margin-top: 3px;
  color: #7a879c;
  font-size: 11px;
}

.kpi-progress {
  height: 4px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f8;
}

.kpi-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d8fed, #3367d6);
}

.dashboard-grid {
  display: grid;
  gap: 14px;
}

.dashboard-grid-primary {
  grid-template-columns: minmax(0, 1.28fr) minmax(360px, .9fr);
}

.dashboard-grid-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 14px rgba(48, 74, 112, .03);
}

.dashboard-panel-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dashboard-panel h3 {
  margin: 0;
  color: #1b2c48;
  font-size: 15px;
}

.dashboard-panel-header p {
  margin: 4px 0 0;
  color: #7c8aa0;
  font-size: 12px;
}

.pulse-summary,
.mix-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.pulse-summary strong,
.mix-total strong {
  display: block;
  color: #315fbe;
  font-size: 34px;
  letter-spacing: -.06em;
}

.pulse-summary span,
.mix-total span {
  display: block;
  color: #7c8aa0;
  font-size: 12px;
}

.pulse-month {
  padding: 6px 9px;
  border-radius: 7px;
  background: #f1f5fb;
  color: #6c7b92 !important;
  font-size: 11px !important;
  font-weight: 700;
}

.dashboard-bars,
.mix-bars,
.opportunity-bars {
  display: grid;
  gap: 14px;
  padding-top: 17px;
}

.bar-label,
.mix-row,
.opportunity-bar .row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #60708a;
  font-size: 12px;
}

.bar-label strong,
.mix-row strong,
.opportunity-bar strong {
  color: #2e3e59;
  font-size: 12px;
}

.bar-label small {
  color: #a2adbc;
  font-size: 10px;
  font-weight: 600;
}

.dashboard-bar,
.mix-track {
  height: 7px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3f9;
}

.dashboard-bar > span,
.mix-track > span {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, #89a7f5, #3367d6);
}

.dashboard-bar > span.video { background: linear-gradient(90deg, #9ba9db, #6a78ba); }
.dashboard-bar > span.review { background: linear-gradient(90deg, #f3bf62, #e09a2f); }
.dashboard-bar > span.approved { background: linear-gradient(90deg, #69c59e, #239267); }

.pulse-foot,
.signal-foot {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: #8794a8;
  font-size: 11px;
}

.status-dot,
.mix-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #4a7be5;
}

.dot-muted { background: #aab7c8; }

.runway {
  display: grid;
}

.runway-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  min-width: 0;
}

.runway-line {
  position: relative;
  display: flex;
  justify-content: center;
}

.runway-line i {
  position: absolute;
  top: 13px;
  bottom: -10px;
  width: 1px;
  background: #dbe5f3;
}

.runway-dot {
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border: 2px solid #c2d2ed;
  border-radius: 50%;
  background: white;
}

.runway-dot.active {
  border-color: #4d7ae1;
  background: #4d7ae1;
  box-shadow: 0 0 0 4px #e5edff;
}

.runway-copy {
  min-width: 0;
  padding: 0 0 18px;
}

.runway-copy strong {
  display: block;
  overflow: hidden;
  max-width: 260px;
  color: #33435e;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runway-copy .meta {
  margin-top: 5px;
  font-size: 11px;
}

.mix-total {
  justify-content: flex-start;
  align-items: baseline;
  gap: 9px;
}

.mix-total strong { font-size: 31px; }

.mix-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.mix-row > div:first-child {
  display: flex;
  align-items: center;
}

.mix-track {
  grid-column: 1 / -1;
  margin-top: -2px;
}

.attention-list {
  display: grid;
  gap: 12px;
}

.attention-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 9px;
}

.attention-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  background: #fff3e0;
  color: #b77618;
  font-size: 12px;
  font-weight: 800;
}

.attention-icon.festival { background: #fff6db; color: #c18a25; }

.attention-item strong,
.attention-item span {
  display: block;
}

.attention-item strong {
  overflow: hidden;
  color: #374761;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-item div span {
  margin-top: 3px;
  color: #8995a8;
  font-size: 11px;
}

.attention-clear {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 0;
  color: #27865f;
}

.attention-clear > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #eaf8f2;
}

.attention-clear p {
  margin: 3px 0 0;
  color: #7e8da2;
  font-size: 11px;
}

.signal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-soft);
}

.signal-stats strong,
.signal-stats span {
  display: block;
}

.signal-stats strong {
  color: #2c4f91;
  font-size: 22px;
  letter-spacing: -.04em;
}

.signal-stats span {
  margin-top: 3px;
  color: #8995a8;
  font-size: 10px;
}

.signal-foot {
  display: grid;
  gap: 5px;
  margin-top: 16px;
}

@media (max-width: 1180px) {
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid-primary { grid-template-columns: 1fr; }
  .dashboard-grid-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .dashboard-intro { align-items: flex-start; flex-direction: column; }
  .dashboard-kpis,
  .dashboard-grid-secondary { grid-template-columns: 1fr; }
}

/* SaaS visual polish: crisp surfaces, deliberate spacing, and restrained motion */
:root {
  --radius: 8px;
}

.sidebar,
.topbar {
  background: #fff;
  backdrop-filter: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
}

.panel,
.stat-card,
.item-card,
.drawer,
.dashboard-kpi,
.dashboard-panel,
.calendar-sidebar-panel,
.calendar-stage,
.calendar-customize-panel,
.production-stat,
.production-notice,
.calendar-role-card,
.agenda-event,
.approval-actions,
.refresh-button,
.action,
.input,
.select {
  border-radius: 8px;
  box-shadow: none !important;
}

.topbar {
  box-shadow: none;
}

.topbar.calendar-topbar {
  min-height: 60px;
  padding: 11px 28px;
}

.view {
  padding-top: 20px;
  background: #f8faff;
}

.calendar-workspace {
  gap: 16px;
}

.calendar-sidebar-panel,
.calendar-stage {
  border-color: #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.calendar-sidebar-panel {
  padding: 13px;
}

.calendar-new-button {
  border-radius: 7px;
  background: #356bd8;
  box-shadow: none;
}

.calendar-new-button:hover {
  background: #285cc5;
}

.calendar-command-bar {
  padding: 14px 16px;
  background: #fff;
}

.calendar-today,
.calendar-arrows button,
.calendar-customize-button,
.calendar-view-switcher,
.calendar-select {
  border-radius: 7px;
}

.calendar-context {
  margin: 11px 16px 0;
}

.context-dot {
  box-shadow: none;
}

.calendar-customize-panel {
  margin: 12px 14px 0;
  border-radius: 7px;
  background: #f8fbff;
}

.month-day-cell {
  min-height: 146px;
  background: #fff;
}

.density-compact .month-day-cell {
  min-height: 108px;
}

.month-day-cell.weekend {
  background: #fbfcfe;
}

.month-day-cell.festival-day {
  background: #fffdf8;
}

.month-day-cell.selected {
  box-shadow: inset 0 0 0 2px #4b7ee0;
}

.calendar-event {
  border-radius: 4px;
  background: #f2f6ff;
}

.calendar-event.festival {
  background: #fff8e9;
}

.calendar-event:hover {
  background: #e9f1ff;
}

.calendar-event.festival:hover {
  background: #fff2d2;
}

.week-event,
.week-focus-card {
  border-radius: 4px;
}

.agenda-row.selected {
  background: #f5f8fe;
}

.dashboard-kpi,
.dashboard-panel,
.panel,
.stat-card,
.item-card {
  border-radius: 8px;
}

.dashboard-kpi::after {
  display: none;
}

.drawer {
  border-left: 1px solid #dbe4f0;
  box-shadow: none !important;
}

.calendar-day-event,
.mini-calendar-day.selected,
.calendar-source input:checked + i,
.calendar-preference i::after,
.production-day:hover,
.dashboard-kpi,
.dashboard-panel,
.runway-dot.active {
  box-shadow: none !important;
}

button,
.calendar-event,
.agenda-event,
.item-card,
.nav-button,
.production-day,
.action,
.chip {
  transition: background-color 170ms ease, border-color 170ms ease, color 170ms ease, transform 170ms ease, opacity 170ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #4b7ee0;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .calendar-sidebar-panel,
  .calendar-stage,
  .dashboard-kpi,
  .dashboard-panel {
    animation: saas-enter 360ms cubic-bezier(.2, .8, .2, 1) both;
  }

  .calendar-stage { animation-delay: 45ms; }
  .dashboard-kpi:nth-child(2), .dashboard-panel:nth-child(2) { animation-delay: 45ms; }
  .dashboard-kpi:nth-child(3), .dashboard-panel:nth-child(3) { animation-delay: 90ms; }
  .dashboard-kpi:nth-child(4) { animation-delay: 135ms; }

  .month-day-cell:not(.outside-month) {
    animation: calendar-cell-in 280ms cubic-bezier(.2, .8, .2, 1) both;
  }

  .calendar-event:hover,
  .agenda-event:hover,
  .item-card:hover,
  .production-day:hover {
    transform: translateY(-1px);
  }

  .calendar-view-switcher button.active {
    animation: view-selection 210ms cubic-bezier(.2, .8, .2, 1) both;
  }

  .drawer {
    animation: drawer-slide-in 260ms cubic-bezier(.2, .8, .2, 1) both;
  }
}

@keyframes saas-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes calendar-cell-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes view-selection {
  from { transform: scale(.96); }
  to { transform: scale(1); }
}

@keyframes drawer-slide-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .sidebar {
    padding: 16px 10px;
  }

  .view {
    padding: 16px;
  }

  .calendar-workspace {
    grid-template-columns: 1fr;
  }

  .calendar-sidebar-panel {
    position: static;
    display: grid;
    grid-template-columns: minmax(185px, .7fr) minmax(250px, 1.3fr) minmax(190px, .7fr);
    gap: 14px;
    align-items: center;
  }

  .calendar-sidebar-panel .calendar-new-button {
    grid-row: span 2;
  }

  .calendar-sidebar-panel .calendar-client-switcher {
    grid-column: 1;
    grid-row: 3;
    margin: 0;
    padding: 0;
    border-bottom: 0;
  }

  .calendar-sidebar-panel .mini-calendar-head,
  .calendar-sidebar-panel .mini-calendar-weekdays,
  .calendar-sidebar-panel .mini-calendar-days {
    grid-column: 2;
  }

  .calendar-sidebar-panel .mini-calendar-head { margin: 0; }
  .calendar-sidebar-panel .mini-calendar-weekdays { margin-top: 8px; }
  .calendar-sidebar-panel .mini-calendar-days { margin-top: -2px; }
  .calendar-sidebar-panel .sidebar-section { grid-column: 3; grid-row: 1 / span 3; margin: 0; padding: 0 0 0 14px; border-top: 0; border-left: 1px solid var(--line-soft); }
  .calendar-sidebar-panel .calendar-role-card,
  .calendar-sidebar-panel .calendar-sidebar-summary { display: none; }
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 10px 12px;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    padding: 0;
    border-bottom: 0;
  }

  .brand span {
    display: none;
  }

  .nav {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar { display: none; }
  .nav-button { width: auto; padding: 8px 11px; white-space: nowrap; font-size: 13px; }
  .nav-separator, .acting-as, .refresh-button { display: none; }

  .topbar.calendar-topbar {
    min-height: 52px;
    padding: 9px 12px;
  }

  .topbar.calendar-topbar h1 { font-size: 17px; }
  .topbar-badges { display: none; }
  .view { padding: 12px; }

  .calendar-sidebar-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .calendar-sidebar-panel .calendar-new-button,
  .calendar-sidebar-panel .calendar-client-switcher,
  .calendar-sidebar-panel .sidebar-section {
    grid-column: auto;
    grid-row: auto;
  }

  .calendar-sidebar-panel .mini-calendar-head,
  .calendar-sidebar-panel .mini-calendar-weekdays,
  .calendar-sidebar-panel .mini-calendar-days {
    display: none;
  }

  .calendar-sidebar-panel .sidebar-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 0 0;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .sidebar-section-head { grid-column: 1 / -1; }
  .calendar-source { font-size: 10px; }
  .calendar-command-bar { padding: 12px; }
  .calendar-navigation { width: 100%; }
  .calendar-command-actions { width: 100%; gap: 5px; }
  .calendar-select { flex: 1; min-width: 106px; }
  .calendar-customize-button span { display: none; }
  .calendar-view-switcher { flex: 1; }
  .calendar-view-switcher button { flex: 1; min-width: 0; }
  .calendar-customize-panel { margin: 10px; }
  .calendar-month-shell,
  .calendar-week-shell { width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .calendar-weekday-row,
  .calendar-month-grid { min-width: 680px; }
  .week-day-headings,
  .week-all-day-row,
  .week-timeline { min-width: 700px; }
  .agenda-row { grid-template-columns: 46px 1fr; }
}

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

/* Refined primary navigation */
.sidebar {
  padding: 20px 14px 16px;
  background: #fff;
}

.brand {
  gap: 11px;
  padding: 2px 9px 18px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid #dce5f0;
  border-radius: 10px;
  background: #fff;
}

.brand-logo { width: 33px; height: 33px; }
.brand-wordmark { font-size: 17px; }
.brand span { font-size: 12px; }

.nav {
  gap: 4px;
}

.nav-section-label {
  display: block;
  margin: 3px 10px 5px;
  color: #91a0b5;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #52627a;
  font-size: 13px;
  font-weight: 650;
}

.nav-button:hover {
  border-color: #e1eaf6;
  background: #f7faff;
  color: #2f63c8;
}

.nav-button.active {
  border-color: #d8e5fb;
  background: #edf4ff;
  color: #2f63c8;
  font-weight: 800;
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid #e2e9f3;
  border-radius: 7px;
  background: #f8faff;
  color: #71819a;
  font-size: 16px;
  line-height: 1;
}

.nav-button.active .nav-icon {
  border-color: #c6d9fb;
  background: #fff;
  color: #336bd8;
}

.nav-label { flex: 1; }
.nav-arrow { color: #a6b3c5; font-size: 17px; line-height: 1; }
.nav-button.active .nav-arrow { color: #4a7cdb; }

.nav-separator {
  margin: 13px 10px 8px;
  background: #e8eef6;
}

.session-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 13px 9px;
  border-top: 1px solid #e8eef6;
}

.identity-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 50%;
  background: #eaf2ff;
  color: #3167cf;
  font-size: 10px;
  font-weight: 850;
}

.session-identity > div { display: grid; min-width: 0; gap: 2px; }
.session-identity span:not(.identity-avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.refresh-button,
.logout-button {
  margin-left: 0;
  margin-right: 0;
  border-color: #dce5f0;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .nav-section-label { display: none; }
  .nav-button { min-height: 38px; padding: 5px 9px; }
  .nav-arrow { display: none; }
  .nav-icon { width: 25px; height: 25px; flex-basis: 25px; font-size: 14px; }
}

/* Sidebar layout pass: keep account actions together and remove unused role UI. */
.sidebar .acting-as[hidden] { display: none !important; }

.sidebar > .refresh-button,
.sidebar > .logout-button {
  width: calc(100% - 18px);
  align-self: center;
  min-height: 38px;
  margin: 0 9px;
  padding: 0 12px;
  font-size: 12px;
}

.sidebar > .refresh-button {
  color: #315fb9;
  background: #f6f9ff;
}

.sidebar > .logout-button {
  margin-top: -5px;
  color: #6d7d95;
  background: #fff;
}

.sidebar > .refresh-button:hover,
.sidebar > .logout-button:hover {
  border-color: #aec5ec;
  background: #eef4ff;
  color: #2f63c8;
}

.session-identity {
  margin-top: auto;
  padding: 13px 9px 12px;
}

@media (max-width: 760px) {
  .sidebar > .refresh-button,
  .sidebar > .logout-button { display: none; }
}

/* Phone layout: never let desktop toolbar minimums create horizontal overflow. */
@media (max-width: 760px) {
  .calendar-command-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-width: 0;
  }
  .calendar-navigation {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    width: 100%;
    min-width: 0 !important;
  }
  .calendar-month-title { min-width: 0; }
  .calendar-month-title img { width: 26px; height: 31px; }
  .calendar-month-title h2 {
    max-width: 100%;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .calendar-command-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    min-width: 0;
    gap: 6px;
  }
  .calendar-select { min-width: 0; width: 100%; }
  .calendar-customize-button { min-width: 42px; }
  .calendar-view-switcher { grid-column: 1 / -1; width: 100%; }
}

/* Final anti-overflow rules: placed after the inspector styles so they win the cascade. */
@media (max-width: 1900px) and (min-width: 761px) {
  .calendar-workspace { grid-template-columns: 205px minmax(0, 1fr) !important; }
  .calendar-selected-panel { position: static; grid-column: 1 / -1; }
  .calendar-command-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .calendar-navigation { min-width: 0; }
  .calendar-command-actions { min-width: 0; flex-wrap: wrap; }
  .calendar-select { max-width: 250px; }
}

@media (max-width: 760px) {
  .calendar-workspace { grid-template-columns: minmax(0, 1fr) !important; }
  .calendar-selected-panel { grid-column: auto; }
  .calendar-command-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }
  .calendar-navigation { min-width: 0 !important; }
  .calendar-command-actions { min-width: 0; }
}

/* Secure workspace access and actionable dashboard queue */
.session-identity {
  display: grid;
  gap: 3px;
  margin-top: auto;
  padding: 11px 12px;
  border-top: 1px solid var(--line-soft);
}

.session-identity span {
  color: #7c8aa1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.session-identity strong { color: #3c4e68; font-size: 12px; }

.logout-button {
  min-height: 36px;
  margin: 0 8px;
  border: 1px solid #d9e2ef;
  border-radius: 7px;
  background: #fff;
  color: #667790;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.logout-button:hover { border-color: #9fb7dd; color: #315fb9; }

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #f5f8fd;
}

.auth-card {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid #d9e3f0;
  border-radius: 10px;
  background: #fff;
}

.auth-brand { display: flex; align-items: center; gap: 10px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.auth-brand img { width: 34px; height: 34px; object-fit: contain; }
.auth-brand strong, .auth-brand span { display: block; }
.auth-brand strong { color: #223653; font-size: 17px; }
.auth-brand span { margin-top: 1px; color: #8090a5; font-size: 11px; }
.auth-copy { margin-top: 23px; }
.auth-copy > span { color: #356bd8; font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.auth-copy h1 { margin: 5px 0 0; color: #243858; font-size: 26px; letter-spacing: -.035em; }
.auth-copy p { margin: 7px 0 0; color: #71829b; font-size: 13px; line-height: 1.5; }
.auth-form { display: grid; gap: 14px; margin-top: 23px; }
.auth-form label { display: grid; gap: 6px; color: #586a84; font-size: 12px; font-weight: 700; }
.auth-form input { min-height: 41px; border: 1px solid #d4dfed; border-radius: 7px; padding: 0 10px; color: #263a58; }
.auth-password-field { position: relative; display: block; }
.auth-password-field input { width: 100%; padding-right: 58px; }
.auth-password-field button { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); border: 0; background: transparent; color: #3367d6; cursor: pointer; font-size: 11px; font-weight: 800; }
.auth-form .action { margin-top: 4px; }
.auth-error { margin: 18px 0 -5px; padding: 9px 10px; border-left: 3px solid #c2473b; background: #fff5f4; color: #a5352c; font-size: 12px; line-height: 1.4; }
.auth-help { margin: 13px 0 0; color: #71829b; font-size: 11px; line-height: 1.45; }
.auth-help a { color: #3367d6; font-weight: 800; }
.auth-note { margin: 18px 0 0; color: #8795a8; font-size: 11px; line-height: 1.45; }

.attention-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #7d8da4;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.attention-list { gap: 0; border-top: 1px solid var(--line-soft); }

.attention-item {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.attention-item:hover { background: #f8faff; }
.attention-priority { height: 32px; border-radius: 0; background: #4e7fe1; }
.attention-priority.review { background: #d98b32; }
.attention-priority.festival { background: #c99a32; }
.attention-copy { min-width: 0; }
.attention-copy > div { display: flex; justify-content: space-between; gap: 10px; }
.attention-copy strong { overflow: hidden; color: #344762; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.attention-date { flex: 0 0 auto; color: #7d8da5; font-size: 11px; }
.attention-copy p { margin: 4px 0 0; color: #7c8ca2; font-size: 11px; }
.attention-action { color: #376bcf; font-size: 11px; font-weight: 800; white-space: nowrap; }
.attention-action i { font-size: 14px; font-style: normal; }

.calendar-research-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid #d8e3f3;
  background: #fbfdff;
}
.calendar-research-summary > div:first-child { display: grid; gap: 3px; min-width: 0; }
.calendar-research-summary .eyebrow { color: #4878d8; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.calendar-research-summary strong { overflow: hidden; color: #29415f; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-research-summary p { margin: 0; color: #74859d; font-size: 11px; }
.research-summary-meta { display: grid; flex: 0 0 auto; gap: 4px; color: #55708f; font-size: 11px; text-align: right; }

@media (max-width: 760px) {
  .session-identity, .logout-button { display: none; }
  .auth-screen { padding: 16px; }
  .auth-card { padding: 22px; }
  .attention-copy > div { display: grid; gap: 2px; }
  .calendar-research-summary { align-items: flex-start; flex-direction: column; }
  .research-summary-meta { text-align: left; }
}

/* Platform-aware calendar inspector */
.calendar-workspace {
  grid-template-columns: 215px minmax(0, 1fr) 286px;
  gap: 14px;
}

.calendar-selected-panel {
  position: sticky;
  top: 104px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.selected-panel-empty {
  display: grid;
  gap: 7px;
  padding: 18px;
}

.selected-panel-empty strong { color: #263a5b; font-size: 18px; }
.selected-panel-empty p { margin: 0; color: #7b8ba1; font-size: 12px; line-height: 1.5; }
.panel-kicker { color: #7b8ba0; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.selected-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.selected-panel-header > div { display: grid; gap: 4px; }
.selected-panel-header strong { color: #263a5b; font-size: 17px; letter-spacing: -.02em; }
.selected-platform-count { color: #8492a6; font-size: 11px; font-weight: 700; }

.selected-platform-switcher {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 6px;
  padding: 12px 12px 10px;
}

.selected-platform-switcher > button {
  width: 30px;
  height: 30px;
  border: 1px solid #dce5f0;
  border-radius: 6px;
  background: #fff;
  color: #4b6b9b;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.selected-platform-switcher > button:hover:not(:disabled) { border-color: #8eafe6; background: #f2f6ff; color: #2e63c6; }
.selected-platform-switcher > button:disabled { cursor: not-allowed; opacity: .35; }

.selected-platform-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
}

.selected-platform-name > div { display: grid; min-width: 0; gap: 2px; }
.selected-platform-name span { color: #2f4b72; font-size: 12px; font-weight: 800; }
.selected-platform-name small { overflow: hidden; color: #8795aa; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

/* On dates with separate creative deliverables (for example an image post and a
   Reel), keep each real slot selectable instead of silently collapsing them. */
.selected-slot-picker { display: flex; gap: 5px; overflow-x: auto; padding: 0 16px 10px; }
.selected-slot-picker button { display: flex; min-width: 0; max-width: 180px; align-items: center; gap: 5px; overflow: hidden; padding: 5px 7px; border: 1px solid #dce6f3; border-radius: 5px; background: #f8fafc; color: #60758f; cursor: pointer; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.selected-slot-picker button > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.selected-slot-picker button.active { border-color: #7da4e7; background: #edf4ff; color: #2f66ce; }
[data-theme="dark"] .selected-slot-picker button { border-color: #303030; background: #151515; color: #b6c1d2; }
[data-theme="dark"] .selected-slot-picker button.active { border-color: #507cc6; background: #172947; color: #a9c7ff; }

.selected-platform-tabs {
  display: flex;
  gap: 5px;
  padding: 0 16px 13px;
}

.selected-platform-tabs button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f3f6fb;
  cursor: pointer;
}

.selected-platform-tabs button.active { border-color: #8eafe6; background: #edf4ff; }

.platform-icon {
  display: inline-grid;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.platform-icon svg {
  display: block;
  width: 72%;
  height: 72%;
  fill: currentColor;
}

.platform-icon.large svg {
  width: 70%;
  height: 70%;
}

.platform-icon.small { width: 16px; height: 16px; font-size: 10px; }
.platform-icon.large { width: 32px; height: 32px; border-radius: 7px; font-size: 19px; }
.platform-icon.x { background: #111827; color: #fff; }
.platform-icon.linkedin { background: #0a66c2; color: #fff; }
.platform-icon.facebook { background: #1877f2; color: #fff; }
.platform-icon.youtube { background: #ff0033; color: #fff; }
.platform-icon.story { background: #7657d6; color: #fff; }
.platform-icon.instagram { position: relative; background: linear-gradient(145deg, #7c3aed, #ec4899 52%, #f59e0b); }
.platform-icon.instagram svg { color: #fff; }

.event-platforms { display: inline-flex; align-items: center; gap: 3px; }
.event-platforms .platform-icon { width: 14px; height: 14px; border-radius: 3px; font-size: 9px; }

.selected-copy-block {
  display: grid;
  gap: 9px;
  margin: 0 16px 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
}

.selected-copy-label { display: inline-flex; align-items: center; gap: 9px; }
.selected-copy-label .platform-icon { flex: 0 0 auto; }

.selected-copy-block p {
  max-height: 190px;
  overflow: auto;
  margin: 0;
  color: #485e7d;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.copy-post-button,
.selected-open-button {
  min-height: 32px;
  border: 1px solid #d9e4f2;
  border-radius: 6px;
  background: #fff;
  color: #3367c9;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.copy-post-button { display: flex; width: 100%; box-sizing: border-box; align-items: center; justify-content: center; gap: 7px; text-decoration: none; }
.copy-post-button span { font-size: 15px; line-height: 1; }

.copy-post-button:hover, .selected-open-button:hover { border-color: #8eafe6; background: #f4f7ff; }
.selected-slot-meta { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 16px 14px; color: #7d8da2; font-size: 10px; }
.selected-slot-meta > span { padding: 4px 6px; border: 1px solid #e1e8f2; border-radius: 4px; background: #f8fafc; }
.selected-slot-meta .selected-asset-button { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border: 1px solid #cfe0fa; border-radius: 4px; background: #fff; color: #3367c9; font-weight: 800; text-decoration: none; }
.selected-slot-meta .selected-asset-button:hover { border-color: #8eafe6; background: #f4f7ff; }
.selected-open-button { display: flex; width: calc(100% - 32px); align-items: center; justify-content: space-between; margin: 0 16px 16px; padding: 0 10px; }
.selected-open-button span { font-size: 16px; }
.calendar-role-workflow { display: grid; gap: 7px; margin: 0 16px 14px; padding: 12px; border: 1px solid #dce7f5; border-radius: 9px; background: #f8fbff; }
.calendar-role-workflow.locked { border-color: #ead29f; background: #fffaf0; }
.calendar-role-workflow strong { color: #2e4669; font-size: 12px; }
.calendar-role-workflow p { margin: 0; color: #71839d; font-size: 10px; line-height: 1.48; }
.role-workflow-action { display: flex; min-height: 31px; align-items: center; justify-content: space-between; padding: 0 9px; border: 1px solid #cfe0fa; border-radius: 6px; background: #fff; color: #3567c9; cursor: pointer; font-size: 10px; font-weight: 800; text-align: left; }
.role-workflow-action:hover { border-color: #8eafe6; background: #f0f6ff; }
.calendar-admin-lifecycle { display: grid; gap: 6px; margin-top: 3px; padding-top: 8px; border-top: 1px solid #dce7f5; }
.calendar-admin-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.calendar-admin-detail-actions .action { flex: 1 1 150px; justify-content: center; }
.role-workflow-action.danger, .calendar-admin-detail-actions .danger { border-color: #e6b6b6; color: #a04444; }
.role-workflow-action.danger:hover, .calendar-admin-detail-actions .danger:hover { border-color: #c97c7c; background: #fff3f3; }
.drive-handoff-summary { display: grid; gap: 9px; }
.drive-handoff-summary code { padding: 9px; border: 1px solid #dbe6f4; border-radius: 7px; background: #f6f9fd; color: #315b9a; font-size: 11px; overflow-wrap: anywhere; }
.drive-handoff-summary p, .drive-handoff-summary small { margin: 0; color: #687d9b; line-height: 1.5; }
[data-theme="dark"] .calendar-role-workflow { border-color: #2d4569; background: #121c2c; }
[data-theme="dark"] .calendar-role-workflow.locked { border-color: #765a2e; background: #2c2416; }
[data-theme="dark"] .calendar-role-workflow strong { color: #dbe8ff; }
[data-theme="dark"] .calendar-role-workflow p, [data-theme="dark"] .drive-handoff-summary p, [data-theme="dark"] .drive-handoff-summary small { color: #aebed5; }
[data-theme="dark"] .role-workflow-action { border-color: #304a70; background: #111; color: #9fc0ff; }
[data-theme="dark"] .drive-handoff-summary code { border-color: #304563; background: #111d31; color: #b9c9e1; }

.media-uploader-card { display: grid; gap: 14px; }
.media-uploader-card h3, .media-uploader-card p { margin: 0; }
.media-uploader-slide-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 360px; overflow: auto; padding: 2px; }
.media-uploader-slide { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line, #dbe4f0); border-radius: 12px; background: var(--surface-soft, #f7f9fd); }
.media-uploader-slide.uploaded { border-color: #91c9a1; background: #f0faf2; }
.media-uploader-slide > span { display: grid; gap: 3px; min-width: 0; }
.media-uploader-slide small { overflow: hidden; color: var(--muted, #71819c); text-overflow: ellipsis; white-space: nowrap; }
.media-uploader-workflow { border-color: #a8c4fb; background: linear-gradient(135deg, #f4f8ff, #fff); }
.media-uploader-drive-button { justify-self: start; }
@media (max-width: 720px) { .media-uploader-slide-list { grid-template-columns: 1fr; } }
.editor-delivery-card { display: grid; gap: 12px; border-color: #bcd1f3; background: #f8fbff; }
.editor-delivery-card h3, .editor-delivery-card .post-text { margin: 0; }
.editor-delivery-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.editor-delivery-card dl div { min-width: 0; padding: 9px; border: 1px solid #dbe7f7; border-radius: 7px; background: #fff; }
.editor-delivery-card dt { color: #7083a1; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.editor-delivery-card dd { margin: 4px 0 0; color: #284264; font-size: 11px; font-weight: 700; line-height: 1.35; }
.editor-workflow-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.editor-workflow-actions .action { min-height: 40px; }
.editor-delivery-card .post-text { max-height: 220px; overflow: auto; padding: 12px; border: 1px solid #dbe7f7; border-radius: 8px; background: #fff; color: #344a69; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.editor-creative-recipe { display: grid; gap: 8px; }
.editor-creative-recipe > div { padding: 10px 12px; border-left: 3px solid #5e8de4; border-radius: 0 7px 7px 0; background: #fff; }
.editor-creative-recipe span { display: block; margin-bottom: 3px; color: #6d83a4; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.editor-creative-recipe strong, .editor-creative-recipe p { margin: 0; color: #2f496b; font-size: 12px; line-height: 1.45; }
.editor-creative-recipe p { font-weight: 500; }
.editor-drive-button, .deliverable-upload-button { white-space: nowrap; }
[data-theme="dark"] .editor-delivery-card { border-color: #315582; background: #101c2e; }
[data-theme="dark"] .editor-delivery-card dl div, [data-theme="dark"] .editor-delivery-card .post-text { border-color: #304563; background: #111; }
[data-theme="dark"] .editor-delivery-card dd, [data-theme="dark"] .editor-delivery-card .post-text { color: #d5e2f6; }
[data-theme="dark"] .editor-delivery-card dt { color: #8fa5c7; }
[data-theme="dark"] .editor-creative-recipe > div { border-left-color: #5e8de4; background: #111; }
[data-theme="dark"] .editor-creative-recipe span { color: #93a9c9; }
[data-theme="dark"] .editor-creative-recipe strong, [data-theme="dark"] .editor-creative-recipe p { color: #d5e2f6; }
@media (max-width: 680px) { .editor-delivery-card dl { grid-template-columns: 1fr; } }
.asset-redirect-link { color: #356bd8; font-weight: 750; text-decoration: none; }
.asset-redirect-link:hover { text-decoration: underline; }
.media-lock-notice { display: grid; gap: 4px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid #e8c87e; border-radius: 8px; background: #fffaf0; color: #8a671f; font-size: 11px; line-height: 1.4; }
.media-lock-notice span { color: #657994; }
.file-action.disabled { cursor: not-allowed; opacity: .55; }
[data-theme="dark"] .asset-redirect-link { color: #9fc0ff; }
[data-theme="dark"] .media-lock-notice { border-color: #765a2e; background: #2c2416; color: #f0c875; }
[data-theme="dark"] .media-lock-notice span { color: #d0dcf0; }

.week-event { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.week-event .event-platforms { flex: 0 0 auto; }

@media (max-width: 1280px) {
  .calendar-workspace { grid-template-columns: 205px minmax(0, 1fr); }
  .calendar-selected-panel { position: static; grid-column: 1 / -1; }
  .selected-platform-switcher { max-width: 420px; }
  .selected-copy-block { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .selected-copy-block .panel-kicker { grid-column: 1 / -1; }
  .selected-copy-block p { max-height: 92px; }
}

@media (max-width: 760px) {
  .calendar-workspace { grid-template-columns: 1fr; }
  .calendar-selected-panel { grid-column: auto; }
  .selected-platform-switcher { max-width: none; }
  .selected-copy-block { display: grid; grid-template-columns: 1fr; }
  .selected-copy-block .panel-kicker { grid-column: auto; }
  .selected-copy-block p { max-height: 220px; }
}

/* Final sidebar overrides keep the footer compact after all responsive rules. */
.sidebar .acting-as[hidden] { display: none !important; }
.sidebar > .refresh-button,
.sidebar > .logout-button {
  width: calc(100% - 18px);
  align-self: center;
  min-height: 38px;
  margin-right: 9px;
  margin-left: 9px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
}
.sidebar > .refresh-button { color: #315fb9; background: #f6f9ff; }
.sidebar > .logout-button { margin-top: -5px; color: #6d7d95; background: #fff; }
.sidebar > .refresh-button:hover,
.sidebar > .logout-button:hover { border-color: #aec5ec; background: #eef4ff; color: #2f63c8; }
.session-identity { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 13px 9px 12px; }
.session-identity > div { display: grid; min-width: 0; gap: 2px; }
.session-identity span:not(.identity-avatar),
.session-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Calendar header keeps focus on the month and client identity. */
.calendar-topbar .topbar-badges { display: none; }
.calendar-command-bar { flex-wrap: nowrap; }
.calendar-navigation { flex: 1 1 auto; min-width: 500px; }
.calendar-month-title { flex: 1 1 auto; min-width: 0; }
.calendar-month-title h2 { flex: 0 0 auto; overflow: visible; text-overflow: clip; white-space: nowrap; }
.calendar-command-actions { flex: 0 0 auto; }
.calendar-client-label.logo-only {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 3px;
  border: 1px solid #dedbd4;
  border-left: 3px solid #9a6b22;
  background: #fffdf8;
}
.calendar-client-label.logo-only img {
  display: block;
  width: 33px;
  height: 36px;
  object-fit: contain;
}

@media (prefers-reduced-motion: no-preference) {
  .calendar-client-label.logo-only img { animation: logo-settle 520ms cubic-bezier(.2, .8, .2, 1) both; }
  .calendar-event { transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease; }
  .calendar-event:hover { transform: translateY(-2px); }
  .month-day-cell:nth-child(7n + 1) { animation-delay: 20ms; }
  .month-day-cell:nth-child(7n + 2) { animation-delay: 35ms; }
  .month-day-cell:nth-child(7n + 3) { animation-delay: 50ms; }
  .month-day-cell:nth-child(7n + 4) { animation-delay: 65ms; }
  .month-day-cell:nth-child(7n + 5) { animation-delay: 80ms; }
  .month-day-cell:nth-child(7n + 6) { animation-delay: 95ms; }
  .month-day-cell:nth-child(7n) { animation-delay: 110ms; }
}

@keyframes logo-settle {
  from { opacity: 0; transform: scale(.92) translateY(-2px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 760px) {
  .sidebar > .refresh-button,
  .sidebar > .logout-button { display: none; }
}

@media (max-width: 1120px) and (min-width: 761px) {
  .calendar-command-bar { flex-wrap: wrap; }
  .calendar-navigation { min-width: 100%; }
  .calendar-command-actions { width: 100%; justify-content: flex-end; }
}

/* Medium desktop: keep the toolbar and seven-column calendar readable. */
@media (max-width: 1500px) and (min-width: 1121px) {
  .calendar-workspace { grid-template-columns: 205px minmax(0, 1fr); }
  .calendar-selected-panel { position: static; grid-column: 1 / -1; }
  .calendar-command-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .calendar-navigation { min-width: 0; }
  .calendar-command-actions { min-width: 0; flex-wrap: nowrap; }
}

/* Premium calendar surface: preserve structure without heavy ruled lines. */
.calendar-month-grid {
  border-top-color: #e8eef6;
  border-left-color: #e8eef6;
}
.calendar-weekday-row { color: #8291a6; }
.calendar-weekday-row span { padding-left: 6px; }
.month-day-cell { border-right-color: #edf2f7; border-bottom-color: #edf2f7; }
.month-day-cell:hover { background: #fbfdff; }
.month-day-cell.weekend { background: #fcfdff; }
.month-day-cell.festival-day { background: #fffdf8; }
.month-day-cell.selected { box-shadow: inset 0 0 0 2px #4b7ee0; }
.calendar-event { margin: 10px 5px 0 0; width: calc(100% - 5px); padding: 8px 8px 8px 0; background: #f5f8fe; }
.calendar-event.festival { background: #fffbf1; }
.calendar-event:hover { background: #edf4ff; }
.calendar-event.festival:hover { background: #fff5dc; }
.event-title { min-height: 2.5em; color: #304361; }
.event-meta { margin-top: 8px; }

@media (max-width: 760px) {
  .calendar-event { margin-right: 4px; width: calc(100% - 4px); }
}

/* Final cascade override: prevent the inspector from squeezing the toolbar. */
@media (max-width: 1900px) and (min-width: 761px) {
  .calendar-workspace { grid-template-columns: 205px minmax(0, 1fr) !important; }
  .calendar-selected-panel { position: static; grid-column: 1 / -1; }
  .calendar-command-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .calendar-navigation { min-width: 0; }
  .calendar-command-actions { min-width: 0; flex-wrap: wrap; }
  .calendar-select { max-width: 250px; }
}

@media (max-width: 760px) {
  .calendar-workspace { grid-template-columns: minmax(0, 1fr) !important; }
  .calendar-selected-panel { grid-column: auto; }
  .calendar-command-bar { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
  .calendar-navigation { min-width: 0 !important; }
  .calendar-command-actions { min-width: 0; }
}

/* Explicit placement prevents the inspector from auto-flowing behind the sidebar. */
@media (min-width: 1901px) {
  .calendar-workspace { grid-template-columns: 215px minmax(0, 1fr) 340px !important; }
  .calendar-sidebar-panel { grid-column: 1; grid-row: 1; }
  .calendar-stage { grid-column: 2; grid-row: 1; }
  .calendar-selected-panel { grid-column: 3; grid-row: 1; width: 100%; }
}

@media (max-width: 1900px) and (min-width: 761px) {
  .calendar-workspace { grid-template-columns: 205px minmax(0, 1fr) !important; }
  .calendar-sidebar-panel { grid-column: 1; grid-row: 1; }
  .calendar-stage { grid-column: 2; grid-row: 1; }
  .calendar-selected-panel { grid-column: 1 / -1; grid-row: 2; justify-self: end; width: min(100%, 560px); }
}

@media (max-width: 760px) {
  .calendar-workspace { grid-template-columns: minmax(0, 1fr) !important; }
  .calendar-sidebar-panel { grid-column: 1; grid-row: 1; }
  .calendar-stage { grid-column: 1; grid-row: 2; }
  .calendar-selected-panel { grid-column: 1; grid-row: 3; width: 100%; }
}

/* Customize controls: readable labels with their switches kept together. */
.customize-controls { grid-template-columns: minmax(170px, 1.15fr) repeat(3, minmax(120px, 1fr)); }
.calendar-data-filters { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 10px; flex: 1 1 100%; }
.calendar-data-filters .detail-field { margin: 0; }
.calendar-data-filters .detail-field > span { font-size: 11px; }
.calendar-preference {
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid #e2eaf5;
  border-radius: 8px;
  background: #fff;
  line-height: 1.25;
}
.calendar-preference span { min-width: 0; }
.calendar-preference i { flex: 0 0 auto; }

@media (max-width: 1180px) {
  .customize-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .customize-controls { grid-template-columns: 1fr; }
  .calendar-data-filters { grid-template-columns: minmax(0, 1fr); }
}

/* Final responsive controls pass: never let a setting impose a desktop width. */
.calendar-customize-panel,
.calendar-customize-panel > div,
.customize-controls,
.customize-density,
.density-switch,
.calendar-preference {
  min-width: 0;
  max-width: 100%;
}

.calendar-customize-panel {
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  overflow: hidden;
}

.customize-controls {
  grid-template-columns: minmax(0, 1.1fr) repeat(3, minmax(0, 1fr));
}

.density-switch {
  display: flex;
  width: 100%;
}

.density-switch button {
  min-width: 0;
  padding: 0 6px;
  white-space: nowrap;
}

.calendar-preference {
  width: 100%;
}

/* Density is intentionally visible in every calendar mode, not only Month. */
.density-compact .calendar-command-bar { padding-top: 10px; padding-bottom: 10px; }
.density-compact .calendar-month-shell,
.density-compact .calendar-week-shell,
.density-compact .calendar-agenda { margin-top: 8px; }
.density-compact .calendar-weekday-row { padding-bottom: 6px; }
.density-compact .month-day-cell { min-height: 108px; padding: 6px; }
.density-compact .calendar-event { margin-top: 5px; padding-top: 5px; padding-bottom: 5px; }
.density-compact .event-title { -webkit-line-clamp: 2; }
.density-compact .event-meta { margin-top: 4px; }
.density-compact .week-day-headings button { min-height: 43px; }
.density-compact .week-all-day-row { min-height: 64px; }
.density-compact .week-timeline,
.density-compact .week-focus-column { min-height: 420px; }
.density-compact .agenda-row { padding-top: 6px; padding-bottom: 6px; }
.density-compact .agenda-event { padding-top: 9px; padding-bottom: 9px; }

/* The mini month must shrink with its sidebar instead of clipping its last column. */
.mini-calendar-head,
.mini-calendar-weekdays,
.mini-calendar-days,
.mini-calendar-head > div {
  min-width: 0;
}

.mini-calendar-weekdays,
.mini-calendar-days {
  width: 100%;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
}

.mini-calendar-day {
  width: min(27px, 100%);
  min-width: 0;
  padding: 0;
}

@media (max-width: 1180px) and (min-width: 761px) {
  .calendar-customize-panel { grid-template-columns: 1fr; }
  .customize-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-sidebar-panel,
  .calendar-sidebar-panel > * { min-width: 0; }
}

@media (max-width: 900px) and (min-width: 761px) {
  .customize-controls { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .calendar-customize-panel { grid-template-columns: 1fr; margin-right: 8px; margin-left: 8px; }
  .customize-controls { grid-template-columns: 1fr; gap: 8px; }
  .calendar-preference { min-height: 38px; }
  .calendar-sidebar-panel > * { min-width: 0; }
}

/* Reference-led type and primary action treatment. */
:root {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body,
button,
input,
select,
textarea {
  font-family: inherit;
}

body { letter-spacing: -0.008em; }

.brand-wordmark,
.topbar h1,
.calendar-navigation h2,
.calendar-sidebar-panel strong,
.calendar-stage h2,
.calendar-stage h3 {
  letter-spacing: -0.035em;
}

.topbar.calendar-topbar h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.calendar-new-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  background: #315bdc;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background-color 160ms ease, transform 160ms ease;
}

.calendar-new-button:hover {
  background: #264fc8;
  transform: translateY(-1px);
}

.calendar-button-plus {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.calendar-new-button > span:last-child { line-height: 1; }

.calendar-today,
.calendar-arrows button,
.calendar-customize-button,
.calendar-view-switcher button,
.calendar-select,
.density-switch button,
.calendar-preference {
  font-weight: 600;
  letter-spacing: -0.012em;
}

.calendar-weekday-row,
.mini-calendar-weekdays,
.panel-kicker,
.calendar-client-switcher > span,
.calendar-role-label {
  letter-spacing: 0.09em;
}

@media (max-width: 760px) {
  .topbar.calendar-topbar h1 { font-size: 18px; }
  .calendar-new-button { min-height: 40px; }
}

/* Reference header: quiet title block with a compact action rail. */
.topbar {
  min-height: 76px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, .96);
  border-bottom-color: #e8eef6;
}

.topbar-title { min-width: 0; }
.topbar-title h1 { color: #1d2d49; }
.topbar-title p {
  display: block;
  margin-top: 3px;
  color: #7b8aa1;
  font-size: 11px;
}
.topbar.calendar-topbar .topbar-title p { display: block; }

.topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.topbar-search {
  display: flex;
  width: 214px;
  height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid #e1e8f2;
  border-radius: 8px;
  background: #fff;
  color: #8492a6;
}

.topbar-search:focus-within {
  border-color: #9db9ee;
  box-shadow: 0 0 0 3px #edf4ff;
}

.topbar-search svg,
.topbar-icon-button svg,
.topbar-filter-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.topbar-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #2f405b;
  font-size: 11px;
}

.topbar-search input::placeholder { color: #8b98aa; }

.topbar-icon-button,
.topbar-filter-button {
  position: relative;
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid #e1e8f2;
  border-radius: 8px;
  background: #fff;
  color: #455a78;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.topbar-icon-button { width: 40px; }
.topbar-filter-button { gap: 8px; padding: 0 14px; font-size: 11px; font-weight: 700; }
.topbar-icon-button:hover,
.topbar-filter-button:hover { border-color: #b7ccee; background: #f7faff; color: #2f63c8; transform: translateY(-1px); }
.topbar-icon-button b {
  position: absolute;
  z-index: 2;
  top: -7px;
  right: -6px;
  display: inline-flex;
  min-width: 20px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #356bd8;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
.topbar-badges { display: none !important; }

@media (max-width: 1080px) {
  .topbar-search { width: 170px; }
  .topbar-filter-button span { display: none; }
  .topbar-filter-button { width: 40px; padding: 0; }
}

@media (max-width: 760px) {
  .topbar { min-height: 60px; padding: 10px 14px; }
  .topbar-title p { display: none; }
  .topbar-search,
  .topbar-filter-button { display: none; }
  .topbar-tools { gap: 6px; }
}

/* Settings workspace: platform-first connection cards with safe responsive wrapping. */
.settings-page {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.settings-hero,
.settings-section,
.settings-panel {
  min-width: 0;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  background: #fff;
}

.settings-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
}

.settings-hero h2,
.settings-section-heading h3,
.settings-panel-heading h3 {
  margin: 0;
  color: #203552;
  letter-spacing: -0.035em;
}

.settings-hero h2 { margin-top: 4px; font-size: 28px; }
.settings-hero p,
.settings-section-heading p { margin: 6px 0 0; color: #7a8ba5; font-size: 13px; }

.settings-secure-status,
.settings-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dce8f8;
  border-radius: 999px;
  background: #f7faff;
  color: #4f6d9a;
  font-size: 11px;
  font-weight: 700;
}

.settings-secure-status i,
.settings-status-dot i,
.settings-connection-status i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #8da4c6;
}

.settings-section { padding: 22px; }
.settings-section-heading,
.settings-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.settings-section-heading h3 { margin-top: 4px; font-size: 19px; }
.settings-count { color: #7d8da4; font-size: 11px; font-weight: 700; white-space: nowrap; }
.connection-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.connection-actions .action { min-height: 38px; }

.settings-platform-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.settings-platform-card {
  display: flex;
  min-width: 0;
  min-height: 238px;
  flex-direction: column;
  padding: 16px;
  border: 1px solid #e0e8f2;
  border-radius: 9px;
  background: #fbfdff;
  transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.settings-platform-card:hover { border-color: #b9ccee; background: #fff; transform: translateY(-2px); }
.settings-platform-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.settings-platform-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 9px; color: #fff; }
.settings-platform-icon svg { width: 22px; height: 22px; fill: currentColor; }
.settings-platform-icon.instagram { background: linear-gradient(145deg, #7c4fe0, #ef477b 58%, #f7a72d); }
.settings-platform-icon.linkedin { background: #0a66c2; }
.settings-platform-icon.facebook { background: #1877f2; }
.settings-platform-icon.youtube { background: #ff0033; }
.settings-platform-icon.x { background: #101828; }
.settings-connection-status { display: inline-flex; align-items: center; gap: 5px; color: #7b8ca4; font-size: 10px; font-weight: 650; white-space: nowrap; }
.settings-connection-status i { width: 6px; height: 6px; flex-basis: 6px; background: #c4cfdd; }
.settings-platform-card h4 { margin: 16px 0 5px; color: #263b5b; font-size: 16px; letter-spacing: -0.025em; }
.settings-platform-card p { min-height: 58px; margin: 0; color: #7587a0; font-size: 11px; line-height: 1.55; }
.settings-platform-meta { display: grid; gap: 5px; margin-top: 13px; color: #536b8f; font-size: 10px; font-weight: 650; }
.settings-platform-meta span:first-child { color: #7d8da3; font-weight: 500; }
.settings-platform-card button { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: auto; padding: 10px 0 0; border: 0; border-top: 1px solid #e6edf6; background: transparent; color: #3367c9; cursor: pointer; font-size: 11px; font-weight: 750; text-align: left; }
.settings-platform-card button span { font-size: 17px; line-height: 1; }

.settings-bottom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.settings-panel { padding: 20px 22px; }
.settings-panel-heading h3 { margin-top: 4px; font-size: 17px; }
.settings-status-dot { min-height: 26px; border: 0; background: #effaf4; color: #298052; }
.settings-status-dot i { background: #42ae73; }
.settings-rule { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid #edf2f7; }
.settings-rule:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-rule span { color: #8191a8; font-size: 11px; }
.settings-rule strong { color: #344a6b; font-size: 11px; text-align: right; }
.settings-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid #edf2f7; cursor: default; }
.settings-toggle-row:last-child { border-bottom: 0; }
.settings-toggle-row span { display: grid; gap: 3px; min-width: 0; }
.settings-toggle-row strong { color: #344a6b; font-size: 11px; }
.settings-toggle-row small { color: #8191a8; font-size: 10px; }
.settings-toggle-row input { position: absolute; opacity: 0; }
.settings-toggle-row i { position: relative; width: 31px; height: 18px; flex: 0 0 31px; border-radius: 999px; background: #4a7ce0; }
.settings-toggle-row i::after { position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; content: ""; }

/* Settings is intentionally operational rather than a credential console. */
.settings-calendar-action { align-self: center; white-space: nowrap; }
.managed-channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.managed-channel { min-width: 0; padding: 16px; border: 1px solid #e0e8f2; border-radius: 9px; background: #fbfdff; }
.managed-channel > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.managed-channel .settings-status-dot { min-height: 25px; padding: 0 8px; font-size: 10px; }
.managed-channel h4 { margin: 15px 0 5px; color: #263b5b; font-size: 16px; letter-spacing: -0.025em; }
.managed-channel p,
.settings-panel-copy { margin: 0; color: #7587a0; font-size: 12px; line-height: 1.6; }
.settings-panel-copy { margin-top: 18px; max-width: 52ch; }
.settings-status-dot.is-pending { background: #fff7e6; color: #8a5b09; }
.settings-status-dot.is-pending i { background: #d99b21; }
.facebook-connection-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.facebook-connection-details span { display: grid; gap: 4px; min-width: 0; padding: 12px; border: 1px solid #e0e8f2; border-radius: 8px; color: #7d8da4; font-size: 11px; }
.facebook-connection-details strong { overflow: hidden; color: #304766; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.facebook-connect-button { margin-top: 18px; }
.facebook-connection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.facebook-client-connection { min-width: 0; padding: 16px; border: 1px solid #e0e8f2; border-radius: 9px; background: #fbfdff; }
.facebook-client-connection h4 { margin: 4px 0 0; color: #263b5b; font-size: 16px; }
.facebook-client-connection p { margin: 8px 0 0; color: #7587a0; font-size: 12px; line-height: 1.55; }

/* Editors get a focused operational guide instead of account settings. */
.editor-guide-page { display: grid; gap: 16px; min-width: 0; }
.editor-guide-hero,
.editor-guide-section { min-width: 0; border: 1px solid #dbe5f1; border-radius: 10px; background: #fff; }
.editor-guide-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 26px; }
.editor-guide-hero h2,
.editor-guide-section h3 { margin: 4px 0 0; color: #203552; letter-spacing: -0.035em; }
.editor-guide-hero h2 { font-size: 28px; }
.editor-guide-hero p,
.editor-guide-copy { margin: 7px 0 0; color: #71839f; font-size: 13px; line-height: 1.6; }
.editor-guide-section { padding: 22px; }
.editor-guide-section h3 { font-size: 19px; }
.editor-guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 19px; }
.editor-guide-steps article { position: relative; min-width: 0; padding: 17px 16px 16px 52px; border: 1px solid #e0e8f2; border-radius: 9px; background: #fbfdff; }
.editor-guide-steps b { position: absolute; top: 16px; left: 16px; display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: #e8f0ff; color: #3465ce; font-size: 12px; }
.editor-guide-steps h4 { margin: 1px 0 6px; color: #2a405f; font-size: 14px; }
.editor-guide-steps p { margin: 0; color: #70829d; font-size: 12px; line-height: 1.55; }
.editor-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.editor-guide-checklist { display: grid; gap: 11px; margin: 18px 0 0; padding: 0; list-style: none; }
.editor-guide-checklist li { position: relative; padding-left: 22px; color: #596f90; font-size: 13px; line-height: 1.5; }
.editor-guide-checklist li::before { position: absolute; top: .25em; left: 0; width: 13px; height: 13px; border: 1px solid #7ca6ef; border-radius: 50%; color: #3568d6; content: "✓"; font-size: 9px; font-weight: 800; line-height: 12px; text-align: center; }

@media (max-width: 1180px) { .managed-channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .settings-calendar-action { align-self: flex-start; }
  .managed-channel-grid,
  .editor-guide-steps,
  .editor-guide-grid,
  .facebook-connection-details { grid-template-columns: 1fr; }
  .facebook-connection-grid { grid-template-columns: 1fr; }
  .editor-guide-hero { align-items: flex-start; flex-direction: column; padding: 20px; }
  .editor-guide-section { padding: 16px; }
}

.settings-drawer-details { display: grid; gap: 16px; }
.settings-drawer-platform { display: flex; align-items: center; gap: 10px; }
.settings-drawer-platform h3 { margin: 0; color: #243a5b; font-size: 18px; }
.settings-drawer-platform span { color: #8090a6; font-size: 11px; }
.settings-drawer-details > p { margin: 0; color: #5e718e; font-size: 13px; line-height: 1.6; }

@media (max-width: 1180px) {
  .settings-platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .settings-hero { padding: 20px; }
  .settings-hero { flex-direction: column; }
  .settings-section { padding: 16px; }
  .settings-platform-grid,
  .settings-bottom-grid { grid-template-columns: 1fr; }
  .settings-platform-card { min-height: 0; }
  .settings-rule { align-items: flex-start; flex-direction: column; gap: 5px; }
  .settings-rule strong { text-align: left; }
}

.notification-list,
.settings-filter-list {
  display: grid;
  gap: 8px;
}

.notification-list article {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e6edf6;
  border-radius: 8px;
  background: #fbfdff;
}

.notification-list article strong { color: #304766; font-size: 12px; }
.notification-list article p { margin: 4px 0 0; color: #7a8ba4; font-size: 11px; line-height: 1.5; }
.notification-icon { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 7px; font-size: 14px; font-weight: 800; }
.notification-icon.blue { background: #eaf1ff; color: #356bd8; }
.notification-icon.amber { background: #fff5df; color: #b57918; }
.notification-icon.violet { background: #f0eaff; color: #7754c8; }

.settings-filter-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #e0e8f2;
  border-radius: 8px;
  background: #fff;
  color: #415674;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}

.settings-filter-option:hover,
.settings-filter-option.active { border-color: #9db9ee; background: #f3f7ff; color: #2f63c8; }
.settings-filter-option span { font-size: 15px; }
.settings-search-empty { margin-top: 14px; padding: 18px; border: 1px dashed #cbd8eb; border-radius: 8px; color: #7b8da7; font-size: 12px; text-align: center; }
.topbar-drawer-copy { color: #6f819d; font-size: 13px; line-height: 1.6; }

/* Reference calendar cards: contained tiles, platform-first metadata, no accent rails. */
.calendar-month-grid {
  overflow: hidden;
}

.month-day-cell {
  min-width: 0;
  overflow: hidden;
}

.calendar-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  margin: 10px 0 0;
  padding: 9px 9px 8px;
  overflow: hidden;
  border: 1px solid #e8eef7;
  border-radius: 8px;
  background: #f5f8fe;
  box-shadow: none;
}

.calendar-event .event-accent { display: none; }
.calendar-event.festival { border-color: #f4e8cf; background: #fffaf0; }
.calendar-event:hover { border-color: #c9d9f4; background: #eef4ff; transform: translateY(-1px); }
.calendar-event.festival:hover { border-color: #ead4a8; background: #fff6e2; }
.event-title { min-width: 0; -webkit-line-clamp: 3; font-size: 11px; line-height: 1.28; }
.event-meta { min-width: 0; margin-top: 8px; }
.event-platforms { display: flex; flex-wrap: wrap; min-width: 0; gap: 4px; }

/* Remove the same visual rails from Week view while retaining status colors in the tile. */
.week-event,
.week-focus-card {
  border: 1px solid #e3ebf6;
  border-left: 1px solid #e3ebf6;
  border-radius: 7px;
}

.week-event.festival,
.week-focus-card.festival {
  border-color: #f1e4c9;
}

.density-compact .calendar-event { margin-top: 6px; padding: 7px 7px 6px; }
.density-compact .event-meta { margin-top: 5px; }

.calendar-client-lock {
  position: relative;
  display: grid;
  gap: 5px;
  margin-top: 13px;
  padding: 10px 30px 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.calendar-client-lock span {
  color: #7b8aa0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.calendar-client-lock strong { color: #344861; font-size: 12px; }
.calendar-client-lock i { position: absolute; top: 20px; right: 2px; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: #edf7f1; color: #2d9760; font-size: 11px; font-style: normal; }

/* Keep the density choices as two equal, non-overlapping controls. */
.density-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.density-switch button {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-preference input {
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* “Show details” controls text previews in every detail-bearing surface.
   Month cards remain intentionally title + platform icons only. */
.calendar-workspace:not(.density-compact) .selected-copy-block,
.calendar-workspace:not(.density-compact) .agenda-event p,
.calendar-workspace:not(.density-compact) .week-focus-card small {
  transition: opacity 180ms ease;
}

/* Reference-matched product pass: compact shell, confident type, and a calm
   calendar surface. This block intentionally lives last so older exploratory
   styles cannot reintroduce the clipped toolbar or heavy card treatment. */
:root {
  --bg: #f7f9fd;
  --surface: #ffffff;
  --surface-soft: #f4f7fc;
  --text: #172944;
  --muted: #7d8da6;
  --line: #dfe7f2;
  --line-soft: #edf1f7;
  --accent: #3564d9;
  --accent-soft: #edf3ff;
  --radius: 8px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow-x: hidden;
  color: #203351;
  font-size: 13px;
  letter-spacing: -0.01em;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.shell {
  grid-template-columns: 208px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 12px 14px;
  gap: 18px;
  border-right-color: #e1e8f2;
  background: #fff;
}

.brand {
  gap: 10px;
  padding: 2px 8px 18px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid #dfe7f2;
  border-radius: 9px;
  background: #fff;
}

.brand-logo { width: 31px; height: 31px; }
.brand-wordmark { color: #1d2d49; font-size: 16px; font-weight: 750; }
.brand span { color: #7a8ba5; font-size: 11px; }

.nav { gap: 3px; }
.nav-section-label { margin: 2px 10px 6px; color: #8a9ab1; font-size: 9px; letter-spacing: .11em; }
.nav-button {
  min-height: 40px;
  padding: 5px 8px;
  border-radius: 8px;
  color: #52627b;
  font-size: 12px;
  font-weight: 600;
}

.nav-button:hover { border-color: #e1eaf7; background: #f8faff; color: #3564d9; }
.nav-button.active { border-color: #d7e4fb; background: #edf3ff; color: #2f61ce; }
.nav-icon { width: 27px; height: 27px; flex-basis: 27px; border-color: #e1e9f4; border-radius: 7px; background: #fbfcff; color: #7a8da9; }
.nav-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.nav-button.active .nav-icon { border-color: #c9dcff; color: #356bd8; }
.nav-label { letter-spacing: -0.005em; }
.nav-arrow { color: #a3b2c7; font-size: 16px; }
.nav-button.active .nav-arrow { color: #4b7add; }
.nav-separator { margin: 12px 10px 8px; background: #edf1f6; }

.session-identity { padding: 12px 8px 11px; border-top-color: #e8eef6; }
.identity-avatar { width: 30px; height: 30px; flex-basis: 30px; background: #eef3fd; color: #456bc1; }
.session-identity span { color: #8291a8; font-size: 9px; letter-spacing: .09em; }
.session-identity strong { color: #40526f; font-size: 11px; }
.sidebar > .refresh-button,
.sidebar > .logout-button { width: calc(100% - 16px); min-height: 36px; margin-right: 8px; margin-left: 8px; border-radius: 8px; font-size: 11px; }
.sidebar > .refresh-button { color: #3564c9; background: #f7faff; }
.sidebar > .logout-button { margin-top: -4px; color: #71829b; }

.topbar {
  min-height: 76px;
  padding: 15px 24px;
  background: #fff;
  border-bottom-color: #e8eef6;
}

.topbar-title h1 { color: #1d2d49; font-size: 23px; font-weight: 700; letter-spacing: -.04em; }
.topbar-title p { margin-top: 3px; color: #8291a8; font-size: 11px; }
.topbar-tools { gap: 8px; }
.topbar-search { width: 174px; height: 38px; border-color: #e3eaf3; border-radius: 8px; }
.topbar-search input { font-size: 11px; }
.topbar-icon-button,
.topbar-filter-button { height: 38px; border-color: #e3eaf3; border-radius: 8px; }
.topbar-icon-button { width: 38px; }
.topbar-filter-button { padding: 0 13px; font-size: 11px; }

.view {
  padding: 20px;
  gap: 16px;
  background: var(--bg);
}

.calendar-workspace {
  grid-template-columns: 224px minmax(0, 1fr) !important;
  gap: 12px;
  align-items: start;
}

.calendar-sidebar-panel,
.calendar-stage,
.calendar-customize-panel,
.calendar-selected-panel {
  border-color: #dce5f1;
  border-radius: 8px;
  background: #fff;
  box-shadow: none !important;
}

.calendar-sidebar-panel { top: 96px; padding: 13px; }
.calendar-new-button { min-height: 40px; border-radius: 7px; background: #3561d8; font-size: 13px; box-shadow: none; }
.calendar-new-button:hover { background: #2b55c8; }
.calendar-button-plus { font-size: 19px; }
.calendar-client-switcher,
.calendar-client-lock { margin-top: 12px; padding-top: 9px; padding-bottom: 11px; }
.calendar-client-switcher select { min-height: 34px; border-color: #dce5f1; border-radius: 7px; font-size: 11px; }
.calendar-client-lock strong { font-size: 12px; }
.mini-calendar-head { margin: 18px 2px 11px; color: #344764; font-size: 12px; }
.mini-calendar-weekdays { color: #91a0b5; font-size: 9px; }
.mini-calendar-day { width: 25px; height: 25px; color: #5a6c88; font-size: 10px; }
.mini-calendar-day.selected { background: #3564d9; }
.sidebar-section { margin-top: 17px; padding-top: 15px; gap: 8px; }
.sidebar-section-head { color: #50627e; font-size: 11px; }
.sidebar-section-head button { color: #3564d9; font-size: 10px; }
.calendar-source { gap: 7px; color: #687b96; font-size: 11px; }
.calendar-source i { width: 12px; height: 12px; border-radius: 3px; }
.calendar-role-card { padding: 12px; border-color: #dce7f7; border-radius: 8px; background: #f8faff; }
.calendar-role-card strong { color: #3561ba; font-size: 12px; }
.calendar-role-card p { font-size: 10px; line-height: 1.48; }
.calendar-sidebar-summary { margin-top: 16px; color: #8796aa; font-size: 10px; }
.calendar-sidebar-summary strong { color: #415572; font-size: 11px; }

.calendar-stage { min-width: 0; overflow: visible; }
.calendar-command-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
}
.calendar-navigation { min-width: 0; gap: 6px; }
.calendar-today,
.calendar-arrows button,
.calendar-customize-button,
.calendar-view-switcher button,
.calendar-select {
  min-height: 36px;
  border-color: #dce5f1;
  border-radius: 8px;
  color: #566983;
  font-size: 11px;
  font-weight: 650;
}
.calendar-today { padding: 0 12px; }
.calendar-arrows { gap: 4px; }
.calendar-arrows button { width: 31px; font-size: 19px; }
.calendar-month-title { gap: 8px; }
.calendar-month-title img { width: 29px; height: 34px; }
.calendar-month-title h2 { margin: 0; color: #243a5c; font-size: 22px; font-weight: 700; letter-spacing: -.045em; }
.calendar-command-actions { gap: 6px; min-width: 0; flex-wrap: nowrap; }
.calendar-select { min-width: 112px; padding-right: 25px; }
.calendar-customize-button { gap: 6px; padding: 0 11px; white-space: nowrap; }
.calendar-customize-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.calendar-view-switcher { border-color: #dce5f1; border-radius: 8px; }
.calendar-view-switcher button { min-width: 55px; }
.calendar-view-switcher button.active { background: #3564d9; }
.calendar-today:hover,
.calendar-arrows button:hover,
.calendar-customize-button:hover { border-color: #a9c2ef; background: #f5f8ff; color: #315fc6; }

.calendar-customize-panel {
  grid-template-columns: minmax(190px, .9fr) minmax(0, 1.4fr);
  gap: 18px;
  margin: 11px 12px 0;
  padding: 14px;
  border-radius: 8px;
  background: #f9fbff;
}
.calendar-customize-panel .eyebrow { margin-bottom: 3px; font-size: 9px; }
.calendar-customize-panel h3 { color: #2e4567; font-size: 15px; }
.calendar-customize-panel p { color: #7a8ba4; font-size: 10px; line-height: 1.4; }
.customize-controls { grid-template-columns: minmax(118px, 1.1fr) repeat(3, minmax(88px, 1fr)); gap: 8px; }
.customize-density { gap: 5px; color: #7889a2; font-size: 10px; }
.density-switch { gap: 2px; padding: 3px; border-color: #dce6f4; border-radius: 7px; }
.density-switch button { min-height: 25px; border-radius: 5px; font-size: 9px; }
.density-switch button.active { background: #eaf1ff; color: #3265cf; }
.calendar-preference { min-height: 38px; padding: 6px 7px; border-color: #e4ebf4; border-radius: 7px; background: #fff; color: #697c98; font-size: 10px; line-height: 1.2; }
.calendar-preference i { width: 28px; height: 16px; }

.calendar-month-shell { margin-top: 11px; }
.calendar-weekday-row { padding: 0 8px 7px; color: #8191a8; font-size: 9px; letter-spacing: .1em; }
.calendar-weekday-row span { padding-left: 6px; }
.calendar-month-grid { border-color: #e6edf5; }
.month-day-cell { min-height: 158px; padding: 8px; border-right-color: #edf2f7; border-bottom-color: #edf2f7; }
.density-compact .month-day-cell { min-height: 108px; }
.month-day-cell.weekend { background: #fcfdff; }
.month-day-cell.festival-day { background: #fffdf8; }
.month-day-cell.selected { box-shadow: inset 0 0 0 2px #4f80e5; }
.month-day-number { width: 25px; height: 25px; color: #536782; font-size: 11px; }
.month-day-cell.selected .month-day-number { background: #3564d9; }
.calendar-event {
  width: 100%;
  min-width: 0;
  margin-top: 9px;
  padding: 8px 8px 7px;
  border: 1px solid #e8eef6;
  border-radius: 7px;
  background: #f4f7fd;
}
.calendar-event.festival { border-color: #f1e5cc; background: #fffaf0; }
.calendar-event:hover { border-color: #c4d6f3; background: #eef4ff; transform: translateY(-1px); }
.event-title { color: #2f4362; font-size: 11px; line-height: 1.28; }
.event-meta { margin-top: 7px; }
.event-platforms { gap: 3px; }
.event-platforms .platform-icon { width: 15px; height: 15px; border-radius: 3px; }

.calendar-selected-panel { overflow: hidden; }
.selected-panel-header { padding: 14px 14px 11px; }
.selected-panel-header strong { font-size: 16px; }
.selected-platform-switcher { padding: 10px 11px 8px; }
.selected-platform-tabs { padding: 0 14px 11px; }
.selected-copy-block { margin-right: 14px; margin-left: 14px; }
.selected-copy-block p { color: #526986; font-size: 11px; }
.selected-slot-meta { padding-right: 14px; padding-left: 14px; }
.selected-open-button { width: calc(100% - 28px); margin-right: 14px; margin-left: 14px; }

.calendar-workspace > .calendar-selected-panel { grid-column: 1 / -1; grid-row: 2; justify-self: end; width: min(100%, 560px); }

@media (min-width: 1500px) {
  .calendar-workspace { grid-template-columns: 224px minmax(0, 1fr) 316px !important; }
  .calendar-sidebar-panel { grid-column: 1; grid-row: 1; }
  .calendar-stage { grid-column: 2; grid-row: 1; }
  .calendar-workspace > .calendar-selected-panel { grid-column: 3; grid-row: 1; width: 100%; }
}

@media (max-width: 1180px) and (min-width: 761px) {
  .shell { grid-template-columns: 196px minmax(0, 1fr); }
  .calendar-workspace { grid-template-columns: 1fr !important; }
  .calendar-sidebar-panel { display: grid; grid-template-columns: minmax(165px, .75fr) minmax(210px, 1fr) minmax(170px, .75fr); gap: 12px; align-items: center; }
  .calendar-sidebar-panel .calendar-new-button { grid-row: span 2; }
  .calendar-sidebar-panel .calendar-client-switcher,
  .calendar-sidebar-panel .calendar-client-lock { grid-column: 1; grid-row: 3; margin: 0; padding: 0; border-bottom: 0; }
  .calendar-sidebar-panel .mini-calendar-head,
  .calendar-sidebar-panel .mini-calendar-weekdays,
  .calendar-sidebar-panel .mini-calendar-days { grid-column: 2; }
  .calendar-sidebar-panel .mini-calendar-head { margin: 0; }
  .calendar-sidebar-panel .sidebar-section { grid-column: 3; grid-row: 1 / span 3; margin: 0; padding: 0 0 0 12px; border-top: 0; border-left: 1px solid var(--line-soft); }
  .calendar-sidebar-panel .calendar-role-card,
  .calendar-sidebar-panel .calendar-sidebar-summary { display: none; }
  .calendar-command-bar { grid-template-columns: 1fr; align-items: stretch; }
  .calendar-command-actions { justify-content: flex-start; }
  .customize-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 10px 12px; gap: 9px; border-right: 0; border-bottom: 1px solid #e1e8f2; }
  .brand { padding: 0; border-bottom: 0; }
  .brand span { display: none; }
  .nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 1px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-section-label,
  .nav-separator { display: none; }
  .nav-button { width: auto; min-height: 36px; padding: 4px 9px; white-space: nowrap; }
  .nav-arrow { display: none; }
  .nav-icon { width: 24px; height: 24px; flex-basis: 24px; }
  .session-identity,
  .sidebar > .refresh-button,
  .sidebar > .logout-button { display: none; }
  .topbar { min-height: 60px; padding: 10px 14px; }
  .topbar-title h1 { font-size: 18px; }
  .topbar-title p { display: none; }
  .topbar-search,
  .topbar-filter-button { display: none; }
  .view { padding: 10px; }
  .calendar-workspace { grid-template-columns: 1fr !important; gap: 10px; }
  .calendar-sidebar-panel { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .calendar-sidebar-panel .calendar-new-button,
  .calendar-sidebar-panel .calendar-client-switcher,
  .calendar-sidebar-panel .calendar-client-lock,
  .calendar-sidebar-panel .sidebar-section { grid-column: 1 / -1; grid-row: auto; }
  .calendar-sidebar-panel .mini-calendar-head,
  .calendar-sidebar-panel .mini-calendar-weekdays,
  .calendar-sidebar-panel .mini-calendar-days,
  .calendar-role-card,
  .calendar-sidebar-summary { display: none; }
  .calendar-sidebar-panel .sidebar-section { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }
  .calendar-command-bar { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 11px; }
  .calendar-navigation { display: grid; grid-template-columns: auto auto minmax(0, 1fr); width: 100%; }
  .calendar-month-title h2 { max-width: 100%; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-command-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
  .calendar-select { min-width: 0; width: 100%; }
  .calendar-view-switcher { grid-column: 1 / -1; width: 100%; }
  .calendar-view-switcher button { flex: 1; min-width: 0; }
  .calendar-customize-panel { grid-template-columns: 1fr; margin: 10px; }
  .customize-controls { grid-template-columns: 1fr; gap: 7px; }
  .calendar-month-shell,
  .calendar-week-shell { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .calendar-weekday-row,
  .calendar-month-grid { min-width: 680px; }
  .calendar-workspace > .calendar-selected-panel { grid-column: auto; grid-row: auto; width: 100%; }
}

/* Weekly view containment and responsive inspector layout. Keep the seven-day
   canvas inside the stage so it can scroll without covering the inspector. */
.calendar-stage { overflow: hidden; }
.calendar-week-shell {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.week-day-headings,
.week-all-day-row,
.week-timeline { min-width: 720px; }
.week-day-headings,
.week-all-day-row { width: max(100%, 720px); }
.week-timeline { width: max(100%, 720px); }

@media (min-width: 761px) and (max-width: 1719px) {
  .calendar-workspace { grid-template-columns: 224px minmax(0, 1fr) !important; }
  .calendar-sidebar-panel { grid-column: 1; grid-row: 1; }
  .calendar-stage { grid-column: 2; grid-row: 1; }
  .calendar-workspace > .calendar-selected-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
    width: min(100%, 560px);
  }
}

/* Toolbar fit: make the calendar header respond to the stage width itself.
   Narrow client workspaces wrap the action rail instead of covering the month
   title with the filter control. */
.calendar-stage { container-type: inline-size; }
.calendar-command-bar { min-width: 0; }
.calendar-navigation { min-width: 0; overflow: visible; }
.calendar-month-title { min-width: 0; flex: 1 1 auto; }
.calendar-month-title h2 { min-width: 0; flex: 1 1 auto; overflow: visible; text-overflow: clip; white-space: nowrap; }
.calendar-command-actions { min-width: 0; flex: 0 1 auto; }

@container (max-width: 820px) {
  .calendar-command-bar { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .calendar-command-actions { justify-content: flex-start; }
}

@container (max-width: 560px) {
  .calendar-navigation { display: grid; grid-template-columns: auto auto minmax(0, 1fr); }
  .calendar-month-title h2 { overflow: hidden; font-size: 19px; text-overflow: ellipsis; }
  .calendar-command-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .calendar-view-switcher { grid-column: 1 / -1; width: 100%; }
  .calendar-view-switcher button { flex: 1; min-width: 0; }
}

/* Sidebar destinations: focused, real workspace surfaces rather than dead links. */
.workspace-page {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.workspace-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.workspace-page-header > div { min-width: 0; }
.workspace-page-header h2 { margin: 0; color: #1e3352; font-size: 26px; letter-spacing: -.045em; }
.workspace-page-header p { max-width: 660px; margin: 5px 0 0; color: #7d8da5; font-size: 12px; line-height: 1.5; }
.workspace-header-action { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 8px; font-size: 11px; }
.workspace-header-action span { font-size: 16px; line-height: 1; }

.workspace-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.workspace-summary-grid article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #fff;
}

.workspace-summary-grid article > span { color: #7f90a8; font-size: 10px; font-weight: 650; }
.workspace-summary-grid article > strong { color: #2e5fc4; font-size: 24px; letter-spacing: -.045em; }
.workspace-summary-grid article > strong small { color: #8b9ab0; font-size: 12px; font-weight: 600; }
.workspace-summary-grid article > small { color: #8897ab; font-size: 10px; }
.workspace-summary-grid .summary-status { color: #3e7e63; font-size: 17px; }

.workspace-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dce5f1;
  border-radius: 8px;
  background: #fff;
}

.workspace-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.workspace-panel-header .eyebrow { margin-bottom: 3px; font-size: 9px; }
.workspace-panel-header h3 { margin: 0; color: #2e4567; font-size: 17px; letter-spacing: -.03em; }
.workspace-count { flex: 0 0 auto; color: #8392a7; font-size: 10px; font-weight: 650; }

.workspace-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.workspace-search {
  display: flex;
  height: 34px;
  min-width: 180px;
  flex: 1;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #dfe7f1;
  border-radius: 7px;
  background: #fbfdff;
  color: #8a99ae;
}

.workspace-search:focus-within { border-color: #9db9ee; background: #fff; outline: 2px solid #edf3ff; outline-offset: 0; }
.workspace-search svg { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.workspace-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #334968; font-size: 11px; }
.workspace-search input::placeholder { color: #8b9ab0; }
.workspace-filter-bar .select { min-width: 135px; height: 34px; font-size: 10px; }

.brief-list,
.asset-hub-list { display: grid; gap: 7px; margin-top: 10px; }

.workspace-brief-card,
.asset-hub-card {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid #edf2f7;
}

.workspace-brief-card:last-child,
.asset-hub-card:last-child { border-bottom: 0; }
.workspace-brief-date { display: grid; align-content: start; gap: 5px; }
.workspace-brief-date strong { color: #45617f; font-size: 11px; }
.slot-type { display: inline-flex; width: max-content; color: #7b8ca3; font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.slot-type.festival { color: #b17816; }
.workspace-brief-main { min-width: 0; }
.workspace-brief-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.workspace-brief-title h3 { overflow: hidden; min-width: 0; margin: 0; color: #2f4361; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-brief-title .badge { min-height: 20px; padding: 2px 6px; font-size: 9px; }
.workspace-brief-main > p { display: -webkit-box; overflow: hidden; max-width: 720px; margin: 4px 0 6px; color: #7587a0; font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.workspace-brief-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.workspace-platform-list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.workspace-platform-list span { display: inline-flex; min-height: 19px; align-items: center; padding: 2px 6px; border: 1px solid #e0e8f2; border-radius: 4px; background: #f8faff; color: #6c80a0; font-size: 9px; font-weight: 650; }
.workspace-asset-state { color: #bd7c22; font-size: 9px; font-weight: 650; }
.workspace-asset-state.ready { color: #398260; }
.workspace-row-action { display: inline-flex; align-items: center; gap: 8px; min-height: 31px; padding: 0 9px; border: 1px solid #dce6f3; border-radius: 6px; background: #fff; color: #3564c9; cursor: pointer; font-size: 10px; font-weight: 700; white-space: nowrap; }
.workspace-row-action span { font-size: 15px; line-height: 1; }
.workspace-row-action:hover { border-color: #a9c2ec; background: #f5f8ff; }

.asset-hub-card { grid-template-columns: minmax(0, 1fr) auto; }
.asset-hub-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.asset-hub-heading > div:first-child { min-width: 0; }
.asset-hub-heading > div:first-child > span { color: #8392a7; font-size: 9px; }
.asset-hub-heading h3 { overflow: hidden; margin: 3px 0 0; color: #304562; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.asset-hub-heading .workspace-platform-list { justify-content: flex-end; }
.asset-status-grid { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.asset-status { display: grid; grid-template-columns: 7px minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 6px; min-width: 0; padding: 8px 9px; border: 1px solid #e5ebf3; border-radius: 6px; background: #fbfcff; }
.asset-status i { width: 7px; height: 7px; border-radius: 50%; background: #d19a38; }
.asset-status.ready i { background: #4aa276; }
.asset-status strong { color: #526884; font-size: 9px; white-space: nowrap; }
.asset-status small { overflow: hidden; color: #8493a8; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-empty { margin-top: 12px; padding: 20px; border: 1px dashed #cbd8eb; border-radius: 7px; color: #7a8da8; font-size: 11px; text-align: center; }

.workspace-guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, .95fr); gap: 6px 20px; padding: 16px 18px; border: 1px solid #dce7f6; border-radius: 8px; background: #f8faff; }
.workspace-guide .eyebrow { margin-bottom: 3px; font-size: 9px; }
.workspace-guide h3 { margin: 0; color: #2e4567; font-size: 15px; }
.workspace-guide p { max-width: 610px; margin: 4px 0 0; color: #7c8ca4; font-size: 10px; line-height: 1.45; }
.workspace-guide code { align-self: center; padding: 10px; border: 1px solid #e0e8f3; border-radius: 6px; background: #fff; color: #526b90; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; white-space: normal; }
.workspace-guide-examples { display: grid; grid-column: 2; gap: 3px; color: #7890b1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.workspace-drawer { display: grid; gap: 16px; }
.workspace-drawer-block { display: grid; gap: 6px; }
.workspace-drawer-block .eyebrow { margin: 0; font-size: 9px; }
.workspace-drawer-block p { margin: 0; color: #536b89; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.workspace-drawer-assets { display: grid; gap: 5px; color: #5f7696; font-size: 11px; }
.workspace-drawer .action { width: 100%; justify-content: center; }

@media (max-width: 760px) {
  .workspace-page-header { align-items: flex-start; flex-direction: column; }
  .workspace-header-action { width: 100%; justify-content: center; }
  .workspace-summary-grid { grid-template-columns: 1fr; }
  .workspace-filter-bar { align-items: stretch; flex-direction: column; }
  .workspace-search { width: 100%; }
  .workspace-filter-bar .select { width: 100%; }
  .workspace-brief-card,
  .asset-hub-card { grid-template-columns: 1fr; gap: 8px; align-items: start; }
  .workspace-row-action { width: 100%; justify-content: center; }
  .asset-hub-heading { flex-direction: column; }
  .asset-hub-heading .workspace-platform-list { justify-content: flex-start; }
  .asset-status-grid { grid-template-columns: 1fr; }
  .workspace-guide { grid-template-columns: 1fr; }
.workspace-guide-examples { grid-column: auto; }
}

/* Keep the selected-date inspector beside the weekly canvas on desktop-sized
   screens. The stage remains shrinkable and its seven-day canvas scrolls
   internally when the viewport is narrower than the full reference layout. */
@media (min-width: 1280px) {
  .calendar-workspace { grid-template-columns: 224px minmax(0, 1fr) 316px !important; }
  .calendar-sidebar-panel { grid-column: 1; grid-row: 1; }
  .calendar-stage { grid-column: 2; grid-row: 1; }
  .calendar-workspace > .calendar-selected-panel {
    grid-column: 3;
    grid-row: 1;
    justify-self: stretch;
    width: 100%;
  }
}

/* Weekly cards use one consistent visual hierarchy: title first, platform
   icons second. Descriptions and editor placeholders belong in the inspector,
   not inside constrained calendar cells. */
.week-event,
.week-focus-card { min-width: 0; }
.week-event { display: grid; gap: 6px; white-space: normal; }
.week-event-title,
.week-focus-card > strong {
  display: -webkit-box;
  overflow: hidden;
  color: inherit;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.week-event .event-platforms,
.week-focus-card .event-platforms { margin-top: 0; }
.week-focus-card { gap: 6px; }
.week-focus-card .event-platforms { justify-content: flex-start; }

/* Agenda: use clean floating cards instead of accent rails and full-width row
   rules. The date column still keeps the schedule easy to scan. */
.calendar-agenda {
  gap: 10px;
  padding: 2px 12px 14px;
}
.agenda-row,
.agenda-row.selected {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}
.agenda-date { padding: 12px 4px; }
.agenda-date strong { font-size: 22px; }
.agenda-event,
.agenda-event.festival {
  min-width: 0;
  border: 1px solid #dfe8f5;
  border-left: 1px solid #dfe8f5;
  border-radius: 10px;
  background: #fff;
}
.agenda-event:hover { border-color: #b9cfee; background: #fbfdff; }
.agenda-event.festival { border-color: #f0e1c3; background: #fffaf0; }
.agenda-event.festival:hover { border-color: #e5c98d; background: #fff6e4; }
.agenda-event > div:first-child { min-width: 0; }
.agenda-event h3,
.agenda-event p { overflow: hidden; text-overflow: ellipsis; }
.agenda-event h3 { white-space: nowrap; }
.agenda-event p { white-space: nowrap; }
.agenda-event-meta { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 7px 10px; min-width: 0; }

/* Keep the agenda summary readable: the content copy owns the flexible column
   while status, readiness and time always retain a usable compact column. */
.agenda-event { display: grid; grid-template-columns: minmax(0, 1fr) 142px; align-items: center; gap: 18px; }
.agenda-event-meta { display: grid; grid-template-columns: 1fr; justify-items: end; align-content: center; gap: 6px; min-width: 142px; text-align: right; }
.agenda-event-meta .event-platforms { flex-wrap: nowrap; }
.agenda-event-meta > span { max-width: 142px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .agenda-event { grid-template-columns: 1fr; gap: 10px; }
  .agenda-event-meta { justify-items: start; min-width: 0; text-align: left; }
}

/* Notification popover: visually related to the product surfaces, but
   intentionally distinct from the full-height production drawer. */
.drawer-backdrop-notifications-drawer {
  align-items: flex-start;
  background: rgba(26, 45, 76, .12);
}
.notifications-drawer {
  width: min(500px, calc(100% - 28px));
  height: min(720px, calc(100vh - 88px));
  margin: 70px 14px 18px 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #d9e3f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(38, 65, 105, .16) !important;
}
.notifications-panel { display: grid; height: 100%; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; }
.notifications-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 20px; border-bottom: 1px solid #dbe5f1; background: #eef3ff; }
.notifications-panel-header h2 { margin: 5px 0 3px; color: #16233c; font-size: 22px; letter-spacing: -.035em; }
.notifications-panel-header p { margin: 0; color: #667894; font-size: 13px; }
.notifications-panel-header .icon-button { width: 30px; height: 30px; border: 1px solid #d4e0ef; border-radius: 7px; background: #fff; color: #6a7f9e; font-size: 20px; line-height: 1; }
.notifications-panel .notification-list { align-content: start; grid-auto-rows: max-content; min-height: 0; overflow: auto; gap: 0; background: #fff; }
.notification-list-loading { display: grid; align-content: start; padding: 8px 0; }
.notification-loading-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: center; min-height: 84px; padding: 16px 24px; border-bottom: 1px solid #e1e8f2; }
.notification-loading-row:last-child { border-bottom: 0; }
.notification-loading-icon,
.notification-loading-copy i { display: block; border-radius: 999px; background: linear-gradient(90deg, #e6edf6, #f5f8fc, #e6edf6); background-size: 180% 100%; animation: shimmer 1.2s ease infinite; }
.notification-loading-icon { width: 40px; height: 40px; }
.notification-loading-copy { display: grid; gap: 10px; }
.notification-loading-copy i { height: 12px; width: min(100%, 260px); }
.notification-loading-copy i:last-child { width: min(74%, 180px); }
.notification-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: start; min-width: 0; padding: 22px 24px; border-bottom: 1px solid #e1e8f2; background: #fff; }
.notification-item.unread { background: #fbfdff; }
.notification-item:last-child { border-bottom: 0; }
.notification-icon { width: 40px; height: 40px; border-radius: 50%; }
.notification-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.notification-icon.blue { background: #eaf0ff; color: #3d70e1; }
.notification-icon.amber { background: #fff3d9; color: #b47a18; }
.notification-icon.violet { background: #f0eaff; color: #7b59ce; }
.notification-content { min-width: 0; }
.notification-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.notification-list article strong { overflow: hidden; color: #16233c; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.notification-title-row time { flex: 0 0 auto; color: #71839e; font-size: 11px; }
.notification-list article p { margin: 7px 0 10px; color: #637692; font-size: 12px; line-height: 1.55; }
.notification-link { padding: 0; border: 0; background: transparent; color: #3c70df; cursor: pointer; font-size: 12px; font-weight: 750; }
.notification-link span { font-size: 15px; }
.notification-remove { padding: 0; border: 0; background: transparent; color: #7d8da5; cursor: pointer; font-size: 20px; line-height: 1; }
.notification-remove:hover { color: #3b64ad; }
.notifications-footer { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 8px; padding: 12px 16px; border-top: 1px solid #dbe5f1; background: #f8faff; }
.notifications-footer button { min-height: 40px; padding: 0 10px; border: 1px solid #e1e8f2; border-radius: 9px; background: #f1f4f9; color: #18243a; cursor: pointer; font-size: 12px; font-weight: 650; }
.notifications-footer button:last-child { border-color: #d4deec; background: #fff; }
.notifications-footer button:hover { border-color: #a9c2ec; background: #edf3ff; color: #2f62c7; }
.notifications-empty { display: grid; place-content: center; gap: 6px; min-height: 220px; padding: 30px; color: #7890ae; text-align: center; }
.notifications-empty strong { color: #29415f; font-size: 15px; }
.notifications-empty span { font-size: 12px; }

@media (max-width: 760px) {
  .agenda-row,
  .agenda-row.selected { grid-template-columns: 54px minmax(0, 1fr); gap: 8px; }
  .calendar-agenda { padding-right: 8px; padding-left: 8px; }
  .agenda-event-meta { justify-content: flex-start; }
  .notifications-drawer { width: calc(100% - 16px); height: calc(100% - 16px); margin: 8px; border-radius: 16px; }
  .notifications-panel-header { padding: 18px; }
  .notification-item { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; padding: 18px; }
  .notification-icon { width: 36px; height: 36px; }
  .notifications-footer { padding: 10px; }
}

/* Sidebar appearance control */
.sidebar-theme-control {
  display: grid;
  gap: 6px;
  margin: 0 9px;
  padding-top: 12px;
  border-top: 1px solid #e8eef6;
}
.sidebar-theme-caption {
  color: #91a0b5;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.theme-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #dce5f0;
  border-radius: 8px;
  background: #f7faff;
  color: #50627e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}
.theme-toggle:hover { border-color: #aec5ec; background: #eef4ff; color: #2f63c8; }
.theme-toggle-icon { display: grid; width: 22px; height: 22px; place-items: center; color: #416fc8; font-size: 15px; }
.theme-toggle > span:nth-child(2) { flex: 1; }
.theme-toggle-track { position: relative; width: 30px; height: 18px; flex: 0 0 30px; border-radius: 999px; background: #cbd8ea; }
.theme-toggle-track i { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform 180ms ease, background 180ms ease; }

/* Dark theme: a complete surface, border, text, control, calendar, and drawer
   palette. Keeping the selectors at the end makes the theme deterministic even
   though the legacy light styles above remain available as the light default. */
:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111b2d;
  --surface-soft: #17243a;
  --text: #edf3ff;
  --muted: #9eacc5;
  --line: #2a3a56;
  --line-soft: #20304a;
  --accent: #78a7ff;
  --accent-soft: #1b3157;
  --blue: #79a7ff;
  --black: #edf3ff;
  --orange: #e4ad4c;
  --pink: #f28bb7;
  color-scheme: dark;
}

html[data-theme="dark"],
body[data-theme="dark"],
body:has(#app-shell:not([hidden]))[data-theme="dark"] { background: var(--bg); color: var(--text); }
[data-theme="dark"] .sidebar,
[data-theme="dark"] .topbar,
[data-theme="dark"] .view,
[data-theme="dark"] .main { background: var(--bg); }
[data-theme="dark"] .sidebar { background: #0e1728; border-right-color: var(--line); }
[data-theme="dark"] .topbar { background: rgba(11, 18, 32, .94); border-bottom-color: var(--line-soft); }
[data-theme="dark"] .topbar h1,
[data-theme="dark"] .topbar-title h1,
[data-theme="dark"] .section-title h2,
[data-theme="dark"] .workspace-page-header h2 { color: #f1f5ff; }
[data-theme="dark"] .topbar p,
[data-theme="dark"] .topbar-title p,
[data-theme="dark"] .section-title p,
[data-theme="dark"] .workspace-page-header p { color: #9aaaca; }
[data-theme="dark"] .brand-mark { border-color: #2c3c58; background: #111b2d; }
[data-theme="dark"] .brand-wordmark { color: #f0f4ff; }
[data-theme="dark"] .brand span { color: #9eacc5; }
[data-theme="dark"] .nav-section-label,
[data-theme="dark"] .sidebar-theme-caption { color: #7184a3; }
[data-theme="dark"] .nav-button { color: #aab8cf; }
[data-theme="dark"] .nav-button:hover { border-color: #2d4771; background: #152642; color: #9fc0ff; }
[data-theme="dark"] .nav-button.active { border-color: #315b9c; background: #1a3560; color: #a9c6ff; }
[data-theme="dark"] .nav-icon { border-color: #2d3e5c; background: #15223a; color: #9aacC8; }
[data-theme="dark"] .nav-button.active .nav-icon { border-color: #4d78c5; background: #203f71; color: #a9c6ff; }
[data-theme="dark"] .nav-separator,
[data-theme="dark"] .brand,
[data-theme="dark"] .session-identity,
[data-theme="dark"] .sidebar-theme-control { border-color: var(--line-soft); }
[data-theme="dark"] .identity-avatar { background: #1e3965; color: #b7ceff; }
[data-theme="dark"] .session-identity span:not(.identity-avatar) { color: #8193b1; }
[data-theme="dark"] .session-identity strong { color: #dbe5f7; }
[data-theme="dark"] .theme-toggle { border-color: #2c3f60; background: #15233a; color: #b5c3da; }
[data-theme="dark"] .theme-toggle:hover { border-color: #4d77bd; background: #1a3560; color: #c7d9ff; }
[data-theme="dark"] .theme-toggle-icon { color: #f2c86b; }
[data-theme="dark"] .theme-toggle-track { background: #4676d1; }
[data-theme="dark"] .theme-toggle-track i { transform: translateX(12px); background: #fff4c8; }
[data-theme="dark"] .sidebar > .refresh-button,
[data-theme="dark"] .sidebar > .logout-button { border-color: #2d3f5d; background: #111d31; color: #a8b9d4; }
[data-theme="dark"] .sidebar > .refresh-button:hover,
[data-theme="dark"] .sidebar > .logout-button:hover { border-color: #4b76c4; background: #1a3560; color: #c4d7ff; }

[data-theme="dark"] .topbar-search,
[data-theme="dark"] .topbar-icon-button,
[data-theme="dark"] .topbar-filter-button,
[data-theme="dark"] .topbar-search input { border-color: #2b3d5a; background: #111c2f; color: #dce7fb; }
[data-theme="dark"] .topbar-search input::placeholder { color: #7f91b0; }
[data-theme="dark"] .topbar-search:focus-within { border-color: #5c88e4; outline-color: #1d3967; }
[data-theme="dark"] .topbar-icon-button,
[data-theme="dark"] .topbar-filter-button { color: #aec0dc; }
[data-theme="dark"] .topbar-icon-button b { border-color: #111c2f; }
[data-theme="dark"] .topbar-icon-button:hover,
[data-theme="dark"] .topbar-filter-button:hover { border-color: #4a73bb; background: #1a3156; color: #c8d9ff; }
[data-theme="dark"] .badge,
[data-theme="dark"] .workspace-count { color: #a7b7d0; }

/* Pale light-theme pills were being carried into dark mode, leaving their
   labels washed out. Dark mode uses dark surfaces with high-contrast text. */
[data-theme="dark"] .badge,
[data-theme="dark"] .slot-type {
  border: 1px solid #3b3b3b;
  background: #171717;
  color: #e1e8f5;
}
[data-theme="dark"] .badge.status-published {
  border-color: #315d9f;
  background: #13284a;
  color: #dceaff;
}
[data-theme="dark"] .slot-type.festival {
  border-color: #765a2e;
  background: #211a0c;
  color: #f0c875;
}

[data-theme="dark"] .calendar-sidebar-panel,
[data-theme="dark"] .calendar-stage,
[data-theme="dark"] .calendar-customize-panel,
[data-theme="dark"] .calendar-selected-panel,
[data-theme="dark"] .workspace-panel,
[data-theme="dark"] .workspace-summary-grid article,
[data-theme="dark"] .production-stat,
[data-theme="dark"] .dashboard-kpi,
[data-theme="dark"] .dashboard-panel,
[data-theme="dark"] .panel,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .item-card { border-color: #2a3b58; background: #111b2d; color: var(--text); }
[data-theme="dark"] .calendar-new-button,
[data-theme="dark"] .action.primary { background: #477be5; color: #fff; }
[data-theme="dark"] .calendar-new-button:hover,
[data-theme="dark"] .action.primary:hover { background: #5a8af0; }
[data-theme="dark"] .calendar-client-switcher select,
[data-theme="dark"] .calendar-client-lock,
[data-theme="dark"] .calendar-select,
[data-theme="dark"] .calendar-today,
[data-theme="dark"] .calendar-arrows button,
[data-theme="dark"] .calendar-customize-button,
[data-theme="dark"] .calendar-view-switcher,
[data-theme="dark"] .calendar-view-switcher button,
[data-theme="dark"] .select,
[data-theme="dark"] .input,
[data-theme="dark"] .textarea { border-color: #304563; background: #152238; color: #dce7fb; }
[data-theme="dark"] .calendar-today:hover,
[data-theme="dark"] .calendar-arrows button:hover,
[data-theme="dark"] .calendar-customize-button:hover { border-color: #5b86dc; background: #1b3560; color: #c9daff; }
[data-theme="dark"] .calendar-month-title h2,
[data-theme="dark"] .calendar-sidebar-panel strong,
[data-theme="dark"] .mini-calendar-head,
[data-theme="dark"] .calendar-role-card strong,
[data-theme="dark"] .calendar-sidebar-summary strong { color: #e6eeff; }
[data-theme="dark"] .calendar-month-title img { background: #f8f8f5; border-radius: 4px; }
[data-theme="dark"] .calendar-client-lock span,
[data-theme="dark"] .calendar-source,
[data-theme="dark"] .calendar-sidebar-summary,
[data-theme="dark"] .calendar-role-card p { color: #91a4c2; }
[data-theme="dark"] .calendar-role-card { border-color: #2c456c; background: #132340; }
[data-theme="dark"] .calendar-source i { border-color: #3b5374; }
[data-theme="dark"] .mini-calendar-weekdays,
[data-theme="dark"] .mini-calendar-day,
[data-theme="dark"] .calendar-weekday-row,
[data-theme="dark"] .week-day-headings,
[data-theme="dark"] .week-day-headings button,
[data-theme="dark"] .agenda-date,
[data-theme="dark"] .time-axis { color: #91a4c2; }
[data-theme="dark"] .mini-calendar-day.selected,
[data-theme="dark"] .month-day-cell.selected .month-day-number,
[data-theme="dark"] .week-day-headings button.selected strong,
[data-theme="dark"] .calendar-view-switcher button.active { background: #477be5; color: #fff; }
[data-theme="dark"] .mini-calendar-day.has-posted-content:not(.selected) { background: #163723; color: #b7ecc7; box-shadow: inset 0 0 0 1px #35794c; }
[data-theme="dark"] .mini-calendar-day.has-pending-content:not(.selected) { background: #3a1d1b; color: #ffd0ca; box-shadow: inset 0 0 0 1px #9a514b; }
[data-theme="dark"] .mini-calendar-day.has-missed-content:not(.selected) { background: #2b3037; color: #c2cad5; box-shadow: inset 0 0 0 1px #5b6572; }
[data-theme="dark"] .sidebar-section,
[data-theme="dark"] .calendar-command-bar,
[data-theme="dark"] .calendar-weekday-row,
[data-theme="dark"] .week-day-headings,
[data-theme="dark"] .week-all-day-row,
[data-theme="dark"] .week-timeline,
[data-theme="dark"] .calendar-agenda { border-color: var(--line-soft); }
[data-theme="dark"] .calendar-month-grid,
[data-theme="dark"] .month-day-cell,
[data-theme="dark"] .week-day-headings button,
[data-theme="dark"] .week-all-day-cell,
[data-theme="dark"] .week-focus-column,
[data-theme="dark"] .time-axis span { border-color: #253752; }
[data-theme="dark"] .month-day-cell,
[data-theme="dark"] .week-day-headings,
[data-theme="dark"] .week-focus-column { background: #101a2b; }
[data-theme="dark"] .month-day-cell.weekend { background: #0e1727; }
[data-theme="dark"] .month-day-cell.festival-day { background: #211d16; }
[data-theme="dark"] .month-day-cell:hover { background: #162641; }
[data-theme="dark"] .calendar-event,
[data-theme="dark"] .week-event,
[data-theme="dark"] .week-focus-card { border-color: #2d4569; background: #162641; color: #d7e4fb; }
[data-theme="dark"] .calendar-event.festival,
[data-theme="dark"] .week-event.festival,
[data-theme="dark"] .week-focus-card.festival,
[data-theme="dark"] .agenda-event.festival { border-color: #765a2e; background: #282116; color: #f1cf87; }
[data-theme="dark"] .calendar-event:hover,
[data-theme="dark"] .week-event:hover,
[data-theme="dark"] .week-focus-card:hover { border-color: #5b85d5; background: #1d3760; }
[data-theme="dark"] .event-title,
[data-theme="dark"] .week-event-title,
[data-theme="dark"] .week-focus-card > strong,
[data-theme="dark"] .agenda-event h3 { color: #e0eaff; }
[data-theme="dark"] .event-meta,
[data-theme="dark"] .week-focus-card small,
[data-theme="dark"] .agenda-event p { color: #93a8c8; }
[data-theme="dark"] .agenda-event,
[data-theme="dark"] .agenda-event.festival { border-color: #304563; background: #111e32; }
[data-theme="dark"] .agenda-event:hover { border-color: #5b85d5; background: #182d4d; }
[data-theme="dark"] .agenda-event.festival:hover { border-color: #987433; background: #302518; }
[data-theme="dark"] .selected-panel-header,
[data-theme="dark"] .selected-platform-tabs,
[data-theme="dark"] .selected-copy-block,
[data-theme="dark"] .selected-slot-meta { border-color: var(--line-soft); }
[data-theme="dark"] .selected-platform-name span,
[data-theme="dark"] .selected-copy-block p { color: #d2def2; }
[data-theme="dark"] .selected-platform-name small,
[data-theme="dark"] .selected-platform-count,
[data-theme="dark"] .selected-panel-empty p { color: #91a4c2; }
[data-theme="dark"] .selected-slot-meta > span,
[data-theme="dark"] .copy-post-button,
[data-theme="dark"] .selected-open-button { border-color: #304563; background: #152238; color: #bcd0f3; }
[data-theme="dark"] .copy-post-button:hover,
[data-theme="dark"] .selected-open-button:hover { border-color: #5d87dd; background: #1b3560; }
[data-theme="dark"] .calendar-customize-panel { background: #13223a; }
[data-theme="dark"] .calendar-customize-panel h3,
[data-theme="dark"] .calendar-customize-panel p,
[data-theme="dark"] .customize-density { color: #a9b9d1; }
[data-theme="dark"] .density-switch,
[data-theme="dark"] .calendar-preference { border-color: #304563; background: #152238; color: #adbeda; }
[data-theme="dark"] .density-switch button.active { background: #203d6c; color: #bcd2ff; }
[data-theme="dark"] .calendar-preference i { background: #3b5374; }
[data-theme="dark"] .calendar-preference input:checked + i { background: #477be5; }

[data-theme="dark"] .workspace-summary-grid article > span,
[data-theme="dark"] .workspace-summary-grid article > small,
[data-theme="dark"] .workspace-count,
[data-theme="dark"] .workspace-brief-date strong,
[data-theme="dark"] .workspace-guide p,
[data-theme="dark"] .workspace-platform-list span { color: #91a4c2; }
[data-theme="dark"] .workspace-summary-grid article > strong { color: #9fc0ff; }
[data-theme="dark"] .workspace-filter-bar { border-color: var(--line-soft); }
[data-theme="dark"] .workspace-search,
[data-theme="dark"] .workspace-row-action,
[data-theme="dark"] .asset-status,
[data-theme="dark"] .workspace-guide code { border-color: #304563; background: #152238; color: #b9c9e1; }
[data-theme="dark"] .workspace-search input { color: #dce7fb; }
[data-theme="dark"] .workspace-search input::placeholder { color: #7f91b0; }
[data-theme="dark"] .workspace-brief-card,
[data-theme="dark"] .asset-hub-card { border-color: #233550; }
[data-theme="dark"] .workspace-brief-title h3,
[data-theme="dark"] .asset-hub-heading h3,
[data-theme="dark"] .workspace-panel-header h3,
[data-theme="dark"] .workspace-guide h3 { color: #e0eaff; }
[data-theme="dark"] .workspace-brief-main > p,
[data-theme="dark"] .asset-status small { color: #91a4c2; }

[data-theme="dark"] .drawer-backdrop { background: rgba(2, 7, 16, .62); }
[data-theme="dark"] .drawer,
[data-theme="dark"] .notifications-drawer { border-color: #2b3e5e; background: #111b2d; color: #e2ebfb; box-shadow: 0 18px 48px rgba(0, 0, 0, .34) !important; }
[data-theme="dark"] .drawer-header,
[data-theme="dark"] .notifications-panel-header { border-color: #2a3c59; background: #172741; }
[data-theme="dark"] .drawer h2,
[data-theme="dark"] .notifications-panel-header h2 { color: #edf3ff; }
[data-theme="dark"] .notification-item,
[data-theme="dark"] .notification-item.unread,
[data-theme="dark"] .notifications-panel .notification-list { border-color: #273a57; background: #111b2d; }
[data-theme="dark"] .notifications-drawer .skeleton { background: linear-gradient(90deg, #18253a, #22334c, #18253a); }
[data-theme="dark"] .notification-loading-row { border-color: #273a57; }
[data-theme="dark"] .notification-loading-icon,
[data-theme="dark"] .notification-loading-copy i { background: linear-gradient(90deg, #1a2940, #263a57, #1a2940); }
[data-theme="dark"] .notification-list article strong { color: #edf3ff; }
[data-theme="dark"] .notification-list article p,
[data-theme="dark"] .notification-title-row time,
[data-theme="dark"] .notifications-panel-header p { color: #9eacc5; }
[data-theme="dark"] .notification-remove { color: #8ea2c1; }
[data-theme="dark"] .notifications-footer { border-color: #2a3c59; background: #0f192b; }
[data-theme="dark"] .notifications-footer button { border-color: #2f4567; background: #172741; color: #dbe6fa; }
[data-theme="dark"] .notifications-footer button:last-child { background: #132238; }
[data-theme="dark"] .notifications-footer button:hover { border-color: #5a84d7; background: #1c3863; color: #c8d9ff; }
[data-theme="dark"] .notification-link { color: #9fc0ff; }
[data-theme="dark"] .notifications-empty { color: #91a4c2; }
[data-theme="dark"] .notifications-empty strong { color: #e5edfc; }

[data-theme="dark"] .auth-screen { background: var(--bg); }
[data-theme="dark"] .auth-card { border-color: #2b3e5e; background: #111b2d; box-shadow: 0 18px 48px rgba(0, 0, 0, .26); }
[data-theme="dark"] .auth-brand,
[data-theme="dark"] .auth-copy h1 { color: #edf3ff; }
[data-theme="dark"] .auth-copy p,
[data-theme="dark"] .auth-note { color: #9eacc5; }
[data-theme="dark"] .auth-form label { color: #b7c5db; }
[data-theme="dark"] .auth-form input { border-color: #304563; background: #152238; color: #edf3ff; }

@media (max-width: 760px) {
  .sidebar-theme-control { margin: 0; padding-top: 8px; border-top: 0; }
  .theme-toggle { min-height: 34px; }
}

/* Final viewport-fit pass: calendar content should never create a page-level
   horizontal scrollbar. The week view uses flexible columns at every width;
   mobile users can read the same seven-day canvas without sideways scrolling. */
html,
body,
#app-shell,
.shell,
.main,
.view,
.calendar-workspace,
.calendar-stage { min-width: 0; max-width: 100%; }

html,
body { overflow-x: hidden; }

.calendar-stage,
.calendar-month-shell,
.calendar-agenda { overflow-x: hidden; }

.calendar-week-shell {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.week-day-headings,
.week-all-day-row,
.week-timeline { min-width: 720px; width: max(100%, 720px); }

.week-day-headings,
.week-all-day-row { grid-template-columns: 46px repeat(7, minmax(0, 1fr)); }
.week-timeline { grid-template-columns: 46px minmax(0, 1fr); }
.week-focus-grid { min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week-day-headings.weekdays-five,
.week-all-day-row.weekdays-five { grid-template-columns: 46px repeat(5, minmax(0, 1fr)); }
.week-focus-grid.weekdays-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.week-day-headings button,
.week-all-day-cell,
.week-focus-column,
.week-event,
.week-focus-card { min-width: 0; max-width: 100%; }
.week-event,
.week-focus-card { overflow: hidden; }

/* The customize rail collapses before its labels can be clipped. */
.calendar-customize-panel,
.calendar-customize-panel > div,
.customize-controls,
.customize-density,
.density-switch,
.calendar-preference { min-width: 0; max-width: 100%; }
.calendar-customize-panel { overflow: hidden; }
.customize-controls { grid-template-columns: minmax(0, 1.15fr) repeat(3, minmax(0, 1fr)); }
.calendar-preference span { min-width: 0; overflow-wrap: anywhere; }

/* Review notes are deliberately visible without opening a brief. */
.review-note-indicator,
.workspace-review-note {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 2px 5px;
  border: 1px solid #e7c982;
  border-radius: 999px;
  background: #fff8e9;
  color: #a66d18;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}
.review-note-indicator svg,
.workspace-review-note svg { width: 12px; height: 12px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.review-note-indicator.resolved,
.workspace-review-note.resolved { border-color: #dce5f0; background: #f4f7fb; color: #7c8ea7; }
.event-meta { justify-content: space-between; min-width: 0; }
.event-meta > * { min-width: 0; }
.workspace-brief-badges,
.asset-hub-heading-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; min-width: 0; }
.workspace-brief-badges { flex-wrap: wrap; }
.selected-review-note,
.workspace-drawer-note {
  display: grid;
  gap: 6px;
  margin: 0 14px 12px;
  padding: 10px 12px;
  border: 1px solid #e8c87e;
  border-radius: 8px;
  background: #fffaf0;
}
.selected-review-note-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.selected-review-note-header > div { display: flex; min-width: 0; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.review-note-author { color: #8290a5; font-size: 10px; font-weight: 600; }
.review-note-state { flex: 0 0 auto; padding: 3px 7px; border: 1px solid #e7c982; border-radius: 999px; color: #a66d18; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.selected-review-note.resolved .review-note-state { border-color: #dce5f0; color: #7c8ea7; }
.selected-review-note.resolved,
.workspace-drawer-note.resolved { border-color: #dce5f0; background: #f8fafc; }
.selected-review-note p,
.workspace-drawer-note p { margin: 0; color: #526986; font-size: 11px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.workspace-drawer-note { margin: 0; }
.workspace-drawer-note .muted { font-size: 10px; }

.workspace-guide { min-width: 0; overflow: hidden; }
.workspace-guide code,
.workspace-guide-examples { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }

@container (max-width: 1040px) {
  .calendar-customize-panel { grid-template-columns: 1fr; }
  .customize-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (max-width: 620px) {
  .customize-controls { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .week-day-headings,
  .week-all-day-row { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); }
  .week-timeline { grid-template-columns: 34px minmax(0, 1fr); }
  .week-focus-card,
  .week-event { padding-right: 4px; padding-left: 4px; }
  .week-event-title,
  .week-focus-card > strong { font-size: 9px; }
  .time-axis span { font-size: 8px; }
  .calendar-preference { width: 100%; }
  .asset-hub-heading-actions { align-items: flex-start; flex-direction: column; }
}

/* Naming guidance stays legible against the dark workspace. */
[data-theme="dark"] .workspace-guide { border-color: #2b456c; background: #13223a; }
[data-theme="dark"] .workspace-guide .eyebrow { color: #86adff; }
[data-theme="dark"] .workspace-guide code { border-color: #304563; background: #152238; color: #b9c9e1; }
[data-theme="dark"] .review-note-indicator,
[data-theme="dark"] .workspace-review-note { border-color: #765a2e; background: #2c2416; color: #f0c875; }
[data-theme="dark"] .review-note-indicator.resolved,
[data-theme="dark"] .workspace-review-note.resolved { border-color: #334866; background: #17243a; color: #9eacc5; }
[data-theme="dark"] .selected-review-note,
[data-theme="dark"] .workspace-drawer-note { border-color: #765a2e; background: #2c2416; }
[data-theme="dark"] .selected-review-note.resolved,
[data-theme="dark"] .workspace-drawer-note.resolved { border-color: #334866; background: #17243a; }
[data-theme="dark"] .selected-review-note p,
[data-theme="dark"] .workspace-drawer-note p { color: #d0dcf0; }
[data-theme="dark"] .review-note-author { color: #a7b4c8; }
[data-theme="dark"] .review-note-state { border-color: #765a2e; color: #f0c875; }
[data-theme="dark"] .selected-review-note.resolved .review-note-state { border-color: #334866; color: #9eacc5; }

/* App-shell scrolling model. The navigation and header are viewport-locked;
   active workspace content owns the vertical scroll. This keeps Calendar,
   Briefs, and Content Hub from moving the entire page as one loose canvas. */
html,
body,
#app-shell { height: 100%; min-height: 0; }

body { overflow: hidden; }
#app-shell { min-width: 0; }
.shell { height: 100dvh; min-height: 0; }
.sidebar { position: relative; top: auto; height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.main { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 0; overflow: hidden; }
.topbar { position: relative; top: auto; z-index: 10; flex: 0 0 auto; }
.view { min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-gutter: stable; }

/* Calendar gets a three-pane locked frame on larger screens. Only the stage
   (the actual calendar/agenda canvas) moves; its sidebar and inspector stay in
   place while the user reviews a long month or agenda. */
.calendar-workspace { height: 100%; min-height: 0; overflow: hidden; align-items: stretch; }
.calendar-sidebar-panel,
.calendar-selected-panel { position: relative; top: auto; height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.calendar-stage { display: flex; min-height: 0; height: 100%; flex-direction: column; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; }
.calendar-command-bar { position: sticky; top: 0; z-index: 4; flex: 0 0 auto; background: #fff; }
.calendar-customize-panel { flex: 0 0 auto; }
.calendar-month-shell,
.calendar-week-shell,
.calendar-agenda { flex: 0 0 auto; }

/* Month headers and dates must share the available pane width. The old 910px
   floor hid Monday/Tuesday whenever the admin inspector narrowed the stage. */
.calendar-month-shell { width: 100%; min-width: 0; overflow-x: hidden; }
.calendar-month-shell .calendar-weekday-row,
.calendar-month-shell .calendar-month-grid { box-sizing: border-box; width: 100%; min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-month-shell .calendar-weekday-row.weekdays-five,
.calendar-month-shell .calendar-month-grid.weekdays-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* Briefs and Content Hub keep their own content surface scrollable inside the
   workspace viewport while the app shell remains still. */
.workspace-page { min-height: 100%; overflow: visible; }
.workspace-panel { min-width: 0; }

@media (max-width: 1279px) and (min-width: 761px) {
  .calendar-workspace { height: auto; overflow: visible; align-items: start; }
  .calendar-sidebar-panel { height: auto; max-height: calc(100dvh - 150px); }
  .calendar-stage { height: calc(100dvh - 150px); }
  .calendar-selected-panel { height: auto; max-height: calc(100dvh - 150px); }
}

@media (max-width: 760px) {
  .shell { height: 100dvh; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { height: auto; max-height: none; overflow: visible; }
  .calendar-workspace { height: auto; min-height: 0; overflow: visible; }
  .calendar-sidebar-panel,
  .calendar-stage,
  .calendar-selected-panel { height: auto; max-height: none; overflow: visible; }
  .calendar-command-bar { position: relative; top: auto; }
  .workspace-page { min-height: 0; }
}

/* Icon-first platform tokens for briefs and Content Hub. The accessible
   platform name remains available through title/aria-label without adding
   long text into narrow cards. */
.workspace-platform-list .workspace-platform-icon {
  display: grid;
  width: 18px;
  height: 18px;
  min-height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #fff;
}
.workspace-platform-icon svg { width: 13px; height: 13px; fill: currentColor; }
.workspace-platform-icon.instagram { background: linear-gradient(145deg, #7c3aed, #ec4899 52%, #f59e0b); }
.workspace-platform-icon.linkedin { background: #0a66c2; }
.workspace-platform-icon.facebook { background: #1877f2; }
.workspace-platform-icon.x { background: #101828; }

/* True black dark mode. This final layer intentionally overrides the earlier
   navy palette and covers newer Settings/Calendar surfaces that were added
   after the first dark theme pass. */
:root[data-theme="dark"] {
  --bg: #050505;
  --surface: #0d0d0d;
  --surface-soft: #151515;
  --text: #f4f4f4;
  --muted: #a6a6a6;
  --line: #2b2b2b;
  --line-soft: #202020;
  --accent: #6f9cff;
  --accent-soft: #1b2b4b;
  --blue: #79a7ff;
  --black: #f4f4f4;
}

[data-theme="dark"] body,
[data-theme="dark"] .main,
[data-theme="dark"] .view,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .topbar { background: #050505; color: #f4f4f4; }
[data-theme="dark"] .sidebar { border-right-color: #292929; background: #080808; }
[data-theme="dark"] .topbar { border-bottom-color: #252525; background: rgba(5, 5, 5, .96); }
[data-theme="dark"] .brand,
[data-theme="dark"] .nav-separator,
[data-theme="dark"] .session-identity,
[data-theme="dark"] .sidebar-theme-control { border-color: #222; }
[data-theme="dark"] .brand-mark,
[data-theme="dark"] .calendar-sidebar-panel,
[data-theme="dark"] .calendar-stage,
[data-theme="dark"] .calendar-selected-panel,
[data-theme="dark"] .calendar-command-bar,
[data-theme="dark"] .calendar-customize-panel,
[data-theme="dark"] .settings-hero,
[data-theme="dark"] .settings-section,
[data-theme="dark"] .settings-panel,
[data-theme="dark"] .workspace-panel,
[data-theme="dark"] .workspace-summary-grid article { border-color: #2b2b2b; background: #0d0d0d; }

[data-theme="dark"] .calendar-command-bar { background: #0d0d0d; }
[data-theme="dark"] .calendar-client-switcher select,
[data-theme="dark"] .calendar-client-lock,
[data-theme="dark"] .calendar-select,
[data-theme="dark"] .calendar-today,
[data-theme="dark"] .calendar-arrows button,
[data-theme="dark"] .calendar-customize-button,
[data-theme="dark"] .calendar-view-switcher,
[data-theme="dark"] .calendar-view-switcher button,
[data-theme="dark"] .density-switch,
[data-theme="dark"] .calendar-preference,
[data-theme="dark"] .input,
[data-theme="dark"] .select,
[data-theme="dark"] .textarea { border-color: #363636; background: #141414; color: #f1f1f1; }
[data-theme="dark"] .calendar-today:hover,
[data-theme="dark"] .calendar-arrows button:hover,
[data-theme="dark"] .calendar-customize-button:hover { border-color: #5b7fc4; background: #1a1a1a; color: #fff; }
[data-theme="dark"] .calendar-month-title h2,
[data-theme="dark"] .calendar-sidebar-panel strong,
[data-theme="dark"] .mini-calendar-head,
[data-theme="dark"] .settings-hero h2,
[data-theme="dark"] .settings-section-heading h3,
[data-theme="dark"] .settings-panel-heading h3 { color: #f4f4f4; }
[data-theme="dark"] .calendar-customize-panel h3,
[data-theme="dark"] .settings-hero p,
[data-theme="dark"] .settings-section-heading p,
[data-theme="dark"] .calendar-customize-panel p,
[data-theme="dark"] .customize-density,
[data-theme="dark"] .calendar-client-lock span,
[data-theme="dark"] .calendar-source,
[data-theme="dark"] .calendar-sidebar-summary,
[data-theme="dark"] .calendar-role-card p,
[data-theme="dark"] .settings-section-heading p { color: #a5a5a5; }

[data-theme="dark"] .calendar-weekday-row,
[data-theme="dark"] .calendar-month-grid,
[data-theme="dark"] .month-day-cell,
[data-theme="dark"] .week-day-headings,
[data-theme="dark"] .week-day-headings button,
[data-theme="dark"] .week-all-day-row,
[data-theme="dark"] .week-all-day-cell,
[data-theme="dark"] .week-timeline,
[data-theme="dark"] .week-focus-column,
[data-theme="dark"] .time-axis span { border-color: #292929; }
[data-theme="dark"] .month-day-cell,
[data-theme="dark"] .week-day-headings,
[data-theme="dark"] .week-focus-column { background: #0b0b0b; }
[data-theme="dark"] .month-day-cell.weekend { background: #090909; }
[data-theme="dark"] .month-day-cell.festival-day { background: #17130c; }
[data-theme="dark"] .calendar-event,
[data-theme="dark"] .week-event,
[data-theme="dark"] .week-focus-card,
[data-theme="dark"] .agenda-event { border-color: #373737; background: #151515; color: #f0f0f0; }
[data-theme="dark"] .calendar-event.festival,
[data-theme="dark"] .week-event.festival,
[data-theme="dark"] .week-focus-card.festival,
[data-theme="dark"] .agenda-event.festival { border-color: #765a2e; background: #1b160d; color: #f0c875; }
[data-theme="dark"] .calendar-event:hover,
[data-theme="dark"] .week-event:hover,
[data-theme="dark"] .week-focus-card:hover,
[data-theme="dark"] .agenda-event:hover { border-color: #5b7fc4; background: #1d1d1d; }
[data-theme="dark"] .event-title,
[data-theme="dark"] .week-event-title,
[data-theme="dark"] .week-focus-card > strong,
[data-theme="dark"] .agenda-event h3 { color: #f0f0f0; }
[data-theme="dark"] .event-meta,
[data-theme="dark"] .week-focus-card small,
[data-theme="dark"] .agenda-event p,
[data-theme="dark"] .time-axis { color: #a5a5a5; }

.calendar-posted-time {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #6f819a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}
[data-theme="dark"] .calendar-posted-time { color: #aebbd0; }

[data-theme="dark"] .settings-platform-card,
[data-theme="dark"] .workspace-brief-card,
[data-theme="dark"] .asset-hub-card { border-color: #2f2f2f; background: #111; }
[data-theme="dark"] .settings-platform-card:hover { border-color: #4d6795; background: #171717; }
[data-theme="dark"] .settings-platform-card h4,
[data-theme="dark"] .settings-rule strong,
[data-theme="dark"] .settings-toggle-row strong { color: #ededed; }
[data-theme="dark"] .settings-platform-card p,
[data-theme="dark"] .settings-platform-meta,
[data-theme="dark"] .settings-rule span,
[data-theme="dark"] .settings-toggle-row small,
[data-theme="dark"] .settings-count,
[data-theme="dark"] .settings-connection-status { color: #a0a0a0; }
[data-theme="dark"] .settings-platform-card button { border-top-color: #292929; color: #91b4ff; }
[data-theme="dark"] .settings-rule,
[data-theme="dark"] .settings-toggle-row { border-color: #292929; }
[data-theme="dark"] .workspace-platform-list span:not(.workspace-platform-icon) { border-color: #333; background: #181818; color: #aaa; }
[data-theme="dark"] .workspace-brief-main > p,
[data-theme="dark"] .asset-status small,
[data-theme="dark"] .workspace-guide p { color: #a0a0a0; }
[data-theme="dark"] .asset-status,
[data-theme="dark"] .workspace-row-action { border-color: #363636; background: #151515; color: #b9ceff; }
[data-theme="dark"] .workspace-row-action:hover { border-color: #5b7fc4; background: #1c1c1c; }

[data-theme="dark"] .selected-panel-header,
[data-theme="dark"] .selected-platform-tabs,
[data-theme="dark"] .selected-copy-block,
[data-theme="dark"] .selected-slot-meta { border-color: #292929; }
[data-theme="dark"] .selected-platform-switcher > button,
[data-theme="dark"] .selected-platform-tabs button,
[data-theme="dark"] .selected-slot-meta > span,
[data-theme="dark"] .copy-post-button,
[data-theme="dark"] .selected-open-button { border-color: #363636; background: #151515; color: #d8e4ff; }
[data-theme="dark"] .selected-platform-name small,
[data-theme="dark"] .selected-platform-count,
[data-theme="dark"] .selected-panel-empty p,
[data-theme="dark"] .selected-copy-block p { color: #b1b1b1; }
[data-theme="dark"] .selected-copy-label { color: #aebeff; }

[data-theme="dark"] .workspace-guide { border-color: #333; background: #111; }
[data-theme="dark"] .workspace-guide code { border-color: #363636; background: #171717; color: #c4c4c4; }
[data-theme="dark"] .drawer,
[data-theme="dark"] .notifications-drawer { border-color: #333; background: #0e0e0e; box-shadow: 0 18px 48px rgba(0, 0, 0, .55) !important; }
[data-theme="dark"] .drawer-header,
[data-theme="dark"] .notifications-panel-header { border-color: #292929; background: #171717; }
[data-theme="dark"] .notification-item,
[data-theme="dark"] .notification-item.unread,
[data-theme="dark"] .notifications-panel .notification-list { border-color: #292929; background: #0e0e0e; }
[data-theme="dark"] .notifications-drawer .skeleton { background: linear-gradient(90deg, #181818, #292929, #181818); }
[data-theme="dark"] .notification-loading-row { border-color: #292929; }
[data-theme="dark"] .notification-loading-icon,
[data-theme="dark"] .notification-loading-copy i { background: linear-gradient(90deg, #1a1a1a, #2d2d2d, #1a1a1a); }
[data-theme="dark"] .notifications-footer { border-color: #292929; background: #0a0a0a; }

/* Notification controls and urgency colours stay dark-native in the charcoal theme. */
[data-theme="dark"] .notifications-panel-header .icon-button { border-color: #3a3a3a; background: #1a1a1a; color: #d7e2f8; }
[data-theme="dark"] .notifications-panel-header .icon-button:hover { border-color: #587fbd; background: #252f3f; color: #fff; }
[data-theme="dark"] .notification-icon.blue { background: #1d3966; color: #b5ceff; }
[data-theme="dark"] .notification-icon.amber { background: #4b371a; color: #ffd584; }
[data-theme="dark"] .notification-icon.violet { background: #39265b; color: #dfc5ff; }
[data-theme="dark"] .notifications-footer button { border-color: #363636; background: #181818; color: #d8e3f7; }
[data-theme="dark"] .notifications-footer button:last-child { background: #202020; }
[data-theme="dark"] .notifications-footer button:hover { border-color: #517dc2; background: #263652; color: #fff; }
[data-theme="dark"] .notifications-footer button:disabled { border-color: #2a2a2a; background: #131313; color: #777; cursor: not-allowed; }

.production-publication { border-top: 1px solid var(--line); }
.production-publication .action { display: inline-flex; width: fit-content; margin: .35rem 0; }
.warning-callout { margin-top: .75rem; padding: .75rem .9rem; border: 1px solid #d59a22; border-radius: 10px; background: #fff8e8; color: #805b12; font-size: .9rem; }
.success-callout { margin-top: .75rem; padding: .75rem .9rem; border: 1px solid #70bd89; border-radius: 10px; background: #effaf2; color: #205d35; font-size: .9rem; }
[data-theme="dark"] .production-publication { border-color: #292929; }
[data-theme="dark"] .warning-callout { border-color: #806321; background: #211a0c; color: #f0c875; }
[data-theme="dark"] .success-callout { border-color: #34734a; background: #12271a; color: #d7f1df; }

@media (max-width: 760px) {
  .detail-block .filters.detail-actions { grid-template-columns: 1fr; }
  .brief-editor-heading { display: grid; gap: 5px; }
  .brief-editor-hint { max-width: none; text-align: left; }
  .brief-form-grid,
  .brief-assignment-grid { grid-template-columns: 1fr; }
}

/* Final calendar card correction. The renderer intentionally has no accent
   child; the old 3px grid column made every title render inside a 3px rail. */
.calendar-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(2.65em, auto) auto;
  align-content: space-between;
  min-width: 0;
  min-height: 78px;
  margin: 8px 6px 0 0;
  padding: 9px 9px 8px;
  overflow: hidden;
  border: 1px solid #e1e9f4;
  border-radius: 8px;
  background: #f3f7ff;
}
.calendar-event.festival { border-color: #f0dfb9; background: #fff9ed; }
.calendar-event:hover { border-color: #b9cfee; background: #edf4ff; transform: translateY(-1px); }
.calendar-event.festival:hover { border-color: #e4c687; background: #fff5dc; }
.event-title {
  display: -webkit-box;
  min-width: 0;
  min-height: 2.65em;
  overflow: hidden;
  color: #2f4362;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.32;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  margin-top: 8px;
}
.event-platforms { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 4px; }
.event-platforms .platform-icon { width: 16px; height: 16px; border-radius: 4px; }
.review-note-indicator { flex: 0 0 auto; }

/* Keep the reference three-column frame intact wherever the desktop has room;
   below that breakpoint the inspector stacks instead of creating page overflow. */
@media (min-width: 1280px) {
  .calendar-workspace { grid-template-columns: 224px minmax(0, 1fr) 316px !important; gap: 16px; }
  .calendar-sidebar-panel,
  .calendar-stage,
  .calendar-selected-panel { min-width: 0; }
}

[data-theme="dark"] .calendar-event { border-color: #303030; background: #151515; color: #f1f1f1; }
[data-theme="dark"] .calendar-event.festival { border-color: #6e5528; background: #1c170e; }
[data-theme="dark"] .calendar-event:hover { border-color: #5a78ad; background: #1d1d1d; }
[data-theme="dark"] .calendar-event.festival:hover { border-color: #94722f; background: #251c0d; }
[data-theme="dark"] .event-title { color: #f1f1f1; }

.selected-platform-post-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: #356bd8;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-platform-status { color: #7f90a9; font-size: 10px; font-weight: 700; }
[data-theme="dark"] .selected-platform-post-link { color: #9fc0ff; }
[data-theme="dark"] .selected-platform-status { color: #a5a5a5; }

/* Weekly calendar scrolling. A continuous date track owns horizontal overflow;
   the time gutter remains sticky while headers, all-day cells, and timed cards
   stay aligned inside the same native scroll surface. */
.calendar-week-shell {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: auto;
  scrollbar-color: #9bb1d5 transparent;
  scrollbar-gutter: stable;
  user-select: none;
}
.calendar-week-shell:focus-visible { outline: 3px solid #86aef5; outline-offset: -3px; }
.calendar-week-shell > .week-day-headings,
.calendar-week-shell > .week-all-day-row,
.calendar-week-shell > .week-timeline {
  width: var(--week-canvas-width) !important;
  min-width: var(--week-canvas-width) !important;
}
.calendar-week-shell > .week-day-headings,
.calendar-week-shell > .week-all-day-row {
  grid-template-columns: 64px repeat(var(--week-day-count), minmax(150px, 1fr)) !important;
}
.calendar-week-shell > .week-timeline {
  grid-template-columns: 64px minmax(0, 1fr) !important;
  overflow: visible;
}
.calendar-week-shell .week-focus-grid {
  width: calc(var(--week-canvas-width) - 64px) !important;
  min-width: calc(var(--week-canvas-width) - 64px) !important;
  grid-template-columns: repeat(var(--week-day-count), minmax(150px, 1fr)) !important;
}
.calendar-week-shell > .week-day-headings > span:first-child,
.calendar-week-shell > .week-all-day-row > span,
.calendar-week-shell > .week-timeline > .time-axis {
  position: sticky;
  left: 0;
  z-index: 6;
  width: 64px;
  min-width: 64px;
  box-sizing: border-box;
  border-right: 1px solid var(--line-soft);
}
.calendar-week-shell > .week-day-headings > span:first-child { background: #fbfcff; }
.calendar-week-shell > .week-all-day-row > span,
.calendar-week-shell > .week-timeline > .time-axis { background: #fff; }
.calendar-week-shell::-webkit-scrollbar { height: 10px; }
.calendar-week-shell::-webkit-scrollbar-thumb { border-radius: 999px; background: #9bb1d5; }
.calendar-week-shell::-webkit-scrollbar-track { background: transparent; }
[data-theme="dark"] .calendar-week-shell { scrollbar-color: #536b91 transparent; }
[data-theme="dark"] .calendar-week-shell::-webkit-scrollbar-thumb { background: #536b91; }

/* Production month grid: platform posts are compact individual cards, not one
   oversized synthetic card per day. This mirrors the dense calendar reference
   while rendering only real platform records. */
.month-day-cell {
  min-height: 132px;
  max-height: 430px;
  overflow-y: auto;
  padding: 8px;
  container-type: inline-size;
  scrollbar-color: #9bb1d5 transparent;
  scrollbar-width: thin;
}
.month-day-cell::-webkit-scrollbar { width: 6px; }
.month-day-cell::-webkit-scrollbar-thumb { border-radius: 999px; background: #9bb1d5; }
.month-day-cell::-webkit-scrollbar-track { background: transparent; }
.density-compact .month-day-cell { min-height: 104px; }
.month-day-count {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #e2e9f3;
  border-radius: 999px;
  background: #fff;
  color: #61728d;
  font-size: 10px;
  font-weight: 750;
}
.calendar-event-stack {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}
.month-day-cell > .calendar-event-stack + .calendar-event-stack { margin-top: 5px; }
.calendar-post-card {
  display: grid;
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 6px;
  border: 1px solid #edf1f6;
  border-radius: 6px;
  background: #fbfcff;
  color: #34465f;
  cursor: pointer;
  text-align: left;
}
.calendar-post-card:hover { border-color: #bfd0ec; background: #f4f8ff; }
.calendar-event-stack.festival .calendar-post-card { border-color: #f4e8ce; background: #fffdf8; }
.calendar-event-stack.festival .calendar-post-card:hover { border-color: #e6ce9a; background: #fff8e8; }
.calendar-post-card .platform-icon { width: 14px; height: 14px; border-radius: 3px; }
.calendar-post-title {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}
.calendar-post-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-type-icon { display: inline-flex; width: 12px; height: 12px; flex: 0 0 12px; align-items: center; justify-content: center; color: #5677a7; vertical-align: middle; }
.media-type-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.media-type-icon.text { font-size: 10px; font-weight: 900; line-height: 1; }
.selected-platform-name small { display: flex; align-items: center; gap: 5px; }
.selected-platform-name small > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.week-event-title, .week-focus-card strong, .agenda-event h3 { display: flex; align-items: center; gap: 5px; }
.week-event-title > span:last-child, .week-focus-card strong > span:last-child, .agenda-event h3 > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
[data-theme="dark"] .media-type-icon { color: #a9c7ff; }
[data-theme="dark"] .selected-slot-meta .selected-asset-button { border-color: #365b91; background: #132238; color: #a9c7ff; }
.calendar-post-copy { display: grid; min-width: 0; gap: 4px; }
.calendar-post-footer { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: 4px; }
.calendar-post-footer .event-platforms { display: flex !important; width: max-content; min-width: max-content; gap: 2px; flex: 0 0 auto; flex-wrap: nowrap !important; }
.calendar-post-footer .platform-icon { width: 12px; height: 12px; border-radius: 3px; }
.calendar-post-copy .calendar-posted-time { flex: 0 0 auto; color: #7889a2; font-size: 8px; font-weight: 700; line-height: 1; white-space: nowrap; }
.calendar-post-more {
  width: 100%;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: #496a9e;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}
.calendar-event-stack > .review-note-indicator { justify-self: start; margin-top: 1px; }
.calendar-holiday-marker {
  display: block;
  min-width: 0;
  margin: 8px 0 2px;
  overflow: hidden;
  padding: 3px 5px;
  border: 1px solid #f1cf85;
  border-radius: 4px;
  background: #fff7e6;
  color: #8a5b09;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-weekday-row span:nth-child(6),
.calendar-weekday-row span:nth-child(7) { color: #3564d9; font-weight: 800; }
.month-day-cell.weekend { border-top: 2px solid #9ab8f5; background: #f5f9ff; }
.week-day-headings button.weekend { background: #f3f7ff; box-shadow: inset 0 2px 0 #7fa7ef; }
.week-day-headings button em { display: block; margin-top: 2px; overflow: hidden; color: #9a650c; font-size: 8px; font-style: normal; font-weight: 800; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.agenda-holiday { display: grid; gap: 3px; min-width: 0; padding: 14px 18px; border: 1px solid #f1cf85; border-radius: 10px; background: #fff9ed; color: #69450a; }
.agenda-holiday span { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.agenda-holiday strong { font-size: 15px; }
[data-theme="dark"] .month-day-count { border-color: #343434; background: #111; color: #b8b8b8; }
[data-theme="dark"] .calendar-post-card { border-color: #303030; background: #151515; color: #efefef; }
[data-theme="dark"] .calendar-post-card:hover { border-color: #5876a8; background: #1c1c1c; }
[data-theme="dark"] .calendar-event-stack.festival .calendar-post-card { border-color: #66502b; background: #1e180e; }
[data-theme="dark"] .calendar-event-stack.festival .calendar-post-card:hover { border-color: #93712f; background: #281f10; }
[data-theme="dark"] .calendar-post-more { color: #9fc0ff; }
[data-theme="dark"] .calendar-post-copy .calendar-posted-time { color: #aebbd0; }

/* Production state is visible at a glance in every calendar mode. */
.calendar-status-published { border-color: #9bcfad !important; background: #effaf2 !important; color: #205d35 !important; }
.calendar-status-missed { border-color: #c7cdd4 !important; background: #f0f2f4 !important; color: #737b85 !important; filter: saturate(.35); }
.calendar-status-paused { border-color: #b7c0cc !important; background: #eef1f4 !important; color: #66717f !important; filter: saturate(.35); }
.calendar-status-in_review,
.calendar-status-ready_for_review,
.calendar-status-changes_requested { border-color: #e6c36f !important; background: #fff8e5 !important; color: #765313 !important; }
.calendar-status-planned,
.calendar-status-in_production,
.calendar-status-approved,
.calendar-status-scheduled,
.calendar-status-publishing { border-color: #e4aaa9 !important; background: #fff3f2 !important; color: #7a3433 !important; }
.calendar-status-partially_published { border-color: #e1a83a !important; background: #fff6df !important; color: #704b08 !important; }
.calendar-status-failed { border-color: #d66f6f !important; background: #fff0ef !important; color: #7a2828 !important; }
.calendar-status-approved { border-color: #e1a83a !important; background: #fff6df !important; color: #704b08 !important; }
.calendar-status-publishing { border-color: #8ba9e9 !important; background: #eff4ff !important; color: #294f9d !important; }
.calendar-status-scheduled { border-color: #d6a326 !important; background: #fff8e5 !important; color: #765313 !important; }
[data-theme="dark"] .calendar-status-published { border-color: #326d4a !important; background: #10251a !important; color: #d7f1df !important; }
[data-theme="dark"] .calendar-status-missed { border-color: #555d68 !important; background: #252a30 !important; color: #aeb7c2 !important; }
[data-theme="dark"] .calendar-status-paused { border-color: #596574 !important; background: #242a32 !important; color: #c0c9d3 !important; }
[data-theme="dark"] .calendar-status-in_review,
[data-theme="dark"] .calendar-status-ready_for_review,
[data-theme="dark"] .calendar-status-changes_requested { border-color: #806229 !important; background: #2a2110 !important; color: #f4dfae !important; }
[data-theme="dark"] .calendar-status-planned,
[data-theme="dark"] .calendar-status-in_production,
[data-theme="dark"] .calendar-status-approved,
[data-theme="dark"] .calendar-status-scheduled,
[data-theme="dark"] .calendar-status-publishing { border-color: #7c4242 !important; background: #291616 !important; color: #f1d3d3 !important; }
[data-theme="dark"] .calendar-status-partially_published { border-color: #8c6727 !important; background: #29200f !important; color: #f4dfae !important; }
[data-theme="dark"] .calendar-status-failed { border-color: #974848 !important; background: #2b1717 !important; color: #ffdede !important; }
[data-theme="dark"] .calendar-status-approved { border-color: #8c6727 !important; background: #29200f !important; color: #f4dfae !important; }
[data-theme="dark"] .calendar-status-publishing { border-color: #385b98 !important; background: #121e34 !important; color: #d7e4ff !important; }
[data-theme="dark"] .calendar-status-scheduled { border-color: #c99b2e !important; background: #3d351f !important; color: #f4dfae !important; }
/* Client requests track asset readiness independently from review/publication status. */
.client-request-asset-missing { border-color: #dc7777 !important; background: #fff0ef !important; color: #7a2828 !important; }
[data-theme="dark"] .client-request-asset-missing { border-color: #974848 !important; background: #2b1717 !important; color: #ffdede !important; }
[data-theme="dark"] .month-day-cell { scrollbar-color: #4b6183 transparent; }
[data-theme="dark"] .month-day-cell::-webkit-scrollbar-thumb { background: #4b6183; }
[data-theme="dark"] .calendar-holiday-marker { border-color: #7d5b24; background: #251c0c; color: #f5c965; }
[data-theme="dark"] .calendar-weekday-row span:nth-child(6),
[data-theme="dark"] .calendar-weekday-row span:nth-child(7) { color: #8cafee; }
[data-theme="dark"] .month-day-cell.weekend { border-top-color: #456caf; background: #0c1524; }
[data-theme="dark"] .week-day-headings button.weekend { background: #101b2e; box-shadow: inset 0 2px 0 #4a76bc; }
[data-theme="dark"] .week-day-headings button em { color: #ecc466; }
[data-theme="dark"] .agenda-holiday { border-color: #7d5b24; background: #1f180c; color: #f2ce79; }

[data-theme="dark"] .managed-channel,
[data-theme="dark"] .editor-guide-hero,
[data-theme="dark"] .editor-guide-section,
[data-theme="dark"] .editor-guide-steps article { border-color: #2b2b2b; background: #0d0d0d; }
[data-theme="dark"] .managed-channel { background: #111; }
[data-theme="dark"] .managed-channel h4,
[data-theme="dark"] .editor-guide-hero h2,
[data-theme="dark"] .editor-guide-section h3,
[data-theme="dark"] .editor-guide-steps h4 { color: #f2f2f2; }
[data-theme="dark"] .managed-channel p,
[data-theme="dark"] .settings-panel-copy,
[data-theme="dark"] .editor-guide-hero p,
[data-theme="dark"] .editor-guide-copy,
[data-theme="dark"] .editor-guide-steps p,
[data-theme="dark"] .editor-guide-checklist li { color: #b2b2b2; }
[data-theme="dark"] .facebook-connection-details span { border-color: #303030; color: #a5a5a5; }
[data-theme="dark"] .facebook-connection-details strong { color: #efefef; }
[data-theme="dark"] .editor-guide-steps b { background: #182a4c; color: #b9d1ff; }
[data-theme="dark"] .editor-guide-checklist li::before { border-color: #4d77bb; color: #a8c8ff; }

@container (max-width: 130px) {
  .calendar-post-card { gap: 3px; padding: 4px; }
  .calendar-post-card > .calendar-post-thumbnail { flex: 0 0 20px; width: 20px; min-width: 20px; max-width: 20px; height: 20px; min-height: 20px; max-height: 20px; }
  .calendar-post-client { display: none; }
  .calendar-post-footer { flex-wrap: wrap; }
  .calendar-post-card .platform-icon { width: 12px; height: 12px; }
  .calendar-post-title { font-size: 9px; }
}

/* Weekly timeline uses seven evenly spaced two-hour bands from 08:00 through
   20:00. Keep the grid tall enough that those bands remain readable. */
.week-timeline,
.week-focus-grid,
.week-focus-column { min-height: 760px; }
.density-compact .week-timeline,
.density-compact .week-focus-grid,
.density-compact .week-focus-column { min-height: 620px; }
[data-theme="dark"] .calendar-new-button,
[data-theme="dark"] .calendar-new-button:hover {
  color: #fff;
}

/* Final calendar polish: keep the primary request CTA compact and readable
   at every panel width, and keep today's date distinct from the selected date. */
.calendar-new-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px !important;
  padding: 0 14px !important;
  font-size: 14px !important;
  line-height: 1 !important;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
}
.calendar-new-button .calendar-button-plus {
  flex: 0 0 auto;
  margin: 0 !important;
  font-size: 20px !important;
  line-height: 1 !important;
}
.calendar-new-button > span:last-child {
  margin: 0 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  white-space: nowrap;
  line-height: 1 !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-day-request {
  display: block;
  margin: 2px 0 4px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f9ff;
  color: #356bd8;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.month-day-request:hover { background: #eaf0ff; }
.reference-upload-field input[type="file"] {
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.2;
}
.reference-upload-field small {
  display: block;
  margin-top: 6px;
}
.reference-assets-list {
  display: grid;
  gap: 8px;
}
.reference-asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border, #d7e1f0);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.reference-asset-row:hover { border-color: #3561d8; background: var(--surface-soft, #f4f7fc); }
.reference-asset-row > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-asset-row small { color: var(--muted, #70819d); white-space: nowrap; }
.mini-calendar-day.today {
  box-shadow: inset 0 0 0 2px #3561d8;
  font-weight: 800;
}
.mini-calendar-day.today.selected {
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #3561d8;
}
.month-day-cell.today {
  box-shadow: inset 0 0 0 2px #3561d8;
}
.month-day-cell.today.selected {
  box-shadow: inset 0 0 0 3px #3561d8;
}
.week-day-headings button.today strong,
.agenda-row.today .agenda-date strong {
  color: #3561d8;
}
.calendar-event-stack .calendar-post-card.same-day-scheduled,
.week-event.same-day-scheduled,
.week-focus-card.same-day-scheduled,
.agenda-event.same-day-scheduled {
  background: #fff8e5 !important;
  border-color: #d6a326 !important;
}
[data-theme="dark"] .mini-calendar-day.today {
  box-shadow: inset 0 0 0 2px #7ea2ff;
}
[data-theme="dark"] .month-day-cell.today {
  box-shadow: inset 0 0 0 2px #7ea2ff;
}
[data-theme="dark"] .calendar-event-stack .calendar-post-card.same-day-scheduled,
[data-theme="dark"] .week-event.same-day-scheduled,
[data-theme="dark"] .week-focus-card.same-day-scheduled,
[data-theme="dark"] .agenda-event.same-day-scheduled {
  background: #3d351f !important;
  border-color: #c99b2e !important;
}

.calendar-strategy-card > p,
.calendar-strategy-guardrail {
  color: var(--muted, #71819b);
  font-size: 12px;
  line-height: 1.55;
}
.calendar-strategy-card .calendar-strategy-tag {
  color: var(--accent, #3561d8);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.calendar-strategy-card details { margin: 8px 0 12px; }
.calendar-strategy-card summary { cursor: pointer; font-size: 12px; font-weight: 700; }
.calendar-strategy-card details ul { display: grid; gap: 5px; padding-left: 18px; color: var(--muted, #71819b); font-size: 11px; }
.calendar-script-open { width: 100%; justify-content: center; }
.calendar-reel-studio-note { display: block; margin-top: 7px; font-size: 11px; line-height: 1.45; }
.reel-script-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.reel-script-result h4 { margin: 16px 0 6px; }
.reel-script-result ol { display: grid; gap: 8px; padding-left: 22px; }
.reel-script-form { display: grid; gap: 16px; }
.reel-script-form .request-platforms { display: flex; flex-wrap: wrap; gap: 12px; }
.reel-script-form button[disabled] { opacity: .72; cursor: wait; }
[data-theme="dark"] .calendar-strategy-card > p,
[data-theme="dark"] .calendar-strategy-guardrail,
[data-theme="dark"] .calendar-strategy-card details ul { color: #a4b4cc; }

/* Calendar side rails: compact information hierarchy and touch-friendly controls. */
.calendar-strategy-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line, #dce5f4); border-radius: 14px; background: linear-gradient(145deg, var(--surface, #fff), var(--surface-subtle, #f7faff)); }
.calendar-strategy-card .sidebar-section-head { align-items: center; }
.calendar-strategy-card .calendar-strategy-position { margin: 0; font-size: 12px; line-height: 1.6; }
.calendar-strategy-card details { margin: 0; overflow: hidden; border: 1px solid var(--line, #dce5f4); border-radius: 10px; background: var(--surface, #fff); }
.calendar-strategy-card summary { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 9px 11px; color: var(--ink, #263a5b); list-style: none; font-size: 12px; }
.calendar-strategy-card summary::-webkit-details-marker { display: none; }
.calendar-strategy-card summary::after { content: "⌄"; margin-left: auto; color: var(--accent, #3561d8); font-size: 16px; }
.calendar-strategy-card details[open] summary::after { transform: rotate(180deg); }
.calendar-strategy-card summary span { margin-left: 8px; padding: 2px 6px; border-radius: 9px; background: var(--surface-subtle, #f1f5fb); color: var(--muted, #71819b); font-size: 10px; }
.calendar-strategy-content { display: grid; gap: 9px; padding: 0 11px 12px; }
.calendar-pillar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; align-items: center; color: var(--muted, #71819b); font-size: 11px; }
.calendar-pillar span { min-width: 0; }
.calendar-pillar strong { color: var(--ink, #263a5b); font-size: 10px; }
.calendar-pillar i { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 4px; background: var(--line, #dce5f4); }
.calendar-pillar i::before { content: ""; display: block; width: var(--pillar-share); height: 100%; border-radius: inherit; background: var(--accent, #3d74e5); }
.calendar-strategy-card .calendar-strategy-content ul { margin: 0; padding-left: 16px; line-height: 1.5; }
.calendar-strategy-card .calendar-strategy-action { display: grid; gap: 6px; }
.calendar-strategy-card .calendar-script-open { min-height: 42px; padding: 8px; font-size: 11px; font-weight: 700; }
.calendar-strategy-card .calendar-reel-studio-note { margin: 0; line-height: 1.45; }
.selected-platform-count { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--line, #dce5f4); border-radius: 999px; background: var(--surface-subtle, #f1f5fb); color: var(--ink, #263a5b); font-size: 10px; }
.selected-slot-picker { gap: 7px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); scrollbar-width: thin; }
.selected-slot-picker button { flex: 0 0 auto; min-height: 36px; max-width: 165px; padding: 6px 9px; border-radius: 9px; background: var(--surface, #fff); }
.selected-slot-picker .selected-slot-number { display: grid; width: 18px; height: 18px; flex: 0 0 auto; place-items: center; border-radius: 6px; background: var(--surface-subtle, #f1f5fb); color: var(--accent, #3561d8); }
.selected-platform-switcher { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 8px; padding: 14px 16px; }
.selected-platform-switcher > button { width: 36px; height: 36px; border-radius: 9px; }
.selected-platform-name { gap: 9px; }
.selected-platform-name small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.selected-platform-name > div { overflow: hidden; }
.provider-post-preview { display: grid; gap: 12px; }
.provider-post-frame { display: block; width: min(100%, 540px); height: 610px; margin: 0 auto; border: 1px solid var(--line, #dce5f4); border-radius: 12px; background: var(--surface, #fff); }
.provider-preview-note { margin: 0; color: var(--muted, #71819b); font-size: 12px; line-height: 1.5; }
.provider-preview-links { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) { .provider-post-frame { height: 520px; } }

/* Content Hub: one card per required deliverable, with scannable handoff state. */
.content-hub-page { gap: 20px; }
.content-hub-page .workspace-page-header { align-items: center; padding: 4px 0; }
.content-hub-page .workspace-page-header h2 { font-size: clamp(24px, 2.5vw, 32px); }
.content-hub-page .hub-summary-grid article { gap: 7px; min-height: 104px; padding: 18px; border-radius: 14px; box-shadow: 0 5px 18px rgba(25, 58, 100, .035); }
.content-hub-page .hub-summary-grid article > span { color: var(--muted, #71819b); font-size: 11px; }
.content-hub-page .hub-summary-grid article > strong { color: var(--ink, #263a5b); font-size: 27px; line-height: 1; }
.content-hub-page .hub-summary-grid article > small { font-size: 11px; line-height: 1.45; }
.content-hub-page .hub-summary-grid .summary-status { color: #34745c; font-size: 18px; }
.content-hub-page .workspace-panel { padding: 22px; border-radius: 15px; }
.content-hub-page .workspace-panel-header { align-items: center; }
.content-hub-page .workspace-filter-bar { margin-top: 20px; padding-bottom: 14px; }
.content-hub-page .workspace-search { height: 42px; border-radius: 9px; }
.content-hub-page .workspace-search input { font-size: 12px; }
.content-hub-page .workspace-filter-bar .select { height: 42px; min-width: 165px; border-radius: 9px; font-size: 11px; }
.hub-filter-count { margin: 12px 0 4px; color: var(--muted, #71819b); font-size: 11px; }
.content-hub-page .asset-hub-list { gap: 9px; }
.content-hub-page .asset-hub-card { grid-template-columns: 1fr; gap: 10px; padding: 14px 16px; border: 1px solid var(--line, #dce5f4); border-radius: 11px; background: var(--surface, #fff); }
.content-hub-page .asset-hub-card:hover { border-color: #bfd2ef; box-shadow: 0 5px 15px rgba(35, 70, 120, .055); }
.content-hub-page .asset-hub-heading { align-items: center; }
.content-hub-page .asset-hub-heading h3 { margin-top: 5px; color: var(--ink, #263a5b); font-size: 13px; }
.hub-card-date { color: var(--muted, #71819b); font-size: 10px; font-weight: 650; }
.hub-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.content-hub-page .asset-status { display: flex; flex: 1; min-width: 0; gap: 8px; padding: 8px 10px; border-radius: 8px; }
.content-hub-page .asset-status strong { color: var(--ink, #263a5b); font-size: 10px; }
.content-hub-page .asset-status small { min-width: 0; font-size: 10px; }
.content-hub-page .asset-status.ready { background: #f1faf5; border-color: #d6eddd; }
.content-hub-page .asset-status.missing { background: #fffaf0; border-color: #f2e3be; }
.content-hub-page .workspace-row-action { min-height: 34px; padding: 0 11px; border-radius: 8px; }
.hub-show-more { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 42px; margin-top: 14px; border: 1px solid var(--line, #dce5f4); border-radius: 9px; background: var(--surface, #fff); color: var(--accent, #3561d8); cursor: pointer; font-size: 11px; font-weight: 750; }
.hub-show-more[hidden] { display: none; }

/* Publishing History: source-of-truth provider outcomes, not duplicated workflow badges. */
.publishing-history { width: min(100%, 1360px); }
.publishing-history .ops-queue-heading { align-items: center; }
.history-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.history-summary > div { display: grid; gap: 5px; padding: 16px 18px; border: 1px solid var(--line, #dce5f4); border-radius: 13px; background: var(--surface, #fff); }
.history-summary strong { color: var(--ink, #263a5b); font-size: 24px; line-height: 1; }
.history-summary span { color: var(--muted, #71819b); font-size: 11px; }
.history-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.history-toolbar label { display: grid; gap: 5px; min-width: 170px; color: var(--muted, #71819b); font-size: 10px; font-weight: 700; }
.history-toolbar .select { min-height: 39px; border-radius: 8px; background: var(--surface, #fff); }
.history-toolbar .workspace-count { margin-left: auto; font-size: 11px; }
.history-list { display: grid; gap: 10px; }
.history-card { min-width: 0; padding: 17px 19px; border: 1px solid var(--line, #dce5f4); border-radius: 13px; background: var(--surface, #fff); transition: border-color .15s ease, box-shadow .15s ease; }
.history-card:hover { border-color: #c5d7ef; box-shadow: 0 6px 18px rgba(34, 71, 122, .05); }
.history-card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.history-format, .history-result { padding: 4px 8px; border-radius: 999px; background: var(--surface-subtle, #f2f5fa); color: var(--muted, #71819b); font-size: 10px; font-weight: 750; }
.history-result.published { background: #eaf7ee; color: #31744b; }
.history-result.partially_published { background: #fff5dc; color: #986615; }
.history-result.failed { background: #fff0ef; color: #b24640; }
.history-card h3 { margin: 9px 0 5px; color: var(--ink, #263a5b); font-size: 15px; letter-spacing: -.015em; }
.history-card-main p { margin: 0; color: var(--muted, #71819b); font-size: 11px; }
.history-card-footer { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line-soft, #edf2f8); }
.history-channels { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.history-channel { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line, #dce5f4); border-radius: 8px; color: var(--ink, #263a5b); font-size: 10px; }
.history-channel .settings-platform-icon { width: 20px; height: 20px; flex: 0 0 auto; border-radius: 5px; }
.history-channel .settings-platform-icon svg { width: 14px; height: 14px; }
.history-channel strong { font-weight: 750; }
.history-channel.posted strong { color: #31744b; }
.history-channel.failed strong { color: #b24640; }
.history-channel.disconnected strong { color: var(--muted, #71819b); }
.history-channel a { color: var(--accent, #3561d8); font-size: 13px; font-weight: 750; text-decoration: none; }
.history-open { min-height: 34px; flex: 0 0 auto; padding: 0 11px; border: 1px solid var(--line, #dce5f4); border-radius: 8px; background: var(--surface, #fff); color: var(--accent, #3561d8); cursor: pointer; font-size: 11px; font-weight: 750; }
.history-open:hover { background: var(--surface-subtle, #f2f5fa); }
@media (max-width: 760px) {
  .content-hub-page .hub-summary-grid, .history-summary { grid-template-columns: 1fr; }
  .hub-card-bottom, .history-card-footer { align-items: stretch; flex-direction: column; }
  .content-hub-page .workspace-row-action, .history-open { justify-content: center; width: 100%; }
  .history-toolbar label { flex: 1 1 150px; min-width: 0; }
  .history-toolbar .workspace-count { width: 100%; margin-left: 0; }
}
[data-theme="dark"] .content-hub-page .asset-status.ready { background: #13251b; border-color: #31533c; }
[data-theme="dark"] .content-hub-page .asset-status.missing { background: #2a2110; border-color: #574628; }
[data-theme="dark"] .content-hub-page .hub-summary-grid .summary-status, [data-theme="dark"] .history-result.published { color: #8fd5a6; }
[data-theme="dark"] .history-result.published { background: #183020; }
[data-theme="dark"] .history-result.partially_published { background: #322713; color: #f1cd7c; }
[data-theme="dark"] .history-result.failed { background: #361e1e; color: #f4a19b; }

.content-studio-page { display: grid; box-sizing: border-box; width: 100%; min-width: 0; max-width: 1440px; gap: 20px; margin: 0 auto; padding: 22px; overflow-x: clip; }
.content-studio-heading,
.content-studio-form,
.content-studio-capabilities > section,
.content-studio-result-card { border: 1px solid var(--line, #dce5f4); border-radius: 16px; background: var(--surface, #fff); }
.content-studio-page *,
.content-studio-page *::before,
.content-studio-page *::after { box-sizing: border-box; }
.content-studio-heading { padding: 24px 28px; background: linear-gradient(120deg, #f1f5ff, #fff 68%); }
.content-studio-heading h2 { margin: 6px 0; color: var(--ink, #1d2b48); font-size: clamp(22px, 3vw, 30px); }
.content-studio-heading p,
.content-studio-capabilities p { max-width: 780px; color: var(--muted, #71819b); line-height: 1.6; }
.content-studio-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 18px; align-items: start; min-width: 0; }
.content-studio-layout > *,
.content-studio-form > *,
.content-studio-capabilities > * { min-width: 0; }
.content-studio-form { display: grid; gap: 16px; padding: 22px; }
.content-studio-form .brief-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.content-studio-form .detail-field { min-width: 0; }
.content-studio-form .detail-field > span small { display: inline-block; margin-left: 5px; font-size: 10px; line-height: 1.2; letter-spacing: 0; vertical-align: baseline; }
.content-studio-form .input,
.content-studio-form .select,
.content-studio-form .textarea { width: 100%; min-width: 0; max-width: 100%; }
.content-studio-form .request-platforms { display: flex; flex-wrap: wrap; gap: 12px; }
.fresh-angle-button { justify-self: start; margin-top: 8px; }
.content-studio-form .detail-field:has(#content-studio-angle-status) { gap: 8px; }
.content-studio-form .detail-field:has(#content-studio-angle-status) > span:last-child { font-size: 12px; line-height: 1.45; }
.content-studio-targets { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line, #dce5f4); border-radius: 12px; background: color-mix(in srgb, var(--surface, #fff) 88%, var(--line, #dce5f4)); color: var(--muted, #71819b); line-height: 1.5; }
.content-studio-targets strong { color: var(--ink, #1d2b48); }
.content-studio-targets ul { margin: 8px 0 0; }
.content-studio-capabilities { display: grid; gap: 14px; }
.content-studio-capabilities > section { padding: 20px; }
.content-studio-capabilities h3,
.content-studio-result-card h3 { margin: 6px 0 10px; color: var(--ink, #1d2b48); }
.content-studio-capabilities ul,
.content-studio-result-card ol { display: grid; gap: 9px; padding-left: 20px; color: var(--muted, #71819b); line-height: 1.55; }
.content-studio-video-note { background: #f8faff !important; }
.content-studio-result-card { display: grid; gap: 16px; padding: 22px; }
.content-studio-result-card h2 { margin: 5px 0; color: var(--ink, #1d2b48); font-size: 22px; }
.content-studio-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.content-studio-result-grid > section { min-width: 0; }
.content-studio-result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line, #dce5f4); }
.reel-script-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 1200px) {
  .content-studio-layout,
  .content-studio-result-grid { grid-template-columns: 1fr; }
  .content-studio-capabilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .content-studio-page { padding: 12px; }
  .content-studio-heading,
  .content-studio-form,
  .content-studio-capabilities > section,
  .content-studio-result-card { padding: 16px; }
}
@media (max-width: 600px) {
  .content-studio-form .brief-form-grid,
  .content-studio-capabilities { grid-template-columns: minmax(0, 1fr); }
}

/* Keep Content Studio surfaces and heading contrast consistent with the
   application dark theme; the light-mode inline card treatments must not leak
   into a dark workspace. */
[data-theme="dark"] .content-studio-heading {
  border-color: #26364f;
  background: linear-gradient(120deg, #111d31, #101827 68%);
}
[data-theme="dark"] .content-studio-heading h2,
[data-theme="dark"] .content-studio-capabilities h3,
[data-theme="dark"] .content-studio-result-card h2,
[data-theme="dark"] .content-studio-result-card h3 { color: #e8efff; }
[data-theme="dark"] .content-studio-heading p,
[data-theme="dark"] .content-studio-capabilities p,
[data-theme="dark"] .content-studio-capabilities ul,
[data-theme="dark"] .content-studio-result-card ol { color: #aab8cf; }
[data-theme="dark"] .content-studio-form,
[data-theme="dark"] .content-studio-capabilities > section,
[data-theme="dark"] .content-studio-result-card {
  border-color: #26364f;
  background: #0e1728;
}
[data-theme="dark"] .content-studio-video-note { background: #111d31 !important; }
[data-theme="dark"] .content-studio-page .panel-kicker { color: #9bb4dc; }
[data-theme="dark"] .content-studio-targets { border-color: #26364f; background: #111d31; color: #aab8cf; }
[data-theme="dark"] .content-studio-targets strong { color: #e8efff; }
[data-theme="dark"] .content-studio-form .input,
[data-theme="dark"] .content-studio-form .select,
[data-theme="dark"] .content-studio-form .textarea { border-color: #34445d; background: #111827; color: #e8efff; }
[data-theme="dark"] .content-studio-form .input::placeholder,
[data-theme="dark"] .content-studio-form .textarea::placeholder { color: #9aa9bf; }

/* Phase 3 workspace surfaces: operational dashboard, review queues, and brand palette. */
:root {
  --accent: #188bfc;
  --accent-strong: #0d70ed;
  --accent-bright: #3699fd;
  --accent-soft: #e7f2fd;
  --line: #e2eaf3;
  --line-soft: #edf2f8;
  --radius: 14px;
}

.ops-dashboard,
.ops-queue { width: min(100%, 1440px); margin: 0 auto; padding: 10px 4px 30px; }
.ops-welcome,
.ops-queue-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.ops-welcome h2,
.ops-queue-heading h2 { margin: 7px 0 5px; color: var(--text); font-size: clamp(25px, 3vw, 34px); font-weight: 750; letter-spacing: -.045em; }
.ops-welcome p,
.ops-queue-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.ops-welcome-tools { display: flex; align-items: center; gap: 10px; }
.ops-period { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.ops-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ops-kpi { position: relative; display: grid; grid-template-columns: 35px 1fr; grid-template-rows: auto auto auto; align-items: center; gap: 0 10px; min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--text); cursor: pointer; text-align: left; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.ops-kpi:hover { transform: translateY(-2px); border-color: #b8d9fb; box-shadow: 0 8px 22px rgba(13, 112, 237, .08); }
.ops-kpi-icon { display: grid; grid-row: span 2; width: 35px; height: 35px; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-strong); font-size: 17px; font-weight: 750; }
.ops-kpi-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.ops-kpi strong { margin-top: 5px; font-size: 27px; line-height: 1; letter-spacing: -.04em; }
.ops-kpi small { grid-column: 2; margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.ops-kpi-arrow { position: absolute; top: 16px; right: 16px; color: #9badc2; font-size: 15px; }
.ops-kpi.approval .ops-kpi-icon, .ops-kpi.overdue .ops-kpi-icon { background: #fff3dc; color: #a96a00; }
.ops-kpi.production .ops-kpi-icon { background: #f1ecff; color: #7455c7; }
.ops-kpi.scheduled .ops-kpi-icon { background: #eaf4ff; color: #1c76ce; }
.ops-kpi.published .ops-kpi-icon { background: #e8f7ee; color: #27804a; }
.ops-kpi.failed .ops-kpi-icon { background: #fff0ef; color: #c3443e; }
.ops-main-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .8fr); gap: 16px; }
.ops-panel { min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ops-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ops-panel-heading h3 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.025em; }
.ops-dashboard .eyebrow, .ops-queue .eyebrow { color: var(--accent-strong); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.text-action { padding: 7px 0 7px 8px; border: 0; background: transparent; color: var(--accent-strong); font-size: 12px; font-weight: 700; cursor: pointer; }
.ops-post-list, .ops-queue-list { display: grid; }
.ops-post-row { display: grid; grid-template-columns: 48px minmax(140px, 1fr) minmax(125px, auto) auto 18px; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 11px 3px; border: 0; border-top: 1px solid var(--line-soft); background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.ops-post-row:hover { background: #f7fbff; }
.ops-post-thumb { display: grid; width: 44px; height: 44px; overflow: hidden; place-items: center; border-radius: 11px; background: #f0f6fc; color: #6e8baa; }
.ops-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ops-post-thumb video, .calendar-post-thumbnail video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ops-post-thumb.has-video, .calendar-post-thumbnail.has-video { position: relative; }
.ops-post-thumb.has-video::after, .calendar-post-thumbnail.has-video::after { position: absolute; right: 2px; bottom: 2px; display: grid; width: 16px; height: 16px; place-items: center; border-radius: 50%; background: rgba(12, 32, 58, .78); color: #fff; content: "▶"; font-size: 8px; pointer-events: none; }
.ops-post-placeholder { font-size: 19px; }
.ops-post-copy { display: grid; min-width: 0; gap: 4px; }
.ops-post-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ops-post-copy small, .ops-post-date { color: var(--muted); font-size: 11px; }
.ops-post-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-post-date { white-space: nowrap; }
.ops-post-states { display: grid; justify-items: start; gap: 4px; }
.ops-workflow-status { max-width: 142px; overflow: hidden; padding: 4px 7px; border-radius: 999px; background: #f1f5f9; color: #52647a; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.ops-created-date { font-size: 10px !important; }
.ops-row-arrow { color: #9badc2; }
.ops-queue .ops-post-row { grid-template-columns: 52px minmax(140px, 1fr) minmax(130px, auto) auto 18px; padding: 14px 10px; border: 1px solid var(--line-soft); border-radius: 12px; }
.ops-queue-list { gap: 8px; }
.ops-action { display: grid; grid-template-columns: 37px 1fr 16px; align-items: center; gap: 11px; width: 100%; padding: 13px 0; border: 0; border-top: 1px solid var(--line-soft); background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.ops-action:hover strong { color: var(--accent-strong); }
.ops-action-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-strong); font-size: 18px; }
.ops-action > span:nth-child(2) { display: grid; gap: 4px; }
.ops-action strong { font-size: 12px; }
.ops-action small { color: var(--muted); font-size: 11px; }
.ops-action > b { color: #94a5ba; }
.ops-empty { display: grid; min-height: 180px; align-content: center; justify-items: center; padding: 22px; color: var(--muted); text-align: center; }
.ops-empty strong, .ops-empty h3 { margin: 0; color: var(--text); font-size: 15px; }
.ops-empty p { max-width: 390px; margin: 6px 0 0; font-size: 12px; line-height: 1.55; }
.ops-empty-mark { display: grid; width: 40px; height: 40px; margin-bottom: 10px; place-items: center; border-radius: 50%; background: #e8f7ee; color: #27804a; }
.calendar-post-card { display: flex; flex-direction: row; align-items: flex-start; grid-template-columns: none; border-radius: 10px; padding: 6px; overflow: hidden; }
.calendar-post-thumbnail { display: grid; box-sizing: border-box; width: 30px; height: 30px; min-width: 30px; min-height: 30px; justify-self: start; align-self: start; overflow: hidden; place-items: center; border-radius: 7px; background: #edf4fb; color: #6885a1; font-size: 13px; }
.calendar-post-card > .calendar-post-thumbnail { flex: 0 0 30px; max-width: 30px; max-height: 30px; }
.calendar-post-card > .calendar-post-copy { flex: 1 1 0; width: 0; min-width: 0; }
.calendar-post-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.calendar-post-thumbnail.video { background: #e7f2fd; color: var(--accent-strong); }
.calendar-post-thumbnail.empty { color: #8ba0b5; }
.calendar-post-client { overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.calendar-post-title { font-size: 10px; }
.week-event { display: flex; gap: 6px; align-items: flex-start; }
.week-event-content, .week-focus-copy { display: grid; min-width: 0; gap: 3px; }
.week-focus-card { display: flex; gap: 7px; align-items: flex-start; padding: 7px; }
.week-focus-card > .calendar-post-thumbnail { flex: 0 0 30px; }
.week-focus-copy { flex: 1; }
.week-focus-copy > strong { font-size: 10px; }
.status-chip.published { background: #e9f7ee; border-color: #ccebd7; color: #267747; }
.status-chip.partially_published, .status-chip.failed, .status-chip.failed_retryable, .status-chip.failed_permanent { background: #fff0ef; border-color: #ffd5d1; color: #b83f38; }
.status-chip.not_published, .status-chip.scheduled { background: #edf5ff; border-color: #d4e7fc; color: #286eb8; }
.platform-outcome-list { display: grid; gap: 7px; }
.platform-outcome-row { display: grid; grid-template-columns: minmax(88px, .5fr) auto minmax(130px, 1fr); align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 10px; }
.platform-outcome-row strong { font-size: 12px; }
.platform-outcome-row small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.post-media-preview > img,
.post-media-preview > video { display: block; width: min(100%, 720px); max-height: 520px; margin: 14px auto 0; border: 1px solid var(--line); border-radius: 12px; background: #101a29; object-fit: contain; }
.post-media-preview > img { height: auto; }
.post-carousel-previews { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; }
.post-carousel-previews img { flex: 0 0 96px; width: 96px; height: 96px; border: 1px solid var(--line); border-radius: 9px; object-fit: cover; }
.post-carousel-preview-unavailable { display: grid; flex: 0 0 96px; width: 96px; height: 96px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-subtle, #f0f4fa); color: var(--muted); }
.preview-unavailable-message { margin: 12px 0 0; }
.post-caption-list { display: grid; gap: 9px; }
.post-caption-list article { min-width: 0; padding: 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-subtle, #f8faff); }
.post-caption-list article p { margin: 9px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.post-hashtags { color: var(--accent-strong); overflow-wrap: anywhere; }
.revision-history ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.revision-history li { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(90px, .5fr) minmax(130px, 1fr); gap: 10px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 9px; font-size: 11px; }
.revision-history li span, .revision-history li time { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.ops-task-sections { display: grid; gap: 14px; }
.ops-task-section { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ops-task-section .ops-panel-heading { margin-bottom: 10px; }
.ops-task-section .ops-panel-heading h3 { margin: 0; font-size: 14px; }
.ops-task-empty { margin: 0; padding: 8px 2px; font-size: 12px; }

/* My Tasks is a production desk, not a single unbounded stack of cards. */
.ops-task-board { width: min(100%, 1500px); padding: 16px 12px 40px; }
.ops-task-hero { position: relative; overflow: hidden; padding: clamp(20px, 3vw, 30px); border: 1px solid #d9e7f8; border-radius: 22px; background: linear-gradient(125deg, #fff 12%, #f0f6ff 68%, #e9f3ff); box-shadow: 0 15px 35px rgba(31, 75, 127, .055); }
.ops-task-hero::after { position: absolute; top: -85px; right: -60px; width: 320px; height: 260px; border: 1px solid rgba(79, 135, 211, .15); border-radius: 50%; box-shadow: 0 0 0 42px rgba(79, 135, 211, .045), 0 0 0 84px rgba(79, 135, 211, .028); content: ""; pointer-events: none; }
.ops-task-hero-copy { position: relative; z-index: 1; max-width: 640px; }
.ops-task-hero h2 { margin: 8px 0 6px; color: var(--text); font-size: clamp(28px, 3vw, 38px); letter-spacing: -.05em; line-height: 1.1; }
.ops-task-hero p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.ops-task-total { position: absolute; top: 24px; right: 28px; z-index: 1; padding: 8px 11px; border: 1px solid #d3e2f4; border-radius: 999px; background: rgba(255,255,255,.8); color: #58708e; font-size: 11px; font-weight: 750; }
.ops-task-spotlight { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.ops-task-stat { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 3px 10px; min-width: 0; padding: 14px; border: 1px solid #dce7f5; border-radius: 14px; background: rgba(255,255,255,.85); color: var(--text); cursor: pointer; text-align: left; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.ops-task-stat:hover { transform: translateY(-2px); border-color: #9fc5f8; box-shadow: 0 8px 20px rgba(43, 97, 171, .1); }
.ops-task-stat > span { grid-row: span 2; display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; background: #e8f2ff; color: #2864bd; font-size: 17px; }
.ops-task-stat.posted > span { background: #e7f7ec; color: #2f8951; }
.ops-task-stat.overdue > span { background: #fff0e8; color: #ba5b30; }
.ops-task-stat strong { grid-column: 2; font-size: 22px; line-height: 1; }
.ops-task-stat small { grid-column: 2; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.ops-task-stat b { grid-column: 3; grid-row: 1 / 3; color: #91a7c3; font-size: 15px; }
.ops-task-jumps { display: flex; gap: 7px; overflow-x: auto; padding: 16px 0 14px; scrollbar-width: thin; scrollbar-color: #bdcfe5 transparent; }
.ops-task-jumps button { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 11px; font-weight: 700; cursor: pointer; }
.ops-task-jumps button:hover { border-color: #a8caf2; color: var(--accent-strong); }
.ops-task-jumps span { color: var(--muted); font-size: 10px; }
.ops-task-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.ops-task-board .ops-task-section { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 5px 22px rgba(29, 55, 87, .035); scroll-margin-top: 96px; }
.ops-task-section-head { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 76px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.ops-task-section-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: #eaf3ff; color: #2864bd; font-size: 16px; font-weight: 800; }
.ops-task-posted .ops-task-section-icon { background: #e7f7ec; color: #2f8951; }
.ops-task-overdue .ops-task-section-icon, .ops-task-attention .ops-task-section-icon { background: #fff0e8; color: #ba5b30; }
.ops-task-section-head h3 { margin: 0; color: var(--text); font-size: 15px; letter-spacing: -.02em; }
.ops-task-section-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.ops-task-count { display: grid; min-width: 30px; height: 30px; padding: 0 7px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--text); font-size: 11px; font-weight: 750; }
.ops-task-board .ops-task-list { display: block; max-height: min(410px, 55vh); overflow-y: auto; padding: 5px 10px 10px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b9cbe2 transparent; }
.ops-task-board .ops-task-list::-webkit-scrollbar, .ops-task-jumps::-webkit-scrollbar { width: 7px; height: 6px; }
.ops-task-board .ops-task-list::-webkit-scrollbar-thumb, .ops-task-jumps::-webkit-scrollbar-thumb { border-radius: 20px; background: #b9cbe2; }
.ops-task-board .ops-post-row { grid-template-columns: 48px minmax(0, 1fr) auto 17px; gap: 10px; margin-top: 5px; padding: 11px; border: 1px solid transparent; border-radius: 11px; }
.ops-task-board .ops-post-row:hover { border-color: #dce9f7; background: #f7fbff; }
.ops-task-board .ops-post-copy strong { font-size: 12px; }
.ops-task-board .ops-slot-time { color: var(--accent-strong); font-weight: 700; }
.ops-task-board .ops-post-date { display: none; }
.ops-task-board .ops-post-states { justify-items: end; }
.ops-task-board .ops-created-date { white-space: normal; }
.ops-task-empty { display: flex; align-items: center; gap: 10px; min-height: 96px; padding: 18px; color: var(--muted); }
.ops-task-empty > span { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border-radius: 50%; background: #eaf6ee; color: #318752; }
.ops-task-empty p { margin: 0; font-size: 11px; }
[data-theme="dark"] .ops-task-hero { border-color: #2d3e55; background: linear-gradient(125deg, #111d2e 12%, #162943 74%, #19345a); box-shadow: none; }
[data-theme="dark"] .ops-task-hero h2, [data-theme="dark"] .ops-task-section-head h3 { color: #e9f1fb; }
[data-theme="dark"] .ops-task-total, [data-theme="dark"] .ops-task-stat, [data-theme="dark"] .ops-task-jumps button { border-color: #32445b; background: #14243a; color: #e9f1fb; }
[data-theme="dark"] .ops-task-board .ops-task-section { border-color: #2d3b4e; background: #101a29; }
[data-theme="dark"] .ops-task-board .ops-post-row:hover { border-color: #31516f; background: #14243a; }
[data-theme="dark"] .ops-task-section-head { border-color: #28374b; }
.ops-task-stat:focus-visible, .ops-task-jumps button:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 2px; }
.ops-task-filters { display: grid; grid-template-columns: repeat(4, minmax(135px, 1fr)) auto; align-items: end; gap: 10px; margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ops-task-filters[hidden] { display: none; }
.ops-task-filters label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 10px; font-weight: 750; }
.ops-task-filters select { width: 100%; min-width: 0; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: 11px; }
.ops-task-filters button { min-height: 38px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--accent-strong); font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.ops-task-filters button:hover { border-color: #a8caf2; background: #f7fbff; }
[data-theme="dark"] .ops-task-filters { border-color: #2d3b4e; background: #101a29; }
[data-theme="dark"] .ops-task-filters select, [data-theme="dark"] .ops-task-filters button { border-color: #32445b; background: #14243a; color: #e9f1fb; }
@media (max-width: 1000px) { .ops-task-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .ops-task-board { padding: 8px 0 24px; }
  .ops-task-hero { padding: 18px; border-radius: 15px; }
  .ops-task-total { position: static; display: inline-block; margin-top: 12px; }
  .ops-task-spotlight { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 17px; }
  .ops-task-stat { padding: 10px; }
  .ops-task-board .ops-task-list { max-height: 340px; }
  .ops-task-board .ops-post-row { grid-template-columns: 42px minmax(0, 1fr) 16px; }
  .ops-task-board .ops-post-states { display: none; }
  .ops-task-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

[data-theme="dark"] .ops-kpi,
[data-theme="dark"] .ops-panel,
[data-theme="dark"] .ops-period { border-color: #2d3b4e; background: #101a29; color: #e9f1fb; }
[data-theme="dark"] .ops-welcome h2,
[data-theme="dark"] .ops-queue-heading h2,
[data-theme="dark"] .ops-panel-heading h3,
[data-theme="dark"] .ops-empty strong,
[data-theme="dark"] .ops-empty h3 { color: #e9f1fb; }
[data-theme="dark"] .ops-post-row { border-color: #28374b; color: #e1eaf6; }
[data-theme="dark"] .ops-post-row:hover { background: #14243a; }
[data-theme="dark"] .ops-post-thumb,
[data-theme="dark"] .calendar-post-thumbnail { background: #1b2c41; color: #b9d8f6; }
[data-theme="dark"] .ops-action { border-color: #28374b; color: #e1eaf6; }
[data-theme="dark"] .ops-action-icon { background: #183353; color: #80bdff; }
[data-theme="dark"] .ops-workflow-status { background: #1b2b3f; color: #c5d2e2; }
[data-theme="dark"] .platform-outcome-row,
[data-theme="dark"] .revision-history li,
[data-theme="dark"] .ops-task-section { border-color: #2d3b4e; background: #101a29; }
[data-theme="dark"] .post-caption-list article { border-color: #2d3b4e; background: #101a29; }
.ops-kpi:focus-visible,
.ops-post-row:focus-visible,
.ops-action:focus-visible,
.text-action:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 3px; }

@media (max-width: 1120px) {
  .ops-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-main-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr); }
}
@media (max-width: 760px) {
  .ops-dashboard, .ops-queue { padding: 4px 0 20px; }
  .ops-welcome, .ops-queue-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .ops-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ops-kpi { padding: 12px; grid-template-columns: 30px 1fr; column-gap: 8px; }
  .ops-kpi-icon { width: 30px; height: 30px; }
  .ops-kpi strong { font-size: 23px; }
  .ops-kpi small { font-size: 10px; }
  .ops-main-grid { grid-template-columns: 1fr; }
  .ops-panel { padding: 14px; }
  .ops-post-row, .ops-queue .ops-post-row { grid-template-columns: 42px minmax(0, 1fr) 16px; gap: 9px; padding: 10px 3px; }
  .ops-post-thumb { width: 40px; height: 40px; }
  .ops-post-date, .ops-post-row .status-chip { display: none; }
  .ops-post-states { display: none; }
  .ops-post-copy strong { white-space: normal; }
  .platform-outcome-row { grid-template-columns: minmax(75px, .65fr) auto; }
  .platform-outcome-row small { grid-column: 1 / -1; white-space: normal; overflow-wrap: anywhere; }
  .revision-history li { grid-template-columns: 1fr; gap: 4px; }
  .post-media-preview > img,
  .post-media-preview > video { max-height: 360px; }
  .calendar-post-card { grid-template-columns: none; }
  .calendar-post-thumbnail { width: 24px; height: 24px; min-width: 24px; min-height: 24px; }
  .calendar-post-card > .calendar-post-thumbnail { flex-basis: 24px; max-width: 24px; max-height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .ops-kpi, .ops-post-row, .ops-action { transition: none; }
}

.nav-button[data-view="Create & Post Immediately"] .nav-label { font-size: 11px; line-height: 1.25; white-space: normal; }
.urgent-post-page { display: grid; gap: 18px; width: min(100%, 1280px); min-width: 0; margin: 0 auto; padding: 22px; }
.urgent-post-heading,
.urgent-post-form,
.urgent-post-aside > section,
.urgent-result-card { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.urgent-post-heading { padding: 24px 28px; background: linear-gradient(125deg, var(--accent-soft), var(--surface) 72%); }
.urgent-post-heading h2 { margin: 6px 0 8px; font-size: clamp(22px, 3vw, 30px); }
.urgent-post-heading p { max-width: 820px; margin: 0; color: var(--muted); line-height: 1.55; }
.urgent-post-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(270px, .7fr); align-items: start; gap: 18px; min-width: 0; }
.urgent-post-form { display: grid; gap: 16px; padding: 22px; }
.urgent-post-form > *, .urgent-post-layout > * { min-width: 0; }
.urgent-post-form .brief-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.urgent-post-form .urgent-schedule-fields[hidden] { display: none; }
.urgent-fixed-client { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--text); font-weight: 700; }
.urgent-publish-mode { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.urgent-post-form .input, .urgent-post-form .select, .urgent-post-form .textarea { width: 100%; min-width: 0; max-width: 100%; }
.urgent-post-form .detail-field small { display: block; margin-top: 6px; font-size: 11px; }
.urgent-post-channels { display: flex; gap: 18px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.urgent-post-channels legend { padding: 0 5px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.urgent-post-channels label, .urgent-post-confirm { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; }
.urgent-post-channels input, .urgent-post-confirm input { flex: none; margin-top: 2px; }
.urgent-post-confirm { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.urgent-post-form button[type="submit"] { justify-self: start; }
.urgent-file-list { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.urgent-post-aside { display: grid; gap: 14px; }
.urgent-post-aside > section { padding: 20px; }
.urgent-post-aside h3, .urgent-result-card h3 { margin: 6px 0 14px; }
.urgent-post-aside ol { display: grid; gap: 10px; padding-left: 18px; line-height: 1.5; }
.urgent-channel-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.urgent-channel-row .connected { color: #248450; font-weight: 700; }
.urgent-channel-row .unavailable { color: #ad5538; font-weight: 700; text-align: right; }
.urgent-result-card { padding: 22px; }
.urgent-result-card ul { display: grid; gap: 8px; padding: 0; list-style: none; }
.urgent-result-card li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.urgent-result-card a { color: var(--accent); }
[data-theme="dark"] .urgent-post-heading { background: linear-gradient(125deg, #18365d, var(--surface) 72%); }
[data-theme="dark"] .urgent-channel-row .connected { color: #82d6a7; }
[data-theme="dark"] .urgent-channel-row .unavailable { color: #ffad90; }
@media (max-width: 880px) {
  .urgent-post-layout { grid-template-columns: 1fr; }
  .urgent-post-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .urgent-post-page { padding: 12px; }
  .urgent-post-heading, .urgent-post-form, .urgent-post-aside > section, .urgent-result-card { padding: 16px; }
  .urgent-post-form .brief-form-grid, .urgent-post-aside { grid-template-columns: 1fr; }
}

/* Keep the month readable inside the three-pane admin layout, including at
   enlarged browser zoom. Every day stays visible and thumbnails remain icons,
   not full-width media blocks that squeeze the title and platform badges. */
.calendar-month-shell .calendar-weekday-row,
.calendar-month-shell .calendar-month-grid {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
.calendar-month-shell .calendar-post-card { min-width: 0; max-width: 100%; }
.calendar-month-shell .calendar-post-card > .calendar-post-thumbnail {
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
}
.calendar-month-shell .calendar-post-card > .calendar-post-copy { min-width: 0; overflow: hidden; }
.calendar-month-shell .calendar-post-footer { overflow: hidden; }
@container (max-width: 130px) {
  .calendar-month-shell .calendar-post-card > .calendar-post-thumbnail {
    flex-basis: 20px;
    width: 20px;
    min-width: 20px;
    max-width: 20px;
    height: 20px;
    min-height: 20px;
    max-height: 20px;
  }
}

/* Immediate-post form: balanced controls, clear account state and an AI draft
   surface without making generated copy look approved or auto-published. */
.urgent-post-page { width: min(100%, 1340px); }
.urgent-post-layout { grid-template-columns: minmax(0, 1.6fr) minmax(260px, .8fr); }
.urgent-post-form { gap: 20px; }
.urgent-post-form .detail-field { min-width: 0; }
.urgent-post-form .detail-field > span { display: block; margin-bottom: 8px; }
.urgent-post-form select.select {
  appearance: none;
  min-height: 48px;
  padding: 0 44px 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a7d99' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  color: var(--text);
  cursor: pointer;
}
.urgent-post-form select.select:focus-visible,
.urgent-post-form .input:focus-visible,
.urgent-post-form .textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.urgent-post-form .textarea { resize: vertical; min-height: 104px; line-height: 1.55; }
.urgent-ai-panel { display: grid; gap: 12px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.urgent-ai-heading, .urgent-aside-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.urgent-ai-heading h3 { margin: 4px 0; font-size: 17px; }
.urgent-ai-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.urgent-ai-heading .action { flex: 0 0 auto; white-space: nowrap; }
.urgent-ai-panel .detail-field > span { margin-bottom: 7px; }
.urgent-ai-review { padding: 12px 14px; border: 1px solid #c9dcf5; border-radius: 10px; background: var(--surface); color: var(--text); font-size: 12px; line-height: 1.5; }
.urgent-ai-review[hidden] { display: none; }
.urgent-ai-review p { margin: 6px 0 0; overflow-wrap: anywhere; }
.urgent-post-form .urgent-file-input { padding: 9px; min-height: 48px; }
.urgent-file-input::file-selector-button { margin-right: 12px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--text); font: inherit; cursor: pointer; }
.urgent-aside-heading h3 { margin: 5px 0 0; }
.urgent-refresh-connections { border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 11px; font-weight: 750; white-space: nowrap; }
.urgent-channel-row { align-items: center; }
.urgent-channel-row > span:first-child { display: grid; gap: 4px; min-width: 0; }
.urgent-channel-row small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.urgent-connection-badge { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: 11px; }
.urgent-connection-badge.connected { background: #e9f7ee; }
.urgent-connection-badge.unavailable { background: #fff0e8; }
.urgent-channel-error { padding: 12px; border: 1px solid #f0d3a4; border-radius: 9px; color: #805610; font-size: 12px; }
[data-theme="dark"] .urgent-connection-badge.connected { background: #133321; }
[data-theme="dark"] .urgent-connection-badge.unavailable { background: #3a241b; }
[data-theme="dark"] .urgent-channel-error { border-color: #735429; color: #f4d49a; }
@media (max-width: 1000px) { .urgent-post-layout { grid-template-columns: 1fr; } .urgent-post-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .urgent-post-form .brief-form-grid, .urgent-post-aside { grid-template-columns: 1fr; } .urgent-ai-heading { flex-direction: column; } }

/* Dense month cards never reserve a media square for an unproduced plan. */
.calendar-month-shell .month-day-cell { min-width: 0; max-height: 350px; padding: 7px; }
.calendar-month-shell .calendar-event-stack { margin-top: 5px; }
.calendar-month-shell .calendar-post-card { align-items: center; min-height: 40px; gap: 5px; padding: 5px 6px; border-radius: 8px; }
.calendar-month-shell .calendar-post-card.no-creative { min-height: 40px; }
.calendar-month-shell .calendar-post-card > .calendar-post-copy { flex: 1 1 auto; width: auto; }
.calendar-month-shell .calendar-post-client { display: block; max-width: 100%; }
.calendar-month-shell .calendar-post-footer { gap: 5px; min-width: 0; }
.calendar-month-shell .calendar-posted-time { flex: 0 0 auto; white-space: nowrap; }
.settings-connection-notice {
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 1px solid #c8d9f5;
  border-radius: 12px;
  background: #eff5ff;
  color: #254577;
  line-height: 1.5;
}

.drawer:has(.slot-load-error) {
  align-self: flex-start;
  width: min(440px, calc(100% - 32px));
  height: auto;
  max-height: calc(100dvh - 32px);
  margin: 16px;
  border-radius: 16px;
}

.slot-load-error {
  display: grid;
  gap: 14px;
  line-height: 1.5;
}

.slot-load-error p { margin: 0; }
