/* App config admin — stepped card UI (reference: tall inputs, green CTAs, gradient shell) */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&family=Open+Sans:wght@400;600&display=swap");

:root {
  --ac-green: #27ae60;
  --ac-green-hover: #219a52;
  --ac-green-muted: rgba(39, 174, 96, 0.15);
  --ac-card: #ffffff;
  --ac-text: #2c3e50;
  --ac-text-soft: #7f8c8d;
  --ac-border: #dfe4ea;
  --ac-placeholder: #95a5a6;
  --ac-radius: 12px;
  --ac-shadow: 0 12px 40px rgba(44, 62, 80, 0.12);
  --ac-step-inactive: #ecf0f1;
  /* Desktop-first editor width (was 40rem — too narrow on large screens) */
  --ac-page-max-width: 52rem;
  /* Fixed bottom nav (wizard + setup): reserve scroll space + safe area */
  --ac-nav-dock-pad: calc(5.25rem + env(safe-area-inset-bottom, 0px));
}

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

html {
  min-height: 100%;
}

body.ac-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Open Sans", system-ui, sans-serif;
  font-size: 15px;
  color: var(--ac-text);
  background: linear-gradient(165deg, #f39c6b 0%, #9b59b6 45%, #6c5ce7 100%);
  background-attachment: fixed;
}

.ac-page {
  max-width: var(--ac-page-max-width);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}

/* Extra bottom space when the editor wizard dock is shown */
.ac-page:has(#acEditorShell:not([hidden])) {
  padding-bottom: var(--ac-nav-dock-pad);
}

.ac-page-title {
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
  text-align: center;
  margin: 0 0 1.25rem 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.ac-toolbar {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border-radius: var(--ac-radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.ac-toolbar .ac-label {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.65rem;
}

.ac-toolbar .ac-label:first-child {
  margin-top: 0;
}

.ac-toolbar input,
.ac-toolbar select {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.95);
  font-family: inherit;
  font-size: 0.95rem;
}

.ac-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.ac-toolbar-row--split {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.65rem;
  align-items: flex-end;
}

.ac-toolbar-field {
  min-width: 0;
}

.ac-toolbar-field--2 {
  flex: 2;
}

.ac-toolbar-field--1 {
  flex: 1;
  min-width: 8rem;
}

.ac-toolbar-row--saved-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.65rem;
  align-items: flex-end;
}

.ac-toolbar-field--grow {
  flex: 1 1 14rem;
  min-width: 0;
}

.ac-toolbar-field--btn {
  flex: 0 0 auto;
}

.ac-toolbar-field--btn .btn-ac:not(.btn-ac--icon) {
  white-space: nowrap;
}

.btn-ac--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  min-width: 2.65rem;
  min-height: 2.65rem;
}

.btn-ac--icon svg {
  display: block;
}

.ac-toolbar-saved-hint {
  margin: 0.4rem 0 0 0;
  font-size: 0.76rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
}

.ac-toolbar-saved-hint code {
  font-size: 0.85em;
  padding: 0.05rem 0.25rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.12);
}

/* Ghost on glass toolbars: default grey is for white cards only */
.ac-toolbar .btn-ac--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.14);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

.ac-toolbar .btn-ac--ghost:hover {
  background: rgba(255, 255, 255, 0.26);
  color: #fff;
  border-color: #fff;
}

.ac-toolbar .btn-ac--ghost:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Setup wizard (1 · Login → 2 · Load or create) */
.ac-setup-flow {
  margin-bottom: 1.25rem;
}

.ac-setup-card {
  margin-bottom: 0;
}

.ac-setup-panel {
  padding-top: 0.25rem;
}

.ac-setup-login-form {
  margin: 0;
  padding: 0;
  border: 0;
}

.ac-setup-heading {
  font-family: Montserrat, sans-serif;
  font-size: 1.15rem;
  margin: 0 0 0.35rem 0;
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.ac-setup-credential-field {
  margin-top: 0.85rem;
}

.ac-setup-credential-field:first-of-type {
  margin-top: 0.4rem;
}

/* Mask API key like a password while keeping type="text" so password managers fill "username" reliably. */
.ac-setup-credential-field--api-key input#adminKey {
  -webkit-text-security: disc;
}

.ac-setup-appid-note {
  margin: 0.5rem 0 0.35rem 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.ac-setup-appid-note code {
  font-size: 0.88em;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.14);
  color: rgba(255, 255, 255, 0.98);
}

.ac-setup-actions {
  margin-top: 1rem;
}

/* Setup steps: keep actions in the card (fixed dock is editor wizard only — setup looked broken with a “floating” bar). */
.ac-setup-actions--nav {
  display: block;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.ac-setup-actions--nav .ac-setup-nav__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.ac-setup-actions--nav.ac-setup-actions--nav-end .ac-setup-nav__inner {
  justify-content: flex-end;
}

.ac-setup-actions--nav-end {
  justify-content: flex-end;
}

.ac-setup-open-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.ac-setup-mode {
  border: none;
  margin: 0 0 0.75rem 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.ac-setup-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.ac-setup-radio input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--ac-green);
}

