:root {
  --navy-950: #060f24;
  --navy-900: #0a1b3d;
  --navy-800: #142a54;
  --navy-700: #223d6e;
  --gold: #c89b3c;
  --gold-soft: #e6c876;
  --teal: #2a9d8f;
  --paper: #f7f5f0;
  --paper-dim: #ece8df;
  --ink: #1c2430;
  --ink-soft: #5b6472;
  --danger: #b3453c;

  --display-font: 'Space Grotesk', sans-serif;
  --body-font: 'Inter', sans-serif;
  --mono-font: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

/* The browser's built-in `[hidden] { display: none }` rule loses to ANY
   author rule that sets `display` on the same element (origin beats
   specificity in the cascade) - e.g. `.field { display: flex }` would
   otherwise silently defeat the native hidden attribute on any element
   that's also `class="field"`. This makes the attribute reliable everywhere. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* -------------------- Rail nav -------------------- */

.railnav {
  background: var(--navy-900);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--navy-700);
  margin-bottom: 24px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(155deg, var(--gold-soft), var(--gold));
  color: var(--navy-950);
  font-family: var(--display-font);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-text strong {
  font-family: var(--display-font);
  font-size: 1rem;
  font-weight: 600;
}
.brand-text span {
  font-size: 0.72rem;
  color: var(--gold-soft);
  letter-spacing: 0.03em;
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: rgba(247, 245, 240, 0.72);
  font-family: var(--body-font);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-index {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  color: var(--gold-soft);
  opacity: 0.8;
}

.tab:hover { background: rgba(255,255,255,0.06); color: var(--paper); }

.tab.active {
  background: var(--navy-800);
  color: var(--paper);
  box-shadow: inset 3px 0 0 var(--gold);
}

.rail-section-label {
  font-family: var(--mono-font);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(247,245,240,0.4);
  margin: 18px 0 6px 12px;
}

.railnav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: rgba(247, 245, 240, 0.5);
  padding-top: 16px;
  border-top: 1px solid var(--navy-700);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-soft);
  display: inline-block;
}
.dot.ok { background: var(--teal); }
.dot.err { background: var(--danger); }

/* -------------------- Stage -------------------- */

.stage {
  padding: 44px 56px 60px;
  max-width: 880px;
}

.stage.stage-wide {
  max-width: none;
}

.stage-head h1 {
  font-family: var(--display-font);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--navy-900);
}

.stage-sub {
  margin: 0 0 32px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* -------------------- Chain of trust stepper (signature element) -------------------- */

.chain {
  display: flex;
  align-items: center;
  margin-bottom: 36px;
  padding: 18px 22px;
  background: var(--navy-900);
  border-radius: 12px;
}

.chain-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 74px;
}

.chain-node {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--navy-700);
  transform: rotate(45deg);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.chain-link label {
  font-family: var(--mono-font);
  font-size: 0.68rem;
  color: rgba(247, 245, 240, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chain-wire {
  flex: 1;
  height: 2px;
  background: var(--navy-700);
  margin: 0 -6px;
  margin-bottom: 22px;
}

.chain-link.done .chain-node { background: var(--gold); box-shadow: 0 0 0 4px rgba(200,155,60,0.18); }
.chain-link.done label { color: var(--gold-soft); }
.chain-link.current .chain-node { background: var(--teal); box-shadow: 0 0 0 4px rgba(42,157,143,0.22); }
.chain-link.current label { color: #bfe7e1; }

/* -------------------- Panels & forms -------------------- */

.panel.hidden { display: none; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--navy-900);
}

.field em {
  font-weight: 400;
  font-style: normal;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.field.span-2 { grid-column: span 2; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select, textarea {
  font-family: var(--body-font);
  font-size: 0.92rem;
  padding: 10px 12px;
  border: 1px solid var(--paper-dim);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline-offset: 2px;
}

textarea.mono, input.mono {
  font-family: var(--mono-font);
  font-size: 0.82rem;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--teal);
  border-color: var(--teal);
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.checkbox-field input { width: 16px; height: 16px; }

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}

.btn-primary {
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--navy-900);
  color: var(--paper);
  border: none;
  padding: 12px 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--navy-800); }
.btn-primary:disabled { background: var(--ink-soft); cursor: not-allowed; }

.hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* -------------------- Results -------------------- */

.result {
  margin-top: 28px;
}

.result:empty { display: none; }

.result-card {
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.result-card.success {
  background: rgba(42,157,143,0.09);
  border: 1px solid rgba(42,157,143,0.35);
  color: var(--navy-900);
}

.result-card.error {
  background: rgba(179,69,60,0.08);
  border: 1px solid rgba(179,69,60,0.35);
  color: var(--danger);
}

.result-card dl {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
}
.result-card dt { color: var(--ink-soft); font-size: 0.78rem; }
.result-card dd { margin: 0; font-family: var(--mono-font); font-size: 0.82rem; }

/* -------------------- Responsive -------------------- */

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }

  .railnav {
    position: static;
    height: auto;
    flex-direction: column;
    padding: 16px 16px 12px;
  }

  .brand {
    border: none;
    padding-bottom: 0;
    margin-bottom: 12px;
  }

  /* Each tab group becomes its own single-row, horizontally
     scrollable strip instead of wrapping and mixing with other
     rail elements (which is what caused the "disjointed" layout). */
  .tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    flex: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    margin: 0 -16px;
    padding: 2px 16px 6px;
  }
  .tabs::-webkit-scrollbar { display: none; }

  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 9px 12px;
  }

  .tab-index { display: none; }

  .rail-section-label {
    margin: 4px 0 2px 2px;
  }

  .railnav-footer { display: none; }

  .user-bar {
    margin-top: 4px;
    padding: 10px 0;
  }

  .stage { padding: 28px 20px 40px; }
  .grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* -------------------- Generic utility -------------------- */

