/* Components on top of Pico + the Ledger theme (theme.css). Colours come from --ds-* tokens. */

h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; letter-spacing: -0.01em; }
hgroup > p, .lede { color: var(--ds-muted); }
.muted { color: var(--ds-muted); }
.num, time.num { font-family: var(--pico-font-family-monospace); font-variant-numeric: tabular-nums; }

/* Page frame: footer stays at the bottom of short pages */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }

/* Header */
.site-header { --pico-nav-element-spacing-vertical: 0.625rem; background: var(--ds-surface); border-bottom: 1px solid var(--ds-border); margin-bottom: 2rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ds-text); font-weight: 700;
  font-size: 1.125rem; letter-spacing: -0.01em; text-decoration: none; }
.brand:hover { color: var(--ds-text); text-decoration: none; }
.brand-mark rect { fill: var(--ds-accent); }
.brand-mark path { stroke: var(--ds-on-accent); }
/* Header actions: "Link a deck", "Sign in" and the profile menu share one height and line. */
.site-header nav > ul:last-child { align-items: center; }
.site-header nav > ul:last-child > li { display: flex; align-items: center; }
.site-header nav [role="button"],
.site-header details.dropdown summary { box-sizing: border-box; height: 2.5rem; margin: 0; padding: 0 1rem;
  display: inline-flex; align-items: center; font-size: 0.875rem; line-height: 1; white-space: nowrap; }
.site-header nav [role="button"] { font-weight: 600; }
@media (max-width: 30rem) {
  .site-header nav [role="button"] { padding: 0 0.75rem; }
  .site-header nav > ul:first-child .brand { font-size: 1rem; }
  /* Only the avatar letter; the name stays for screen readers. */
  .site-header summary .username { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap; }
  .site-header details.dropdown summary { padding-right: 0.5rem; }
}
.site-header details.dropdown { margin: 0; }
.site-header details.dropdown summary { gap: 0.5rem; padding: 0 0.75rem 0 0.375rem; }
.site-header details.dropdown summary::after { height: 1rem; margin-inline-start: 0.375rem; }
nav details.dropdown form { margin: 0; }
nav details.dropdown button { width: 100%; margin: 0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem;
  border-radius: 50%; background: var(--ds-avatar-bg); color: var(--ds-accent-text); font-size: 0.75rem;
  font-weight: 700; text-transform: uppercase; }

/* Footer */
.site-footer { background: var(--ds-surface); border-top: 1px solid var(--ds-border); margin-top: 3rem; }
.site-footer > .container p { margin: 0; }
.site-footer > .container p + p { margin-top: 0.375rem; }
.site-footer > .container { padding-block: 1.25rem; font-size: 0.8125rem; color: var(--ds-muted); }

/* Panels and tables */
.panel { background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-panel); }
.panel.scroll { overflow-x: auto; }
.panel > table { --pico-background-color: transparent; margin: 0; }
.panel > table th { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ds-muted); border-bottom: 1px solid var(--ds-border); }
.panel > table th, .panel > table td { padding: 0.875rem 1.25rem; }
.panel > table tbody tr:last-child td { border-bottom: 0; }
.panel > table a.deck-name { color: var(--ds-text); font-weight: 600; text-decoration: none; }
.panel > table a.deck-name:hover { color: var(--ds-accent-text); }

/* Badges and tags */
.badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.125rem 0.625rem; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 600; background: var(--ds-tag-bg); color: var(--ds-sub); white-space: nowrap; }
.badge.warning { background: var(--ds-badge-bg); color: var(--ds-badge-text); }
.badge.warning::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--ds-badge-dot); }
.tag { font-size: 0.75rem; color: var(--ds-sub); background: var(--ds-tag-bg); border-radius: 0.375rem; padding: 0.125rem 0.5rem; }

/* Swaps: out / in (used by the deck page) */
.out { color: var(--ds-out); font-weight: 500; }
.in { color: var(--ds-in); font-weight: 500; }
.callout { background: var(--ds-callout-bg); border: 1px solid var(--ds-callout-border); color: var(--ds-callout-text);
  border-radius: var(--ds-radius-panel); padding: 1.25rem; }