.ac-setup-block {
  margin-top: 0.35rem;
}

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

/* Editor context (after setup): which app + last app_configs DB save time; Start over returns to setup */
.ac-editor-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.ac-editor-status__main {
  margin: 0;
  flex: 1 1 16rem;
  min-width: 0;
  line-height: 1.45;
  word-break: break-word;
}

.ac-editor-status__exit {
  flex: 0 0 auto;
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  border-width: 2px;
}

/* Stepper */
.ac-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
  position: relative;
}

.ac-stepper::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 1.1rem;
  height: 2px;
  background: rgba(255, 255, 255, 0.45);
  z-index: 0;
}

.ac-stepper--five::before {
  left: 6%;
  right: 6%;
}

.ac-stepper--six::before {
  left: 4%;
  right: 4%;
}

.ac-stepper--seven::before {
  left: 3%;
  right: 3%;
}

.ac-step {
  position: relative;
  z-index: 1;
  flex: 1;
  text-align: center;
  max-width: 33%;
  min-width: 0;
}

.ac-stepper--five .ac-step,
.ac-stepper--six .ac-step,
.ac-stepper--seven .ac-step {
  max-width: none;
}

.ac-stepper--seven .ac-step-label {
  font-size: 0.62rem;
}

/* Runbook (wizard step 7) */
.ac-runbook-intro {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--ac-text-soft);
  line-height: 1.45;
}

.ac-runbook-summary {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #f8fafb;
  border: 1px solid var(--ac-border);
  border-radius: 8px;
  font-size: 0.85rem;
}

.ac-runbook-dl {
  display: grid;
  grid-template-columns: minmax(7rem, 9rem) 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0;
}

.ac-runbook-dl dt {
  margin: 0;
  font-weight: 600;
  color: var(--ac-text-soft);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ac-runbook-dl dd {
  margin: 0;
  word-break: break-word;
}

.ac-runbook-warn {
  margin: 0.65rem 0 0;
  padding: 0.5rem 0.65rem;
  background: #fff8e6;
  border: 1px solid #f0d78c;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #7d5a00;
}

.ac-runbook-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 560px) {
  .ac-runbook-fields {
    grid-template-columns: 1fr;
  }
}

.ac-runbook-field .hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--ac-text-soft);
}

.ac-runbook-output-wrap {
  margin-bottom: 1rem;
}

.ac-runbook-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.ac-runbook-output {
  margin: 0;
  padding: 0.85rem 1rem;
  max-height: 22rem;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  white-space: pre;
  tab-size: 2;
}

.btn-ac--sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.ac-runbook-manual {
  margin-top: 0.5rem;
  font-size: 0.88rem;
}

.ac-runbook-manual summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ac-text);
}

.ac-runbook-manual-list {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.25rem;
  color: var(--ac-text-soft);
}

.ac-runbook-manual-list li {
  margin-bottom: 0.35rem;
}

.ac-review-json-toolbar-label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.45);
}

.ac-review-json-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-bottom: 0.75rem;
}

/* JSON preview: toolbar lives in the card head (not absolute over the title rule) */
.ac-json-preview-wrap {
  position: relative;
  margin-top: 0;
}

.ac-card-head--with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ac-json-preview-actions {
  position: static;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  flex-shrink: 0;
}

.ac-json-preview-wrap__editor {
  width: 100%;
  box-sizing: border-box;
}

.btn-ac--icon-sm {
  padding: 0.32rem;
  min-width: 2.05rem;
  min-height: 2.05rem;
}

.btn-ac--icon-sm svg {
  width: 18px;
  height: 18px;
}

.ac-review-publish {
  margin-top: 1.15rem;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.025);
}

.ac-review-publish__legend {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 0.25rem;
}

.ac-review-publish__hint {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(0, 0, 0, 0.55);
}

.ac-publish-section {
  margin-top: 1rem;
}

.ac-publish-section:first-of-type {
  margin-top: 0.65rem;
}

.ac-publish-section--divider {
  padding-top: 1rem;
  margin-top: 1.1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.ac-publish-section__title {
  margin: 0;
  font-family: Montserrat, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ac-text);
}

.ac-publish-section__sub {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(0, 0, 0, 0.52);
}

.ac-publish-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.ac-publish-actions .btn-ac {
  flex: 1 1 10rem;
  min-width: 0;
  justify-content: center;
}

.ac-review-json-preview {
  min-height: 14rem;
  max-height: min(50vh, 28rem);
  resize: vertical;
  background: rgba(0, 0, 0, 0.04);
  cursor: default;
}

.ac-page-title + .ac-stepper {
  margin-top: 0.15rem;
}

.ac-step-num {
  width: 2.2rem;
  height: 2.2rem;
  margin: 0 auto 0.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--ac-step-inactive);
  color: #7f8c8d;
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.ac-step.is-active .ac-step-num {
  background: var(--ac-green);
  color: #fff;
  border-color: #fff;
}

