/* Afterhrs Radar v2.12 — restore the September creator dashboard visual language
   while retaining the current creator workflow, accessibility, and responsive UI. */

body.creator-mode {
  --creator-canvas: #030405;
  --creator-sidebar: #070a0e;
  --creator-surface: #0b0e13;
  --creator-surface-raised: #101722;
  --creator-surface-active: #10243a;
  --creator-line: #202a36;
  --creator-line-strong: #33485e;
  --creator-text: #f5f7fb;
  --creator-muted: #b8c1ce;
  --creator-subtle: #8491a2;
  --creator-accent: #00aff0;
  --creator-accent-strong: #58c9f6;
  --creator-good: #58d4a8;
  --creator-warn: #f2c66d;
  overflow-x: hidden;
  background: var(--creator-canvas) !important;
  color: var(--creator-text) !important;
}

/* Later shared navigation rules must never reveal owner-only controls. */
body.creator-mode .admin-only {
  display: none !important;
}

html[data-text-size="readable"] body.creator-mode {
  --creator-body: 18px;
  --creator-support: 16px;
  --creator-control: 17px;
  --creator-h1: clamp(30px, 2.6vw, 40px);
  --creator-h2: clamp(27px, 2.2vw, 34px);
  --creator-h3: clamp(23px, 1.8vw, 29px);
}

html[data-text-size="larger"] body.creator-mode {
  --creator-body: 21px;
  --creator-support: 18px;
  --creator-control: 19px;
  --creator-h1: clamp(35px, 3vw, 46px);
  --creator-h2: clamp(31px, 2.6vw, 39px);
  --creator-h3: clamp(27px, 2.2vw, 34px);
}

html[data-text-size="largest"] body.creator-mode {
  --creator-body: 24px;
  --creator-support: 20px;
  --creator-control: 21px;
  --creator-h1: clamp(40px, 3.5vw, 52px);
  --creator-h2: clamp(35px, 3vw, 44px);
  --creator-h3: clamp(30px, 2.5vw, 39px);
}

body.creator-mode,
body.creator-mode p,
body.creator-mode li,
body.creator-mode dd {
  font-size: var(--creator-body) !important;
  line-height: 1.55 !important;
}

body.creator-mode :is(small, label, legend, .eyebrow, .nav-section-label, .header-date, .week-date-range, .weekly-pad-access) {
  font-size: var(--creator-support) !important;
  line-height: 1.45 !important;
}

body.creator-mode :is(button, input, select, textarea, summary, [role="button"]) {
  font-size: var(--creator-control) !important;
  line-height: 1.35 !important;
}

body.creator-mode h1 { font-size: var(--creator-h1) !important; line-height: 1.12 !important; }
body.creator-mode h2 { font-size: var(--creator-h2) !important; line-height: 1.16 !important; }
body.creator-mode h3 { font-size: var(--creator-h3) !important; line-height: 1.2 !important; }

/* Restore natural reading alignment for creator surfaces. */
html[data-text-size] body.creator-mode :is(h1, h2, h3, h4, h5, h6, p, label, legend, dt, dd, input, select, textarea) {
  text-align: left !important;
}

html[data-text-size] body.creator-mode :is(.panel, .section-heading, .panel-head, .weekly-pad-heading, .support-head, .support-form, .support-request-card, .support-section-title) {
  text-align: left !important;
}

html[data-text-size] body.creator-mode :is(button, [role="button"], summary) {
  justify-content: center !important;
  text-align: center !important;
}

body.creator-mode .shell {
  background: var(--creator-canvas) !important;
}

body.creator-mode main {
  width: 100%;
  max-width: none !important;
  padding: 0 clamp(24px, 3vw, 46px) calc(72px + env(safe-area-inset-bottom)) !important;
  background: var(--creator-canvas) !important;
}

body.creator-mode main > header {
  min-height: 104px !important;
  height: auto !important;
  padding-block: 20px !important;
  border-bottom: 1px solid var(--creator-line) !important;
  background: var(--creator-canvas) !important;
}

body.creator-mode main > header .page-heading,
body.creator-mode main > header .page-heading :is(h1, .eyebrow, small) {
  text-align: left !important;
}

body.creator-mode main > header .page-heading {
  min-width: 0;
}

body.creator-mode main > header .eyebrow,
body.creator-mode .eyebrow {
  color: #75a8f2 !important;
  letter-spacing: .1em !important;
}

body.creator-mode main > header h1 {
  margin-top: 4px !important;
  color: var(--creator-text) !important;
}

body.creator-mode main > header .header-date {
  display: block;
  margin-top: 5px;
  color: var(--creator-muted) !important;
}