/* Messages and forms */
article.message { padding: 0.75rem 1rem; margin-bottom: 1rem; border: 1px solid var(--ds-border); box-shadow: none; }
article.message.error { border-left: 0.3rem solid var(--ds-out); }
article.message.success { border-left: 0.3rem solid var(--ds-accent); }
article.message.warning, article.message.info { border-left: 0.3rem solid var(--ds-badge-dot); }
/* Destructive actions: solid red, or a red outline where the action is one step away. The
   :is(…) and [aria-current] only match Pico's own hover selectors in specificity, so ours win. */
.danger { --pico-background-color: var(--ds-danger); --pico-border-color: var(--ds-danger);
  --pico-color: var(--ds-on-danger); }
:is(button, [role="button"]).danger:is(:hover, :active, :focus, [aria-current]) { --pico-background-color: var(--ds-danger-hover);
  --pico-border-color: var(--ds-danger-hover); --pico-color: var(--ds-on-danger); }
:is(button, [role="button"]).danger.outline { --pico-background-color: transparent; --pico-border-color: var(--ds-danger-text);
  --pico-color: var(--ds-danger-text); }
:is(button, [role="button"]).danger.outline:is(:hover, :active, :focus, [aria-current]) { --pico-background-color: var(--ds-danger);
  --pico-border-color: var(--ds-danger); --pico-color: var(--ds-on-danger); }
.danger:focus-visible { --pico-box-shadow: 0 0 0 var(--pico-outline-width) var(--ds-danger-text); }
small.error { color: var(--ds-out); }
button.save { width: auto; }

/* Utilities */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Deck page */
.deck-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1.25rem;
  margin-bottom: 1.5rem; }
.deck-head h1 { font-size: 2.25rem; margin-bottom: 0.5rem; }
.deck-head p { margin-bottom: 0.25rem; }
.crumbs { font-size: 0.875rem; color: var(--ds-muted); }
.crumbs a { color: var(--ds-muted); }
.deck-meta { color: var(--ds-sub); }
.deck-meta strong { color: var(--ds-text); font-weight: 600; }
.deck-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.deck-actions form { margin: 0; }
.deck-actions [role="button"], .deck-actions button { margin: 0; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600; }

.callout { margin-bottom: 1.5rem; }
.callout h2 { font-size: 1.125rem; color: var(--ds-callout-text); margin-bottom: 0.5rem; }
.callout p { color: var(--ds-callout-text); font-size: 0.9375rem; margin-bottom: 0.75rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0 0 0.75rem; }
.chips li { list-style: none; margin: 0; font-size: 0.875rem; font-weight: 500; background: var(--ds-surface);
  border: 1px solid var(--ds-callout-border); border-radius: 0.375rem; padding: 0.25rem 0.625rem; }
.as-of-note { border-left: 0.3rem solid var(--ds-accent); }

.deck-list { margin-bottom: 2rem; }
.deck-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--ds-border); }
.deck-list-head h2 { font-size: 1.375rem; margin: 0; }
.section-totals { margin: 0; flex: 1 1 auto; font-size: 0.875rem; color: var(--ds-muted); }
.as-of-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--ds-border); background: var(--ds-bg); font-size: 0.875rem; color: var(--ds-sub); }
.as-of { margin: 0; }
.as-of fieldset { margin: 0; }
.as-of select, .as-of input, .as-of button { padding-block: 0.375rem; font-size: 0.875rem; height: auto; }
.as-of select { max-width: 26rem; }

.deck-section { padding: 1.25rem 1.5rem 0.5rem; }
.deck-section + .deck-section { border-top: 1px solid var(--ds-border); }
.section-head { display: flex; justify-content: space-between; font-size: 1rem; margin-bottom: 0.75rem; }
.section-head .num { color: var(--ds-muted); font-weight: 500; }
.type-columns { column-width: 15rem; column-gap: 2.5rem; }
.type-group { break-inside: avoid; margin-bottom: 1.5rem; }
.type-group h4 { display: flex; justify-content: space-between; font-size: 0.8125rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ds-muted); border-bottom: 1px solid var(--ds-border);
  padding-bottom: 0.375rem; margin-bottom: 0.375rem; }