.ac-step.is-done .ac-step-num {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ac-green);
  border-color: var(--ac-green);
}

.ac-step-label {
  font-family: Montserrat, sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.25;
}

.ac-step:not(.is-active) .ac-step-label {
  color: rgba(255, 255, 255, 0.75);
}

/* Card */
.ac-card {
  background: var(--ac-card);
  border-radius: var(--ac-radius);
  box-shadow: var(--ac-shadow);
  padding: 1.5rem 1.35rem 1.35rem;
  margin-bottom: 1rem;
  overflow: visible;
}

.ac-label--dark {
  font-family: Montserrat, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ac-text);
  margin-top: 0.75rem;
  display: block;
}

.ac-card-head {
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--ac-border);
}

.ac-card-title {
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--ac-text);
  margin: 0;
  text-transform: uppercase;
}

.ac-card-sub {
  margin: 0.35rem 0 0 0;
  font-size: 0.88rem;
  color: var(--ac-text-soft);
}

.ac-wizard-panel[hidden] {
  display: none !important;
}

/* Form fields — collapsible sections */
.ac-form-section {
  margin-top: 1rem;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
  overflow: hidden;
}

.ac-form-section:first-of-type {
  margin-top: 0;
}

.ac-form-section summary {
  list-style: none;
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ac-text);
  padding: 0.8rem 1rem;
  margin: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f3f5f7 100%);
  border-bottom: 1px solid var(--ac-border);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.ac-form-section summary::-webkit-details-marker {
  display: none;
}

.ac-form-section summary::marker {
  content: "";
}

.ac-form-section summary:hover {
  background: linear-gradient(180deg, #fff 0%, #e8ecf0 100%);
  color: #1a252f;
}

.ac-form-section summary::before {
  content: "";
  display: block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--ac-text-soft);
  border-bottom: 2px solid var(--ac-text-soft);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-top: -0.2rem;
}

.ac-form-section[open] summary::before {
  transform: rotate(45deg);
  margin-top: -0.35rem;
}

.ac-form-section-body {
  margin-top: 0;
  padding: 1rem 1rem 1.15rem;
  background: linear-gradient(180deg, #fafbfc 0%, #f5f7f9 100%);
}

/* Two-column app sections (e.g. UI & features): card-like field tiles */
.ac-form-section.ac-form-section--two-col {
  overflow: visible;
}

.ac-form-section--two-col .ac-form-section-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.85rem;
  row-gap: 0.85rem;
  align-items: stretch;
}

.ac-form-section--two-col .ac-form-section-body > .field {
  margin-top: 0;
  padding: 0.9rem 1rem 1rem;
  background: #fff;
  border: 1px solid #e4e9ee;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(44, 62, 80, 0.04);
  min-height: 5.35rem;
}

.ac-form-section--two-col .ac-form-section-body > .field > label {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: #34495e;
}

.ac-form-section--two-col .ac-form-section-body > .field.field--checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  justify-content: flex-start;
}

.ac-form-section--two-col .ac-form-section-body > .field.field--checkbox > label {
  margin-bottom: 0;
  line-height: 1.35;
  font-size: 0.84rem;
}

/* Optional trailing icon (UI & features tiles) */
.ac-form-section--two-col .ac-form-section-body > .field.field--with-feature-icon {
  padding-right: 2.6rem;
}

.ac-form-section--two-col .ac-form-section-body > .field.field--with-feature-icon .field-feature-icon {
  position: absolute;
  right: 0.75rem;
  left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ac-green);
  opacity: 0.9;
  pointer-events: none;
}

.ac-form-section--two-col .ac-form-section-body > .field.field--with-feature-icon .field-feature-icon svg {
  display: block;
}

.ac-form-section--two-col .ac-form-section-body > .field.field--with-feature-icon.field--checkbox .field-feature-icon {
  top: 50%;
  transform: translateY(-50%);
}

.ac-form-section--two-col .ac-form-section-body > .field.field--with-feature-icon:not(.field--checkbox) .field-feature-icon {
  top: 0.92rem;
  transform: none;
}

.ac-form-section--two-col .ac-form-section-body > .field.field--with-feature-icon.field--form-disabled .field-feature-icon {
  opacity: 0.38;
  color: var(--ac-text-soft);
}

@media (max-width: 36rem) {
  .ac-form-section--two-col .ac-form-section-body {
    grid-template-columns: 1fr;
  }

  .ac-form-section--two-col .ac-form-section-body > .field {
    min-height: 0;
  }
}

/* Customer: Zeno full width; customer name + default background on one row */
.ac-form-section--customer-row.ac-form-section--two-col .ac-form-section-body > .field:first-child {
  grid-column: 1 / -1;
}

.field {
  position: relative;
  margin-top: 1rem;
}

.field:first-child {
  margin-top: 0;
}

.field.field--has-tip:hover,
.field.field--has-tip:focus-within {
  z-index: 18;
}

