@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Instrument+Sans:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg-base: #080a0f;
  --bg-surface: #11151d;
  --bg-surface-hover: #181e28;
  --text-primary: #f5f7fb;
  --text-secondary: #9aa4b2;
  --text-muted: #8490a0;
  --brand-accent: #4266af;
  --brand-muted: #7f98c9;
  --brand-accent-strong: #365895;
  --brand-red: #e11d48;
  --font-mono: "IBM Plex Mono", monospace;
  --status-success-text: #86efac;
  --status-warning-text: #fbbf24;
  --status-neutral-text: #cbd5e1;
  --status-success-surface: rgba(34, 197, 94, 0.12);
  --status-warning-surface: rgba(245, 158, 11, 0.12);
  --status-neutral-surface: rgba(148, 163, 184, 0.12);
  --border-subtle: #252c38;
  --border-strong: #3a4658;
  --focus-ring: #9fb8e8;
  --radius-control: 0.5rem;
  --radius-surface: 0.75rem;
  --shell-width: 90rem;
  --shadow-surface: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.18);
  --grid-line: rgba(127, 152, 201, 0.045);
  --overlay-backdrop: rgba(8, 10, 15, 0.76);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg-base: #f5f7fb;
    --bg-surface: #ffffff;
    --bg-surface-hover: #edf1f7;
    --text-primary: #151a23;
    --text-secondary: #4f5b6b;
    --text-muted: #5f6c7c;
    --brand-accent: #4266af;
    --brand-muted: #365895;
    --brand-accent-strong: #2f4f8a;
    --status-success-text: #166534;
    --status-warning-text: #92400e;
    --status-neutral-text: #475569;
    --status-success-surface: rgba(22, 101, 52, 0.09);
    --status-warning-surface: rgba(146, 64, 14, 0.09);
    --status-neutral-surface: rgba(71, 85, 105, 0.09);
    --border-subtle: #d9e0ea;
    --border-strong: #aeb9c8;
    --focus-ring: #294f9c;
    --overlay-backdrop: rgba(245, 247, 251, 0.82);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 100%;
}

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: "Instrument Sans", "Noto Sans Arabic", system-ui, sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 4rem 4rem;
  background-attachment: fixed;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 0.1875rem solid var(--focus-ring);
  outline-offset: 0.1875rem;
}

.skip-link {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-control);
  background: var(--text-primary);
  color: var(--bg-base);
  font-weight: 700;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell-container {
  width: min(calc(100% - 2rem), var(--shell-width));
  margin-inline: auto;
}

.production-header {
  min-height: 4.5rem;
  border-block-end: 1px solid var(--border-subtle);
  background: var(--bg-base);
  position: sticky;
  inset-block-start: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
}

