:root {
  color-scheme: light;
  --navy: #071a33;
  --blue: #135dff;
  --blue-dark: #0a48d5;
  --blue-light: #eaf1ff;
  --ink: #132238;
  --muted: #65778d;
  --line: #d7dee8;
  --surface: #ffffff;
  --background: #f5f7f9;
  --success: #135dff;
  --danger: #bd352d;
  --signal: #16c9d4;
  --panel-muted: #edf2f6;
  --shadow: 0 18px 48px rgba(7, 26, 51, 0.08);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --navy: #edf4fc;
  --blue: #4381ff;
  --blue-dark: #2869f6;
  --blue-light: #102849;
  --ink: #e7eef7;
  --muted: #91a4ba;
  --line: #24364d;
  --surface: #0b1729;
  --background: #050d1a;
  --success: #20d6df;
  --danger: #ff7168;
  --signal: #20d6df;
  --panel-muted: #0f2036;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.is-hidden {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
}

[data-theme="dark"] body {
  background: var(--background);
}

.site-header {
  width: min(1280px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.language-select select {
  min-width: 62px;
  min-height: 40px;
  padding: 0 26px 0 12px;
  color: var(--navy);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.language-select select:hover,
.language-select select:focus-visible {
  border-color: var(--blue);
}

.operations-rail a i,
.operations-assurance b {
  font: inherit;
}

.theme-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.theme-toggle span:first-child {
  font-size: 17px;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--blue);
}

[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .status-pill,
[data-theme="dark"] .account-pill {
  color: var(--ink);
  background: var(--surface);
}

[data-theme="dark"] .brand-logo,
[data-theme="dark"] .auth-brand-logo {
  padding: 0;
  background: transparent;
  border-radius: 0;
  filter:
    grayscale(1)
    brightness(0)
    invert(1)
    drop-shadow(0 4px 12px rgba(32, 214, 223, 0.16));
}

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 6px 12px 6px 7px;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.account-pill span:last-child {
  display: grid;
}

.account-pill strong {
  font-size: 13px;
}

.account-pill small {
  color: var(--muted);
  font-size: 11px;
  text-transform: capitalize;
}

.account-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  border-radius: 6px;
  font-weight: 800;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--navy);
  font-weight: 750;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 238px;
  height: auto;
  max-height: 54px;
  object-fit: contain;
}

.auth-brand-logo {
  display: block;
  width: min(360px, 88%);
  height: auto;
  margin-bottom: 24px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  border-radius: 11px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

@media (max-width: 680px) {
  .brand-logo {
    width: 190px;
  }

  .status-pill {
    display: none;
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--signal);
  border-radius: 50%;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.auth-shell {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(34px, 8vw, 90px);
  align-items: center;
  padding: 54px 0 74px;
}

.auth-intro h1 {
  margin: 18px 0 20px;
  font-size: clamp(40px, 6vw, 64px);
  text-align: left;
}

.auth-intro > p:last-child {
  max-width: 580px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.auth-brand-mark {
  margin-bottom: 30px;
}

.auth-access-panel {
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.auth-card {
  display: grid;
  gap: 17px;
  padding: clamp(26px, 5vw, 42px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.auth-access-panel .auth-card {
  border: 0;
  box-shadow: none;
}

.trial-terms {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.auth-card h2 {
  margin: 0;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.25;
}

.auth-copy {
  margin: 2px 0 4px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-card label small {
  color: var(--muted);
  font-weight: 500;
}

.auth-card .remember-session {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
}

.auth-card .remember-session input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}

.auth-card .remember-session > span {
  display: grid;
  gap: 2px;
}

.auth-card .remember-session strong {
  color: var(--ink);
  font-size: 13px;
}

.auth-card input,
.auth-card select,
.auth-card textarea {
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.request-price-summary {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-strong);
  font-weight: 700;
}

.auth-card input {
  min-height: 48px;
}

.auth-card textarea {
  resize: vertical;
}

.auth-card .button {
  width: 100%;
  margin-top: 4px;
}

.auth-card .auth-text-button {
  justify-self: center;
  padding: 2px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.auth-route-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-route-switch .auth-text-button {
  color: var(--blue);
  font-weight: 800;
}

.auth-message {
  min-height: 18px;
  margin: 0;
  color: var(--success);
  font-size: 13px;
}

.auth-message.is-error {
  color: var(--danger);
}

.access-request-success {
  position: relative;
  justify-items: center;
  overflow: hidden;
  text-align: center;
}

.access-request-success .auth-copy {
  max-width: 430px;
}

.success-check {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(19, 93, 255, 0.28);
  font-size: 30px;
  font-weight: 900;
}

.request-reference {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 16px;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.request-reference span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.request-reference strong {
  color: var(--ink);
  font-size: 17px;
  letter-spacing: 0.04em;
}

.success-next-step {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.success-confetti span {
  position: absolute;
  width: 7px;
  height: 15px;
  background: var(--blue);
  border-radius: 3px;
  opacity: 0;
  animation: success-confetti 900ms ease-out forwards;
}

.success-confetti span:nth-child(1) { top: 7%; left: 17%; }
.success-confetti span:nth-child(2) { top: 12%; left: 28%; animation-delay: 80ms; background: var(--signal); }
.success-confetti span:nth-child(3) { top: 6%; right: 20%; animation-delay: 120ms; }
.success-confetti span:nth-child(4) { top: 18%; right: 12%; animation-delay: 40ms; background: var(--signal); }
.success-confetti span:nth-child(5) { top: 26%; left: 10%; animation-delay: 160ms; }
.success-confetti span:nth-child(6) { top: 32%; right: 8%; animation-delay: 200ms; background: var(--signal); }
.success-confetti span:nth-child(7) { top: 4%; left: 42%; animation-delay: 100ms; background: var(--signal); }
.success-confetti span:nth-child(8) { top: 9%; right: 38%; animation-delay: 180ms; }

@keyframes success-confetti {
  0% {
    opacity: 0;
    transform: translateY(-18px) rotate(0deg);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(48px) rotate(210deg);
  }
}

.account-panel {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin: 0 0 24px;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.account-panel h2,
.account-panel p {
  margin: 4px 0;
}

.account-panel p {
  color: var(--muted);
}

.account-panel-actions {
  display: flex;
  gap: 10px;
}

.account-email-preference {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 620px;
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-muted);
}

.account-email-preference input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--blue);
}

.account-email-preference span {
  display: grid;
  gap: 3px;
}

.account-email-preference small,
.account-preference-message {
  color: var(--muted);
  font-size: 0.82rem;
}

.account-preference-message {
  min-height: 1.25rem;
  margin-top: 8px !important;
}

.account-preference-message.is-error {
  color: var(--danger);
}

.admin-shell {
  margin: 24px 0 64px;
  padding: clamp(24px, 5vw, 46px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.billing-shell {
  margin: 24px 0 64px;
  padding: clamp(24px, 5vw, 46px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.billing-summary,
.billing-entitlements {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.billing-summary > div,
.billing-entitlements > div {
  display: grid;
  gap: 7px;
  padding: 18px;
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.billing-summary small,
.billing-entitlements small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.billing-summary strong,
.billing-entitlements strong {
  color: var(--navy);
  font-size: 18px;
  text-transform: capitalize;
}

.billing-summary p,
.billing-entitlements p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.billing-section {
  margin-top: 34px;
}

.billing-section h3 {
  margin: 5px 0 0;
  color: var(--navy);
  line-height: 1.3;
}

.billing-section > .section-copy {
  margin: 10px 0 0;
  line-height: 1.6;
}

.billing-note {
  margin: 30px 0 0;
  padding: 14px 16px;
  color: var(--muted);
  background: var(--blue-light);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.billing-subscription-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.billing-pending-change {
  margin-top: 14px;
  padding: 14px 16px;
  color: var(--navy);
  background: var(--blue-light);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.billing-confirmation {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 19, 37, 0.68);
}

.billing-confirmation.is-hidden {
  display: none;
}

.billing-confirmation-card {
  width: min(520px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.billing-confirmation-card h3 {
  margin: 6px 0 18px;
  color: var(--navy);
}

.billing-monitoring-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  color: var(--navy);
  background: var(--blue-light);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.billing-monitoring-choice input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}

.billing-monitoring-choice > span {
  margin: 0;
  line-height: 1.35;
}

.billing-monitoring-choice.is-hidden {
  display: none;
}

.billing-change-summary {
  display: grid;
  gap: 10px;
}

.billing-change-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.billing-change-summary span {
  color: var(--muted);
}

.admin-email-detail-body {
  max-height: 360px;
  overflow: auto;
  padding: 16px;
  color: var(--navy);
  background: var(--blue-light);
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: pre-wrap;
  font: inherit;
}

[data-theme="dark"] .billing-summary > div,
[data-theme="dark"] .billing-entitlements > div {
  background: #0d1728;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  min-height: 430px;
  padding: 24px;
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.pricing-card.is-featured {
  border: 2px solid var(--blue);
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.12);
}

.pricing-card.is-current {
  background: var(--blue-light);
}

.pricing-card small,
.pricing-addons small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pricing-card h4 {
  margin: 12px 0 0;
  color: var(--navy);
  font-size: 22px;
  line-height: 1.25;
}

.pricing-price {
  margin: 18px 0 0;
  color: var(--navy);
  font-size: 30px;
  font-weight: 800;
}

.pricing-price span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.pricing-description {
  min-height: 44px;
  color: var(--muted);
  line-height: 1.5;
}

.pricing-card ul {
  display: grid;
  gap: 10px;
  flex: 1;
  margin: 10px 0 24px;
  padding: 0;
  list-style: none;
}

.pricing-card li {
  color: var(--text);
  font-size: 14px;
}

.pricing-card li::before {
  content: "✓";
  margin-right: 9px;
  color: var(--green);
  font-weight: 800;
}

.pricing-feature-status {
  display: inline-flex;
  margin-left: 8px;
  padding: 3px 6px;
  color: var(--blue);
  background: var(--blue-light);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.pricing-card .button {
  width: 100%;
}

.pricing-addons {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.pricing-addons > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pricing-addons strong {
  display: block;
  margin-top: 5px;
  color: var(--navy);
}

.pricing-addons p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pricing-addon-price {
  flex: 0 0 auto;
  margin: 0;
  font-size: 17px;
}

.pricing-addon-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
}

[data-theme="dark"] .pricing-card,
[data-theme="dark"] .pricing-addons > div {
  background: #0d1728;
}

[data-theme="dark"] .pricing-card.is-current {
  background: #13274a;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 24px 0 34px;
}

.admin-ticket-panel {
  margin-top: 28px;
  padding: 24px;
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.admin-ticket-details {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.admin-ticket-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 26px;
}

.admin-ticket-columns > section,
.ticket-resolution,
.ticket-activity-section {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin-ticket-columns form,
.ticket-resolution-controls {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.admin-ticket-columns label,
.ticket-resolution-controls label,
.help-request-detail form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-ticket-columns textarea,
.ticket-resolution-controls textarea,
.help-request-detail textarea {
  width: 100%;
  resize: vertical;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
}

.ticket-resolution,
.ticket-activity-section {
  margin-top: 20px;
}

.ticket-resolution-controls {
  grid-template-columns: minmax(140px, 190px) 1fr auto;
  align-items: end;
}

.ticket-thread,
.ticket-activity {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.ticket-thread article,
.ticket-activity article,
.admin-ticket-details article,
.help-request-detail-body article {
  padding: 12px;
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.ticket-thread article > div,
.ticket-activity article > div,
.admin-ticket-details article > div,
#help-request-detail-body article > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ticket-thread article small,
.ticket-activity article small,
.admin-ticket-details article small,
#help-request-detail-body article small {
  color: var(--muted);
  font-size: 10px;
}

.ticket-thread article p,
.ticket-activity article p,
.admin-ticket-details article p,
#help-request-detail-body article p {
  margin: 8px 0 0;
  color: var(--ink);
  white-space: pre-wrap;
}

[data-theme="dark"] .admin-ticket-panel,
[data-theme="dark"] .ticket-thread article,
[data-theme="dark"] .ticket-activity article,
[data-theme="dark"] .admin-ticket-details article,
[data-theme="dark"] #help-request-detail-body article {
  background: #0d1728;
}

[data-theme="dark"] .admin-ticket-columns textarea,
[data-theme="dark"] .ticket-resolution-controls textarea,
[data-theme="dark"] .help-request-detail textarea {
  background: #0d1728;
}

.admin-metrics div {
  display: grid;
  gap: 5px;
  padding: 18px;
  background: var(--blue-light);
  border-radius: 12px;
}

.admin-metrics strong {
  color: var(--navy);
  font-size: 25px;
}

.admin-metrics small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-section {
  margin-top: 30px;
}

.admin-section h3 {
  margin: 4px 0 16px;
  color: var(--navy);
  font-size: 23px;
}

.admin-subheading {
  margin: 24px 0 8px;
  color: var(--navy);
  font-size: 16px;
}

.admin-backup-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.admin-backup-details > div {
  display: grid;
  gap: 5px;
  padding: 14px;
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-backup-details strong {
  color: var(--ink);
  font-size: 13px;
}

.admin-backup-details small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-section select {
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-section input[type="date"],
.admin-section input[type="text"] {
  min-width: 150px;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.admin-toggle input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: var(--blue);
}

#admin-access-table .preview-table {
  min-width: 1480px;
}

#admin-access-table th,
#admin-access-table td {
  vertical-align: middle;
}

#admin-access-table td:nth-child(6) {
  min-width: 150px;
}

#admin-access-table td:nth-child(10) {
  min-width: 190px;
}

.admin-plan-select {
  width: 100%;
  min-width: 132px;
}

.admin-inline-checkbox {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  white-space: nowrap;
  font-size: 12px;
}

.admin-inline-checkbox input {
  width: auto;
}

.admin-organizations-table {
  min-width: 1840px;
}

.admin-organizations-table th:nth-child(1),
.admin-organizations-table td:nth-child(1) {
  min-width: 150px;
}

.admin-organizations-table th:nth-child(2),
.admin-organizations-table td:nth-child(2) {
  min-width: 230px;
}

.admin-organizations-table th:nth-child(3),
.admin-organizations-table td:nth-child(3) {
  min-width: 150px;
}

.admin-organizations-table th:nth-child(4),
.admin-organizations-table td:nth-child(4),
.admin-organizations-table th:nth-child(5),
.admin-organizations-table td:nth-child(5) {
  min-width: 145px;
}

.admin-organizations-table th:nth-child(6),
.admin-organizations-table td:nth-child(6) {
  min-width: 125px;
}

.admin-organizations-table th:nth-child(7),
.admin-organizations-table td:nth-child(7) {
  min-width: 120px;
}

.admin-organizations-table td:nth-child(3) select,
.admin-organizations-table td:nth-child(7) select {
  width: 100%;
  min-width: 0;
}

.admin-action-group {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.admin-action-group select {
  width: 100%;
  min-width: 105px;
}

.admin-action-group .button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
}

.button-danger {
  color: #ffffff;
  background: var(--danger);
  border-color: var(--danger);
}

.admin-toggle > span {
  display: inline;
  margin: 0;
}

.admin-save {
  min-height: 38px;
  padding: 0 12px;
}

.admin-inline-message {
  min-height: 22px;
  margin: -4px 0 12px;
}

.admin-row-status {
  display: block;
  max-width: 110px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.is-success {
  color: var(--success) !important;
}

.suspended-shell {
  width: min(760px, calc(100% - 40px));
  margin: 80px auto;
  padding: clamp(28px, 6vw, 56px);
  text-align: center;
  background: #fff8f7;
  border: 1px solid #fecaca;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.suspended-shell h2 {
  margin: 0 0 12px;
  color: var(--danger);
  font-size: clamp(30px, 5vw, 46px);
}

.suspended-shell p:not(.eyebrow) {
  max-width: 560px;
  margin: 0 auto 24px;
  color: var(--muted);
  line-height: 1.6;
}

.hero {
  padding: 82px 0 56px;
  text-align: center;
}

.operations-home {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 640px;
  margin: 30px 0 48px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.operations-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 28px 14px;
  background: var(--panel-muted);
  border-right: 1px solid var(--line);
}

.operations-rail > div {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 8px 28px;
}

.operations-rail p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.rail-signal {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 12%, transparent);
}

.operations-rail a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--muted);
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: 150ms ease;
}

.operations-rail a span {
  color: var(--signal);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

.operations-rail a:hover {
  color: var(--navy);
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  border-left-color: var(--blue);
}

.operations-canvas {
  min-width: 0;
  padding: clamp(30px, 5vw, 60px);
}

.operations-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: clamp(30px, 6vw, 70px);
  align-items: end;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}

.operations-intro h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(42px, 5.5vw, 66px);
  text-align: left;
}

.operations-intro .hero-copy {
  max-width: 660px;
  margin: 20px 0 0;
  font-size: 17px;
}

.operations-assurance {
  display: grid;
  gap: 13px;
  padding-bottom: 4px;
}

.operations-assurance span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.operations-assurance i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: var(--signal);
  border-radius: 50%;
}

.channel-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.channel-context .eyebrow { margin: 0 0 5px; }
.channel-context strong,
.channel-context small { display: block; }
.channel-context small { margin-top: 3px; color: var(--muted); }
.channel-context label { width: min(100%, 320px); }
.channel-context select { width: 100%; }

.billing-channel-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.billing-channel-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.billing-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-muted);
}

.billing-channel-row strong,
.billing-channel-row small {
  display: block;
}

.billing-channel-row small {
  margin-top: 4px;
  color: var(--muted);
}

.billing-channel-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  text-align: right;
}

.billing-channel-removal {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-muted);
}

#billing-channel-removal-summary {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

#billing-channel-removal-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.billing-channel-form > button,
.billing-channel-form .remember-session {
  align-self: end;
}

.billing-channel-preview {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-muted);
}

#billing-channel-costs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#billing-channel-costs > div {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

#billing-channel-costs small,
#billing-channel-costs strong,
#billing-channel-costs p {
  display: block;
  margin: 0;
}

#billing-channel-costs small,
#billing-channel-costs p {
  color: var(--muted);
}

#billing-channel-costs strong {
  color: var(--navy);
  font-size: 20px;
}

.module-launcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 30px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.module-launcher a {
  position: relative;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  color: var(--ink);
  background: transparent;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: 160ms ease;
}

.module-launcher a:hover {
  z-index: 1;
  background: color-mix(in srgb, var(--blue) 7%, transparent);
  box-shadow: inset 3px 0 0 var(--signal);
}

.module-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: var(--signal);
}

.module-icon svg {
  width: 25px;
  height: 25px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-launcher strong {
  margin-top: 15px;
  color: var(--navy);
  font-size: 17px;
}

.module-launcher small {
  max-width: 210px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.module-arrow {
  position: absolute;
  right: 18px;
  bottom: 18px;
  color: var(--blue);
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1 {
  max-width: 800px;
  margin: 0 auto;
  color: var(--navy);
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.hero-copy {
  max-width: 650px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
}

.hero-actions,
.form-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 7px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.text-link:focus-visible,
.brand:focus-visible,
.drop-zone:focus-within {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 3px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button-primary {
  color: white;
  background: var(--blue);
  box-shadow: none;
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-secondary {
  color: var(--navy);
  background: var(--surface);
  border-color: var(--line);
}

[data-theme="dark"] .button-secondary,
[data-theme="dark"] input,
[data-theme="dark"] select {
  color: var(--ink);
  background: #0d1728;
  border-color: var(--line);
}

[data-theme="dark"] .auth-card,
[data-theme="dark"] .auth-access-panel,
[data-theme="dark"] .account-panel,
[data-theme="dark"] .admin-shell,
[data-theme="dark"] .programming-grid-export,
[data-theme="dark"] .profile-manager,
[data-theme="dark"] .download-menu-options,
[data-theme="dark"] .download-menu-list {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

[data-theme="dark"] .auth-card h2,
[data-theme="dark"] .auth-card label,
[data-theme="dark"] .auth-card label > span,
[data-theme="dark"] .preview-table th,
[data-theme="dark"] .epg-preview-stats span,
[data-theme="dark"] .result-metrics span,
[data-theme="dark"] .repair-list {
  color: var(--ink);
}

[data-theme="dark"] .auth-card input,
[data-theme="dark"] .auth-card select,
[data-theme="dark"] .hls-url-field input,
[data-theme="dark"] .hls-monitor-controls select {
  color: var(--ink);
  background: #0d1728;
  border-color: var(--line);
}

[data-theme="dark"] .drop-zone,
[data-theme="dark"] .preview-table th,
[data-theme="dark"] .result-metrics span {
  background: #13213a;
}

[data-theme="dark"] .epg-preview-stats span,
[data-theme="dark"] .upload-icon {
  color: var(--ink);
  background: #13213a;
  border-color: var(--line);
}

[data-theme="dark"] .preview-table td {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

[data-theme="dark"] .preview-table tbody tr:nth-child(even) {
  background: var(--panel-muted);
}

[data-theme="dark"] .preview-table tbody tr:nth-child(even) td {
  background: var(--panel-muted);
}

[data-theme="dark"] .playlist-summary {
  background: #13213a;
  border-color: #294567;
}

[data-theme="dark"] .result-panel:not(.is-error),
[data-theme="dark"] .authorization {
  background: var(--panel-muted);
  border-color: var(--line);
}

[data-theme="dark"] .result-panel.is-error,
[data-theme="dark"] .drop-zone.is-invalid,
[data-theme="dark"] .suspended-shell {
  background: #321817;
  border-color: #7f1d1d;
}

[data-theme="dark"] .admin-metrics > div,
[data-theme="dark"] .export-panel,
[data-theme="dark"] .epg-preview {
  background: #0d1728;
  border-color: var(--line);
}

.generator-shell {
  padding: clamp(24px, 5vw, 48px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(7, 26, 51, 0.05);
}

.validator-shell {
  margin-top: 48px;
}

.section-copy {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.drop-zone.is-invalid {
  background: #fff6f5;
  border-color: var(--danger);
}

.compact-drop-zone {
  min-height: 160px;
}

.playlist-summary {
  margin-top: 20px;
  padding: 16px;
  background: var(--blue-light);
  border: 1px solid #c9dbfa;
  border-radius: 12px;
}

.playlist-summary.is-hidden,
.filter-value-field.is-hidden {
  display: none;
}

.playlist-summary p {
  margin: 10px 0 0;
  color: var(--muted);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.broadcast-day-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.result-content {
  min-width: 0;
}

.table-scroll {
  max-height: 440px;
  margin-top: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
}

.preview-table th {
  position: sticky;
  top: 0;
  padding: 10px 12px;
  color: var(--muted);
  text-align: left;
  background: var(--panel-muted);
  border-bottom: 1px solid var(--line);
}

.preview-table td {
  padding: 9px 12px;
  color: var(--ink);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.epg-preview {
  margin-top: 24px;
  padding: 24px;
  background: #f8faff;
  border: 1px solid #cfe0ff;
  border-radius: 14px;
}

.epg-preview.is-hidden {
  display: none;
}

.preview-heading {
  align-items: flex-start;
  margin-bottom: 18px;
}

.epg-preview-filters {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(210px, 280px);
  gap: 12px;
}

.epg-preview-filters label {
  display: grid;
  gap: 7px;
}

.epg-preview-filters label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.epg-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.epg-preview-stats span {
  padding: 6px 9px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.epg-preview-table {
  max-height: 520px;
}

.programme-title {
  min-width: 180px;
  color: var(--navy);
  font-weight: 800;
}

.preview-date,
.preview-time {
  white-space: nowrap;
}

.preview-date {
  min-width: 96px;
}

.programming-grid-export {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 22px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.programming-grid-export h3 {
  margin: 4px 0 6px;
  color: var(--navy);
}

.programming-grid-export .section-copy {
  margin: 0;
}

.programming-grid-export .button {
  flex: 0 0 auto;
}

.programming-grid-controls {
  display: grid;
  min-width: 320px;
  gap: 12px;
}

.programming-grid-controls input[type="file"] {
  padding: 9px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

h2 {
  margin: 0;
  color: var(--navy);
  font-size: 34px;
  letter-spacing: -0.025em;
}

.text-link {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.download-menu {
  position: relative;
}

.download-menu summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  user-select: none;
}

.download-menu summary::-webkit-details-marker {
  display: none;
}

.download-menu summary::after {
  content: "⌄";
  margin-left: 8px;
}

.download-menu[open] summary::after {
  content: "⌃";
}

.download-menu-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 12px);
  right: 0;
  width: 310px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(16, 42, 67, 0.16);
}

.download-menu-options a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  color: var(--navy);
  text-decoration: none;
}

.download-menu-options a + a {
  border-top: 1px solid var(--border);
}

.download-menu-options a:hover {
  background: var(--surface-soft);
}

.download-menu-options small {
  color: var(--muted);
  font-size: 12px;
}

.hls-url-field {
  display: grid;
  gap: 9px;
}

.hls-url-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hls-url-field input {
  min-height: 52px;
  width: 100%;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.hls-monitor-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px));
  gap: 16px;
  margin-top: 18px;
}

.hls-monitor-controls label {
  display: grid;
  gap: 9px;
}

.hls-monitor-controls span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hls-monitor-controls select {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.hls-monitor-panel {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.hls-monitor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.hls-monitor-heading div {
  display: grid;
  gap: 4px;
}

.hls-monitor-heading small {
  color: var(--muted);
}

#hls-monitor-countdown {
  color: var(--blue);
  font-size: 20px;
  font-weight: 800;
}

.hls-result-content {
  min-width: 0;
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

label > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.drop-zone {
  min-height: 210px;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  background: #f9fbff;
  border: 2px dashed #b9c8dc;
  border-radius: 16px;
  cursor: pointer;
  transition: 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  background: var(--blue-light);
  border-color: var(--blue);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: var(--blue);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 24px;
}

.drop-zone strong {
  color: var(--navy);
  font-size: 17px;
}

.drop-zone small {
  margin-top: 7px;
  color: var(--muted);
}

.form-actions {
  justify-content: flex-end;
}

.authorization {
  margin-top: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--blue-light);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.authorization.is-hidden {
  display: none;
}

.authorization input {
  width: 19px;
  min-height: 19px;
  margin: 2px 0 0;
}

.authorization span {
  display: grid;
  gap: 4px;
}

.authorization strong {
  color: var(--navy);
  font-size: 14px;
}

.authorization small {
  color: var(--muted);
  line-height: 1.45;
}

.result-panel {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  margin-top: 28px;
  padding: 22px;
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.result-panel.is-error {
  background: #fff6f5;
  border-color: #f5b7b1;
}

.result-panel.is-hidden {
  display: none;
}

.export-panel {
  margin-top: 22px;
  padding: 24px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.export-panel.is-hidden {
  display: none;
}

.export-panel h3 {
  margin: 4px 0 0;
  color: var(--navy);
  font-size: 22px;
}

.export-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.export-status.is-error {
  color: var(--danger);
}

.profile-manager {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr auto auto;
  align-items: end;
  gap: 12px;
  margin: 20px 0 4px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.result-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 800;
}

.is-error .result-icon {
  background: var(--danger);
}

.result-panel h3 {
  margin: 2px 0 5px;
  color: var(--navy);
}

.result-panel p {
  margin: 0;
  color: var(--muted);
}

.result-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.result-actions.is-hidden {
  display: none;
}

.download-menu {
  position: relative;
}

.download-menu summary {
  list-style: none;
  user-select: none;
}

.download-menu summary::-webkit-details-marker {
  display: none;
}

.download-menu summary::after {
  content: "▾";
  margin-left: 10px;
  font-size: 12px;
}

.download-menu[open] summary::after {
  content: "▴";
}

.download-menu-list {
  position: absolute;
  z-index: 10;
  right: 0;
  bottom: calc(100% + 8px);
  width: 270px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(16, 42, 67, 0.16);
}

.download-menu-list button {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.download-menu-list button:hover,
.download-menu-list button:focus-visible {
  background: var(--blue-light);
  outline: none;
}

.download-menu-list small {
  color: var(--muted);
}

.result-metrics span {
  padding: 6px 9px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.issue-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--danger);
}

.template-guidance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.8rem;
  margin-top: 0.9rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.template-guidance strong {
  color: var(--ink);
}

.template-guidance a {
  color: var(--blue);
  font-weight: 700;
}

.history-shell {
  margin-top: 30px;
}

.history-status {
  margin: 12px 0 0;
  color: var(--muted);
}

.history-table td {
  vertical-align: middle;
}

.history-download {
  display: inline-flex;
  padding: 7px 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  background: var(--blue-light);
  border-radius: 7px;
  white-space: nowrap;
}

.history-download:hover {
  text-decoration: underline;
}

.repair-list {
  color: var(--muted);
}

footer {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.help-launcher {
  position: fixed;
  z-index: 40;
  left: 22px;
  bottom: 22px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px 0 10px;
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.28);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.help-launcher > span:first-child {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: white;
  border-radius: 50%;
  font-size: 17px;
}

.help-panel {
  position: fixed;
  z-index: 50;
  left: 22px;
  bottom: 78px;
  width: min(440px, calc(100vw - 44px));
  max-height: min(720px, calc(100vh - 110px));
  overflow: auto;
  padding: 24px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(16, 42, 67, 0.22);
}

.help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.help-header h2 {
  margin: 5px 0 0;
  color: var(--navy);
  font-size: 25px;
}

.help-close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  color: var(--muted);
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-size: 23px;
  cursor: pointer;
}

.help-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(120px, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.help-controls label {
  display: grid;
  gap: 6px;
}

.help-controls label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.help-content {
  margin-top: 20px;
  line-height: 1.55;
}

.help-summary {
  margin: 0;
  color: var(--muted);
}

.help-content ol {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding-left: 24px;
}

.help-tip {
  margin: 0;
  padding: 13px 14px;
  color: var(--navy);
  background: var(--blue-light);
  border-radius: 9px;
  font-size: 13px;
}

.help-footer {
  margin: 18px 0 0;
  padding-top: 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
}

.help-support-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.help-support-actions .button {
  width: 100%;
  padding-inline: 10px;
}

.help-support-form,
.help-requests {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.help-support-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.help-support-heading h3 {
  margin: 0;
  color: var(--navy);
}

.help-back {
  padding: 7px 10px;
  color: var(--blue);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.help-support-form > label,
.help-support-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.help-support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.help-support-form textarea {
  width: 100%;
  resize: vertical;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
}

[data-theme="dark"] .help-support-form textarea {
  background: #0d1728;
}

.help-privacy {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.help-request-list {
  display: grid;
  gap: 10px;
}

.help-request-list article {
  padding: 12px;
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.help-request-list article[role="button"] {
  cursor: pointer;
}

.help-request-list article[role="button"]:hover {
  border-color: var(--blue);
}

.help-request-detail {
  display: grid;
  gap: 14px;
}

#help-request-detail-body {
  display: grid;
  gap: 10px;
}

.help-request-list article > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.help-request-list article span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.help-request-list article p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

[data-theme="dark"] .help-panel {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

@media (max-width: 800px) {
  .operations-home {
    grid-template-columns: 1fr;
  }

  .operations-rail {
    flex-direction: row;
    overflow-x: auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .operations-rail > div {
    display: none;
  }

  .operations-rail a {
    flex: 0 0 auto;
    min-height: 38px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 6px 6px 0 0;
  }

  .operations-rail a:hover {
    border-bottom-color: var(--blue);
    border-left-color: transparent;
  }

  .operations-intro {
    grid-template-columns: 1fr;
  }

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

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

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .admin-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .billing-summary,
  .billing-entitlements,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    min-height: 0;
  }

  .pricing-addons > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .pricing-addon-actions {
    width: 100%;
    justify-content: space-between;
  }

  .billing-channel-row,
  .billing-channel-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .billing-channel-status {
    width: 100%;
    text-align: left;
  }

  .admin-ticket-columns,
  .ticket-resolution-controls {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .filter-grid,
  .profile-manager,
  .epg-preview-filters {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .programming-grid-export,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .download-menu-options {
    right: auto;
    left: 0;
    width: min(310px, calc(100vw - 48px));
  }

  .programming-grid-controls {
    width: 100%;
    min-width: 0;
  }

  .hero {
    padding-top: 52px;
  }
}

@media (max-width: 520px) {
  .site-header {
    width: min(100% - 24px, 1180px);
  }

  .status-pill {
    display: none;
  }

  .theme-toggle {
    width: 42px;
    justify-content: center;
    padding: 0;
  }

  .theme-toggle span:last-child {
    display: none;
  }

  main,
  footer {
    width: min(100% - 24px, 1080px);
  }

  .operations-home {
    margin-top: 18px;
  }

  .operations-canvas {
    padding: 26px 18px;
  }

  .operations-intro h1 {
    font-size: 38px;
  }

  .operations-assurance,
  .module-launcher {
    grid-template-columns: 1fr;
  }

  .channel-context {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-channel-form,
  #billing-channel-costs {
    grid-template-columns: 1fr;
  }

  .module-launcher a {
    min-height: 132px;
  }

  .hero-actions,
  .form-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .help-launcher {
    left: 14px;
    bottom: 14px;
  }

  .help-launcher > span:last-child {
    display: none;
  }

  .help-launcher {
    width: 46px;
    padding: 0 9px;
  }

  .help-panel {
    left: 12px;
    bottom: 70px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 92px);
  }

  .help-controls {
    grid-template-columns: 1fr;
  }

  .help-support-actions,
  .help-support-grid {
    grid-template-columns: 1fr;
  }
}