.field > label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ac-text);
  margin-bottom: 0.4rem;
}

.field-external-link-wrap {
  margin: 0 0 0.5rem 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.field-external-link {
  color: var(--ac-green);
  font-weight: 600;
  text-decoration: none;
}

.field-external-link:hover {
  text-decoration: underline;
}

.field--checkbox .field-external-link-wrap {
  flex: 1 1 100%;
  width: 100%;
  order: 3;
  margin: 0.35rem 0 0 0;
}

.field--form-disabled {
  opacity: 0.55;
}

.field--form-disabled label {
  color: var(--ac-text-soft);
  font-weight: 500;
}

.field--form-disabled input[type="checkbox"] {
  cursor: not-allowed;
  opacity: 0.85;
}

.field--form-disabled select,
.field--form-disabled .field-input:not([type="checkbox"]) {
  cursor: not-allowed;
}

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

.field--checkbox > label {
  margin-bottom: 0;
  order: 2;
  font-weight: 600;
}

.field--checkbox .field-input {
  order: 1;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--ac-green);
}

.field--ctl-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.25rem;
}

.field--ctl-inline-row .field-ctl-inline-pair {
  position: relative;
  flex: 1 1 11rem;
  min-width: 0;
}

.field--ctl-inline-row .field-ctl-inline-pair.field--has-tip:hover,
.field--ctl-inline-row .field-ctl-inline-pair.field--has-tip:focus-within {
  z-index: 25;
}

.field--ctl-inline-row .field-ctl-inline-pair label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ac-text);
  margin-bottom: 0.4rem;
}

.field--ctl-inline-row .field-ctl-inline-pair .field-input {
  width: 100%;
}

.field--text-color-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.25rem;
}

.field-text-color-inline-pair {
  position: relative;
}

.field-text-color-inline-pair--text {
  flex: 1 1 14rem;
  min-width: 0;
}

.field-text-color-inline-pair--color {
  flex: 0 1 13rem;
  min-width: 10rem;
}

.field-text-color-inline-pair label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ac-text);
  margin-bottom: 0.4rem;
}

.field-text-color-inline-pair--text .field-input {
  width: 100%;
}

.field-text-color-inline-pair--color .field-color-row {
  width: 100%;
}

.field--dual-color-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.25rem;
}

.field-dual-color-inline-pair {
  position: relative;
  flex: 1 1 12rem;
  min-width: 0;
}

.field-dual-color-inline-pair label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ac-text);
  margin-bottom: 0.4rem;
}

.field-dual-color-inline-pair .field-color-row {
  width: 100%;
}

.field--station-name-row > label {
  margin-bottom: 0;
}

.field--station-name-row .field-station-name-row__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.35rem;
  width: 100%;
}

.field--station-name-row .field-station-name-row__controls > .field-input {
  flex: 1 1 12rem;
  min-width: 0;
}

.field-station-name-row__featured {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ac-text);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.field-station-name-row__featured input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--ac-green);
}

.field-input:not([type="checkbox"]) {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--ac-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ac-text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field-input:not([type="checkbox"])::placeholder {
  color: var(--ac-placeholder);
}

.field-input:not([type="checkbox"]):hover {
  border-color: #bdc3c7;
}

.field-input:not([type="checkbox"]):focus {
  outline: none;
  border-color: var(--ac-green);
  box-shadow: 0 0 0 3px var(--ac-green-muted);
}

/* Native selects: custom chevron + ellipsis for long selected labels */
select.field-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1.5L7 7l6-5.5' stroke='%237f8c8d' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 11px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

select.field-input:hover {
  border-color: #bdc3c7;
}

/* URL + image thumbnail */
.field-url-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
}

.field-url-row > .field-input {
  flex: 1 1 12rem;
  min-width: 0;
}

/* Compact URL: disabled preview input + pencil / real url input + check */
.field-compact-url-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin-top: 0.25rem;
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.field-compact-url-row .field-input {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 0.88rem;
}

.field-compact-url-row .field-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ac-green);
}

.field-compact-url-row .field-compact-url-display:disabled {
  background: #f8f9fb;
  color: var(--ac-text);
  opacity: 1;
  -webkit-text-fill-color: var(--ac-text);
  cursor: default;
}

