/* MyCard portal, Basic theme (the canvas boards titled "Basic"). Every colour is a variable: an owner's theme
   (Classic, Modern, his own accent) will replace these values later, never the rules below. */
:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f9fafb; --surface-3: #f3f4f6;
  --border: #e5e7eb; --border-strong: #d1d5db;
  --ink: #111827; --ink-2: #4b5563; --ink-3: #6b7280;
  --accent: #1d4ed8; --on-accent: #ffffff; --accent-soft: #eef2ff;
  --danger: #b91c1c; --danger-ink: #991b1b; --danger-soft: #fee2e2;
  --ok: #166534; --ok-soft: #dcfce7; --warn: #92400e; --warn-soft: #fef3c7; --info: #1e40af; --info-soft: #dbeafe;
  --sans: Inter, "Segoe UI", system-ui, sans-serif; --mono: "JetBrains Mono", Menlo, Consolas, monospace;
  --r-card: 6px; --r-ctl: 4px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); }
a { color: var(--ink); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* One centred column on every screen. */
.pt-col { width: 100%; max-width: 430px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }

.pt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Signed-in pages: a white bar across the top. */
.pt-head-bar { margin: -16px -16px 0; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.pt-brand { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.pt-brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.pt-brand-mark.pt-round { border-radius: 50%; }
.pt-brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.pt-brand-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-2); }

.pt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; }
.pt-btn-main { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.pt-btn-sm { padding: 0 12px; font-size: 13px; }
.pt-btn-wide { width: 100%; }

.pt-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-top: 8px; }
.pt-hero-mark { width: 84px; height: 84px; border-radius: 50%; background: var(--accent-soft); border: 2px solid var(--accent); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 700; }
.pt-hero h1, .pt-title h1 { font-size: 28px; font-weight: 700; line-height: 1.2; }
.pt-hero p { font-size: 15px; color: var(--ink-2); }
.pt-nets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pt-net { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 700; }
.mc-chain { display: inline-flex; flex-shrink: 0; }
.mc-chain svg { width: 100%; height: 100%; display: block; }

.pt-tiles { display: grid; gap: 6px; }
.pt-tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pt-tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pt-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); font-size: 11px; font-weight: 600; text-align: center; }
.pt-tile svg { color: var(--accent); flex-shrink: 0; }
.pt-tile-step { font-size: 12px; }
.pt-num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.pt-h2 { margin-bottom: 8px; font-size: 15px; font-weight: 600; }