/* The historical creator sidebar was quiet, compact, and blue-accented. */
@media (min-width: 951px) {
  body.creator-mode .shell {
    grid-template-columns: 248px minmax(0, 1fr) !important;
  }

  body.creator-mode .sidebar {
    width: 248px !important;
  }

  html[data-text-size="largest"] body.creator-mode .shell {
    grid-template-columns: 280px minmax(0, 1fr) !important;
  }

  html[data-text-size="largest"] body.creator-mode .sidebar {
    width: 280px !important;
  }
}

body.creator-mode .sidebar {
  border-right: 1px solid var(--creator-line) !important;
  background: var(--creator-sidebar) !important;
  box-shadow: none !important;
}

body.creator-mode .sidebar nav {
  gap: 4px !important;
  margin-top: 22px !important;
}

body.creator-mode .sidebar .nav-section-label {
  margin: 15px 10px 6px !important;
  color: var(--creator-subtle) !important;
  text-align: left !important;
}

html[data-text-size] body.creator-mode .sidebar .nav-item {
  justify-content: flex-start !important;
  min-height: 48px !important;
  padding: 10px 12px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--creator-muted) !important;
  text-align: left !important;
  box-shadow: none !important;
}

body.creator-mode .sidebar .nav-item:hover,
body.creator-mode .sidebar .nav-item:focus-visible {
  border-color: var(--creator-line) !important;
  background: var(--creator-surface) !important;
  color: var(--creator-text) !important;
  transform: none !important;
}

body.creator-mode .sidebar .nav-item.active {
  border-color: #1f4260 !important;
  background: var(--creator-surface-active) !important;
  color: var(--creator-text) !important;
  box-shadow: inset 3px 0 0 var(--creator-accent) !important;
}

body.creator-mode .sidebar .nav-item > span {
  color: var(--creator-accent-strong) !important;
}

body.creator-mode .sidebar :is(.sidebar-promo-card, .user-chip) {
  border: 1px solid var(--creator-line) !important;
  border-radius: 9px !important;
  background: var(--creator-surface) !important;
  box-shadow: none !important;
}

body.creator-mode .sidebar .sidebar-promo-card,
body.creator-mode .sidebar .sidebar-promo-card :is(span, strong) {
  text-align: left !important;
}

body.creator-mode .sidebar .sidebar-promo-card button,
body.creator-mode .sidebar .sidebar-logout {
  min-height: 46px !important;
  border: 1px solid var(--creator-line-strong) !important;
  border-radius: 8px !important;
  background: var(--creator-surface-raised) !important;
  color: var(--creator-text) !important;
  box-shadow: none !important;
}

body.creator-mode .sidebar .user-chip {
  align-items: center !important;
}

body.creator-mode .sidebar .user-chip > span:nth-child(2),
body.creator-mode .sidebar .user-chip :is(strong, small) {
  min-width: 0;
  text-align: left !important;
}

body.creator-mode .sidebar .user-chip :is(strong, small) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Current functionality, presented with the historical card language. */
body.creator-mode #schedule-view,
body.creator-mode #todo-view,
body.creator-mode #resources-view,
body.creator-mode #share-view,
body.creator-mode #support-view {
  width: 100%;
  max-width: 1060px;
  margin-inline: auto;
}

body.creator-mode #schedule-view > .weekly-plan-heading {
  align-items: end !important;
  gap: 18px !important;
  margin: 28px 0 18px !important;
}

body.creator-mode #schedule-view > .weekly-plan-heading,
body.creator-mode #schedule-view > .weekly-plan-heading > div,
body.creator-mode #schedule-view > .weekly-plan-heading :is(h3, p, strong, span) {
  text-align: left !important;
}

body.creator-mode .week-navigation {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}

body.creator-mode :is(.primary, button.primary) {
  border-color: #0ea9e4 !important;
  background: #00a5e4 !important;
  color: #00141e !important;
  box-shadow: none !important;
}

body.creator-mode :is(.primary, button.primary):hover {
  border-color: #59cff7 !important;
  background: #37baf0 !important;
}

body.creator-mode :is(.secondary, button.secondary, .week-navigation button) {
  border: 1px solid var(--creator-line-strong) !important;
  background: var(--creator-surface-raised) !important;
  color: var(--creator-text) !important;
  box-shadow: none !important;
}

body.creator-mode :is(.secondary, button.secondary, .week-navigation button):hover {
  border-color: var(--creator-accent) !important;
  background: var(--creator-surface-active) !important;
}

body.creator-mode :is(#weekly-schedule-notepad, .creator-approved-resources, .creator-promo-link, .support-form, .support-request-card, .notification-opt-in) {
  border: 1px solid var(--creator-line) !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, var(--creator-surface-raised), var(--creator-surface)) !important;
  color: var(--creator-text) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22) !important;
}

body.creator-mode #weekly-schedule-notepad {
  margin: 0 !important;
}