.field-compact-url-edit-icon {
  flex-shrink: 0;
  width: 2.65rem;
  min-height: 2.65rem;
  align-self: stretch;
  border: none;
  border-left: 1px solid var(--ac-border);
  background: #f0f2f5;
  color: var(--ac-text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.field-compact-url-edit-icon:hover {
  background: #e4e8ec;
  color: var(--ac-text);
}

.field-compact-url-edit-icon:focus-visible {
  outline: 2px solid var(--ac-green);
  outline-offset: -2px;
  z-index: 1;
}

.field-compact-url-edit-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* Hex text + native color picker — one grouped control (avoids “floating” swatch) */
.field-color-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  width: 100%;
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-color-row:focus-within {
  border-color: var(--ac-green);
  box-shadow: 0 0 0 3px var(--ac-green-muted);
}

.field-color-row .field-input--color-hex {
  flex: 1 1 10rem;
  min-width: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  min-height: 2.85rem;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.field-color-row .field-input--color-hex:hover {
  border-color: transparent;
}

.field-color-row .field-input--color-hex:focus {
  outline: none;
  box-shadow: none;
  border-color: transparent;
}

.field-color-picker {
  flex: 0 0 auto;
  width: 3.1rem;
  min-height: 2.85rem;
  height: auto;
  padding: 0.35rem;
  border: none;
  border-left: 1px solid var(--ac-border);
  border-radius: 0;
  background: #f8f9fa;
  cursor: pointer;
}

.field-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.field-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.field-url-preview {
  flex: 0 0 auto;
  width: 5.5rem;
  height: 5.5rem;
  border: 1px solid var(--ac-border);
  border-radius: 8px;
  background: #f4f6f8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.field-url-preview-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.35rem;
  font-size: 0.65rem;
  line-height: 1.25;
  color: var(--ac-text-soft);
}

.field-url-preview-ph.is-hidden {
  display: none;
}

.field-url-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

textarea.field-input {
  min-height: 5.5rem;
  resize: vertical;
  font-family: inherit;
}

textarea.field-input--json {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.8125rem;
  line-height: 1.45;
  min-height: 12rem;
}

textarea.field-input--lines {
  min-height: 6.5rem;
}

select.field-input {
  cursor: pointer;
}

/* Hover tooltip */
.field-tooltip-bubble {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 99999;
  min-width: 200px;
  max-width: min(100%, 22rem);
  padding: 0.65rem 0.85rem;
  background: var(--ac-text);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.45;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.field-tooltip-bubble::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 1.25rem;
  border: 7px solid transparent;
  border-bottom-color: var(--ac-text);
}

/*
 * Open upward where a default-down bubble would cover the next field (station branding
 * colors, dual primary/secondary row, app two-column cards).
 */
.field--color.field--has-tip .field-tooltip-bubble,
.ac-form-section--two-col .field--has-tip .field-tooltip-bubble {
  top: auto;
  bottom: calc(100% + 6px);
}

.field--color.field--has-tip .field-tooltip-bubble::before,
.ac-form-section--two-col .field--has-tip .field-tooltip-bubble::before {
  top: 100%;
  bottom: auto;
  border-top-color: var(--ac-text);
  border-bottom-color: transparent;
}

.field--has-tip:focus-within .field-tooltip-bubble {
  display: block;
}

/*
 * Color: hex + native picker keep :focus-within true — don’t show the bubble then or it
 * sticks with the OS color dialog. Fine-pointer users get hover tooltips; others keep the
 * visible .field-help paragraph (hover media doesn’t hide it when coarse / no hover).
 */
.field--color.field--has-tip:focus-within .field-tooltip-bubble {
  display: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .field--has-tip:hover .field-tooltip-bubble {
    display: block;
  }

  .field-help--below-desktop {
    display: none;
  }

  /* Color fields: no tooltip while :focus-within (picker open); show inline help for keyboard :focus-visible only */
  .field--color.field--has-tip:focus-within:has(:focus-visible) .field-help--below-desktop {
    display: block;
  }
}

/*
 * Lift the whole accordion / card while a tooltip is shown so overflow:hidden and
 * paint order don’t clip or bury the bubble behind the next section or station row.
 */
.ac-form-section:has(.field--has-tip:hover),
.ac-form-section:has(.field--has-tip:focus-within) {
  position: relative;
  z-index: 100;
  overflow: visible;
}

.ac-station-list-item.is-expanded:has(.field--has-tip:hover),
.ac-station-list-item.is-expanded:has(.field--has-tip:focus-within) {
  position: relative;
  z-index: 90;
  overflow: visible;
}

.field-help--below-desktop {
  margin: 0.35rem 0 0 0;
  font-size: 0.8rem;
  color: var(--ac-text-soft);
  line-height: 1.4;
}

/* Wizard nav */
.ac-wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ac-border);
}

.ac-wizard-nav.ac-wizard-nav--align-end {
  justify-content: flex-end;
}

.ac-wizard-nav.ac-wizard-nav--align-start {
  justify-content: flex-start;
}

/* Sticky dock: Back / Next always visible while scrolling the form wizard */
#acEditorShell:not([hidden]) #formTabPanel:not([hidden]) {
  padding-bottom: var(--ac-nav-dock-pad);
}

#acEditorShell:not([hidden]) #formTabPanel:not([hidden]) #wizardNav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 250;
  margin-top: 0;
  padding: 0.65rem 1rem;
  padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--ac-border);
  background: var(--ac-card);
  box-shadow: 0 -8px 28px rgba(44, 62, 80, 0.12);
  display: block;
}

#acEditorShell:not([hidden]) #formTabPanel:not([hidden]) #wizardNav .ac-wizard-nav__inner {
  max-width: var(--ac-page-max-width);
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