.card-list { padding: 0; margin: 0; }
/* One line per card: qty, name and flags, mana. Tags, the note icon and the edit button get their own
   line under the name, so they never squeeze it (#56). The flags flow after the name like words, and a
   long name wraps inside its box, so the qty and mana stay on the name's first line (#67). */
.card-row { position: relative; list-style: none; display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: 0 0.5rem; margin: 0; line-height: 1.85; }
.card-row .qty { flex: none; width: 1.25rem; text-align: right; font-size: 0.8125rem; line-height: 1.85rem;
  color: var(--ds-muted); }
.row-main { flex: 1 1 0; min-width: 0; overflow-wrap: break-word; }
.row-main .flag { display: inline-block; margin-left: 0.25rem; vertical-align: 0.1em; }
.card-row > .mana { height: 1.85rem; }
.card-row > .row-action { height: 1.85rem; align-items: center; }
.card-name { overflow-wrap: break-word; }
.card-name .nobreak { white-space: nowrap; } /* "First-Year" doesn't wrap at the hyphen */
.card-name[tabindex]:focus-visible { outline: 2px solid var(--pico-primary-focus); border-radius: 0.25rem; }
.flag { flex: none; font-size: 0.6875rem; font-weight: 600; line-height: 1.4; border: 1px solid currentColor;
  border-radius: 0.25rem; padding: 0 0.3125rem; }
.flag.out { color: var(--ds-out); border-color: var(--ds-out-border); }
.flag.in { color: var(--ds-in); }
.flag.partial { color: var(--ds-muted); border-style: dashed; }
.row-tags { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; min-width: 0;
  padding-left: 1.75rem; margin: -0.125rem 0 0.375rem; line-height: 1.4; }
.row-tags .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-icon { display: inline-flex; color: var(--ds-muted); cursor: help; }
.note-icon:focus-visible { outline: 2px solid var(--pico-primary-focus); border-radius: 0.25rem; }

