/* ── Bootstrap MVC base (keep defaults working) ─────────── */
html {
  font-size: 14px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* ── App design tokens ─────────────────────────────────────── */
/* Token values live in design-system.css (DESIGN.md).
   Keep only layout overrides here that are not part of the shared system. */
:root {
  --sidebar-w: 260px;
  --content-max: 1200px;
  --page-max: 1280px;
  --header-h: 64px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Client secure-form / token views: no fixed site header — drop reserved top space. */
body.layout-no-site-header {
  --header-h: 0px;
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 100;
}
.site-header .header-inner {
  height: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.header-logo:hover { text-decoration: none; }
.header-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.header-logo .logo-icon svg { width: 18px; height: 18px; fill: #fff; }
.header-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: 1.5rem;
}
.header-nav a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.header-nav a:hover { background: var(--bg-sub); color: var(--text-primary); text-decoration: none; }
.header-nav a.active { background: var(--accent-light); color: var(--accent-dark); }
.header-spacer { flex: 1; }
.header-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-dark);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius-full);
  padding: 4px 12px;
}
.header-action {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  text-decoration: none;
  transition: background .15s;
}
.header-action:hover { background: var(--accent-dark); text-decoration: none; color: #fff; }
.header-deployment-action {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-deployment-action .deployment-start-form {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.header-deployment-action .btn-start {
  white-space: nowrap;
}
.deployment-branch-field {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin: 0;
  min-width: 10rem;
}
.deployment-branch-field__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.deployment-branch-field__input {
  min-width: 11rem;
  max-width: 16rem;
  padding: 6px 10px;
  font-size: 12.5px;
  font-family: var(--font-mono);
}

/* ── Main content area ─────────────────────────────────────── */
.site-main {
  padding: calc(var(--header-h) + 1.5rem) var(--page-gutter) 3rem;
}

.page-shell {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
}

.form-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  width: 100%;
  max-width: calc(var(--page-max) + var(--sidebar-w) + 2rem);
  margin: 0 auto;
  align-items: start;
}

.form-shell__sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  align-self: start;
  min-width: 0;
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow-y: auto;
  z-index: 10;
}

.form-shell__content {
  min-width: 0;
  max-width: var(--content-max);
}

/* ── Sidebar ────────────── */
.sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.25rem 0;
}
.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 1.25rem;
  margin-bottom: .5rem;
}
.sidebar-nav { list-style: none; padding: 0; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 1.25rem;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background .12s, color .12s;
}
.sidebar-nav a:hover { background: var(--bg-sub); color: var(--text-primary); text-decoration: none; }
.sidebar-nav a.active {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-left-color: var(--accent);
  font-weight: 500;
}
.sidebar-nav a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; stroke: currentColor; fill: none; }
.sidebar-nav a.active svg { opacity: 1; }

/* ── Page typography ───────────────────────────────────────── */
.page-title {
  font: var(--type-headline-md);
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.page-sub {
  font: var(--type-body-md);
  color: var(--text-secondary);
  margin-bottom: 2rem;
}
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

/* ── Workflow page context (Dashboard / Progress) ───────── */
.workflow-page-header {
  width: 100%;
  min-width: 0;
}
.workflow-page-header__lead {
  margin: 0.35rem 0 1rem;
}
.workflow-context-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-sub);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}
.workflow-context-meta--with-job {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.workflow-context-meta__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.workflow-context-meta__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.workflow-context-meta__value {
  font-size: 14px;
  font-weight: 550;
  color: var(--text-primary);
  word-break: break-word;
}
.workflow-context-meta__value.mono-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 500;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .875rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 14px;
}
.alert-banner--success { background: var(--success-light); color: #166534; border: 1px solid #86EFAC; }
.alert-banner--info { background: var(--accent-light); color: var(--accent-dark); border: 1px solid rgba(59,108,244,.2); }
.alert-banner--warn { background: var(--warn-light); color: #92400E; border: 1px solid #FCD34D; }
.alert-banner--danger { background: var(--danger-light); color: #991B1B; border: 1px solid #FCA5A5; }
.alert-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* ── Repository merge progress ─────────────────────────────── */
.merge-progress-card {
  padding: 1.75rem;
}

.merge-progress-card__header {
  margin-bottom: 1.5rem;
}

.merge-progress-card__header--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.merge-progress-card__actions {
  flex-shrink: 0;
}

.merge-progress-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 .35rem;
}

.merge-progress-card__subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.merge-progress-bar--retrying .merge-progress-bar__fill {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
}

.workflow-step-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem .9rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-sub);
}