.pt-foot { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11px; color: var(--ink-3); }
.pt-18 { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.pt-18 span { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-weight: 700; }

.pt-title { margin-top: 18px; }
.pt-title p { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.pt-title-tight { margin-top: 0; }
.pt-title-tight h1 { font-size: 24px; }

.pt-card { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.pt-form { display: flex; flex-direction: column; gap: 12px; }
.pt-field { display: flex; flex-direction: column; gap: 6px; }
.pt-field > span:first-child, .pt-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
/* 16px in the boxes: a smaller size makes iPhones zoom the page on focus. */
.pt-input { height: 44px; width: 100%; min-width: 0; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.pt-input::placeholder { color: var(--ink-3); }
.pt-input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.pt-pass { display: flex; gap: 6px; }
.pt-pass .pt-input { flex: 1 1 0; }
.pt-pass-show { flex-shrink: 0; height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.pt-hint { font-size: 12px; color: var(--ink-3); }

/* Signed-in pages */
.pt-flash { padding: 10px 12px; border: 1px solid var(--ok); border-radius: var(--r-card); background: var(--ok-soft); color: var(--ok); font-size: 14px; font-weight: 600; }
.pt-hello h1 { font-size: 24px; font-weight: 700; }
.pt-hello p { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.pt-chip { display: inline-block; padding: 3px 8px; border-radius: var(--r-ctl); background: var(--surface-3); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pt-chip-main { background: var(--accent-soft); color: var(--accent); }
.pt-chip-ok { background: var(--ok-soft); color: var(--ok); }
.pt-chip-warn { background: var(--warn-soft); color: var(--warn); }
.pt-chip-info { background: var(--info-soft); color: var(--info); }
.pt-chip-bad { background: var(--danger-soft); color: var(--danger-ink); }
.pt-sub { font-size: 12px; color: var(--ink-3); }
.pt-big { font-size: 22px; font-weight: 600; line-height: 1.25; margin: 2px 0; }
.pt-big span { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.pt-bad { color: var(--danger); }
.pt-ok { color: var(--ok); }
.pt-link { color: var(--accent); font-weight: 600; }
.pt-inline { display: inline-flex; align-items: center; gap: 6px; }
.pt-meter { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin: 8px 0 4px; }
.pt-meter span { display: block; height: 100%; background: var(--accent); }
.pt-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pt-sec .pt-h2 { margin: 0; }
.pt-rows { padding: 2px 14px; }
.pt-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pt-rows .pt-row:last-child { border-bottom: 0; }
.pt-row-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.pt-row-main .pt-sub { font-weight: 400; }
.pt-row-end { text-align: right; font-weight: 600; font-size: 14px; white-space: nowrap; display: flex; flex-direction: column; }
.pt-site-mark { width: 44px; height: 28px; border: 1px solid var(--border); border-radius: var(--r-card); object-fit: contain; padding: 3px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.pt-rec { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; border-left-width: 3px; }
.pt-rec-ok { border-left-color: var(--ok); } .pt-rec-warn { border-left-color: var(--warn); } .pt-rec-info { border-left-color: var(--info); } .pt-rec-bad { border-left-color: var(--danger); }
.pt-rec-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.pt-rec-top b { color: var(--ink); }
.pt-rec-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-weight: 600; }
/* The main button stays at the bottom of the screen, on a white bar. */
.pt-cta { position: sticky; bottom: 0; margin: auto -16px calc(-16px - env(safe-area-inset-bottom)); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.pt-cta-2 { display: flex; gap: 8px; }
.pt-cta-2 .pt-btn { flex: 1 1 0; }
.pt-back { font-size: 13px; font-weight: 600; color: var(--accent); min-height: 32px; display: inline-flex; align-items: center; }

/* The step forms fill the column, so their button bar stays at the bottom of the screen. */
form[data-deposit], form[data-declare], form[data-pay] { display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; }

/* New deposit */
.pt-steps { margin: 0; padding: 0; list-style: none; display: flex; gap: 8px; }
.pt-steps li { flex: 1 1 0; height: 28px; border-radius: var(--r-ctl); border: 1px solid var(--border-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pt-steps li.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pt-steps li.is-done { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.pt-step { display: none; flex-direction: column; gap: 10px; }
.pt-step.is-on { display: flex; }
.pt-acc { display: flex; flex-direction: column; gap: 8px; }
.pt-acc .pt-row { padding: 0; border: 0; }
.pt-amount { display: flex; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface); }
.pt-amount:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); }
.pt-amount .pt-input { border: 0; border-radius: 0; background: transparent; font-weight: 600; outline: 0; }
.pt-amount > span { display: flex; align-items: center; padding: 0 12px; border-left: 1px solid var(--border); background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pt-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pt-quick button { min-height: 40px; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; }
.pt-quick-1 { grid-template-columns: minmax(0, 1fr); }
.pt-debt-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.pt-totals { display: flex; flex-direction: column; gap: 8px; }
.pt-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; }
.pt-totals > div > span { color: var(--ink-2); }
.pt-pay { display: flex; flex-direction: column; gap: 2px; }
.pt-pay.is-on { border-color: var(--accent); background: var(--accent-soft); }
.pt-nets-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pt-nets-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pt-nets-pick label > span { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--surface); font-weight: 600; }
.pt-nets-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pt-nets-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-wallet { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pt-wallet code { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.pt-wallet-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-area { height: auto; padding: 10px 12px; resize: vertical; }
.pt-file { max-width: 100%; font: inherit; font-size: 13px; color: var(--ink-2); min-height: 44px; }
.pt-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; }
.pt-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

/* Bonus and reports */
.pt-strong { font-size: 14px; font-weight: 600; }
.pt-marks { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--ink-3); margin-bottom: 8px; }
.pt-gap { margin-top: 8px; }
.pt-plain { font-weight: 400; color: var(--ink-2); }
.pt-row-end .pt-chip { margin-top: 4px; align-self: flex-end; }
.pt-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
select.pt-input { appearance: auto; }

/* Collectors' pages */
.pt-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pt-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pt-stat { display: flex; flex-direction: column; gap: 2px; }
.pt-stat-n { font-size: 20px; font-weight: 600; line-height: 1.25; }
.pt-stat-n span { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.pt-stat-s { font-size: 15px; font-weight: 600; }
.pt-grid-3 .pt-card { padding: 10px; }
.pt-warn { color: var(--warn); }
.pt-pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.pt-pills a { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pt-pills a[aria-current] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pt-rec-next { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pt-tick { display: flex; align-items: center; gap: 12px; min-height: 56px; cursor: pointer; }
.pt-tick input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.pt-tick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pt-fold summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); min-height: 28px; display: flex; align-items: center; }
.pt-fold[open] summary { margin-bottom: 8px; }
.pt-fold form { margin-top: 10px; }

.pt-alert { padding: 10px 12px; border: 1px solid var(--danger); border-radius: var(--r-card); background: var(--danger-soft); color: var(--danger-ink); font-size: 14px; font-weight: 600; }
.pt-note { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.pt-note svg { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