/* Mana symbols */
.mana { flex: none; display: inline-flex; align-items: center; gap: 2px; }
.ms { display: block; width: 1.05rem; height: 1.05rem; border-radius: 50%; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.pip { display: inline-flex; align-items: center; justify-content: center; min-width: 1.05rem; height: 1.05rem;
  padding: 0 0.15rem; border-radius: 999px; font-family: var(--pico-font-family-monospace); font-size: 0.625rem;
  font-weight: 700; line-height: 1; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
.pip-w { background: #f3ebd3; color: #3d3a30; }
.pip-u { background: #2f73b5; color: #ffffff; }
.pip-b { background: #3a3330; color: #ffffff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); }
.pip-r { background: #c4462f; color: #ffffff; }
.pip-g { background: #2f7f4e; color: #ffffff; }
.pip-c, .pip-n { background: #cfd5d1; color: #16201c; }
.pip-sep { color: var(--ds-muted); font-size: 0.75rem; padding: 0 0.125rem; }

/* Card preview on hover / keyboard focus. Each name's preview is rendered hidden next to it
   (decks/_card_preview.html); static/js/app.js copies it into one floating popup on top of the
   page, so showing it never changes the layout of the list (#62). */
.card-preview { display: none; }
.card-popup { position: fixed; z-index: 100; width: 16rem; max-width: calc(100vw - 1rem);
  max-height: calc(100vh - 1rem); overflow: auto; pointer-events: none;
  background: var(--ds-surface); color: var(--ds-text); border: 1px solid var(--ds-border); border-radius: 0.75rem;
  padding: 0.75rem; box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2); font-size: 0.8125rem; line-height: 1.45; }
.card-popup[hidden] { display: none; }
.card-popup img { display: block; width: 100%; height: auto; border-radius: 4.75% / 3.5%; margin-bottom: 0.5rem; }
.card-popup p { margin: 0 0 0.375rem; }
.card-popup p:last-child { margin-bottom: 0; }
.card-popup.image-only img { margin-bottom: 0; }
.card-popup .preview-note { border-top: 1px solid var(--ds-border); padding-top: 0.375rem; font-style: italic; }
.oracle .ms { display: inline-block; width: 0.95em; height: 0.95em; vertical-align: -0.1em; margin: 0 0.05em; }
.oracle .pip { min-width: 0.95em; height: 0.95em; font-size: 0.6rem; vertical-align: -0.1em; }
.swap-line .card-name, .slot-card .card-name { cursor: default; }
.swap-line .card-name[tabindex]:focus-visible, .slot-card .card-name[tabindex]:focus-visible {
  outline: 2px solid var(--pico-primary-focus); border-radius: 0.25rem; }
.preview-type { color: var(--ds-muted); }

/* Deck pages: tabs, panels with a header, change log, slots (#12) */
.deck-tabs { display: flex; justify-content: flex-start; gap: 1.5rem; border-bottom: 1px solid var(--ds-border); margin-bottom: 1.5rem; }
.deck-tabs a { padding: 0.5rem 0; margin-bottom: -1px; color: var(--ds-muted); text-decoration: none; font-weight: 500;
  border-bottom: 2px solid transparent; }
.deck-tabs a:hover { color: var(--ds-text); }
.deck-tabs a[aria-current="page"] { color: var(--ds-text); font-weight: 600; border-bottom-color: var(--ds-accent); }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--ds-border); }
.panel-head h2 { font-size: 1.125rem; margin: 0; }
.panel-head p { margin: 0; font-size: 0.8125rem; }
.panel .empty { padding: 1rem 1.25rem; margin: 0; }
.panel > .message { margin: 1rem 1.25rem 0; }

.swap-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.625rem; }
.swap-line .arrow { color: var(--ds-muted); flex: none; }
.swap-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.625rem; font-weight: 500; }
.reason { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--ds-sub); }
.notes { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--ds-muted); }

.swap-panels { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.planned-panel { flex: 3 1 30rem; min-width: 0; }
.history-panel { flex: 2 1 21rem; min-width: 0; }
.compact-rows { padding: 0; margin: 0; }
.compact-rows li { list-style: none; margin: 0; padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--ds-row-border); }
.compact-rows li:last-child { border-bottom: 0; }
.compact-rows li.dated { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr); gap: 0.875rem; }
.compact-rows li.dated time { font-size: 0.8125rem; color: var(--ds-muted); padding-top: 0.125rem; }
.compact-rows li.dated p { margin: 0; }

.plan-panel { padding: 0 1.25rem; margin-bottom: 1.5rem; }
.plan-panel > summary { padding: 0.875rem 0; font-weight: 600; }
.plan-panel[open] > summary { margin-bottom: 0.5rem; }
.plan-panel form { max-width: 36rem; padding-bottom: 1.25rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; margin-bottom: 1rem; }
.filters label { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.875rem; color: var(--ds-sub); }
.filters select { width: auto; margin: 0; padding-block: 0.375rem; font-size: 0.875rem; height: auto; }

.swap-rows { padding: 0; margin: 0; }
.swap-row { list-style: none; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; margin: 0;
  padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--ds-row-border); }
.swap-row:last-child { border-bottom: 0; }
.swap-row.baseline p { margin: 0; }
.swap-when { display: flex; flex-direction: column; font-size: 0.8125rem; color: var(--ds-muted); padding-top: 0.125rem; }
.swap-when .seq { font-size: 0.75rem; }
.swap-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.5rem; font-size: 0.875rem; }
.swap-actions form { margin: 0; }
.swap-actions button { margin: 0; padding: 0.25rem 0.75rem; font-size: 0.8125rem; width: auto; }
.swap-row.editing form { margin-top: 0.75rem; max-width: 36rem; }
.state { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.4;
  padding: 0.0625rem 0.375rem; border-radius: 0.25rem; border: 1px solid var(--ds-border); color: var(--ds-muted); }
.state-planned { color: var(--ds-accent-text); border-color: var(--ds-accent-text); border-style: dashed; }
.state-applied { color: var(--ds-in); border-color: var(--ds-in); }
.state-cancelled { text-decoration: line-through; }
.row-action { flex: none; display: inline-flex; color: var(--ds-muted); }
.row-action:hover { color: var(--ds-accent-text); }
/* The owner clicks the row to edit tags and note (#75). The link stays out of the layout, so no
   row's mana cost moves, and only shows when it has keyboard focus. */