#acEditorShell:not([hidden]) #formTabPanel:not([hidden]) #wizardNav.ac-wizard-nav--align-end .ac-wizard-nav__inner {
  justify-content: flex-end;
}

#acEditorShell:not([hidden]) #formTabPanel:not([hidden]) #wizardNav.ac-wizard-nav--align-start .ac-wizard-nav__inner {
  justify-content: flex-start;
}

.btn-ac {
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.btn-ac:active {
  transform: scale(0.98);
}

.btn-ac--primary {
  background: var(--ac-green);
  color: #fff;
}

.btn-ac--primary:hover {
  background: var(--ac-green-hover);
}

.btn-ac--primary:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-ac--submit-review {
  background: #1a7f4b;
  color: #fff;
  border: none;
}

.btn-ac--submit-review:hover {
  background: #155f38;
}

.btn-ac--submit-review:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.ac-store-submit-review__divider {
  border: none;
  border-top: 1px solid var(--ac-border);
  margin: 1rem 0;
}

.btn-ac--ghost {
  background: transparent;
  color: var(--ac-text-soft);
  border: 1px solid var(--ac-border);
}

.btn-ac--ghost:hover {
  background: #f4f6f8;
  color: var(--ac-text);
}

.btn-ac--toolbar {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ac-green);
  border: 2px solid #fff;
  padding: 0.55rem 1rem;
  font-size: 0.8rem;
}

.btn-ac--toolbar:hover {
  background: #fff;
}

/* Config JSON toolbar (wizard final step) */
.ac-json-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ac-json-actions .btn-ac {
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
}

textarea.json-editor {
  width: 100%;
  min-height: 16rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ac-border);
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* Store listings */
.ac-store-panel {
  margin-top: 0.5rem;
}

.ac-store-panel .app-store-listing {
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 0.85rem;
  background: #fafbfc;
}

.ac-store-panel .app-store-listing h3,
.ac-store-panel .app-store-listing-title {
  margin: 0 0 0.65rem 0;
  font-family: Montserrat, sans-serif;
  font-size: 0.9rem;
}

.ac-store-panel .app-store-listing label {
  display: block;
  font-weight: 600;
  font-size: 0.78rem;
  margin-top: 0.65rem;
}

.ac-store-panel .app-store-listing input[type="text"],
.ac-store-panel .app-store-listing input[type="date"],
.ac-store-panel .app-store-listing textarea {
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.25rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--ac-border);
  border-radius: 8px;
  font-family: inherit;
}

.ac-store-panel .app-store-listing textarea {
  min-height: 5rem;
}

.ac-store-only-save {
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--ac-border);
}

.ac-store-only-save__hint {
  margin: 0.5rem 0 0 0;
  font-size: 0.88rem;
  color: var(--ac-text-soft);
  max-width: 42rem;
  line-height: 1.45;
}

.char-hint,
.field-label-secondary {
  font-weight: 400;
  color: var(--ac-text-soft);
  font-size: 0.75rem;
}

.field-required-mark {
  color: #c0392b;
  font-weight: 700;
  text-decoration: none;
  cursor: help;
}

/* Messages (below card on gradient) — solid chip so text isn’t low-contrast on purple */
#msg:empty {
  display: none;
}

#msg {
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
  margin-top: 1rem;
  margin-left: auto;
  margin-right: auto;
  max-width: var(--ac-page-max-width);
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  font-weight: 600;
  white-space: pre-wrap;
  word-break: break-word;
}

#msg.hint {
  background: rgba(255, 255, 255, 0.96);
  color: #2c3e50;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

#msg.err {
  background: #fff;
  color: #922b21;
  border: 1px solid rgba(146, 43, 33, 0.25);
}

#msg.ok {
  background: #fff;
  color: #146a3e;
  border: 1px solid rgba(20, 106, 62, 0.28);
}

#applyStatus:empty {
  display: none;
}

/* Default (standalone) — centered ribbon under the page */
#applyStatus {
  display: block;
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
  margin: 0.35rem auto 0.5rem;
  max-width: var(--ac-page-max-width);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: #2c3e50;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

/* In the editor toolbar row with Start over: undo legacy “standalone” centering */
.ac-editor-status #applyStatus {
  margin: 0;
  text-align: left;
  max-width: none;
  width: auto;
  align-self: center;
  font-size: 0.88rem;
}

.hint {
  color: var(--ac-text-soft);
  font-size: 0.85rem;
  line-height: 1.45;
}

.ac-station-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ac-station-tools .btn-ac {
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
}

.ac-tools-portal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--ac-text-soft);
}

.ac-tools-portal__label {
  font-weight: 600;
  white-space: nowrap;
}