.production-header__inner {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-signout {
  margin: 0;
}

.nav-signout button {
  min-height: 2.75rem;
  padding-inline: 0.85rem;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
}

.nav-signout button:hover {
  color: var(--text-primary);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
}

.production-logo {
  display: block;
  width: 7.75rem;
  height: auto;
}

.brand-product {
  padding-inline-start: 0.75rem;
  border-inline-start: 1px solid var(--border-strong);
  color: var(--brand-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.nav-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding-inline: 0.85rem;
  border-block-end: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
}

.nav-link:hover,
.nav-link--active {
  border-block-end-color: var(--brand-accent);
  color: var(--text-primary);
}

.shell-layout {
  display: grid;
  min-height: calc(100dvh - 10rem);
  grid-template-columns: 12rem minmax(0, 1fr);
}

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

.production-rail {
  padding: 2rem 0 2rem 1.5rem;
  border-inline-end: 1px solid var(--border-subtle);
  position: sticky;
  inset-block-start: 4.5rem;
  align-self: start;
  min-height: calc(100dvh - 4.5rem);
}

.production-rail__label,
.workspace-intro__context,
.foundation-status__label {
  margin: 0;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.production-rail ol {
  display: grid;
  gap: 0;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.production-rail li {
  position: relative;
  padding: 0.8rem 1rem 0.8rem 0;
  border-inline-start: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.875rem;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
}

.production-rail li span {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.production-rail li.is-complete {
  color: var(--text-secondary);
  border-inline-start-color: var(--brand-muted);
}

.production-rail li.is-complete span::after {
  content: " ✓";
  color: var(--status-success-text);
}

.production-rail li.is-current {
  border-inline-start-color: var(--brand-accent);
  color: var(--text-primary);
  font-weight: 700;
}

.main-content {
  min-width: 0;
  padding: clamp(2.25rem, 5vw, 5rem);
  max-width: 82rem;
  width: 100%;
  margin-inline: auto;
}

.eyebrow {
  margin: 0;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", "Noto Sans Arabic", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.page-heading,
.project-header {
  margin-block-end: clamp(2rem, 5vw, 4rem);
}

.page-heading--with-action,
.project-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.page-heading h1,
.project-header h1,
.auth-layout h1,
.message-page h1 {
  margin: 0.5rem 0 0.65rem;
  font-family: "Sora", "Noto Sans Arabic", sans-serif;
  font-size: clamp(2rem, 4vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.page-heading p:last-child,
.project-header p:last-child,
.auth-layout__intro p:last-child,
.message-page > p {
  max-width: 43rem;
  margin-block-end: 0;
  color: var(--text-secondary);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-control);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.primary-action {
  border: 1px solid var(--brand-accent);
  background: var(--brand-accent);
  color: #fff;
}

.primary-action:hover {
  border-color: var(--brand-accent-strong);
  background: var(--brand-accent-strong);
  color: #fff;
  transform: translateY(-1px);
}

.secondary-action {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
}

.secondary-action:hover {
  border-color: var(--brand-accent);
  background: var(--bg-surface-hover);
  transform: translateY(-1px);
}

.workspace-intro__action {
  margin-block-start: 1.75rem;
}

.workspace-intro {
  max-width: 53rem;
}

.workspace-intro h1 {
  max-width: 14ch;
  margin: 0.65rem 0 1rem;
  font-family: "Sora", "Noto Sans Arabic", sans-serif;
  font-size: clamp(2rem, 4.6vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.14;
}

.workspace-intro__summary {
  max-width: 44rem;
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.request-reference {
  margin-block: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.request-reference code {
  color: var(--brand-muted);
}

.text-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  margin-block-start: 1.5rem;
  padding-inline: 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  border-color: var(--brand-accent);
  background: var(--bg-surface-hover);
}

.foundation-status {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(17rem, 0.85fr);
  gap: clamp(2rem, 6vw, 6rem);
  margin-block-start: clamp(3rem, 8vw, 7rem);
  padding-block-start: 1.5rem;
  border-block-start: 1px solid var(--border-strong);
}

.foundation-status h2 {
  margin: 0.5rem 0 0.75rem;
  font-family: "Sora", "Noto Sans Arabic", sans-serif;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 600;
}

.foundation-status p {
  max-width: 43rem;
  margin-block-end: 0;
  color: var(--text-secondary);
}

.foundation-status__facts {
  margin: 0;
}

.foundation-status__facts div {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(0, 1.1fr);
  gap: 1rem;
  padding-block: 0.8rem;
  border-block-end: 1px solid var(--border-subtle);
}

.foundation-status__facts dt {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.foundation-status__facts dd {
  margin: 0;
  color: var(--text-primary);
  font-family: "IBM Plex Mono", "Noto Sans Arabic", monospace;
  font-size: 0.85rem;
}

.notice {
  margin-block-end: 1.5rem;
  padding: 0.85rem 1rem;
  border-inline-start: 0.2rem solid var(--status-success-text);
  background: var(--status-success-surface);
  color: var(--status-success-text);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

.notification-stack {
  position: fixed;
  z-index: 40;
  inset-block-start: 5.25rem;
  inset-inline-end: max(1rem, calc((100vw - var(--shell-width)) / 2));
  display: grid;
  width: min(28rem, calc(100vw - 2rem));
  gap: 0.65rem;
  pointer-events: none;
}

.system-notification {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-inline-start-width: 0.2rem;
  border-radius: var(--radius-control);
  background: var(--bg-surface);
  box-shadow: var(--shadow-surface);
  color: var(--text-primary);
  pointer-events: auto;
  transition: opacity 180ms ease, transform 180ms ease;
}

.system-notification--success {
  border-inline-start-color: var(--status-success-text);
}

.system-notification--error {
  border-inline-start-color: var(--status-warning-text);
}

.system-notification.is-leaving {
  opacity: 0;
  transform: translateY(-0.35rem);
}

.system-notification p {
  margin: 0;
}

.system-notification button {
  padding: 0.25rem 0.45rem;
  border: 0;
  background: transparent;
  color: var(--brand-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.action-status-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--overlay-backdrop);
}

.action-status-overlay[hidden] {
  display: none;
}

.action-status-panel {
  width: min(31rem, 100%);
  overflow: hidden;
  padding: 1.4rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-surface);
  background: var(--bg-surface);
  box-shadow: var(--shadow-surface);
}

.action-status-panel__track,
.operation-progress-line {
  position: relative;
  display: block;
  height: 0.2rem;
  overflow: hidden;
  background: var(--status-neutral-surface);
}

.action-status-panel__track::after,
.operation-progress-line::after {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 42%;
  background: var(--brand-accent);
  content: "";
  animation: action-progress 1.25s ease-in-out infinite;
}

.operation-progress-line {
  width: 100%;
  margin-block-start: 0.85rem;
}

.action-status-panel__label {
  margin: 1rem 0 0.25rem;
  color: var(--text-primary);
  font-family: "Sora", "Noto Sans Arabic", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
}

.action-status-panel__detail {
  margin: 0;
  color: var(--text-secondary);
}

.inline-action-status {
  display: inline-block;
  margin-inline-start: 0.65rem;
  color: var(--status-warning-text);
  font-size: 0.85rem;
}

form[aria-busy="true"] button[type="submit"]:disabled,
form[aria-busy="true"] input[type="submit"]:disabled {
  cursor: wait;
  opacity: 0.68;
}

body.is-action-pending {
  overflow: hidden;
}

@keyframes action-progress {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(240%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .system-notification {
    transition: none;
  }

  .action-status-panel__track::after,
  .operation-progress-line::after {
    width: 100%;
    transform: none;
    animation: none;
  }
}

.empty-state {
  max-width: 52rem;
  padding-block: clamp(2.5rem, 8vw, 6rem);
  border-block: 1px solid var(--border-subtle);
}

.empty-state h2 {
  margin: 0.6rem 0 0.8rem;
  font-family: "Sora", "Noto Sans Arabic", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.empty-state > p:not(.eyebrow) {
  max-width: 38rem;
  color: var(--text-secondary);
}

.empty-state .primary-action {
  margin-block-start: 1rem;
}

.table-shell {
  overflow-x: auto;
  border-block-start: 1px solid var(--border-strong);
  border-radius: var(--radius-surface);
  background: var(--bg-surface);
}

.production-table {
  width: 100%;
  border-collapse: collapse;
}

.production-table th,
.production-table td {
  padding: 1rem 0.8rem;
  border-block-end: 1px solid var(--border-subtle);
  text-align: start;
  vertical-align: middle;
}

.production-table th {
  color: var(--text-muted);
  font-family: "IBM Plex Mono", "Noto Sans Arabic", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  background: color-mix(in srgb, var(--bg-surface) 86%, var(--brand-accent) 14%);
}

.production-table td {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.production-table td:first-child {
  color: var(--text-primary);
}

.production-table small {
  display: block;
  margin-block-start: 0.2rem;
  color: var(--text-muted);
}

.project-link {
  color: var(--text-primary);
  font-weight: 700;
  text-decoration-color: var(--brand-accent);
  text-underline-offset: 0.2rem;
}

.status-label {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-label--ready {
  background: var(--status-success-surface);
  color: var(--status-success-text);
}

.status-label--working,
.status-label--attention {
  background: var(--status-warning-surface);
  color: var(--status-warning-text);
}

.status-label--neutral {
  background: var(--status-neutral-surface);
  color: var(--status-neutral-text);
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.9rem;
  margin-block: 1.5rem 2rem;
}

.report-metrics article {
  display: grid;
  gap: 0.3rem;
  padding: 1.1rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.report-metrics span,
.report-metrics small,
.report-generated {
  color: var(--text-muted);
}

.report-metrics strong {
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.report-section {
  margin-block: 2rem;
}

.admin-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.admin-hub a {
  display: grid;
  gap: 0.4rem;
  min-height: 8rem;
  padding: 1.25rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow-surface);
}

.admin-hub a:hover,
.admin-hub a:focus-visible {
  border-color: var(--brand-accent);
}

.admin-hub span {
  color: var(--text-muted);
}

.admin-edit-section {
  margin-block: 1.5rem;
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.admin-edit-section--danger {
  border-color: var(--status-warning-text);
}

.checkbox-field {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.6rem !important;
}

.production-form {
  width: min(100%, 58rem);
}

.narrow-form {
  width: min(100%, 36rem);
}

.form-section {
  margin: 0 0 2.5rem;
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-surface);
  background: var(--bg-surface);
}

.form-section legend {
  width: 100%;
  margin-block-end: 1.25rem;
  padding-block-end: 0.65rem;
  border-block-end: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: "Sora", "Noto Sans Arabic", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.form-field {
  display: grid;
  gap: 0.45rem;
  margin-block-end: 1.15rem;
}

.form-field--wide {
  grid-column: 1 / -1;
}

.form-field label {
  color: var(--text-primary);
  font-weight: 700;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.form-field textarea {
  resize: vertical;
}

.form-field input:hover,
.form-field textarea:hover,
.form-field select:hover {
  border-color: var(--brand-muted);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--brand-accent) 22%, transparent);
}

.heading-separator {
  color: var(--brand-muted);
  font-weight: 400;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 1.1rem;
}

.section-heading h2 {
  margin: 0.35rem 0 0;
}

@media (prefers-color-scheme: light) {
  :root {
    --shadow-surface: 0 1.2rem 3.5rem rgba(34, 51, 84, 0.08);
    --grid-line: rgba(66, 102, 175, 0.035);
  }

  .production-header {
    background: color-mix(in srgb, var(--bg-base) 92%, transparent);
  }
}

@media (max-width: 70rem) {
  .production-header__inner {
    align-items: flex-start;
    padding-block: 0.75rem;
  }

  .primary-nav {
    max-width: calc(100vw - 12rem);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

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

  .production-rail {
    position: static;
    min-height: auto;
    padding: 1rem 0;
    border-inline-end: 0;
    border-block-end: 1px solid var(--border-subtle);
  }

  .production-rail__label {
    display: none;
  }

  .production-rail ol {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-block-start: 0;
  }

  .production-rail li {
    grid-template-columns: 1fr;
    padding: 0.65rem;
    border-inline-start: 0;
    border-block-end: 2px solid var(--border-subtle);
    text-align: center;
  }

  .production-rail li.is-current,
  .production-rail li.is-complete {
    border-block-end-color: var(--brand-accent);
  }
}

@media (max-width: 48rem) {
  .production-header__inner {
    display: grid;
    gap: 0.65rem;
  }

  .primary-nav {
    width: calc(100vw - 2rem);
    max-width: none;
  }

  .production-logo {
    width: 6.5rem;
  }

  .main-content {
    padding: 1.5rem 1rem 3rem;
  }

  .page-heading--with-action,
  .project-header,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .question-actions,
  .form-actions {
    width: 100%;
  }

  .question-actions > *,
  .form-actions > * {
    flex: 1 1 auto;
  }

  .production-rail li {
    font-size: 0.72rem;
  }

  .production-rail li span {
    display: none;
  }
}

.field-help {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.field-validation-error,
.validation-summary,
.text-danger {
  color: var(--status-warning-text);
  font-size: 0.85rem;
}

.validation-summary:empty,
.validation-summary-valid {
  display: none;
}

.validation-summary ul {
  margin-block: 0 1.25rem;
  padding-inline-start: 1.2rem;
}

.input-validation-error {
  border-color: var(--status-warning-text) !important;
}

.upload-zone {
  display: grid;
  min-height: 13rem;
  place-content: center;
  gap: 0.45rem;
  padding: 2rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-surface);
  background: var(--bg-surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: var(--brand-accent);
  background: var(--bg-surface-hover);
}

.upload-zone__mark {
  color: var(--brand-muted);
  font-size: 2rem;
}

.upload-zone__title {
  color: var(--text-primary);
  font-weight: 700;
}

.upload-zone__filename {
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--border-subtle);
}

.inline-admin-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 12rem;
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.catalog-toolbar .form-field {
  flex: 1 1 18rem;
}

.checkbox-field {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  color: var(--text-secondary);
}

.checkbox-field input {
  inline-size: 1.05rem;
  block-size: 1.05rem;
  accent-color: var(--brand-accent);
}

.catalog-create > summary,
.mapping-summary > summary {
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 700;
}

.catalog-create[open] > summary,
.mapping-summary[open] > summary {
  margin-bottom: 1.25rem;
}

.mapping-summary {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
}

.mapping-summary dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.mapping-summary dl > div {
  display: grid;
  gap: 0.2rem;
}

.mapping-summary dt {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.mapping-summary dd {
  margin: 0;
}

.import-issues {
  margin: 0;
  padding-inline-start: 1rem;
  font-size: 0.82rem;
}

.import-issue--error {
  color: var(--brand-red);
}

.import-issue--warning {
  color: var(--status-warning-text);
}

.inline-admin-form input {
  min-width: 0;
  width: 8rem;
  padding: 0.55rem 0.65rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
}

.usage-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-surface);
  background: var(--border-subtle);
}

.usage-summary > div {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--bg-surface);
}

.usage-summary span {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.usage-summary strong {
  font-family: var(--font-mono);
  font-size: 1.1rem;
}

@media (max-width: 720px) {
  .usage-summary {
    grid-template-columns: 1fr;
  }
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.75fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
  min-height: 60dvh;
}

.auth-form {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-block: 1px solid var(--border-strong);
  background: var(--bg-surface);
}

.auth-form .primary-action {
  width: 100%;
  margin-block-start: 0.5rem;
}

.project-header {
  padding-block-end: 1.5rem;
  border-block-end: 1px solid var(--border-strong);
}

.project-register {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.6fr);
  gap: clamp(2rem, 6vw, 6rem);
}

.project-register h2,
.file-register h2 {
  margin: 0.5rem 0 1rem;
  font-family: "Sora", "Noto Sans Arabic", sans-serif;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.project-register h3 {
  margin-block-start: 2rem;
  font-size: 1rem;
}

.pre-line {
  color: var(--text-secondary);
  white-space: pre-line;
}

.project-register__meta {
  margin: 0;
}

.project-register__meta div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-block: 0.8rem;
  border-block-end: 1px solid var(--border-subtle);
}

.project-register__meta dt {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.project-register__meta dd {
  margin: 0;
  font-family: "IBM Plex Mono", "Noto Sans Arabic", monospace;
  font-size: 0.82rem;
}

.file-register {
  margin-block-start: clamp(3rem, 8vw, 6rem);
}

.file-register ol {
  margin: 0;
  padding: 0;
  border-block-start: 1px solid var(--border-strong);
  list-style: none;
}

.file-register li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6rem 7rem;
  gap: 1rem;
  padding-block: 0.9rem;
  border-block-end: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.file-register__name {
  overflow: hidden;
  color: var(--text-primary);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-page {
  max-width: 48rem;
  padding-block: 8vh;
}

.message-page .secondary-action {
  margin-block-start: 1.25rem;
}

.production-footer {
  border-block-start: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.production-footer p {
  margin: 0;
  padding-block: 1.25rem;
}

@media (max-width: 767.98px) {
  .shell-container {
    width: min(calc(100% - 1.25rem), var(--shell-width));
  }

  .brand-product {
    display: none;
  }

  .production-logo {
    width: 6.5rem;
  }

  .shell-layout {
    display: block;
  }

  .production-rail {
    padding: 1rem 0;
    border-inline-end: 0;
    border-block-end: 1px solid var(--border-subtle);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .production-rail::-webkit-scrollbar {
    display: none;
  }

  .production-rail__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .production-rail ol {
    display: flex;
    width: max-content;
    margin: 0;
  }

  .production-rail li {
    padding: 0.45rem 0.8rem;
    border-inline-start: 0;
    border-block-end: 1px solid var(--border-subtle);
    white-space: nowrap;
  }

  .production-rail li.is-current {
    border-block-end-color: var(--brand-accent);
  }

  .main-content {
    padding: 2.5rem 0.25rem 4rem;
  }

  .primary-nav {
    gap: 0;
  }

  .nav-link,
  .nav-signout button {
    padding-inline: 0.55rem;
    font-size: 0.82rem;
  }

  .page-heading--with-action,
  .project-header,
  .auth-layout,
  .project-register {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field--wide {
    grid-column: auto;
  }

  .production-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .production-table,
  .production-table tbody,
  .production-table tr,
  .production-table td {
    display: block;
    width: 100%;
  }

  .production-table tr {
    padding-block: 0.75rem;
    border-block-end: 1px solid var(--border-strong);
  }

  .production-table td {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 1rem;
    padding: 0.45rem 0;
    border: 0;
  }

  .production-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.78rem;
  }

  .file-register li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .file-register li span:last-child {
    grid-column: 1 / -1;
  }

  .foundation-status {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

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