body.creator-mode #weekly-schedule-notepad > .weekly-pad-heading {
  justify-content: flex-end !important;
  padding: 14px 18px 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body.creator-mode .weekly-pad-access {
  padding: 6px 10px !important;
  border: 1px solid #2a5878 !important;
  border-radius: 999px !important;
  background: #0d2537 !important;
  color: #91d7f6 !important;
}

body.creator-mode .weekly-pad-reader {
  min-height: 0 !important;
  padding: 24px clamp(20px, 3vw, 34px) 30px !important;
  color: var(--creator-text) !important;
  font-size: var(--creator-body) !important;
  line-height: 1.7 !important;
  text-align: left !important;
  overflow-wrap: anywhere;
}

body.creator-mode .weekly-pad-reader a {
  color: var(--creator-accent-strong) !important;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

body.creator-mode .weekly-plan-link button,
body.creator-mode .weekly-pad-empty-actions button,
body.creator-mode .resource-error-state button {
  border: 1px solid #2a5878 !important;
  background: #0d2537 !important;
  color: #dff5ff !important;
}

body.creator-mode .weekly-pad-empty,
body.creator-mode .weekly-pad-empty :is(b, span) {
  text-align: left !important;
}

body.creator-mode .creator-approved-resources,
body.creator-mode .creator-promo-link {
  margin: 18px 0 !important;
  padding: clamp(20px, 3vw, 28px) !important;
}

body.creator-mode .creator-approved-resources > .weekly-pad-heading,
body.creator-mode .creator-approved-resources > .weekly-pad-heading > div,
body.creator-mode .creator-approved-resources > .weekly-pad-heading :is(h3, p),
body.creator-mode .creator-promo-link > div,
body.creator-mode .creator-promo-link :is(h3, p) {
  text-align: left !important;
}

body.creator-mode .creator-work-item {
  padding: 18px !important;
  border: 1px solid var(--creator-line) !important;
  border-left: 4px solid #65758a !important;
  border-radius: 10px !important;
  background: #090d12 !important;
  color: var(--creator-text) !important;
}

body.creator-mode .creator-work-item.status-submitted { border-left-color: var(--creator-accent) !important; }
body.creator-mode .creator-work-item.status-posted,
body.creator-mode .creator-work-item.status-completed { border-left-color: var(--creator-good) !important; }

body.creator-mode .creator-work-item,
body.creator-mode .creator-work-item :is(header, span, b, em, p, label, small) {
  text-align: left !important;
}

body.creator-mode .creator-work-item header em {
  color: var(--creator-warn) !important;
}

body.creator-mode .creator-work-item form button {
  border-color: #0ea9e4 !important;
  background: #00a5e4 !important;
  color: #00141e !important;
}

body.creator-mode .creator-resource-row {
  border-bottom-color: var(--creator-line) !important;
}

body.creator-mode .creator-resource-row > span,
body.creator-mode .creator-resource-row :is(b, small, em) {
  text-align: left !important;
}

body.creator-mode .creator-resource-row small,
body.creator-mode #creator-share-link-feedback,
body.creator-mode .support-form p,
body.creator-mode .support-request-card p {
  color: var(--creator-muted) !important;
}

body.creator-mode .creator-resource-row em { color: var(--creator-subtle) !important; }

body.creator-mode .creator-resource-row :is(a, button) {
  border: 1px solid var(--creator-line-strong) !important;
  border-radius: 8px !important;
  background: var(--creator-surface-raised) !important;
  color: var(--creator-text) !important;
  box-shadow: none !important;
}

body.creator-mode :is(input, select, textarea) {
  min-width: 0;
  border-color: var(--creator-line-strong) !important;
  background: #080c11 !important;
  color: var(--creator-text) !important;
  caret-color: var(--creator-accent);
}

body.creator-mode :is(input, select, textarea)::placeholder {
  color: #7f8c9c !important;
}

body.creator-mode :is(input, select, textarea):focus {
  border-color: var(--creator-accent) !important;
  box-shadow: 0 0 0 3px rgba(0, 175, 240, .18) !important;
}

body.creator-mode .support-head,
body.creator-mode .support-head > div,
body.creator-mode .support-head :is(h2, p),
body.creator-mode .support-form > div,
body.creator-mode .support-form :is(h3, p, label, span, b, small),
body.creator-mode .support-section-title,
body.creator-mode .support-section-title :is(h3, p) {
  text-align: left !important;
}

body.creator-mode .support-type-grid label {
  align-items: flex-start !important;
  border-color: var(--creator-line) !important;
  background: #090d12 !important;
}

body.creator-mode .support-type-grid label:has(input:checked) {
  border-color: var(--creator-accent) !important;
  background: var(--creator-surface-active) !important;
}

body.creator-mode .support-thread-message {
  border-color: var(--creator-line) !important;
  border-radius: 9px !important;
  background: #090d12 !important;
  color: var(--creator-text) !important;
}

body.creator-mode .support-thread-message.role-agency {
  border-color: #2a5878 !important;
  background: #0d1d2a !important;
}

body.creator-mode .support-thread-message,
body.creator-mode .support-thread-message :is(b, p, small) {
  text-align: left !important;
}

body.creator-mode .support-reply-form {
  border-top-color: var(--creator-line) !important;
}

body.creator-mode .status-needs_reply { border-color: var(--creator-warn) !important; color: var(--creator-warn) !important; }
body.creator-mode .status-in_review { border-color: var(--creator-accent) !important; color: var(--creator-accent-strong) !important; }
body.creator-mode .sidebar-backdrop { background: rgba(0, 0, 0, .72) !important; }

/* Preserve the old clean blue/white alternate theme without the newer pink palette. */
html[data-theme="light"] body.creator-mode {
  --creator-canvas: #f4f7fa;
  --creator-sidebar: #eaf0f5;
  --creator-surface: #ffffff;
  --creator-surface-raised: #f8fafc;
  --creator-surface-active: #ddecf8;
  --creator-line: #cbd6e2;
  --creator-line-strong: #8ea4bb;
  --creator-text: #142033;
  --creator-muted: #485a70;
  --creator-subtle: #64778d;
  --creator-accent: #007db4;
  --creator-accent-strong: #006b9b;
  --creator-good: #167152;
  --creator-warn: #8a5b00;
}

html[data-theme="light"] body.creator-mode :is(input, select, textarea),
html[data-theme="light"] body.creator-mode .creator-work-item,
html[data-theme="light"] body.creator-mode .support-type-grid label,
html[data-theme="light"] body.creator-mode .support-thread-message {
  background: #fff !important;
  color: var(--creator-text) !important;
}

html[data-theme="light"] body.creator-mode .support-thread-message.role-agency {
  background: #e9f4fb !important;
}

@media (max-width: 950px) {
  body.creator-mode main {
    padding: 0 20px calc(72px + env(safe-area-inset-bottom)) !important;
  }

  body.creator-mode .sidebar {
    width: min(86vw, 330px) !important;
    max-width: 330px !important;
  }

  body.creator-mode main > header {
    min-height: 76px !important;
    padding-block: 12px !important;
  }

  body.creator-mode main > header .page-heading :is(.eyebrow, h1, small) {
    text-align: center !important;
  }

  body.creator-mode main > header h1 {
    font-size: clamp(25px, 6vw, 34px) !important;
  }

  body.creator-mode .support-creator-layout {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  html[data-text-size="readable"] body.creator-mode {
    --creator-body: 17px;
    --creator-support: 16px;
    --creator-control: 17px;
    --creator-h1: clamp(27px, 8vw, 34px);
    --creator-h2: clamp(25px, 7vw, 31px);
    --creator-h3: clamp(22px, 6vw, 28px);
  }

  body.creator-mode main {
    padding-inline: 16px !important;
  }

  body.creator-mode #schedule-view > .weekly-plan-heading {
    display: grid !important;
    align-items: start !important;
    margin-top: 22px !important;
  }

  body.creator-mode .week-navigation {
    display: grid !important;
    grid-template-columns: 1fr 1.2fr 1fr !important;
    justify-content: stretch !important;
    width: 100%;
  }

  body.creator-mode .week-navigation button {
    min-width: 0 !important;
    padding-inline: 7px !important;
    font-size: max(15px, var(--creator-support)) !important;
  }

  body.creator-mode :is(#weekly-schedule-notepad, .creator-approved-resources, .creator-promo-link, .support-form, .support-request-card) {
    border-radius: 10px !important;
  }

  body.creator-mode .weekly-pad-reader {
    padding: 19px 17px 24px !important;
  }

  body.creator-mode .creator-work-item header {
    display: grid !important;
  }

  body.creator-mode .creator-work-item form,
  body.creator-mode .support-reply-form {
    grid-template-columns: 1fr !important;
  }

  body.creator-mode .creator-resource-row {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  body.creator-mode .creator-resource-row > div {
    width: 100%;
  }

  body.creator-mode .creator-resource-row :is(a, button) {
    flex: 1;
  }

  body.creator-mode .creator-promo-link-actions {
    grid-template-columns: 1fr 1fr !important;
  }

  body.creator-mode .creator-promo-link-actions input {
    grid-column: 1 / -1 !important;
    text-align: left !important;
  }
}

@media (max-width: 380px) {
  body.creator-mode .week-navigation {
    grid-template-columns: 1fr !important;
  }

  body.creator-mode .creator-promo-link-actions {
    grid-template-columns: 1fr !important;
  }

  body.creator-mode .creator-promo-link-actions input {
    grid-column: auto !important;
  }
}

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