.ac-tools-portal__select {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--ac-border, #ccc);
  border-radius: 6px;
  background: var(--ac-surface, #fff);
  color: var(--ac-text, #111);
}

.ac-stations-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.ac-station-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ac-station-list-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--ac-border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
}

.ac-station-list-item .ac-station-picker-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.ac-station-list-item.is-expanded .ac-station-picker-card {
  border-bottom: 1px solid var(--ac-border);
}

.ac-station-list-item.is-expanded {
  border-color: var(--ac-green);
  box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.ac-station-editor-inline {
  padding: 0.85rem 0.75rem 1rem;
  background: linear-gradient(180deg, #f8fafb 0%, #f3f5f7 100%);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.ac-station-featured-orphan {
  margin: 0;
  font-size: 0.82rem;
}

.ac-station-featured-orphan code {
  font-size: 0.85em;
  word-break: break-all;
}

.ac-station-featured-orphan-clear {
  margin-left: 0.25rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
}

.ac-station-picker-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.75rem 0.45rem;
}

.ac-station-list-item:not(.is-expanded) .ac-station-picker-card:hover {
  background: rgba(46, 204, 113, 0.04);
}

.ac-station-picker-card__chevron {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.15rem;
  border-right: 2px solid var(--ac-text-soft);
  border-bottom: 2px solid var(--ac-text-soft);
  transform: rotate(-45deg);
  transition: transform 0.2s ease, border-color 0.15s ease;
}

.ac-station-list-item.is-expanded .ac-station-picker-card__chevron {
  transform: rotate(45deg);
  margin-top: -0.15rem;
  border-color: var(--ac-green);
}

.ac-station-picker-card__select {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.15rem 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.ac-station-picker-card__select:focus-visible {
  outline: 2px solid var(--ac-green);
  outline-offset: 2px;
}

.ac-station-picker-card__default {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem -0.75rem -0.45rem;
  padding: 0.45rem 0.75rem 0.5rem;
  border-top: 1px solid var(--ac-border);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ac-text-soft);
  cursor: pointer;
}

.ac-station-picker-card__default input {
  accent-color: var(--ac-green);
  flex-shrink: 0;
}

.ac-station-picker-card__default-text {
  line-height: 1.25;
  user-select: none;
}

.ac-station-picker-card__default.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ac-station-picker-card__thumb {
  flex: 0 0 3.25rem;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ac-station-picker-card__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ac-station-picker-card__ph {
  font-size: 0.65rem;
  color: var(--ac-text-soft);
  text-align: center;
  padding: 0.2rem;
  line-height: 1.2;
}

.ac-station-picker-card__name {
  flex: 1 1 auto;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
  word-break: break-word;
}

.ac-station-editor-panel .ac-station-subpanel {
  margin-bottom: 0.5rem;
}

.ac-station-editor-panel .ac-station-subpanel:last-child {
  margin-bottom: 0;
}

/* Slightly calmer nested sections inside station editor (many in a row) */
.ac-station-editor-panel > .ac-form-section {
  box-shadow: 0 1px 4px rgba(44, 62, 80, 0.05);
}

.ac-station-editor-panel > .ac-form-section summary {
  padding: 0.65rem 0.9rem;
  font-size: 0.66rem;
}

.ac-schedule-shows-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1rem 0 0.65rem 0;
}

.ac-schedule-shows-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.ac-schedule-shows-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ac-schedule-show-card {
  padding: 0.85rem 1rem;
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
}

.ac-schedule-show-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.ac-schedule-show-card__title {
  font-weight: 600;
  font-size: 0.9rem;
}

.field.ac-schedule-days {
  border: none;
  padding: 0;
  margin: 0.35rem 0 0 0;
  min-width: 0;
}

.ac-schedule-days-legend {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ac-text);
  padding: 0;
  margin: 0 0 0.4rem 0;
}

.ac-schedule-days-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 1rem;
}

.ac-schedule-day-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ac-text);
  user-select: none;
}

.ac-schedule-day-chip input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--ac-green);
  cursor: pointer;
}

.ac-schedule-day-label {
  line-height: 1.2;
}

.ac-schedule-time-head {
  margin-bottom: 0.35rem;
}

.ac-schedule-time-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ac-text);
}

.ac-schedule-time-hint {
  font-size: 0.75rem;
  color: var(--ac-text-soft);
  line-height: 1.35;
  margin-top: 0.2rem;
  max-width: 36rem;
}

.ac-schedule-time-clocks {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.85rem;
}

.ac-schedule-time-clock-pair {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.ac-schedule-time-sublabel {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ac-text-soft);
}

.ac-schedule-time-input {
  min-width: 6.5rem;
  max-width: 100%;
}

.ac-schedule-time-sep {
  font-weight: 600;
  color: var(--ac-text-soft);
  padding-bottom: 0.35rem;
  user-select: none;
}

.ac-schedule-time-custom-wrap {
  margin-top: 0.55rem;
}

.ac-schedule-time-custom-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ac-text-soft);
  margin-bottom: 0.25rem;
}

.ac-schedule-show-social {
  margin-top: 0.5rem;
}

.ac-schedule-show-social summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ac-text-soft);
}

.field-podcast-ids-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.field-podcast-ids-head > label {
  flex: 1 1 auto;
  margin: 0;
}

