/* --------------------------------------------------------------------------
   The confirmation card

   The one thing here that cannot be shown in a terminal. It is deliberately
   the heaviest object on the page: a bordered, shadowed panel with a coloured
   head that interrupts the reading flow, because approving a write should not
   feel like reading a sentence. Amber while it waits for a decision — it
   needs the operator — and red when it is high risk.
   -------------------------------------------------------------------------- */

.card {
  margin-top: 16px;
  border: 1px solid var(--warn-border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  padding: 0 20px;
  overflow: hidden;
  font-size: 14px;
}

.card-high {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--neg) 8%, transparent), var(--shadow-md);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0 -20px 14px;
  padding: 10px 20px;
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn-border);
}

.card-high .card-head {
  background: var(--danger-soft);
  border-bottom-color: var(--danger-border);
}

.card-badge,
.card-expiry {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 650;
}

.card-badge  { color: var(--warn); }
.card-high .card-badge { color: var(--neg); }
.card-expiry { color: var(--text-muted); font-weight: 500; font-variant-numeric: tabular-nums; }

.card-summary {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: -.01em;
  color: var(--text-strong);
}

/* A card with nothing under its summary still ends with room to breathe. */
.card > .card-summary:last-child { margin-bottom: 16px; }

.card-gate {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
}

.card-gate-label {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: var(--neg);
  margin-bottom: 8px;
}

.card-gate-label strong {
  font-family: var(--font-mono);
  font-weight: 500;
}

.card-gate-input {
  width: 100%;
  border: 1px solid var(--border-input);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-strong);
}

.card-gate-input:focus-visible {
  border-color: var(--neg);
  outline: 2px solid var(--neg);
  outline-offset: 1px;
}

/* The decision, in a band of its own at the card's foot. */
.card-foot {
  margin: 18px -20px 0;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-raised);
}

.card-keep { margin-right: auto; cursor: pointer; }
.card-keep[hidden] { display: none; }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.card-status {
  margin-top: 10px;
  text-align: right;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Collapsed until it has something to say, otherwise every card carries an
   empty row under its buttons. */
.card-status:empty {
  display: none;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  min-height: 38px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--r-md);
  padding: 8px 18px;
  transition: opacity .15s, background .15s, border-color .15s;
}

.btn-primary {
  background: var(--accent-fill);
  color: var(--text-on-accent);
  border: 1px solid var(--accent-fill);
  box-shadow: var(--shadow-sm);
}

/* aria-disabled is "busy": the button stays focusable so the operator's place is
   kept while a decision is in flight. The click handler refuses it. */
.btn[aria-disabled="true"] { cursor: default; }

.btn-primary:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--accent-fill-hover);
  border-color: var(--accent-fill-hover);
}
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] { opacity: .45; box-shadow: none; }

.card-high .btn-primary {
  background: var(--danger-fill);
  border-color: var(--danger-fill);
}

.card-high .btn-primary:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--danger-fill);
  opacity: .9;
}

.btn-quiet {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-quiet:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--surface-sunken); }
.btn-quiet:disabled,
.btn-quiet[aria-disabled="true"] { opacity: .5; }
