/*
 * Yuimaru User Guide — shared stylesheet.
 *
 * This deliberately reuses the real app's design tokens (colours, type, radius,
 * shadow) so the guide looks and feels like Yuimaru itself. Values mirror
 * web/src/styles/tokens.css. The little UI mock-ups in the guide (buttons,
 * cards, the save heart, toasts, status pills) are built from these same
 * tokens, so what you see here is what you see in the app.
 */

@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 {
  /* Consumer (web) palette — one job per colour. */
  --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;

  /* Back-office (organiser) accents, for the organiser chapters. */
  --bo-action: #f7c37d;          /* amber primary button */
  --bo-brand: #a4cde0;           /* light-blue mark */
  --bo-ink: #2b3a44;
  --bo-accent: #c98a3a;

  --surface-page: #eaf3f8;
  --surface-paper: #ffffff;
  --surface-raised: #f7f4ff;
  --surface-band: #e9e4f4;
  --surface-committed: #fbf6f9;

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

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

  --shadow-modal: 0 24px 50px rgba(37, 84, 140, 0.32);
  --shadow-toast: 0 12px 28px rgba(37, 84, 140, 0.24);
  --shadow-card-hover: 0 10px 26px rgba(124, 100, 189, 0.16);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* ----------------------------------------------------------------- Layout */

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
  max-width: 1320px;
  margin: 0 auto;
}

/* Sidebar / table of contents */
.sidebar {
  background: var(--surface-paper);
  border-right: 2px solid var(--color-line);
  padding: 26px 22px 60px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 6px;
}
.sidebar__brand img { width: 40px; height: 40px; object-fit: contain; }
.sidebar__brand .name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.sidebar__brand .kicker {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--color-brand);
}

.sidebar__section {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: var(--color-brand);
  margin: 26px 0 8px; padding: 0 8px;
}

.sidebar nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  text-decoration: none;
  color: var(--color-muted);
  font-size: 14.5px;
  font-weight: 500;
}
.sidebar nav a:hover { background: var(--surface-raised); color: var(--color-ink); }
.sidebar nav a.current {
  background: var(--surface-raised);
  color: var(--color-ink);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-action);
}

/* Content column */
.content {
  padding: 40px 56px 120px;
  max-width: 820px;
}

/* Mobile top bar (only shows on small screens) */
.mobile-bar { display: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; border-right: none;
    border-bottom: 2px solid var(--color-line);
  }
  .content { padding: 28px 22px 100px; }
}

/* --------------------------------------------------------------- Typography */

.eyebrow {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--color-brand);
  margin: 0 0 10px;
}
h1 { font-size: 34px; font-weight: 700; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 14px; }
h2 {
  font-size: 23px; font-weight: 700; line-height: 1.2; margin: 46px 0 14px;
  padding-top: 22px; border-top: 2px solid var(--color-line);
}
h2:first-of-type { border-top: none; padding-top: 0; }
h3 { font-size: 18px; font-weight: 700; margin: 30px 0 8px; }
p { margin: 0 0 16px; font-size: 16.5px; }
.lead { font-size: 19px; color: var(--color-muted); line-height: 1.5; margin-bottom: 30px; }
a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration: none; }
strong { font-weight: 600; }
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 */

ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 22px 0; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 22px 56px;
  min-height: 40px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 38px; height: 38px;
  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: 16px;
}
/* connecting line between steps */
ol.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 18px; top: 40px; bottom: 4px;
  width: 2px; background: var(--color-line);
}
ol.steps > li .step-title { font-weight: 600; font-size: 17px; display: block; margin-bottom: 2px; }
ol.steps > li p { margin: 4px 0; }

/* Plain bullet list */
ul.plain { padding-left: 22px; margin: 16px 0; }
ul.plain li { margin-bottom: 8px; font-size: 16.5px; }

/* ------------------------------------------------------------------ Cards */