.workflow-step__icon {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  flex-shrink: 0;
  margin-top: .1rem;
  border: 2px solid var(--border-soft);
  background: var(--bg-card);
}

.workflow-step--running .workflow-step__icon {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: workflow-step-spin .8s linear infinite;
}

.workflow-step--completed .workflow-step__icon {
  border-color: var(--success);
  background: var(--success);
}

.workflow-step--failed .workflow-step__icon {
  border-color: #DC2626;
  background: #DC2626;
}

.workflow-step--cancelled .workflow-step__icon,
.workflow-step--skipped .workflow-step__icon {
  border-color: var(--text-muted);
  background: var(--text-muted);
}

.workflow-step__body {
  min-width: 0;
}

.workflow-step__title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.workflow-step__detail {
  font-size: 13px;
  color: var(--text-muted);
  margin: .2rem 0 0;
}

.workflow-dash-error {
  font-size: 13px;
  color: #DC2626;
  margin-top: .25rem;
}

/* Dashboard workflow panel: one card and one table for every workflow. */
.workflow-panel {
  margin-bottom: 0;
}

/* Table sits flush inside the panel card; scrolls sideways on small screens. */
.workflow-panel__table {
  overflow-x: auto;
}

/* The table header doubles as the card header, so it gets a stronger tint. */
.workflow-panel__table thead th {
  background: #CED4D9;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: bold;
}

/* Full-width heading row that groups the iOS and Android workflows. */
.workflow-group-row td,
.workflow-group-row:hover td {
  background: var(--bg-sub);
  border-top: 1px solid var(--border-soft);
}

.workflow-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workflow-group__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.workflow-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.workflow-status-badge__dot {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--text-muted);
}

.workflow-status-badge--notstarted .workflow-status-badge__dot {
  background: #94A3B8;
}

.workflow-status-badge--queued .workflow-status-badge__dot {
  background: #f59e0b;
}

.workflow-status-badge--queued {
  color: #b45309;
}

.workflow-status-badge--running .workflow-status-badge__dot {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  animation: workflow-status-pulse 1.25s ease-out infinite;
}

.workflow-status-badge--running {
  color: #15803D;
}

.workflow-status-badge--completed .workflow-status-badge__dot {
  background: var(--success);
}

.workflow-status-badge--completed {
  color: #15803D;
}

.workflow-status-badge--failed .workflow-status-badge__dot {
  background: #DC2626;
}

.workflow-status-badge--failed {
  color: #B91C1C;
}

.workflow-status-badge--cancelled .workflow-status-badge__dot,
.workflow-status-badge--skipped .workflow-status-badge__dot {
  background: #F59E0B;
}

.workflow-status-badge--cancelled,
.workflow-status-badge--skipped {
  color: #B45309;
}

@keyframes workflow-status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes workflow-step-spin {
  to { transform: rotate(360deg); }
}

.merge-progress-card__repo-link {
  font-size: 14px;
  font-family: var(--font-mono);
  word-break: break-all;
}

.merge-progress-bar {
  height: 12px;
  background: var(--bg-sub);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.merge-progress-bar__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #5B8DF6);
  border-radius: 999px;
  transition: width .35s ease;
}