.hidden { display: none !important; }

/* -------------------- Auth page -------------------- */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(165deg, var(--navy-950), var(--navy-900) 55%, var(--navy-800));
  background-image:
    radial-gradient(circle at 18% 18%, rgba(200,155,60,0.16), transparent 42%),
    radial-gradient(circle at 84% 82%, rgba(42,157,143,0.14), transparent 45%),
    linear-gradient(165deg, var(--navy-950), var(--navy-900) 55%, var(--navy-800));
}

.auth-shell {
  width: 100%;
  max-width: 440px;
  animation: auth-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
  text-align: center;
}

.auth-brand .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  font-size: 1.15rem;
  box-shadow: 0 10px 24px rgba(6,15,36,0.35);
}

.auth-brand-text strong {
  display: block;
  font-family: var(--display-font);
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.auth-brand-text span {
  display: block;
  font-size: 0.8rem;
  color: rgba(247,245,240,0.62);
  margin-top: 3px;
}

.auth-card {
  background: #fff;
  border-radius: 22px;
  padding: 38px 34px;
  box-shadow: 0 30px 70px rgba(6,15,36,0.45);
}

.auth-toggle {
  display: flex;
  background: var(--paper-dim);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 26px;
}

.auth-toggle-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 10px;
  font-family: var(--body-font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-toggle-btn:hover:not(.active) { color: var(--navy-800); }

.auth-toggle-btn.active { background: #fff; color: var(--navy-900); box-shadow: 0 2px 8px rgba(6,15,36,0.14); }

.auth-form { display: flex; flex-direction: column; gap: 18px; }

.auth-form .field span:first-child { font-size: 0.8rem; font-weight: 600; color: var(--navy-900); }

.auth-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border-top: 1px solid var(--paper-dim);
  padding-top: 16px;
  margin-top: -2px;
}
.auth-section-label em {
  display: block;
  font-style: normal;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin-top: 3px;
}

.auth-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.auth-grid-2 .field { min-width: 0; }
.auth-grid-2 input { width: 100%; min-width: 0; }

.auth-form input {
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--paper-dim);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(42,157,143,0.16);
}

.auth-form .btn-primary {
  margin-top: 4px;
  padding: 13px 22px;
  border-radius: 12px;
  font-size: 0.92rem;
  box-shadow: 0 10px 24px rgba(10,27,61,0.25);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.auth-form .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(10,27,61,0.3); }
.auth-form .btn-primary:active { transform: translateY(0); box-shadow: 0 6px 16px rgba(10,27,61,0.22); }

.auth-form .btn-secondary {
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 0.86rem;
  background: transparent;
  border: 1px solid var(--paper-dim);
  color: var(--ink-soft);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.auth-form .btn-secondary:hover { border-color: var(--teal); color: var(--navy-900); }

.auth-code-input {
  text-align: center;
  font-family: var(--mono-font);
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  padding-left: 10px;
}

.auth-note { font-size: 0.78rem; color: var(--ink-soft); margin: -6px 0 0; text-align: center; }

@media (max-width: 480px) {
  .auth-card { padding: 30px 22px; }
  .auth-grid-2 { grid-template-columns: 1fr; }
}

.auth-error { color: var(--ink-soft); font-size: 0.82rem; min-height: 1em; text-align: center; transition: color 0.15s ease; }
.auth-error.error { color: var(--danger); font-weight: 500; }

/* -------------------- User bar & subaccount filter -------------------- */

.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--navy-700);
  margin-top: 12px;
}

