/* Pre-flight hub + gate modal — aviation warning theme (dark + light). */

.rcs-preflight-page .rcs-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--rcs-accent, var(--pf-amber));
  color: var(--rcs-accent-btn-text, #0a0a0a);
  font-weight: 700;
  text-decoration: none;
}

.rcs-preflight-page .rcs-skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  overflow: visible;
}

:root {
  --pf-black: #0a0a0a;
  --pf-panel: #141414;
  --pf-amber: #facc15;
  --pf-amber-dim: #ca8a04;
  --pf-stripe: repeating-linear-gradient(
    -45deg,
    #0a0a0a,
    #0a0a0a 10px,
    #facc15 10px,
    #facc15 20px
  );
}

[data-theme="light"] {
  --pf-black: #111827;
  --pf-panel: #1f2937;
  --pf-amber: #eab308;
  --pf-amber-dim: #a16207;
}

.pf-gate-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pf-gate-modal[hidden] {
  display: none !important;
}

body.pf-gate-open {
  overflow-y: scroll;
}

.pf-gate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.pf-gate-panel {
  position: relative;
  width: min(480px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  border: 3px solid var(--pf-amber);
  border-radius: 12px;
  background: var(--pf-panel);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.pf-gate-stripe {
  height: 10px;
  background: var(--pf-stripe);
  flex-shrink: 0;
}

.pf-gate-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(250, 204, 21, 0.25);
}

.pf-gate-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--pf-amber);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.pf-gate-title {
  margin: 8px 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #f9fafb;
  line-height: 1.25;
}

.pf-gate-progress {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--pf-amber);
}

.pf-gate-list {
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.pf-gate-item {
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid rgba(250, 204, 21, 0.2);
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.pf-gate-item.is-done {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
}

.pf-gate-item-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  cursor: pointer;
  color: #f3f4f6;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.pf-gate-item-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pf-gate-check-ui {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 2px solid var(--pf-amber);
  background: transparent;
}

.pf-gate-item.is-done .pf-gate-check-ui {
  background: #22c55e;
  border-color: #22c55e;
  box-shadow: inset 0 0 0 2px #fff;
}

.pf-gate-req {
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pf-amber);
}

.pf-gate-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid rgba(250, 204, 21, 0.2);
}

.pf-gate-btn {
  flex: 1 1 0;
  min-height: 40px;
  border-radius: 8px;
  border: 2px solid rgba(250, 204, 21, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #f9fafb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.pf-gate-btn--edit {
  border-color: var(--pf-amber);
  color: var(--pf-amber);
}

.rcs-preflight-page .pf-scene {
  position: relative;
  z-index: 1;
  padding: 8px 12px 28px;
  max-width: min(980px, calc(100vw - 24px));
  margin: 0 auto;
}

/* Hero: always dark warning panel — same in light + dark site theme. */
.pf-hero {
  position: relative;
  margin-bottom: 14px;
  padding: 14px 14px 12px;
  border: 3px solid #facc15;
  border-radius: 12px;
  background: #141414;
  overflow: hidden;
}

.pf-hero-stripe {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: var(--pf-stripe);
}

.pf-hero-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  background: var(--pf-amber);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.pf-hero h1 {
  margin: 8px 0 4px;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 900;
  color: #f9fafb;
}

.pf-hero p {
  margin: 0;
  font-size: 13px;
  color: rgba(249, 250, 251, 0.78);
  line-height: 1.45;
}

.pf-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.pf-tab {
  flex: 1 1 0;
  min-height: 38px;
  border-radius: 8px;
  border: 2px solid rgba(250, 204, 21, 0.55);
  background: rgba(10, 10, 10, 0.88);
  color: #f3f4f6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.pf-tab.is-active {
  background: var(--pf-amber);
  color: #0a0a0a;
  border-color: var(--pf-amber);
}

.pf-panel {
  border: 2px solid rgba(250, 204, 21, 0.28);
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.88);
  padding: 12px;
}

[data-theme="light"] .pf-panel {
  background: rgba(255, 255, 255, 0.96);
}

[data-theme="light"] .pf-gate-title {
  color: #0f172a;
}

.pf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.pf-search {
  flex: 1 1 180px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--rcs-border);
  background: var(--rcs-input-bg);
  color: var(--rcs-text);
  font: inherit;
}

.pf-list-cards {
  display: grid;
  gap: 8px;
}

.pf-card {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(250, 204, 21, 0.22);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.pf-card-title {
  font-weight: 800;
  font-size: 14px;
}

.pf-card-meta {
  font-size: 11px;
  color: var(--rcs-muted);
  margin-top: 2px;
}

.pf-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pf-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--rcs-border);
  background: var(--rcs-input-bg);
}

.pf-item.is-dragging {
  opacity: 0.55;
}

.pf-drag {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(250, 204, 21, 0.15);
  color: var(--pf-amber-dim);
  cursor: grab;
}

.pf-item-order {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
}

.pf-item-move {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--rcs-text);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.pf-item-move:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.24);
}

.pf-item-move:disabled {
  opacity: 0.35;
  cursor: default;
}

.pf-item-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid var(--rcs-border);
  background: var(--rcs-panel);
  color: var(--rcs-text);
  font: inherit;
}

.pf-item-del {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  cursor: pointer;
}

