/* Ordinance Ingestion Pipeline — Three-Gate Governance & FRE 902(14) Ledger Standard */

body {
  background:
    radial-gradient(ellipse 75% 360px at 50% 0%, rgba(56, 189, 248, 0.1), transparent 72%),
    #0A0D12;
  color: #ECEFF1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 920px;
  margin: 28px auto 40px;
  padding: 0 20px;
  flex: 1 0 auto;
}

.badge-gov {
  font-family: var(--font-mono);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7DD3FC;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-box {
  margin-bottom: 22px;
}

h1 {
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #FFFFFF;
  margin-bottom: 8px;
}

p.subtitle {
  color: #94A3B8;
  font-size: 15px;
  line-height: 1.55;
}

/* Three-Gate Governance Stepper */
.gate-stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

@media (max-width: 680px) {
  .gate-stepper {
    grid-template-columns: 1fr;
  }
}

.gate-step {
  background: rgba(18, 22, 31, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-top: 3px solid #38BDF8;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gate-step--verify {
  border-top-color: #F59E0B;
}

.gate-step--sign {
  border-top-color: #10B981;
}

.gate-step-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #7DD3FC;
}

.gate-step--verify .gate-step-num {
  color: #FCD34D;
}

.gate-step--sign .gate-step-num {
  color: #6EE7B7;
}

.gate-step-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
}

.gate-step-desc {
  font-size: 11.5px;
  color: #94A3B8;
  line-height: 1.35;
}

.card {
  background: rgba(18, 22, 31, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.07);
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: #38BDF8;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title--sign {
  color: #4ADE80;
}

.grid-2,
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.grid-spaced {
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

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

.perimeter-row {
  display: none;
  background: rgba(11, 16, 27, 0.9);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #CBD5E1;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  background: #0B101B;
  border: 1px solid #283548;
  border-radius: 10px;
  color: #F8FAFC;
  padding: 12px;
  font-family: inherit;
  font-size: max(1rem, 1em);
  min-height: 48px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

textarea {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 156px;
}

textarea.drop-active {
  border-color: #38BDF8;
  background: #0B1628;
}

.url-fetch-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}

.url-fetch-row input {
  flex: 1 1 280px;
}

.import-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.import-hint {
  font-size: 12px;
  color: #94A3B8;
  margin-top: 8px;
  line-height: 1.45;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #E2E8F0;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 48px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.5);
  color: #FFFFFF;
}

.visually-hidden:focus-visible+.btn-secondary {
  outline: 2px solid #38BDF8;
  outline-offset: 2px;
}

.bookmarklet-details {
  background: rgba(11, 16, 27, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 13px;
  color: #CBD5E1;
}

.bookmarklet-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #38BDF8;
  min-height: 28px;
  display: flex;
  align-items: center;
}

.bookmarklet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.bookmarklet-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #F97316;
  color: #0A0D12;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
}

.btn-extract {
  width: 100%;
  background: #0284C7;
  color: #FFFFFF;
  border: 1px solid #38BDF8;
  border-radius: 12px;
  padding: 14px;
  min-height: 48px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 16px;
}

.btn-extract:hover {
  background: #0369A1;
}

#gate2Pane {
  display: none;
  margin-top: 24px;
}

.verdict-banner {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.45;
}

.verdict-banner--hidden {
  display: none;
}

.banner-pass {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10B981;
  color: #6EE7B7;
}

.banner-fail {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  color: #FCA5A5;
}

.quote-box {
  background: #0B101B;
  border-left: 3px solid #38BDF8;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-top: 6px;
  font-size: 12px;
  color: #94A3B8;
  font-style: italic;
}

.field-row {
  margin-bottom: 16px;
}

.field-row-hours {
  margin-top: 12px;
}

.gate3-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.infra-readonly {
  opacity: 0.7;
}

.btn-commit {
  width: 100%;
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
  color: #FFFFFF;
  border: 1px solid rgba(134, 239, 172, 0.35);
  border-radius: 12px;
  padding: 16px;
  min-height: 48px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 16px;
}

.btn-commit:hover {
  filter: brightness(1.08);
}

#receiptPane {
  display: none;
  background: rgba(9, 19, 34, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 16px;
  padding: 22px;
  margin-top: 24px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}

.receipt-title {
  color: #60A5FA;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
}

.receipt-field {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 13px;
}

.receipt-field:last-child {
  border-bottom: none;
}

.receipt-key {
  color: #94A3B8;
  font-weight: 600;
}

.receipt-val {
  color: #F8FAFC;
  font-family: var(--font-mono);
  word-break: break-all;
  margin-left: 12px;
}