/* MAST: white, photo-first, one navy accent (from the visual mockup). */
:root {
  --bg: #FFFFFF;
  --surface: #F4F3F0;
  --ink: #151515;
  --muted: #6B6B6B;
  --line: #E4E2DC;
  --line-strong: #D9D6CF;
  --accent: #1B2B4B;
  --accent-soft: #E8ECF4;
  --error: #8A3B12;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: Inter, system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
a { color: var(--accent); }

.app { max-width: 520px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 8px) 20px calc(96px + env(safe-area-inset-bottom)); min-height: 100dvh; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 6px; }
.top .spacer { width: 40px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.brand svg { width: 22px; height: 22px; }
.brand span { font-family: var(--serif); font-size: 25px; letter-spacing: 0.14em; }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--accent); color: #fff; border: 0; font-weight: 600; font-size: 15px; cursor: pointer; }

/* page headings */
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 20px 0 6px; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.1; margin: 0; }
h1.page { font-size: 30px; margin-top: 18px; }
.sub { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; }

/* cards and buttons */
.card { background: var(--surface); border-radius: 22px; padding: 20px; margin-top: 22px; }
.card h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.card p { margin: 0; font-size: 14px; line-height: 1.5; color: #3D3D3D; }
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px; border-radius: 27px; border: 0; background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; margin-top: 16px; padding: 0 20px; }
.btn.ghost { background: var(--bg); color: var(--accent); border: 1.5px solid var(--accent); }
.btn:disabled { opacity: 0.45; cursor: default; }
.stats { display: flex; gap: 10px; margin-top: 14px; }
.stat { flex: 1; background: var(--bg); border-radius: 16px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; font-weight: 600; }
.stat span { font-size: 12.5px; color: var(--muted); }

.empty { text-align: center; padding: 48px 12px 8px; }
.empty .art { width: 96px; height: 96px; border-radius: 48px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.empty .art svg { width: 44px; height: 44px; }
.empty h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 18px 0 6px; }
.empty p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 auto; max-width: 300px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 12.5px; font-weight: 600; color: #5E5E5E; }
.field input { height: 48px; border: 1px solid var(--line-strong); border-radius: 14px; padding: 0 14px; font-size: 16px; font-weight: 500; background: var(--bg); }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.error { background: #FBEDE6; color: var(--error); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-top: 16px; }

/* welcome */
.welcome { padding-top: 48px; }
.welcome .mark { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--accent); }
.welcome .mark svg { width: 44px; height: 44px; }
.welcome .mark span { font-family: var(--serif); font-size: 40px; letter-spacing: 0.16em; }
.welcome .lead { text-align: center; color: var(--muted); font-size: 15px; line-height: 1.5; margin: 10px auto 0; max-width: 300px; }

/* bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: rgba(255, 255, 255, 0.96); border-top: 1px solid #ECEBE7; padding-bottom: env(safe-area-inset-bottom); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.tabs[hidden] { display: none; }
.tabs a { flex: 1; max-width: 173px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 12px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.tabs a svg { width: 24px; height: 24px; }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* sheet (slides up over the screen) */
.sheet { position: fixed; inset: 0; background: rgba(21, 21, 21, 0.35); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet[hidden] { display: none; }
.sheetin { width: 100%; max-width: 520px; max-height: 90dvh; overflow-y: auto; background: var(--bg); border-radius: 26px 26px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheetin h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0; }
.sheethead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.close { width: 40px; height: 40px; border-radius: 20px; border: 0; background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.row span { color: var(--muted); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; letter-spacing: 0.06em; text-align: center; background: var(--surface); border-radius: 14px; padding: 14px; margin-top: 12px; user-select: all; }
.small { font-size: 13px; color: var(--muted); line-height: 1.5; }

.install { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); color: var(--accent); border-radius: 16px; padding: 10px 12px 10px 14px; font-size: 13.5px; margin-top: 14px; }
.install button { margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 16px; background: var(--bg); color: var(--accent); font-size: 18px; cursor: pointer; flex: none; }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 22px; padding: 12px 18px; font-size: 14px; z-index: 20; max-width: calc(100% - 40px); }
.toast[hidden] { display: none; }