.user-bar-id { display: flex; flex-direction: column; line-height: 1.3; }
.user-bar-id strong { font-size: 0.82rem; color: var(--paper); }
.user-bar-id span { font-size: 0.7rem; color: var(--gold-soft); text-transform: uppercase; letter-spacing: 0.04em; }

.link-btn {
  background: none;
  border: none;
  color: rgba(247,245,240,0.6);
  font-size: 0.76rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.link-btn:hover { color: var(--paper); }

.owner-filter { margin-bottom: 20px; }
.owner-filter select { max-width: 320px; }

/* -------------------- Data tables -------------------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table th {
  text-align: left;
  font-family: var(--mono-font);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--paper-dim);
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--paper-dim);
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table .mono-cell { font-family: var(--mono-font); font-size: 0.8rem; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-admin { background: rgba(200,155,60,0.15); color: #8a6a20; }
.badge-team { background: rgba(90,110,200,0.15); color: #3a4a9e; }
.badge-subaccount { background: rgba(42,157,143,0.15); color: #1d6e63; }

.empty-state {
  color: var(--ink-soft);
  font-size: 0.88rem;
  padding: 24px 0;
}

.field-status {
  font-size: 0.76rem;
  color: var(--teal);
  min-height: 1em;
}
.field-status.error { color: var(--danger); }

/* -------------------- Price breakdown (retail / our price / discount) -------------------- */

.price-breakdown {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 0.86rem;
}
.price-breakdown-retail {
  color: var(--ink-soft);
  text-decoration: line-through;
  font-family: var(--mono-font);
  font-size: 0.82rem;
}
.price-breakdown-our {
  color: var(--navy-900);
  font-weight: 600;
  font-family: var(--mono-font);
}
.price-breakdown-discount {
  background: var(--teal);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* -------------------- Currency comparison -------------------- */

.price-compare {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.price-compare select {
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--paper-dim);
  background: #fff;
  color: var(--ink-soft);
}
.price-compare #buy-compare-amount {
  font-family: var(--mono-font);
  font-size: 0.82rem;
  color: var(--navy-900);
  font-weight: 600;
}

/* -------------------- Modal (mapping review, etc.) -------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,15,36,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(6,15,36,0.35);
}
.modal-card h3 {
  margin: 0 0 6px;
  color: var(--navy-900);
}

/* -------------------- Validation manager -------------------- */

.validation-row {
  border: 1px solid var(--paper-dim);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.validation-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.validation-row-domain {
  font-family: var(--mono-font);
  font-size: 0.9rem;
  color: var(--navy-900);
  font-weight: 600;
}

.validation-row-meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-pill.status-pending { background: rgba(200,155,60,0.15); color: #8a6a20; }
.status-pill.status-active { background: rgba(42,157,143,0.15); color: #1d6e63; }
.status-pill.status-unknown { background: var(--paper-dim); color: var(--ink-soft); }
.status-pill.status-rejected { background: rgba(179,69,60,0.12); color: var(--danger); }
.status-pill.status-approved { background: rgba(42,157,143,0.15); color: #1d6e63; }
.status-pill.status-issued { background: rgba(200,155,60,0.18); color: #7a5c17; }
.status-pill.status-canceled { background: var(--paper-dim); color: var(--ink-soft); }

/* -------------------- Purchase cards (customer + admin) -------------------- */

.purchase-card {
  border: 1px solid var(--paper-dim);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: #fff;
}
.purchase-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.purchase-card-title {
  font-family: var(--display-font);
  font-weight: 600;
  color: var(--navy-900);
  font-size: 1rem;
}
.purchase-card-meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0 0 10px;
}
.purchase-reject-reason {
  background: rgba(179,69,60,0.06);
  border: 1px solid rgba(179,69,60,0.25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--danger);
  margin-bottom: 10px;
}
.proof-inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.proof-inline-form input[type="file"] { font-size: 0.8rem; }

.validation-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--paper-dim);
  font-size: 0.85rem;
}

.validation-token-box {
  background: var(--paper);
  border: 1px solid var(--paper-dim);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--mono-font);
  font-size: 0.78rem;
  word-break: break-all;
  margin: 8px 0 12px;
}

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

.btn-secondary {
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 0.8rem;
  background: #fff;
  color: var(--navy-900);
  border: 1px solid var(--paper-dim);
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--paper); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
  color: var(--danger);
  border-color: rgba(179,69,60,0.35);
}
.btn-danger:hover:not(:disabled) { background: rgba(179,69,60,0.08); }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.row-actions select {
  font-size: 0.76rem;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid var(--paper-dim);
}
.row-actions .btn-secondary {
  padding: 5px 10px;
  font-size: 0.76rem;
}

/* -------------------- Collapsible create forms -------------------- */

.collapsible-form {
  border: 1px solid var(--paper-dim);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: #fff;
}

.collapsible-form summary {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy-900);
  cursor: pointer;
}