.card-link {
  display: block;
  background: var(--surface-paper);
  border: 2px solid var(--color-line);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s ease, transform .15s ease;
}
.card-link:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.card-link .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius-dot);
  background: var(--surface-raised); color: var(--color-brand);
  font-weight: 700; font-size: 14px; margin-bottom: 12px;
}
.card-link h3 { margin: 0 0 6px; font-size: 18px; }
.card-link p { margin: 0; color: var(--color-muted); font-size: 15px; }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin: 22px 0;
}

/* ---------------------------------------------------------------- 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: 16px 18px;
  margin: 22px 0;
  font-size: 15.5px;
}
.note .note__label {
  font-weight: 700; font-size: 13px; 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: a frame box */

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

/* Buttons — exactly as in the app */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-control);
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: default; border: 2px solid transparent;
  text-decoration: none;
}
.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); }
.btn.bo-primary { background: var(--bo-action); border-color: var(--bo-action); color: var(--bo-ink); }

/* Status / info pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-pill); padding: 4px 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.pending { color: var(--bo-accent); border-color: #eBd3ac; }
.pill.full, .pill.warn { color: var(--color-warning); border-color: #f4c9c9; }

/* The save heart control — matches web/src/components/SaveHeart.jsx. The state
 * is carried by the CIRCLE (border + fill); the heart itself is an inline SVG so
 * it renders identically everywhere (emoji ♡/♥ are unreliable across systems). */
.heart {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-dot);
  border: 2px solid var(--color-line); background: var(--surface-paper);
  flex: none;
}
.heart svg { width: 20px; height: 20px; display: block; }
.heart.interested { border-color: var(--color-ink); }          /* ink circle, filled heart */
.heart.committed { background: var(--color-action); border-color: var(--color-action); } /* rose fill */
.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 input field */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 220px; }
.field label { font-size: 13.5px; font-weight: 600; }
.field .box {
  border: 2px solid var(--color-line); border-radius: var(--radius-control);
  padding: 11px 13px; background: var(--surface-paper);
  color: var(--color-placeholder); font-size: 14.5px;
}

/* A faux top-nav bar */
.faux-nav {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: var(--surface-paper);
  border: 2px solid var(--color-line); border-radius: var(--radius-control);
  padding: 10px 16px;
}
.faux-nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.faux-nav .brand img { width: 26px; height: 26px; }
.faux-nav .right { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--color-muted); }
.faux-nav .avatar {
  width: 30px; height: 30px; border-radius: var(--radius-dot);
  background: var(--color-highlight); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

/* 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); }
.kbd.bo { background: var(--bo-action); color: var(--bo-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: 14px 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: "–"; }
.faq details[open] summary { color: var(--color-brand); }
.faq .answer { padding: 0 4px 16px; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------- Page nav / crumbs */

.crumbs { font-size: 13.5px; color: var(--color-muted); margin-bottom: 22px; }
.crumbs a { color: var(--color-muted); }

.pager {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 60px; padding-top: 26px; 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: 16px 18px; background: var(--surface-paper);
}
.pager a:hover { box-shadow: var(--shadow-card-hover); }
.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: 16px; margin-top: 2px; }

.page-footer {
  margin-top: 40px; font-size: 13.5px; color: var(--color-faint);
  border-top: 2px solid var(--color-line); padding-top: 18px;
}

/* Real screenshots of the app (captured from the live UI). */
figure.shot { margin: 24px 0; }
figure.shot img {
  display: block; max-width: 100%; height: auto; margin: 0 auto;
  border: 2px solid var(--color-line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-hover);
}
figure.shot.cell img { max-width: 300px; }        /* small UI close-ups stay crisp */
figure.shot.bar img { border-radius: var(--radius-control); }
figure.shot figcaption {
  margin-top: 10px; font-size: 13px; color: var(--color-faint); text-align: center;
}
figure.shot figcaption b { color: var(--color-muted); font-weight: 600; }