.card-row[data-edit] { cursor: pointer; border-radius: 0.375rem; }
.card-row[data-edit]:hover { background: rgba(127, 127, 127, 0.08); }
.card-row .row-action { position: absolute; top: 0.25rem; right: 0; padding: 0.125rem;
  background: var(--ds-surface); border-radius: 0.25rem; opacity: 0; pointer-events: none; }
.card-row .row-action:focus-visible { opacity: 1; pointer-events: auto;
  outline: 2px solid var(--pico-primary-focus); }
#note-dialog article { width: min(32rem, 100%); }
#note-dialog form { margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.form-actions button { margin: 0; }
.form-actions button.danger { width: auto; }
.narrow-form { max-width: 36rem; padding: 1.25rem; }

.slot-rows { padding: 0; margin: 0; }
.slot { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.375rem 0.625rem; margin: 0;
  padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--ds-row-border); }
.slot:last-child { border-bottom: 0; }
.slot .arrow { color: var(--ds-muted); align-self: center; }
.slot-card { font-weight: 500; }
.slot-card.start { color: var(--ds-sub); }
.slot-card.planned { color: var(--ds-muted); font-style: italic; }
.slot-meta { font-size: 0.75rem; font-weight: 400; color: var(--ds-muted); margin-left: 0.25rem; }

/* Sync page and pairing screen (#13) */
.sync-now, .sync-now + .panel, .callout + .panel { margin-bottom: 1.5rem; }
.sync-form { padding: 1rem 1.25rem 1.25rem; margin: 0; }
.state-failed { color: var(--ds-out); border-color: var(--ds-out); }
.pairing { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.pairing h2 { font-size: 1.125rem; margin: 0; padding: 1rem 1.25rem; border-bottom: 1px solid var(--ds-border); }
.pairing-out { flex: 3 1 34rem; min-width: 0; }
.pairing-in { flex: 2 1 20rem; min-width: 0; position: sticky; top: 1rem; }
.pair-rows, .in-pool { padding: 0; margin: 0; }
.pair-row { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0.5rem 1rem;
  align-items: center; margin: 0; padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--ds-row-border); }
.pair-row:last-child { border-bottom: 0; }
.pair-row select { margin: 0; padding-block: 0.375rem; font-size: 0.875rem; height: auto; }
.pair-notes { grid-column: 1 / -1; margin: 0; font-size: 0.8125rem; }
.pair-notes summary { color: var(--ds-muted); }
.pair-notes[open] { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pair-notes[open] summary { grid-column: 1 / -1; }
.pair-notes input { margin: 0; padding-block: 0.375rem; font-size: 0.875rem; height: auto; }
.pair-card { position: relative; display: inline-flex; flex-direction: column; vertical-align: top; }
.pair-name { font-weight: 500; }
.pair-meta { color: var(--ds-muted); font-size: 0.75rem; }
.pair-out { display: flex; gap: 0.5rem; align-items: baseline; }
.in-pool li { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; margin: 0;
  padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--ds-row-border); }
.in-pool .replaces { flex-basis: 100%; padding-left: 1rem; color: var(--ds-sub); font-size: 0.8125rem; }
.in-pool li.unpaired .replaces { color: var(--ds-out); }
.suggested { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ds-accent-text);
  border: 1px dashed var(--ds-accent-text); border-radius: 0.25rem; padding: 0 0.3rem; margin-left: 0.25rem; }
#pairing-status .pairing-errors { margin: 0.75rem 1.25rem 0; padding: 0.625rem 0.875rem; font-size: 0.875rem;
  color: var(--ds-out); border-left: 0.3rem solid var(--ds-out); background: var(--ds-surface); }
#pairing-status .pairing-errors li { list-style: none; margin: 0; }
#pairing-status .pairing-errors li + li { margin-top: 0.375rem; }
#pairing-status .form-actions { padding: 1rem 1.25rem 1.25rem; }

/* Compare (#14) */
.diff-picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end;
  gap: 0.75rem 1rem; margin-bottom: 1.5rem; }