.list-heading {
  font-family: var(--display-font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy-900);
  margin: 24px 0 12px;
}

/* -------------------- Cart -------------------- */

.badge-cart {
  background: var(--teal);
  color: #fff;
  min-width: 18px;
  text-align: center;
  margin-left: 4px;
}

/* -------------------- Floating cart widget -------------------- */

.cart-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.cart-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy-900);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(6,15,36,0.28);
}

.cart-fab:hover { background: #132a5c; }

.cart-popup {
  width: min(400px, calc(100vw - 48px));
  max-height: min(560px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(6,15,36,0.24);
  border: 1px solid var(--paper-dim);
  overflow: hidden;
}

.cart-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--navy-900);
  color: #fff;
  font-family: var(--display-font);
}

.cart-popup-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.cart-popup-close:hover { opacity: 0.8; }

.cart-popup-body {
  flex: 1;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
}

.cart-item {
  border: 1px solid var(--paper-dim);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fff;
}

.cart-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-item-head strong {
  color: var(--navy-900);
  font-family: var(--display-font);
}

.cart-item-price {
  font-family: var(--mono-font);
  font-weight: 600;
  color: var(--navy-900);
  margin-top: 6px;
}

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 2px solid var(--navy-900);
  margin-top: 6px;
  font-family: var(--display-font);
  font-weight: 600;
  color: var(--navy-900);
}

/* -------------------- Addons -------------------- */

.addon-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.addon-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--paper-dim);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  background: #fff;
}

.addon-option:hover { background: var(--paper); }

.addon-option input[type="checkbox"] { margin-top: 3px; }

.addon-option-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.addon-option-name {
  font-weight: 600;
  color: var(--navy-900);
  font-size: 0.88rem;
}

.addon-option-price {
  font-family: var(--mono-font);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.addon-qty {
  width: 64px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--paper-dim);
  font-size: 0.82rem;
}

/* -------------------- Domain type indicator (standard / wildcard / SAN) -------------------- */
/* Read-only cards, not an exclusive choice - all that apply light up at   */
/* once, driven entirely by what's typed into the domain fields below     */
/* (see updateDomainTypeToggle() in app.js). The checkbox is disabled;     */
/* it's there purely to show each card's active/inactive state.           */

.domain-type-toggle {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.domain-type-option {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 2px solid var(--paper-dim);
  border-radius: 10px;
  padding: 12px 40px 12px 14px;
  position: relative;
  background: #fff;
}

.domain-type-option input[type="checkbox"] {
  position: absolute;
  top: 14px;
  right: 14px;
  opacity: 1;
}

.domain-type-option:has(input:checked) {
  border-color: var(--teal);
  background: rgba(42,157,143,0.06);
}

.domain-type-label {
  font-weight: 600;
  color: var(--navy-900);
  font-size: 0.9rem;
}

.domain-type-example {
  font-family: var(--mono-font);
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.domain-type-price {
  font-family: var(--mono-font);
  font-weight: 600;
  color: var(--navy-900);
  margin-top: 4px;
}

/* -------------------- Certificate price breakdown (base + Wildcard + SAN) -------------------- */

#buy-total-preview {
  background: var(--paper);
  border: 1px solid var(--paper-dim);
  border-radius: 10px;
  padding: 14px 16px;
  gap: 6px;
}

#buy-total-breakdown {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 2px 0;
}

.total-breakdown-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  font-family: var(--mono-font);
  color: var(--ink-soft);
}

.total-breakdown-line.unpriced { color: var(--danger); }

#buy-total-amount {
  font-family: var(--mono-font);
  font-size: 1.05rem;
  color: var(--navy-900);
}

/* -------------------- Dynamic additional-domains (SAN) list -------------------- */

.san-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.san-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.san-row .san-input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--paper-dim);
  font-size: 0.86rem;
  font-family: var(--body-font);
}

.san-row .san-remove {
  flex-shrink: 0;
}

#buy-dns-names-add {
  margin-top: 8px;
  align-self: flex-start;
}
