/* RITill web — Ledger theme, mirrors app/lib/theme (ink, paper, emerald). */
:root {
  color-scheme: dark light;
  --ink: #03140C;
  --paper: #F6F7F2;
  --emerald: #3BE8A0;
  --emerald-strong: #0B7A53;
  --amber: #F5C35B;
  --red: #FF6B5B;

  --canvas: #07110D;
  --surface: #0D1A14;
  --surface-high: #13241B;
  --surface-top: #1C3027;
  --on: var(--paper);
  --muted: #8FA398;
  --line: #253229;
  --accent: var(--emerald);
  --slip: var(--paper);
  --on-slip: var(--ink);
  --slip-muted: #5E6E65;
  --slip-line: #D3D8CF;
  --slip-accent: var(--emerald-strong);

  --hair: 1.5px;
  --radius: 6px;
  --cut: 14px;
  --wrap: 1120px;
}

@media (prefers-color-scheme: light) {
  :root {
    --canvas: var(--paper);
    --surface: #FFFFFF;
    --surface-high: #EAEDE6;
    --surface-top: #DCE1D8;
    --on: var(--ink);
    --muted: #5E6E65;
    --line: #D3D8CF;
    --accent: var(--emerald-strong);
    --slip: var(--ink);
    --on-slip: var(--paper);
    --slip-muted: #8FA398;
    --slip-line: #253229;
    --slip-accent: var(--emerald);
    --amber: #8A5F00;
    --red: #C2412D;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--on);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--emerald); color: var(--ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }

/* Material Symbols Sharp, the app's icon set */
.ms {
  font-family: "Material Symbols Sharp";
  font-weight: 500;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

/* ---- Brand ---- */
.mark-tile {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--emerald);
  display: grid; place-items: center;
  flex: none;
}
.mark-tile svg { width: 76%; height: 76%; }
.wordmark { display: block; height: 22px; width: auto; color: var(--on); }
.wordmark .cut { fill: var(--emerald); }

/* ---- Type ---- */
.heavy, h1, h2 {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin: 0;
}
h1 { font-size: clamp(44px, 7.2vw, 84px); }
h2 { font-size: clamp(32px, 4.6vw, 54px); }
h3 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.lede { color: var(--muted); font-size: 18px; max-width: 30em; margin: 18px 0 0; }

/* Slash label (LedgerLabel with a LedgerCut mark) */
.label {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted);
  font-size: 11.5px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  margin: 0;
}
.label::before {
  content: "";
  width: 7px; height: 13px;
  background: var(--emerald);
  clip-path: polygon(55% 0, 100% 0, 45% 100%, 0 100%);
  flex: none;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  background: var(--emerald);
  color: var(--ink);
  border: 0;
  border-radius: 2px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  font: inherit; font-size: 15px; font-weight: 900;
  letter-spacing: 0.02em; text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; filter: none; transform: none; }
.btn .ms { font-size: 20px; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px;
  padding: 0 22px;
  background: var(--surface);
  color: var(--on);
  border: var(--hair) solid var(--line);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none;
}
.btn-ghost:hover { border-color: var(--muted); }

/* Official Google Play badge. Do not recolor or redraw it. */
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 22px; }
.play-badge { display: inline-block; line-height: 0; text-decoration: none; }
.play-badge img { height: 96px; width: auto; }

/* Tags (LedgerPlanTag) */
.tag {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px;
  border: var(--hair) solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10.5px; font-weight: 900;
  letter-spacing: 1.2px; text-transform: uppercase;
  vertical-align: middle;
}
.tag.plus { border-color: var(--emerald); color: var(--accent); }

/* ---- Receipt slip with torn bottom edge (LedgerSlip) ---- */
.slip {
  position: relative;
  background: var(--slip);
  color: var(--on-slip);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 22px 22px 34px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
}
.slip .label { color: var(--slip-muted); }
.slip .muted { color: var(--slip-muted); }
.slip .money { color: var(--slip-accent); }
.dashes {
  height: 0;
  border-top: var(--hair) dashed var(--slip-line);
  margin: 16px 0;
}

.money { color: var(--accent); font-weight: 900; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.money sup, .money .c { font-size: .52em; vertical-align: .62em; letter-spacing: -0.01em; }

/* ---- Nav ---- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: var(--hair) solid var(--line);
}
.nav .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 62px;
}
.nav .tag { white-space: nowrap; }
.nav a.back {
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--muted);
  font-size: 12px; font-weight: 800;
  letter-spacing: 1.4px; text-transform: uppercase;
}
.nav a.back:hover { color: var(--on); }
.nav .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.nav .brand .mark-tile { width: 30px; height: 30px; border-radius: 8px; }
.nav .brand .wordmark { height: 15px; }

/* ---- Footer ---- */
.foot {
  border-top: var(--hair) solid var(--line);
  margin-top: 40px;
}
.foot .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  padding-top: 26px; padding-bottom: 34px;
}
.foot .brand { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.foot .brand .wordmark { height: 15px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot nav a {
  color: var(--muted); text-decoration: none;
  font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
}
.foot nav a:hover { color: var(--on); }

/* ---- Document pages (privacy, terms, delete account) ---- */
.doc { padding: 46px 0 20px; }
.doc header { margin-bottom: 28px; }
.doc h1 { font-size: clamp(38px, 6vw, 60px); margin-top: 14px; }
.doc .updated { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.doc .summary { margin: 0 0 34px; }
.doc .summary ul { list-style: none; margin: 10px 0 0; padding: 0; }
.doc .summary li { display: flex; gap: 10px; padding: 6px 0; font-weight: 600; font-size: 15px; }
.doc .summary li .ms { font-size: 19px; color: var(--slip-accent); }
.doc section {
  display: grid; grid-template-columns: 44px 1fr; gap: 0 12px;
  padding: 20px 0;
  border-top: var(--hair) solid var(--line);
}
.doc section .n {
  font-weight: 900; font-size: 15px; color: var(--accent);
  font-variant-numeric: tabular-nums; padding-top: 2px;
}
.doc section h2 {
  font-size: 18px; text-transform: none; letter-spacing: -0.015em; line-height: 1.3; font-weight: 800;
}
.doc section p, .doc section li { color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.doc section p { margin: 8px 0 0; }
.doc section ul, .doc section ol { margin: 8px 0 0; padding-left: 20px; }
.doc section strong { color: var(--on); font-weight: 700; }
.doc section .caps { font-size: 13.5px; letter-spacing: .01em; }
.doc a.inline { color: var(--accent); font-weight: 700; text-decoration: none; }
.doc a.inline:hover { text-decoration: underline; }
.doc .note {
  margin: 30px 0 0;
  padding: 14px 16px;
  border: var(--hair) solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
}

@media (max-width: 480px) {
  .wide-only { display: none; }
}

@media (max-width: 640px) {
  .doc section { grid-template-columns: 1fr; }
  .doc section .n { padding: 0 0 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
