/*
 * Yuimaru App Guide — mobile-first stylesheet.
 *
 * This is the phone-app companion to the web User Guide (../user/). It reuses
 * the real app's design tokens (colours, type, radius) so the guide looks like
 * Yuimaru, but the layout is built for a narrow in-app browser: one column, a
 * sticky top bar with a drop-down list of topics, big tap targets, and a bottom
 * pager. No sidebar. Values mirror mobile/src/theme/theme.ts and the web guide's
 * assets/styles.css.
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --color-action: #d4a5ba;       /* primary button fill, the "committed" heart */
  --color-action-text: #1c2233;  /* ink on an action fill */
  --color-highlight: #ae81bd;    /* active-row fill */
  --color-brand: #7c64bd;        /* identity: mark, eyebrows, links — never a button */
  --color-ink: #25548c;          /* primary text, outlines */
  --color-muted: #4e5daa;        /* secondary / help text */
  --color-line: #cac2e7;         /* dividers, borders */
  --color-faint: #9791b4;        /* faintest text */
  --color-toast-info: #312e81;   /* toast / note copy */
  --color-warning: #f87171;      /* warnings, "full" copy */
  --color-positive: #3f8f5f;     /* confirmed / approved */
  --color-placeholder: #9aa6d0;

  --surface-page: #eaf3f8;
  --surface-paper: #ffffff;
  --surface-raised: #f7f4ff;

  --font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius-chip: 6px;
  --radius-control: 10px;
  --radius-card: 16px;
  --radius-dot: 50%;
  --radius-pill: 999px;

  --shadow-toast: 0 12px 28px rgba(37, 84, 140, 0.24);
  --shadow-card: 0 8px 22px rgba(124, 100, 189, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--color-ink);
  font-family: var(--font-family);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------- Top bar */

/* Sticky bar with the brand and a "Topics" button that opens the menu. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-paper);
  border-bottom: 2px solid var(--color-line);
}
.topbar__brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; min-width: 0;
}
.topbar__brand img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.topbar__brand .kicker {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--color-brand); display: block; line-height: 1.1;
}
.topbar__brand .name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }

/* The "Topics" toggle button. */
.menu-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 2px solid var(--color-ink); background: var(--surface-paper);
  color: var(--color-ink); font-family: inherit; font-weight: 600; font-size: 14px;
  border-radius: var(--radius-pill); padding: 8px 14px; cursor: pointer; flex: none;
}
.menu-btn .bars { display: inline-block; width: 15px; height: 11px; position: relative; }
.menu-btn .bars::before, .menu-btn .bars::after, .menu-btn .bars span {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: currentColor; border-radius: 2px;
}
.menu-btn .bars::before { top: 0; }
.menu-btn .bars span { top: 4.5px; }
.menu-btn .bars::after { bottom: 0; }

/* The drop-down topic list (built by nav.js). Hidden until toggled. */
.menu {
  position: sticky; top: 55px; z-index: 19;
  background: var(--surface-paper);
  border-bottom: 2px solid var(--color-line);
  box-shadow: var(--shadow-card);
  max-height: 0; overflow: hidden;
  transition: max-height .22s ease;
}
.menu.open { max-height: 80vh; overflow-y: auto; }
.menu__section {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--color-brand);
  padding: 16px 18px 4px;
}
.menu a {
  display: block; padding: 12px 18px; text-decoration: none;
  color: var(--color-muted); font-size: 16px; font-weight: 500;
  border-top: 1px solid var(--surface-raised);
}
.menu a.current {
  color: var(--color-ink); font-weight: 700;
  box-shadow: inset 4px 0 0 var(--color-action); background: var(--surface-raised);
}

/* --------------------------------------------------------------- Content */

.content { padding: 24px 18px 90px; max-width: 720px; margin: 0 auto; }

.crumbs { font-size: 13px; color: var(--color-muted); margin: 0 0 16px; }
.crumbs a { color: var(--color-muted); }

