/* Grand Family Capital member app. The member's share is written like an entry in a bank passbook: an indigo
   cloth cover with one gilt monogram, then a ruled page in plain, large type (Atkinson Hyperlegible Next, made
   for low-vision readers) so every generation in the family can read it on a phone. */
@font-face {
  font-family: 'Atkinson Next';
  src: url('fonts/atkinson-next.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --cover: #1e2b45;      /* indigo cloth */
  --cover-2: #26365a;
  --gilt: #c8a55a;       /* the one accent: monogram and the cover's rule */
  --paper: #edf0ec;      /* cool ledger paper */
  --sheet: #f8faf7;
  --ink: #18212f;
  --muted: #56606b;
  --rule: #cdd5cc;
  --gain: #2d6a4c;
  --loss: #a63a2b;
  --focus: #2f6fd6;
  --s1: 0.8rem; --s2: 1rem; --s3: 1.33rem; --s4: 1.66rem; --s5: 2.1rem; --hero: 3.1rem;
  --r: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.5 'Atkinson Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: 'tnum' 1;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
main { max-width: 560px; margin: 0 auto; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 700; }
h1 { font-size: var(--s5); }
h2 { font-size: var(--s4); }
h3 { font-size: var(--s3); }
p { margin: 0 0 var(--s2); max-width: 36em; }
a { color: var(--cover); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ----- the cover */
.cover {
  background: var(--cover); color: #f3f1ea;
  padding: calc(env(safe-area-inset-top) + 1rem) 1.25rem 1.5rem;
  border-radius: 0 0 22px 22px;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.mono { width: 46px; height: 46px; flex: none; }
.brand b { font-size: 1.05rem; letter-spacing: 0.01em; font-weight: 600; }
.brand small { display: block; color: #b9c0cf; font-size: 0.85rem; }
.brand .grow { flex: 1; }
.cover .hello { margin: 1.4rem 0 0.2rem; color: #cfd5e0; }
.cover .figure { font-size: var(--hero); font-weight: 750; letter-spacing: -0.01em; line-height: 1.05; margin: 0; }
.cover .asof { color: #b9c0cf; font-size: 0.95rem; margin: 0.35rem 0 0; }
.cover .gilt-rule { height: 2px; background: var(--gilt); width: 56px; border-radius: 2px; margin: 1.1rem 0 0.9rem; }
.cover dl { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0.2rem 1.6rem; margin: 0; }
.cover dt { color: #b9c0cf; font-size: 0.85rem; }
.cover dd { margin: 0; font-weight: 650; }
.cover.slim { padding-bottom: 1.1rem; }
.cover.slim h1 { margin-top: 1.1rem; font-size: var(--s4); }
.viewing { background: var(--gilt); color: var(--cover); padding: 0.6rem 1.25rem; font-weight: 650; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.viewing button { background: var(--cover); color: #fff; border: 0; border-radius: 999px; padding: 0.4rem 0.9rem; font: inherit; font-size: 0.9rem; }

/* ----- the page */
.page { padding: 1.25rem; }
.page > h2, .page > h3 { margin: 1.6rem 0 0.6rem; }
.page > h2:first-child, .page > h3:first-child { margin-top: 0.4rem; }
.ledger { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 0 1rem; margin: 0 0 1.25rem; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
.row:last-child { border-bottom: 0; }
.row .label { color: var(--muted); }
.row .label small { display: block; font-size: 0.85rem; }
.row .val { font-weight: 650; text-align: right; white-space: nowrap; }
.row .val small { display: block; font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.gain { color: var(--gain); }
.loss { color: var(--loss); }
.entry { padding: 0.85rem 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 1rem; }
.entry:last-child { border-bottom: 0; }
.entry .what { font-weight: 650; }
.entry .when, .entry .detail { color: var(--muted); font-size: 0.9rem; }
.entry .amt { font-weight: 650; text-align: right; }
.entry .detail { grid-column: 1 / -1; }
.empty { color: var(--muted); padding: 1rem 0; margin: 0; }
.note { background: var(--sheet); border-left: 3px solid var(--gilt); padding: 0.8rem 1rem; border-radius: 0 10px 10px 0; white-space: pre-wrap; }
.tag { display: inline-block; font-size: 0.85rem; font-weight: 650; padding: 0.1rem 0.55rem; border-radius: 999px; background: #dde3dc; color: var(--ink); }
.tag.good { background: #d7e8de; color: var(--gain); }
.tag.bad { background: #f1dcd7; color: var(--loss); }
.tag.wait { background: #ece3cf; color: #6b5420; }

/* ----- controls */
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 0 0 1.25rem; }
.btn { appearance: none; border: 2px solid var(--cover); background: var(--cover); color: #fff; font: inherit; font-weight: 650;
  min-height: 50px; padding: 0.6rem 1.2rem; border-radius: 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.alt { background: transparent; color: var(--cover); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--cover); text-decoration: underline; padding-left: 0; padding-right: 0; min-height: 44px; }
.btn.danger { background: transparent; color: var(--loss); border-color: var(--loss); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; }
form { margin: 0 0 1.25rem; }
label { display: block; font-weight: 650; margin: 1rem 0 0.35rem; }
label small, .hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.9rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 2px solid #b8c2b7; border-radius: 10px; padding: 0.7rem 0.8rem; min-height: 50px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(47, 111, 214, 0.25); }
input.code { font-size: 1.9rem; letter-spacing: 0.4em; text-align: center; font-weight: 700; }
.check { display: flex; gap: 0.7rem; align-items: flex-start; font-weight: 400; }
.check input { width: 26px; height: 26px; min-height: 0; flex: none; margin-top: 2px; }
.error { color: var(--loss); font-weight: 650; margin: 0.8rem 0 0; }
.ok { color: var(--gain); font-weight: 650; margin: 0.8rem 0 0; }
.form-submit, .mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.preview { background: #e4ebe3; border-radius: 10px; padding: 0.8rem 1rem; margin: 1rem 0 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.9rem; }
.qr { display: block; width: 190px; height: 190px; background: #fff; padding: 8px; border-radius: 10px; margin: 0.6rem 0; }
.key { font-size: 1rem; word-break: break-all; background: #fff; border: 1px dashed #b8c2b7; border-radius: 10px; padding: 0.6rem 0.8rem; }
ol.steps { padding-left: 1.3rem; margin: 0 0 1rem; }
ol.steps > li { margin: 0 0 1.1rem; padding-left: 0.2rem; }
.list-btn { text-decoration: none; display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 1rem; text-align: left; background: var(--sheet);
  border: 1px solid var(--rule); border-radius: 12px; padding: 0.9rem 1rem; margin: 0 0 0.6rem; font: inherit; color: var(--ink); cursor: pointer; }
.list-btn b { display: block; }
.list-btn span.sub { color: var(--muted); font-size: 0.9rem; }
.center { text-align: center; }
.signin { min-height: 100vh; display: flex; flex-direction: column; }
.signin .page { flex: 1; }
.log { font-size: 0.9rem; }

/* ----- bottom tabs */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--sheet); border-top: 1px solid var(--rule);
  display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav.tabs .in { display: flex; width: 100%; max-width: 560px; }
nav.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0.55rem 0.2rem 0.5rem; color: var(--muted);
  text-decoration: none; font-size: 0.8rem; font-weight: 600; min-height: 60px; }
nav.tabs a svg { width: 26px; height: 26px; }
nav.tabs a[aria-current='page'] { color: var(--cover); }
nav.tabs a[aria-current='page'] svg { stroke: var(--cover); }

@media (min-width: 600px) {
  .cover { border-radius: 0 0 26px 26px; padding-left: 2rem; padding-right: 2rem; }
  .page { padding: 1.5rem 2rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .cover .figure { animation: stamp 420ms cubic-bezier(.2,.8,.2,1) both; }
  @keyframes stamp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