.pf-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pf-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 2px solid rgba(250, 204, 21, 0.4);
  background: rgba(0, 0, 0, 0.3);
  color: var(--rcs-text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pf-btn--primary {
  background: var(--pf-amber);
  color: #0a0a0a;
  border-color: var(--pf-amber);
}

.pf-fo-preflight-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border-radius: 8px;
  border: 3px solid var(--pf-amber);
  background: var(--pf-black);
  color: var(--pf-amber);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.pf-fo-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--rcs-border);
  background: var(--rcs-input-bg);
  font-size: 12px;
}

.fi-col-preflight {
  width: 88px;
  text-align: center;
}

.fi-preflight-toggle {
  min-width: 44px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--rcs-border);
  background: var(--rcs-input-bg);
  color: var(--rcs-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.fi-preflight-toggle.is-on {
  border-color: rgba(250, 204, 21, 0.55);
  background: rgba(250, 204, 21, 0.14);
  color: var(--pf-amber-dim);
}

.hg-spec-preflight-btn {
  border-color: rgba(250, 204, 21, 0.55) !important;
  color: #ca8a04 !important;
  background: rgba(250, 204, 21, 0.1) !important;
}

.pf-tier-teaser--inline {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.08);
}

.pf-tier-teaser--inline h2 {
  margin: 0 0 6px;
  font-size: 15px;
}

.pf-tier-teaser--inline .pf-btn {
  margin-top: 10px;
}

.pf-install-notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
  font-size: 13px;
}

.pf-install-notice code {
  font-size: 11px;
  word-break: break-all;
}

.pf-card-view {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pf-amber-dim);
}

.pf-readonly-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pf-readonly-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--rcs-border);
  background: var(--rcs-input-bg);
  font-size: 14px;
}

.pf-readonly-item--muted {
  color: var(--rcs-muted);
  font-style: italic;
}

.pf-template-panel {
  margin-bottom: 14px;
}

.pf-template-panel.pf-panel {
  padding: 14px 16px;
  background: #141414;
  border: 2px solid rgba(250, 204, 21, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .pf-template-panel.pf-panel {
  background: #ffffff;
  border-color: #ca8a04;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
}

.pf-template-panel h2 {
  color: var(--rcs-text, #f9fafb);
}

.pf-template-panel .rcs-hint {
  color: var(--rcs-muted, #94a3b8);
}

.pf-template-panel .pf-readonly-item {
  background: var(--rcs-input-bg, rgba(0, 0, 0, 0.25));
}

.pf-template-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pf-template-head h2 {
  margin: 0;
  font-size: 16px;
}

.pf-template-meta {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pf-amber-dim);
}

.pf-editor-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--pf-amber-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pf-editor-head {
  margin-bottom: 10px;
}

.pf-editor-head h2 {
  margin: 0 0 10px;
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 900;
  line-height: 1.2;
}

.pf-enable-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.pf-enable-row__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--rcs-text, #f9fafb);
  line-height: 1.3;
}

.pf-enable-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 2px solid var(--rcs-border, rgba(148, 163, 184, 0.45));
  background: var(--rcs-input-bg, rgba(0, 0, 0, 0.25));
  color: var(--rcs-muted, #94a3b8);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.pf-enable-toggle__check {
  display: none;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #22c55e;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
}

.pf-enable-toggle.is-on {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.pf-enable-toggle.is-on .pf-enable-toggle__check {
  display: inline-block;
}

[data-theme="dark"] .pf-enable-toggle.is-on {
  color: #4ade80;
}

[data-theme="light"] .pf-enable-toggle.is-on {
  color: #15803d;
}

.pf-item-req {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--rcs-muted);
  white-space: nowrap;
  cursor: pointer;
}

.pf-item-req input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--pf-amber);
  cursor: pointer;
}

.rcs-preflight-page .rcs-page-eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .rcs-preflight-page .rcs-page-eyebrow {
  color: rgba(15, 23, 42, 0.82);
  text-shadow: none;
}

.pf-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.1);
  font-size: 13px;
  font-weight: 600;
  color: var(--rcs-text, #f9fafb);
}

.pf-status.is-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
}

.pf-global-gate {
  margin-bottom: 14px;
}

.pf-global-gate.pf-panel {
  padding: 14px 16px;
}

.pf-global-gate__head {
  margin-bottom: 10px;
}

.pf-global-gate__head .pf-enable-row__label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
}

.pf-global-gate__toggle {
  flex: 0 0 auto;
  white-space: nowrap;
}

.pf-global-gate__hint {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--rcs-text, #f9fafb);
  opacity: 0.92;
}

.pf-global-gate__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--rcs-muted, #94a3b8);
}

[data-theme="light"] .pf-gate-item-label,
[data-theme="light"] .pf-card {
  color: var(--rcs-text, #0f172a);
}

[data-theme="light"] .pf-tab:not(.is-active) {
  background: rgba(10, 10, 10, 0.92);
  border-color: rgba(234, 179, 8, 0.65);
  color: #f9fafb;
}

[data-theme="light"] .pf-gate-item {
  background: rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .pf-gate-btn {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

[data-theme="light"] .pf-btn {
  background: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .pf-card {
  background: rgba(15, 23, 42, 0.04);
}