.diff-picker label { margin: 0; font-size: 0.8125rem; font-weight: 600; color: var(--ds-sub); }
.diff-picker select { margin: 0.25rem 0 0; font-size: 0.9375rem; font-weight: 400; }
.diff-picker button { margin: 0; width: auto; }
@media (max-width: 40rem) { .diff-picker { grid-template-columns: minmax(0, 1fr); } }
.diff-section { padding: 0 1.25rem 1rem; border-top: 1px solid var(--ds-border); }
.diff-section h3 { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ds-sub); margin: 1rem 0 0; }
.diff-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0 2rem; }
.diff-columns h4 { font-size: 0.9375rem; margin: 1rem 0 0.5rem; }
.diff-columns ul { padding: 0; margin: 0; }
.diff-columns li { list-style: none; display: flex; align-items: baseline; gap: 0.375rem; margin: 0; padding: 0.375rem 0;
  border-bottom: 1px solid var(--ds-border); }
.diff-columns li:last-child { border-bottom: 0; }

/* Import and export (#15) */
.narrow { max-width: 48rem; }
.import-errors { margin-bottom: 1.5rem; border-left: 0.3rem solid var(--ds-out); }
.import-errors td { font-size: 0.875rem; vertical-align: top; }
.import-errors td:first-child { white-space: nowrap; }
.import-form { margin-bottom: 0.5rem; }
.import-option { margin-top: 2rem; }
.import-option h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.import-help { margin-top: 2rem; font-size: 0.9375rem; }
.import-help pre { font-size: 0.8125rem; }
.exports { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; margin-top: 1.5rem;
  font-size: 0.875rem; color: var(--ds-sub); }
.exports a { font-family: var(--pico-font-family-monospace); }

/* htmx request indicators; htmx would inject these as an inline <style>, which the CSP blocks
   (base.html sets includeIndicatorStyles: false). */
.htmx-indicator { opacity: 0; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator {
  opacity: 1;
  transition: opacity 200ms ease-in;
}

/* Sign-in, sign-up and password reset (templates/allauth/layouts/entrance.html) */
.entrance { max-width: 26rem; margin: 1rem auto; padding: 1.75rem; }
.entrance h1 { font-size: 1.75rem; margin-bottom: 1.25rem; }
.entrance form { margin-bottom: 0; }
.entrance label.remember { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.entrance label.remember input { margin: 0; }
.entrance .form-actions { justify-content: space-between; }
.entrance .errorlist { list-style: none; padding: 0; margin: -0.5rem 0 1rem; color: var(--pico-del-color); font-size: 0.875rem; }
.entrance .errorlist li { list-style: none; }
.entrance-or { text-align: center; color: var(--ds-muted); margin: 1.25rem 0 0.75rem; }
.entrance #sso-login button { width: 100%; }
.entrance-alt { margin: 1rem 0 0; }
.card-row > .mana { margin-left: auto; } /* stays right-aligned when a long name pushes it to a new line */

.home-public { margin-top: 3rem; }

/* A pairing row linked to a partial plan (#71) */
.from-plan { font-size: 0.6875rem; font-weight: 600; color: var(--ds-muted); white-space: nowrap; }

/* Card suggestions under "Card in" / "Card out" (#79), drawn by static/js/app.js: fixed to the
   viewport like the card popup, so opening them never moves the form. */
.suggest { position: fixed; z-index: 110; margin: 0; padding: 0.25rem; list-style: none; overflow-y: auto;
  background: var(--ds-surface); color: var(--ds-text); border: 1px solid var(--ds-border);
  border-radius: 0.5rem; box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2); font-size: 0.9375rem; }
.suggest[hidden] { display: none; }
.suggest li { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
  margin: 0; padding: 0.375rem 0.625rem; border-radius: 0.375rem; cursor: pointer; list-style: none; }
.suggest li:hover { background: var(--ds-tag-bg); }
.suggest li[aria-selected="true"] { background: var(--ds-callout-bg); color: var(--ds-accent-text); }
.suggest small { flex: none; color: var(--ds-muted); font-size: 0.75rem; }
