/* The account pages, sign-in, the key shown once, and the error page, in the Ledger palette: cards on the surface
   colour with a frame line, sans for structure and forms, serif for the reading text and the key numbers. */

/* The head of an account page: title, tabs, and the page status, close together. */
.app-top { display: grid; gap: 16px; }
.app-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.app-head .note { margin-top: 4px; }

/* The account tabs. The current tab is plain text with an accent rule; the others are links. */
.tabs { display: flex; gap: 4px 22px; flex-wrap: wrap; border-bottom: 1px solid var(--frame); font-family: var(--sans);
  font-size: 15px; font-weight: 500; }
.tabs > * { padding: 8px 0 10px; margin-bottom: -1px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a { color: var(--ink-soft); }
.tabs [aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* A card: the surface, a 12 px radius, a frame line outside and rule lines inside. */
.card { background: var(--surface); border: 1px solid var(--frame); border-radius: 12px; padding: 22px;
  display: grid; grid-template-columns: minmax(0, 1fr); /* a wide table scrolls inside its .table-wrap, not the page */
  gap: 16px; align-content: start; font-size: 16px; line-height: 1.6; }
.card h2 { font-size: 22px; }
.card ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
/* The account closure: an ink frame. */
.card-danger { border-color: var(--ink); }
.stack { display: grid; gap: 16px; }
.cards { display: grid; gap: 32px; }

/* Balance: key numbers in serif, as on the 13fragments posts; the available credits carry the accent rule. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); column-gap: 18px; margin: 0; }
.stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding: 14px 0 4px;
  border-top: 2px solid var(--ink); }
.stats dt { font-family: var(--sans); font-size: 14px; line-height: 1.4; color: var(--muted); }
.stats dd { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 40px; line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: lining-nums tabular-nums; }
.stats .big { border-top-color: var(--accent); }

/* Tables in cards use .data. A credit added is set in 600. Ids stay on one line; a wide table scrolls in its box. */
.plus { font-weight: 600; }
.data td code, .data th { white-space: nowrap; }
.tag { display: inline-block; margin: 0 4px 2px 0; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em;
  color: var(--accent-text); background: var(--accent-tint); border: 1px solid var(--chip-line); border-radius: 4px; padding: 0 7px; }

/* ------------------------------------------------------------------ forms */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; font-family: var(--sans); font-size: 15px; line-height: 1.5; }
.field label, .field legend { font-weight: 600; }
.field .hint { font-size: 14px; color: var(--muted); font-weight: 400; }
fieldset.plain, fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.input { min-height: var(--control); width: 100%; padding: 0 12px; border: 1px solid var(--muted); border-radius: 8px;
  background: var(--surface); font-family: var(--sans); font-size: 16px; }
.input.mono { font-family: var(--mono); font-size: 15px; }
.input::placeholder { color: var(--muted); opacity: 1; }
.input:hover { border-color: var(--ink-soft); }
.input:focus-visible { outline-offset: 1px; border-color: var(--accent); }
.input:disabled, fieldset:disabled .input { background: var(--surface-alt); border-color: var(--rule); color: var(--muted); cursor: not-allowed; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: start; }
.checks { display: flex; flex-wrap: wrap; gap: 0 20px; }
.checks label, .check { display: inline-flex; align-items: center; gap: 8px; min-height: var(--control); font-family: var(--sans);
  font-size: 15px; font-weight: 400; }
.checks input, .check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ------------------------------------------------------------------ the key shown once */
/* The one thing on the page a reader must not miss: the claim box, with the key in a framed mono field. */
.secret { display: grid; gap: 14px; padding: 20px 22px; background: var(--accent-tint); border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0; animation: arrive .45s cubic-bezier(.2, .8, .2, 1) both; }
.secret h2 { font-size: 22px; }
.secret .warn { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--ink); }
.secret-value { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--chip-line); border-radius: 8px;
  font-size: 15px; color: var(--ink); word-break: break-all; user-select: all; }
@keyframes arrive { from { transform: translateY(6px); opacity: 0; } }

.confirm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--sans); font-size: 14px; }
.empty { font-family: var(--sans); font-size: 15px; color: var(--muted); }

/* ------------------------------------------------------------------ sign-in, welcome, and the error page */
.single { max-width: var(--measure); display: grid; gap: 20px; }
.single .lead { font-size: 19px; color: var(--ink-soft); }

/* Waiting: a ring that turns, in the accent. */
.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -1px; border-radius: 50%;
  border: 2px solid var(--rule); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .card { padding: 16px; border-radius: 10px; }
  .stats { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .stats dd { font-size: 32px; }
}

/* Email sign-in: the Turnstile box takes no room until the check needs the visitor, and the code reads as one group. */
.turnstile:empty { display: none; }
.input.code-input { max-width: 12ch; font-size: 20px; letter-spacing: .3em; }

/* A short line under a table cell's main text, such as the note on the website sign-in key. */
.data .cell-note { display: block; max-width: 28ch; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.data .cell-note.here { color: var(--accent-text); font-weight: 600; }
/* The keys table fits its card: its long headers, such as the limits, may take two lines. */
.key-table th { white-space: normal; }