.merge-progress-bar[aria-valuenow="100"] .merge-progress-bar__fill {
  background: linear-gradient(90deg, var(--success), #22C55E);
}

.merge-progress-status {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 .35rem;
}

.merge-progress-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.merge-result-banner {
  margin-top: 1rem;
  margin-bottom: 0;
}

.merge-progress-actions {
  margin-top: 1.5rem;
}

/* ── Section card ─────────────────────────────────────────────── */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.section[id] {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}
.section-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-icon svg { width: 16px; height: 16px; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
/* Brand logos keep their own colors, so the tinted tile background is dropped. */
.section-icon--logo { background: transparent; }
.section-icon--logo img { width: 22px; height: 22px; object-fit: contain; display: block; }
.icon-org    { background: #EEF2FF; } .icon-org svg    { stroke: #4F46E5; }
.icon-app    { background: #F0FDF4; } .icon-app svg    { stroke: #16A34A; }
.icon-apple  { background: #F1F5F9; } .icon-apple svg  { stroke: #334155; }
.icon-assets { background: #FDF4FF; } .icon-assets svg { stroke: #9333EA; }
.icon-contact{ background: #FFF7ED; } .icon-contact svg{ stroke: #EA580C; }
.icon-identifiers { background: #F0F9FF; } .icon-identifiers svg { stroke: #0284C7; }
.icon-mobile { background: #FFF7ED; } .icon-mobile svg { stroke: #EA580C; }
.icon-website { background: #F0FDF4; } .icon-website svg { stroke: #16A34A; }
.icon-onesignal { background: #EEF2FF; } .icon-onesignal svg { stroke: #4F46E5; }
.icon-firebase { background: #FFF7ED; } .icon-firebase svg { stroke: #EA580C; }
.section-title-group { flex: 1; }
.section-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.section-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.section-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-required {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #FCA5A5;
}
.section-body { padding: 1.5rem; }

/* ── Sub-section ─────────────────────────────────────────────── */
.subsection {
  background: var(--bg-sub);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.subsection:last-child { margin-bottom: 0; }
.subsection-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border-soft);
}
.subsection-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.subsection-icon {
  width: 22px; height: 22px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
}
.subsection-icon svg { width: 13px; height: 13px; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sub-logo   { background: #FDF4FF; } .sub-logo svg   { stroke: #7E22CE; }
.sub-splash { background: #FFF7ED; } .sub-splash svg { stroke: #C2410C; }
.sub-play   { background: #ECFDF5; } .sub-play svg   { stroke: #059669; }
.sub-android { background: #ECFDF5; } .sub-android svg { stroke: #059669; }
.sub-ios    { background: #F1F5F9; } .sub-ios svg    { stroke: #334155; }
.sub-edition { background: #EEF2FF; } .sub-edition svg { stroke: #4338CA; fill: none; }

/* ── Edition & Plan subsection ─────────────────────────── */
.edition-plan-readonly {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
}
.secret-readonly-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}
.secret-readonly-value {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}
.secret-reveal-btn {
  flex-shrink: 0;
  min-width: 40px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.secret-reveal-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.secret-reveal-btn.is-revealed svg path:first-child,
.secret-reveal-btn.is-revealed svg circle {
  opacity: 0.85;
}
.edition-plan-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1rem;
}
.edition-plan-messages {
  margin-bottom: 1rem;
}
.edition-plan-alert {
  margin-bottom: 0.75rem;
}
.edition-plan-alert:last-child {
  margin-bottom: 0;
}

/* ── Grid ─────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.col-full { grid-column: 1 / -1; }
.spacer { margin-top: 1rem; }

/* ── Field ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.field-doc-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.field-doc-link:hover { text-decoration: underline; }
.field-doc-link svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.field-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.field-label-row .field-label-wrap { flex: 1; }
.field-label-wrap--asset,
.field-label-wrap--upload {
  width: 100%;
  justify-content: space-between;
  margin-bottom: 2px;
}
.field-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.field-help-btn:hover {
  /*background: var(--accent);
  color: #fff;*/
}
.field-help-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.field-help-btn svg circle,
.field-help-btn svg path,
.field-help-btn svg line { vector-effect: non-scaling-stroke; }
.field-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, .45);
}
.field-help-overlay[hidden] { display: none; }
.field-help-dialog {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(15, 23, 42, .15);
  overflow: hidden;
}
.field-help-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-sub);
}
.field-help-dialog-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.field-help-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.field-help-close:hover {
  background: #fff;
  color: var(--text-primary);
}
.field-help-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
.field-help-dialog-body {
  padding: 1.25rem;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.field-help-dialog-body .alert-banner {
  margin-bottom: 0;
}

/* ── Workflow skip / revert warning dialog ───────────────── */
.workflow-warn-overlay {
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
}
.workflow-warn-dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 1.75rem 1.5rem 1.35rem;
  background: #fff;
  border: 1px solid #FCD34D;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(15, 23, 42, .2);
  text-align: center;
}
.workflow-warn-dialog[data-mode="revert"] {
  border-color: rgba(59, 108, 244, .35);
}
.workflow-warn-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
}
.workflow-warn-dialog__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto .9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--warn-light);
  color: var(--warn);
  box-shadow: inset 0 0 0 1px #FCD34D;
}
.workflow-warn-dialog[data-mode="revert"] .workflow-warn-dialog__icon {
  background: var(--accent-light);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(59, 108, 244, .25);
}
.workflow-warn-dialog__icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.workflow-warn-dialog__eyebrow {
  margin: 0 0 .35rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #B45309;
}
.workflow-warn-dialog[data-mode="revert"] .workflow-warn-dialog__eyebrow {
  color: var(--accent-dark);
}
.workflow-warn-dialog__title {
  margin: 0 0 .65rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}
.workflow-warn-dialog__text {
  margin: 0 auto 1.35rem;
  max-width: 32ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.workflow-warn-dialog__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .6rem;
}
.btn-warn {
  background: var(--warn);
  color: #fff;
  border-color: var(--warn);
}
.btn-warn:hover {
  background: #B45309;
  border-color: #B45309;
  color: #fff;
}
.workflow-warn-dialog[data-mode="revert"] .btn-warn {
  background: var(--accent);
  border-color: var(--accent);
}
.workflow-warn-dialog[data-mode="revert"] .btn-warn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.required { color: var(--danger); font-size: 11px; }
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.35rem;
}
.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.radio-option input[type="radio"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}
.field-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
    text-align: right;
}
.field-error,
.field-validation-error,
.text-danger {
  font-size: 12px;
  color: var(--danger) !important;
}
.validation-summary-valid {
  display: none;
}
.validation-summary-errors {
  background: var(--danger-light);
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-md);
  padding: .875rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 13px;
  color: #991B1B;
  list-style: none;
}
.validation-summary-errors ul { margin: 0; padding-left: 1.25rem; }

/* ── Inputs ─────────────────────────────────────────────── */
.form-input,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-input:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="url"]:hover,
input[type="tel"]:hover { border-color: var(--border-mid); }
.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}
.input-validation-error,
.form-input.input-validation-error {
  border-color: var(--danger) !important;
}
textarea {
  resize: vertical;
  min-height: 88px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
}
.mono-input { font-family: var(--font-mono); font-size: 13px; letter-spacing: .01em; }
input[type="file"].file-hidden { display: none; }

/* ── Upload zones ─────────────────────────────────────────────── */
.asset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.asset-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.assets-or-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assets-or-divider::before,
.assets-or-divider::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--border-soft);
}

.assets-or-divider span {
  flex: 0 0 auto;
}
.asset-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.spec-badge {
  font-size: 10.5px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-page);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 6px;
}
.upload-zone {
  border: 1.5px dashed var(--border-mid);
  border-radius: var(--radius-md);
  padding: .875rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: var(--bg-card);
  transition: border-color .15s, background .15s;
  text-align: center;
  min-height: 90px;
  justify-content: center;
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-light); }
.upload-zone.has-file {
  border-color: var(--success);
  background: var(--success-light);
  border-style: solid;
}
.upload-zone.upload-zone--invalid {
  border-color: var(--danger) !important;
  background: #FEF2F2;
  border-style: solid;
}
.upload-zone.upload-zone--invalid:hover {
  border-color: var(--danger) !important;
  background: #FEE2E2;
}
.upload-zone svg { width: 22px; height: 22px; stroke: var(--text-muted); fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.upload-zone:hover svg { stroke: var(--accent); }
.upload-zone.has-file svg { stroke: var(--success); }
.upload-zone.upload-zone--invalid svg { stroke: var(--danger); }
.upload-label { font-size: 12px; color: var(--text-secondary); }
.upload-spec { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.upload-filename {
  font-size: 11.5px;
  color: var(--success);
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-wrap {
  display: none;
  margin-top: 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 64px;
  height: 64px;
  background: var(--bg-sub);
}
.preview-wrap.visible { display: block; }
.preview-wrap img { width: 100%; height: 100%; object-fit: contain; }
.existing-file-note {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Firebase / config uploads ─────────────────────────────── */
.config-upload-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.config-upload-item {
  min-width: 0;
}
.config-upload-zone {
  min-height: 120px;
}
.upload-status {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 4px;
}
.upload-status--ok { color: var(--success); }
.upload-status--pending { color: var(--text-muted); }

/* ── Detail view ─────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
}
.detail-item--full { grid-column: 1 / -1; }
.detail-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.detail-value {
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-word;
}
.detail-value a { word-break: break-all; }
.asset-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.asset-preview-card {
  background: var(--bg-sub);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: .75rem;
  text-align: center;
}
.asset-preview-card img {
  max-height: 100px;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.asset-preview-card .detail-label { margin-bottom: .5rem; }
.meta-line {
  font-size: 13px;
  color: var(--text-muted);
  margin: 1.5rem 0;
}

/* ── Data table (Index) ─────────────────────────────────────────────── */
.data-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  background: var(--bg-sub);
  border-bottom: 1px solid var(--border-soft);
}
.data-table td {
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-sub); }
.data-table .cell-muted { color: var(--text-secondary); font-size: 13px; }
.table-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-ghost {
  background: none;
  color: var(--text-secondary);
  border-color: var(--border-soft);
}
.btn-ghost:hover { background: var(--bg-sub); border-color: var(--border-mid); color: var(--text-primary); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: #B91C1C; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-outline {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border-soft);
}
.btn-outline:hover { background: var(--bg-sub); color: var(--text-primary); }
.btn-outline--danger { color: var(--danger); border-color: #FCA5A5; }
.btn-outline--danger:hover { background: var(--danger-light); }
.btn-start {
  background: var(--ds-tertiary);
  color: #fff;
  border-color: var(--ds-tertiary);
}
.btn-start:hover {
  background: var(--ds-tertiary-deep);
  border-color: var(--ds-tertiary-deep);
  color: #fff;
}
.btn-start:disabled,
.btn-start:disabled:hover {
  background: #6ee7b7;
  border-color: #6ee7b7;
  color: #065f46;
  cursor: not-allowed;
  pointer-events: auto;
}

.btn-outline-primary {
  background: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline-primary:hover {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: var(--accent);
}

/* ── Form footer ─────────────────────────────────────────────── */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-right { display: flex; align-items: center; gap: .75rem; }
.footer-hint { font-size: 13px; max-width: 28rem; line-height: 1.4; }
.footer-save-reminder {
  margin: 1.5rem 0 0;
  padding: .75rem 1rem;
  font-size: 13px;
  line-height: 1.45;
  background: var(--bg-sub);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}
.deployment-start-form { margin: 0; display: inline; }
.footer-hint { font-size: 13px; max-width: 28rem; line-height: 1.4; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-lg);
}
.empty-state p { color: var(--text-secondary); font-size: 14px; margin-bottom: 1.25rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .form-shell {
    grid-template-columns: 1fr;
    max-width: var(--page-max);
  }

  .form-shell__content {
    max-width: none;
  }

  .form-shell__sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 900px) {
  .grid-2, .grid-3, .detail-grid, .asset-grid, .asset-grid-3, .config-upload-stack { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .workflow-context-meta,
  .workflow-context-meta--with-job {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-row .btn {
    width: 100%;
  }

  .header-action {
    padding: 7px 10px;
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .header-badge { display: none; }
  .table-actions { justify-content: flex-start; }
  .data-table th:nth-child(3),
  .data-table td:nth-child(3),
  .data-table th:nth-child(4),
  .data-table td:nth-child(4) { display: none; }
  .data-table { min-width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Admin Control Panel */
.acp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.pagination-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pagination-status {
  color: var(--text-secondary);
  font-size: 13px;
}

.table-sort-link {
  color: inherit;
  text-decoration: none;
}

.table-sort-link:hover {
  color: var(--accent);
}

/* Admin Control Panel shell — mirrors .form-shell grid so sidebar and content never overlap */
.site-main--acp {
  padding-top: calc(var(--header-h) + 1.25rem);
  padding-bottom: 3rem;
}

.acp-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  width: 100%;
  max-width: calc(var(--page-max) + var(--sidebar-w) + 2rem);
  margin: 0 auto;
  align-items: start;
  position: relative;
}

.acp-shell__sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1.25rem);
  align-self: start;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  flex-shrink: 0;
  z-index: 20;
}

.acp-shell__content {
  min-width: 0;
  max-width: var(--content-max);
  width: 100%;
}

.acp-sidebar {
  width: 100%;
  box-shadow: var(--shadow-card);
}

.acp-mobile-bar {
  display: none;
  margin-bottom: 1rem;
}

.acp-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.acp-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(17, 24, 39, 0.35);
  cursor: pointer;
}

.acp-page-header {
  margin-bottom: 1.25rem;
}

.acp-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.acp-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.acp-metric-card__label {
  margin: 0 0 0.35rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.acp-metric-card__value {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-primary);
}

.acp-metric-card__description {
  margin: 0 0 0.75rem;
  font-size: 13px;
  color: var(--text-muted);
}

.acp-metric-card__link {
  font-size: 13px;
  font-weight: 500;
}

.acp-dashboard-section {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.acp-section-title {
  margin: 0 0 0.75rem;
  font-size: 14px;
  font-weight: 600;
}

.acp-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 1024px) {
  .acp-shell {
    grid-template-columns: 1fr;
    max-width: var(--page-max);
  }

  .acp-shell__sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: min(var(--sidebar-w), 85vw);
    min-width: 0;
    max-width: min(var(--sidebar-w), 85vw);
    padding: 1rem 0.75rem 1.5rem;
    background: var(--bg-page);
    border-right: 1px solid var(--border-soft);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    transform: translateX(-110%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    z-index: 30;
  }

  .acp-shell--nav-open .acp-shell__sidebar {
    transform: translateX(0);
  }

  .acp-shell--nav-open .acp-sidebar-backdrop {
    display: block;
  }

  .acp-shell__content {
    max-width: none;
    grid-column: 1 / -1;
  }

  .acp-mobile-bar {
    display: block;
  }
}

@media (min-width: 1025px) {
  .acp-sidebar-backdrop {
    display: none !important;
  }
}

body.acp-nav-open {
  overflow: hidden;
}

/* ── Beta testing users (iPhone / Android email lists) ─── */
.beta-testers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.beta-testers-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--surface, #fff);
}

.beta-testers-panel__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.beta-testers-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  /*margin-top: 0.75rem;*/
}

.beta-testers-add-row .form-input {
  flex: 1;
  min-width: 0;
}

.beta-testers-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.beta-testers-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-muted, #f7f7f8);
}

.beta-testers-list__email {
  font-size: 13px;
  word-break: break-all;
  color: var(--text-primary);
}

.beta-testers-list__remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
}

.beta-testers-list__remove:hover {
  color: var(--danger, #c0392b);
}

@media (max-width: 768px) {
  .beta-testers-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Design source multi-file list ─────────────────────── */
.design-source-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.design-source-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-muted, #f7f7f8);
}

.design-source-list__name {
  font-size: 13px;
  word-break: break-all;
  color: var(--text-primary);
}

.design-source-list__remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
}

.design-source-list__remove:hover {
  color: var(--danger, #c0392b);
}