.field-zeno-podcast-ids-btn {
  flex: 0 0 auto;
}

.ac-zeno-pick-select {
  display: block;
  width: 100%;
  min-height: 10rem;
  margin: 0.5rem 0 1rem 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--ac-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  background: #fff;
}

/* Dialog */
dialog.ac-dialog {
  border: none;
  border-radius: var(--ac-radius);
  padding: 0;
  max-width: 26rem;
  box-shadow: var(--ac-shadow);
}

dialog.ac-dialog::backdrop {
  background: rgba(44, 62, 80, 0.35);
}

.ac-dialog__inner {
  padding: 1.35rem;
}

.ac-dialog__title {
  font-family: Montserrat, sans-serif;
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
}

.ac-dialog__text {
  margin: 0 0 1.15rem 0;
  font-size: 0.92rem;
  color: var(--ac-text-soft);
  line-height: 1.45;
}

.ac-dialog__text--muted {
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--ac-text-soft);
  word-break: break-all;
}

.ac-dialog__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.ac-dialog__actions .btn-ac {
  padding: 0.55rem 1.1rem;
  font-size: 0.82rem;
}

a {
  color: var(--ac-green);
}

/* Firebase Storage: card-style drop zones (document + station image) */
.ac-file-drop {
  margin: 0.35rem 0 0 0;
  border-radius: var(--ac-radius);
  background: var(--ac-card);
  box-shadow: 0 2px 14px rgba(44, 62, 80, 0.07);
  border: 1px solid var(--ac-border);
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.ac-file-drop.is-dragover {
  border-color: var(--ac-green);
  box-shadow: 0 0 0 3px var(--ac-green-muted);
}

.ac-file-drop__surface {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.35rem 1.25rem 1.15rem;
  margin: 0.5rem;
  min-height: 11.5rem;
  justify-content: center;
  border: 2px dashed var(--ac-border);
  border-radius: 10px;
  background: rgba(248, 250, 251, 0.85);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.ac-file-drop.is-dragover .ac-file-drop__surface {
  border-color: var(--ac-green);
  background: var(--ac-green-muted);
}

.ac-file-drop__icon {
  display: flex;
  color: var(--ac-green);
  margin-bottom: 0.65rem;
  filter: drop-shadow(0 1px 2px rgba(39, 174, 96, 0.2));
}

.ac-file-drop__icon-svg {
  display: block;
}

.ac-file-drop__lead {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ac-text);
  line-height: 1.45;
  max-width: 22rem;
}

.ac-file-drop__or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 16rem;
  margin: 0.15rem 0 0.75rem;
  color: var(--ac-text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: Montserrat, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ac-file-drop__or::before,
.ac-file-drop__or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ac-border) 15%, var(--ac-border) 85%, transparent);
}

.ac-file-drop__browse {
  margin: 0 0 0.5rem 0;
  padding: 0.55rem 1.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: Montserrat, sans-serif;
  border-radius: 10px;
  border: 1px solid var(--ac-border);
  background: #fff;
  color: var(--ac-text);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(44, 62, 80, 0.06);
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}

.ac-file-drop__browse:hover {
  border-color: var(--ac-green);
  color: var(--ac-green-hover);
  background: rgba(255, 255, 255, 0.98);
}

.ac-file-drop__filename {
  margin: 0 0 0.5rem 0;
  font-size: 0.78rem;
  color: var(--ac-text-soft);
  word-break: break-all;
  max-width: 100%;
  padding: 0 0.5rem;
}

.ac-file-drop__submit {
  margin-top: 0.15rem;
  min-width: 10rem;
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: Montserrat, sans-serif;
  border-radius: 10px;
}

.ac-firebase-upload-panel--stacked {
  margin-top: 1.25rem;
}

/* Nested under station editor “4 · Images” */
.ac-firebase-upload-panel--in-station {
  margin: 0 0 1rem 0;
  padding: 0.85rem 1rem;
}

.ac-firebase-upload-panel {
  margin: 0 0 1.25rem 0;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--ac-border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(44, 62, 80, 0.05);
}

.ac-firebase-upload-panel__title {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ac-text);
}

.ac-firebase-upload-panel__row {
  align-items: flex-end;
  margin-top: 0.75rem;
}

.ac-firebase-upload-panel__btn {
  flex-shrink: 0;
}

.ac-firebase-upload-panel__btn .btn-ac {
  white-space: nowrap;
}

.ac-firebase-upload-result {
  margin-top: 1rem;
}

.ac-firebase-upload-url-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.ac-firebase-upload-url-input {
  flex: 1 1 12rem;
  min-width: 0;
  font-size: 0.8rem;
}

.ac-firebase-upload-msg {
  margin: 0.65rem 0 0 0;
  min-height: 1.25em;
  font-size: 0.85rem;
  line-height: 1.45;
}

.ac-firebase-upload-msg.err {
  color: #922b21;
}

.ac-firebase-upload-msg.ok {
  color: #146a3e;
}

.ac-firebase-upload-msg:empty {
  display: none;
}