.eyebrow {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--color-brand); margin: 0 0 8px;
}
h1 { font-size: 29px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; }
h2 {
  font-size: 21px; font-weight: 700; line-height: 1.2; margin: 38px 0 12px;
  padding-top: 20px; border-top: 2px solid var(--color-line);
}
h2:first-of-type { border-top: none; padding-top: 0; }
h3 { font-size: 17px; font-weight: 700; margin: 26px 0 8px; }
p { margin: 0 0 15px; font-size: 16.5px; }
.lead { font-size: 18px; color: var(--color-muted); line-height: 1.5; margin-bottom: 24px; }
a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; }
strong { font-weight: 600; }
em { font-style: italic; }
code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--surface-raised); border: 1px solid var(--color-line);
  border-radius: var(--radius-chip); padding: 1px 6px; color: var(--color-toast-info);
}

/* Numbered step list — same idea as the web guide, tuned for touch. */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 20px 0; }
ol.steps > li {
  counter-increment: step; position: relative;
  padding: 2px 0 20px 52px; min-height: 38px;
}
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 36px; height: 36px;
  background: var(--color-action); color: var(--color-action-text);
  border-radius: var(--radius-dot);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
ol.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px;
  width: 2px; background: var(--color-line);
}
ol.steps > li .step-title { font-weight: 600; font-size: 16.5px; display: block; margin-bottom: 2px; }
ol.steps > li p { margin: 4px 0; font-size: 16px; }

ul.plain { padding-left: 20px; margin: 14px 0; }
ul.plain li { margin-bottom: 8px; font-size: 16.5px; }

/* Topic cards on the landing page — full-width, stacked. */
.card-link {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface-paper);
  border: 2px solid var(--color-line); border-radius: var(--radius-card);
  padding: 18px; text-decoration: none; color: inherit; margin-bottom: 12px;
}
.card-link:active { box-shadow: var(--shadow-card); }
.card-link .num {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: var(--radius-dot);
  background: var(--surface-raised); color: var(--color-brand);
  font-weight: 700; font-size: 15px;
}
.card-link h3 { margin: 2px 0 4px; font-size: 17px; }
.card-link p { margin: 0; color: var(--color-muted); font-size: 14.5px; }

