/* Settings → Exports (V2A) and the month lock on an expense card.
 *
 * Its own stylesheet (NEXT-PLAN §6.6: new screens get their own), built in the
 * wireframe's card and chip language (docs/ui/MOCKUP.html) on the Settings
 * card from views.css. Colours come from tokens.css only, so light and dark
 * both follow; every control is at least --touch (44 px) tall. Text on a wash
 * (the expense card, a pack's file, the confirm box) is --ink or --ink-muted,
 * never --ink-faint: tokens.css says so, and dark mode measured 3.76:1.
 */

/* ── the month lock: a small padlock drawn in CSS, as the private card's is ── */

.entry__export-lock {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-1) 0 0;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.entry__export-lock-icon {
  position: relative;
  flex: none;
  width: 0.625rem;
  height: 0.5rem;
  margin-top: 0.25rem;
  border-radius: 2px;
  background: currentColor;
}

.entry__export-lock-icon::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0.09375rem;
  right: 0.09375rem;
  height: 0.28125rem;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 0.28125rem 0.28125rem 0 0;
}

/* ─────────────────────────────────────────────────────────── the card ── */

.exports .card__subtitle {
  margin-top: 0;
}

.exports__month-state {
  margin: calc(-1 * var(--space-2)) 0 var(--space-3);
}

/* Expenses with no paid-from: said in the warn wash, the Planned strip's. */
.exports__warn {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--tint-warn);
  border-left: 3px solid var(--emphasis-edge);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: var(--text-md);
}

.exports__confirm {
  padding: var(--space-3);
  background: var(--tint-warn);
  border: 1px solid var(--emphasis-edge);
  border-radius: var(--radius-sm);
}

.exports__confirm-words {
  margin: 0 0 var(--space-3);
  color: var(--ink);
  font-size: var(--text-base);
}

/* A warning repeated under the question: not over yet, no paid-from. */
.exports__confirm-note {
  margin: calc(-1 * var(--space-1)) 0 var(--space-3);
  color: var(--ink);
  font-size: var(--text-md);
}

.exports__lock-btn {
  background: var(--emphasis);
  border-color: var(--emphasis-edge);
  color: #1A1C1A;
}

.exports__lock-btn:hover:not(:disabled) {
  border-color: var(--ink);
}

.exports__pack-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-1);
}

.exports__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.125rem var(--space-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.exports__chip--locked {
  background: var(--surface-sunken);
  border-color: var(--accent);
  color: var(--accent);
}

.exports__chip--open {
  background: var(--tint-warn);
  border-color: var(--emphasis-edge);
  color: var(--warn-ink);
}

.exports__counts {
  font-variant-numeric: tabular-nums;
}

.exports__file {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--tint-money);
  border-radius: var(--radius-sm);
}

.exports__file-name {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
}

.exports__sha {
  grid-column: 1 / 2;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.exports__file .exports__download {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
}

/* An <a> styled as .btn is inline: give it the button's 44 px box. */
.exports__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
}

/* A locked month's row: its words and Amend on one line, whose height is a
 * touch target's whether it holds the 44 px button or, once Amend is open, the
 * small chip — so the rows below never jump up. What Amend said goes under it,
 * on a line of its own (an implicit row: no gap when there is none). */
.exports__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(var(--touch), auto);
  align-items: center;
  column-gap: var(--space-3);
}

.exports__row-words {
  margin: 0;
  min-width: 0;
}

.exports__row-day {
  font-weight: 600;
}

.exports__row .exports__chip {
  justify-self: end;
  white-space: nowrap;
}

/* Undo Amend: on a line of its own under the open row's chip, so the words
 * keep their width at 390 px (fidelity review, V2A round 3). */
.exports__undo {
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: var(--space-1);
}

.exports__row-note {
  grid-column: 1 / -1;
  margin: var(--space-1) 0 0;
  color: var(--ink-muted);
  font-size: var(--text-md);
  /* scrollIntoView stops it above the sticky tab bar, not under it. */
  scroll-margin-block-end: calc(var(--tabs-h) + var(--space-2));
}

.exports__row-note[data-state="ok"],
.exports__row-note[data-state="relocked"] {
  color: var(--ok);
}

.exports__row-note[data-state="error"] {
  color: var(--danger);
}

/* Focused when Amend's button goes (tabindex -1), as the router focuses a
 * view's title: a ring only for the owner who arrived by keyboard. */
.exports__row-note:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.exports__register {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.exports__register .card__name,
.exports__register .card__detail {
  margin: 0 0 var(--space-2);
}

.exports__picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0 var(--space-3);
}

/* Under the Registers heading, above both registers it serves. */
.exports__private {
  margin: 0 0 var(--space-3);
}

/* The browser's own ring on a checkbox is 1 px of near-black: invisible in the
 * dark. It wears the card's ring, as every other control here does. */
.exports__private .field__check:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------ "Your own exports" (EXP, wave-1 merge) */

.exports__own-kinds {
  flex-wrap: wrap;
  margin: var(--space-3) 0 0;
}

.exports__own-name {
  overflow-wrap: anywhere;
}

/* The sha256 is a button (12 hex; the whole value on a tap): it keeps the
 * mono line's look, with a 44 px target and the app's focus ring. */
.exports__sha-toggle {
  min-height: var(--touch);
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.exports__sha-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