/* Callouts */
.note {
  border: 2px solid var(--color-line); border-left: 6px solid var(--color-brand);
  background: var(--surface-paper); border-radius: var(--radius-control);
  padding: 15px 16px; margin: 20px 0; font-size: 15.5px;
}
.note .note__label {
  font-weight: 700; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--color-brand); display: block; margin-bottom: 4px;
}
.note p:last-child { margin-bottom: 0; }
.note.tip { border-left-color: var(--color-positive); }
.note.tip .note__label { color: var(--color-positive); }
.note.warn { border-left-color: var(--color-warning); }
.note.warn .note__label { color: var(--color-warning); }
.note.money { border-left-color: var(--color-action); }
.note.money .note__label { color: #b06d8a; }

/* UI mock-up frame — a small recreation of a real app element. */
.ui-demo {
  border: 2px dashed var(--color-line); border-radius: var(--radius-control);
  background: var(--surface-page); padding: 18px; margin: 18px 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.ui-demo .caption {
  flex-basis: 100%; font-size: 12px; color: var(--color-faint);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: -2px;
}

/* Buttons — exactly as in the app (pink action pill, ink outline). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-control); padding: 12px 18px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  border: 2px solid transparent; text-decoration: none; cursor: default;
}
.btn.primary { background: var(--color-action); border-color: var(--color-action); color: var(--color-action-text); }
.btn.ghost { background: var(--surface-paper); border-color: var(--color-ink); color: var(--color-ink); }

/* Status / info pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-pill); padding: 5px 12px; font-size: 13px; font-weight: 600;
  border: 2px solid var(--color-line); background: var(--surface-paper); color: var(--color-muted);
}
.pill .dot { width: 8px; height: 8px; border-radius: var(--radius-dot); background: currentColor; }
.pill.open { color: var(--color-positive); border-color: #bfe3cd; }
.pill.full, .pill.warn { color: var(--color-warning); border-color: #f4c9c9; }

/* The save heart control — state is carried by the CIRCLE (border + fill). */
.heart {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--radius-dot);
  border: 2px solid var(--color-line); background: var(--surface-paper); flex: none;
}
.heart svg { width: 21px; height: 21px; display: block; }
.heart.interested { border-color: var(--color-ink); }
.heart.committed { background: var(--color-action); border-color: var(--color-action); }
.heart-legend { display: flex; flex-direction: column; gap: 14px; font-size: 15px; }
.heart-legend .hrow { display: flex; align-items: center; gap: 12px; }

/* A toast */
.toast {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--surface-paper); border: 2px solid var(--color-line);
  border-radius: var(--radius-control); box-shadow: var(--shadow-toast);
  padding: 12px 15px; max-width: 300px;
  color: var(--color-toast-info); font-size: 13.5px; font-weight: 700;
}
.toast .x {
  width: 20px; height: 20px; border-radius: var(--radius-chip);
  border: 2px solid var(--color-line); color: var(--color-muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600;
}

/* A ticket-code chip */
.ticket-code {
  font-family: var(--font-mono); font-weight: 600; letter-spacing: .04em;
  background: var(--surface-raised); border: 2px solid var(--color-line);
  border-radius: var(--radius-control); padding: 8px 14px; display: inline-block;
  color: var(--color-toast-info);
}

/* A faux bottom tab bar — the app's four tabs. */
.faux-tabs {
  display: flex; width: 100%; background: var(--surface-paper);
  border: 2px solid var(--color-line); border-radius: var(--radius-control); overflow: hidden;
}
.faux-tabs .tab {
  flex: 1; text-align: center; padding: 10px 4px; font-size: 12px; font-weight: 600;
  color: var(--color-faint); border-right: 1px solid var(--color-line);
}
.faux-tabs .tab:last-child { border-right: none; }
.faux-tabs .tab.active { color: var(--color-brand); background: var(--surface-raised); }
/* The real app icons (shared/assets/icons, copied into assets/icons) rendered as
   masks so they tint with the tab's text colour — grey when inactive, brand when
   active — exactly like the app's tinted <Image> tabs. */
.faux-tabs .tab .ico {
  display: block; width: 20px; height: 20px; margin: 0 auto 3px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.faux-tabs .tab .ico--search  { -webkit-mask-image: url(icons/search.png);       mask-image: url(icons/search.png); }
.faux-tabs .tab .ico--heart   { -webkit-mask-image: url(icons/heart_filled.png); mask-image: url(icons/heart_filled.png); }
.faux-tabs .tab .ico--pushpin { -webkit-mask-image: url(icons/pushpin.png);      mask-image: url(icons/pushpin.png); }
.faux-tabs .tab .ico--person  { -webkit-mask-image: url(icons/person.png);       mask-image: url(icons/person.png); }

/* Key-caps for referring to on-screen buttons in prose */
.kbd {
  display: inline-block; font-family: inherit; font-size: .92em; font-weight: 600;
  background: var(--color-action); color: var(--color-action-text);
  border-radius: var(--radius-chip); padding: 1px 8px; white-space: nowrap;
}
.kbd.ghost { background: var(--surface-paper); color: var(--color-ink); border: 1.5px solid var(--color-ink); }

/* FAQ blocks */
.faq { border-top: 2px solid var(--color-line); margin-top: 12px; }
.faq details { border-bottom: 2px solid var(--color-line); padding: 4px 0; }
.faq summary {
  cursor: pointer; padding: 15px 4px; font-weight: 600; font-size: 16.5px;
  list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--color-brand); font-weight: 700; font-size: 20px; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { color: var(--color-brand); }
.faq .answer { padding: 0 4px 16px; }
.faq .answer p:last-child { margin-bottom: 0; }

/* Bottom pager */
.pager {
  display: flex; gap: 12px; margin-top: 46px; padding-top: 22px;
  border-top: 2px solid var(--color-line);
}
.pager a {
  flex: 1; text-decoration: none; color: inherit;
  border: 2px solid var(--color-line); border-radius: var(--radius-card);
  padding: 14px 16px; background: var(--surface-paper);
}
.pager a.next { text-align: right; }
.pager .dir { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--color-brand); font-weight: 600; }
.pager .ttl { font-weight: 600; font-size: 15px; margin-top: 2px; }

.page-footer {
  margin-top: 34px; font-size: 13px; color: var(--color-faint);
  border-top: 2px solid var(--color-line); padding-top: 16px;
}
.page-footer a { color: var(--color-muted); }
