/* guseul pen — 奶糖 / milk candy: a creamy white base, macaron pastels, chubby
   rounded shapes and a soft matte-milky finish. Nothing cold, nothing sharp. */

:root {
  --paper: #FFF8F0;
  --card: #FFFDF9;
  --ink: #5A4A42;
  --muted: #A8968C;
  --line: #F1E3D6;
  --accent: #FFB6C9;
  --accent-ink: #6B3A4A;
  --accent2: #BFE3D9;
  --shadow: 0 10px 30px rgba(120, 80, 60, .10);
  --radius: 22px;
  --radius-pill: 999px;
  /* Thai and Devanagari are named explicitly: without them the rounded stack
     falls through to a face that has no Thai/Devanagari glyphs and the browser
     picks a last-resort font whose metrics do not match the rest of the page. */
  --font-round: ui-rounded, "SF Pro Rounded", "Nunito", "Apple SD Gothic Neo",
                "Noto Sans KR", "Hiragino Maru Gothic ProN", "PingFang SC",
                "PingFang TC", "Thonburi", "Noto Sans Thai",
                "Kohinoor Devanagari", "Noto Sans Devanagari",
                system-ui, sans-serif;
}

/* dark = milk chocolate, never black */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #2B211C;
    --card: #34281F;
    --ink: #F6EDE4;
    --muted: #B9A59A;
    --line: #463629;
    --accent: #E9A2B8;
    --accent-ink: #2B211C;
    --accent2: #7FB4A6;
    --shadow: 0 10px 30px rgba(0, 0, 0, .40);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "PingFang TC", "Apple SD Gothic Neo", "Noto Sans KR",
               "Hiragino Sans GB", "Thonburi", "Noto Sans Thai",
               "Kohinoor Devanagari", "Noto Sans Devanagari", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 20px env(safe-area-inset-bottom);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------------------ top */

.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 18px 0 6px;
  max-width: 720px; width: 100%; margin: 0 auto;
}

.wordmark {
  margin: 0;
  font-family: var(--font-round);
  font-size: 20px; font-weight: 700; letter-spacing: .01em;
  display: inline-flex; align-items: center;
}
.wordmark span {
  font-family: var(--font-round);
  font-size: 13px; font-weight: 500; color: var(--muted);
  margin-left: 7px; letter-spacing: .06em;
}

/* one little candy before the name */
.candy-dot {
  width: 10px; height: 10px; flex: none;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 2px 0 rgba(200, 120, 140, .25);
}

.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

main {
  flex: 1;
  width: 100%; max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column;
}

.tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------------------------------------------------------------- stage */

.stage { position: relative; margin: 6px 0 2px; }

#stage {
  display: block; width: 100%; height: auto;
  touch-action: none;   /* the pen is a drag surface: never scroll mid-drag */
}

.counter {
  margin: 0 0 6px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  min-height: 18px;
}

/* -------------------------------------------------------------- compose */

.compose { display: flex; flex-direction: column; gap: 10px; }

textarea, input[type="text"], input[type="email"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 13px 16px;
  resize: none;
  line-height: 1.6;
}
textarea { font-size: 17px; }
input[type="text"], input[type="email"] { font-size: 15px; }

textarea:focus, input:focus, select:focus-visible,
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent);
}

.compose-row { display: flex; gap: 10px; }
.compose-row input { flex: 1; min-width: 0; }

/* -------------------------------------------------------------- buttons */

button, .primary, .ghost {
  font: inherit; cursor: pointer;
  font-family: var(--font-round);
}

.primary {
  border: 2px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  /* a soft inner highlight: the wet-looking top of a candy */
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 4px 0 rgba(200, 120, 140, .25);
}
.primary:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55); }

.ghost {
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-size: 14px; font-weight: 600;
  text-decoration: none;
  display: inline-flex; align-items: center;
}
.ghost:hover { border-color: var(--accent); }

.linkish {
  border: none; background: none; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
  padding: 0; font-size: inherit;
}

.danger-quiet {
  border: none; background: none; color: var(--muted);
  font-size: 14px; padding: 8px 4px;
}
.danger-quiet[data-armed="1"] { color: #D9707A; }

.tools {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 14px 0 8px;
}

/* --------------------------------------------------------------- recent */

.recent {
  margin: 18px 0 0;
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-left: 6px solid var(--accent);
  background: var(--card);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.recent-title {
  margin: 0 0 8px;
  font-family: var(--font-round);
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.recent-text {
  margin: 0; font-size: 17px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.recent-meta { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------- bead box */

/* the one-line nudge under the counter, quieter than the counter itself */
.status-tip {
  margin: -2px 0 6px;
  font-size: 12.5px;
  opacity: .85;
}

.tray-wrap { margin: 4px 0 12px; }

.tray-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.tray-title { margin: 0; font-family: var(--font-round); font-size: 15px; font-weight: 700; }
.tray-name { color: var(--muted); font-size: 13px; }

/* one compartment at a time — the tabs are the drawer handles */
.tray-tabs {
  display: flex; gap: 6px;
  margin-bottom: 8px;
  padding: 2px 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tray-tabs::-webkit-scrollbar { display: none; }

.tray-tab {
  flex: none; white-space: nowrap;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 7px 15px;
  font-size: 13.5px; font-weight: 600;
  font-family: var(--font-round);
}
.tray-tab:hover { border-color: var(--accent); color: var(--ink); }
.tray-tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 3px 0 rgba(200, 120, 140, .22);
}

/* a compartment tray, like the plastic bead boxes these come in */
.tray {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 7px;
  padding: 10px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  min-height: 66px;
}
.tray-cell {
  aspect-ratio: 1; max-width: 100%;
  cursor: grab;
  touch-action: none;   /* beads are dragged out of the box */
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  background: var(--paper);
  border: 2px solid transparent;
  border-radius: 16px;
}
.tray-cell:hover { border-color: var(--accent); }
.tray-cell[aria-checked="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--paper));
}
.tray-cell canvas { display: block; pointer-events: none; }

/* ---------------------------------------------------- the pen in hand */

/* the pill that picks the pen up leads the tools row; on it reads as pressed */
.use-pen.is-on {
  background: var(--ink); color: var(--paper);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .18), 0 4px 0 rgba(0, 0, 0, .18);
}

/* the offer to keep a line you just selected on this page */
.keep-pill {
  position: fixed; z-index: 40;
  border: 2px solid transparent;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-family: var(--font-round); font-size: 14px; font-weight: 700;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 6px 18px rgba(120, 80, 60, .25);
  max-width: calc(100vw - 16px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* said once, on the first pickup, then gone */
.pen-hint {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 39;
  max-width: min(520px, calc(100vw - 32px));
  background: var(--card); color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius-pill);
  padding: 11px 18px;
  font-family: var(--font-round); font-size: 13.5px; font-weight: 600;
  line-height: 1.5; text-align: center;
  box-shadow: var(--shadow);
}

/* with the pen in hand the page is a page again: nothing here should feel
   draggable, and text must stay selectable so a line can be kept */
body.pen-mode { user-select: text; }

/* ------------------------------------------------------- get the apps */

.get {
  margin: 30px 0 4px;
  padding-top: 26px;
  border-top: 2px solid var(--line);
  scroll-margin-top: 12px;
}
.get h2 { margin: 0 0 6px; font-family: var(--font-round); font-size: 21px; font-weight: 700; }
.get-lead { margin: 0 0 16px; color: var(--muted); font-size: 15px; line-height: 1.65; }

.get-row {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .get-row { grid-template-columns: repeat(3, 1fr); }
}

.get-card {
  display: flex; flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.get-ico { display: block; line-height: 0; }
.get-ico svg { display: block; width: 44px; height: 44px; }
.get-card h3 {
  margin: 2px 0 0;
  font-family: var(--font-round); font-size: 16px; font-weight: 700;
}
.get-card > p {
  margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink);
  overflow-wrap: anywhere;
}
/* the buttons sit at the bottom of every tile, so a short body does not leave
   one tile's button floating halfway up the row */
.get-do {
  margin-top: auto; padding-top: 6px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.get-do .primary { padding: 11px 18px; font-size: 15px; }
/* the "Coming soon" label is a state, not a button: it must not look tappable */
.get-do #iosSoon { cursor: default; color: var(--muted); }
.get-do #iosSoon:hover { border-color: var(--line); }
.get-note { margin: 0; }

/* --------------------------------------------------------- how it works */

.how {
  margin: 36px 0 8px;
  padding-top: 28px;
  border-top: 2px solid var(--line);
  scroll-margin-top: 12px;
}
.how h2 { margin: 0 0 6px; font-family: var(--font-round); font-size: 21px; font-weight: 700; }
.how-lead { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.65; }

.how-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px;
}
@media (min-width: 720px) {
  .how-steps { grid-template-columns: 1fr 1fr; }
  /* only a lone last card spans the row; with an even count the grid is full */
  .how-steps li:nth-child(odd):last-child { grid-column: 1 / -1; }
}
.how-steps li {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 15px;
}
.how-steps canvas {
  flex: none;
  background: var(--paper);
  border-radius: 18px;
}
.how-steps h3 {
  margin: 2px 0 6px; font-family: var(--font-round); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.how-steps p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--ink); }
.step-no {
  width: 24px; height: 24px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: 12.5px; font-weight: 700;
  font-family: var(--font-round);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55);
}

.faq-title { margin-top: 28px !important; }
.faq { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.faq details {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 0 18px;
}
.faq summary {
  cursor: pointer; list-style: none;
  padding: 15px 0;
  font-family: var(--font-round);
  font-size: 15px; font-weight: 700;
  display: flex; justify-content: space-between; gap: 10px;
  border-radius: var(--radius-pill);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted); font-weight: 500; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 0 0 15px; font-size: 14px; line-height: 1.7; color: var(--ink); }

/* ----------------------------------------------------------------- foot */

.foot {
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: 18px 0 24px;
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 12.5px;
  border-top: 2px solid var(--line);
}

/* --------------------------------------------------------------- sheets */

.scrim {
  position: fixed; inset: 0;
  background: rgba(90, 60, 50, .35);
  backdrop-filter: blur(2px);
  z-index: 20;
}

.sheet {
  position: fixed; inset: 0; z-index: 21;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.card, .bead-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 22px;
  width: 100%; max-width: 460px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}

.card h2 { margin: 0 0 12px; font-family: var(--font-round); font-size: 19px; font-weight: 700; }
.card p { margin: 0 0 12px; line-height: 1.65; font-size: 15px; }
.muted { color: var(--muted); font-size: 13.5px; }

.sheet-actions {
  display: flex; gap: 10px; align-items: center;
  justify-content: flex-end; flex-wrap: wrap;
  margin-top: 16px;
}

.bead-text {
  margin: 0 0 10px;
  font-size: 19px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.bead-meta { margin: 0; color: var(--muted); font-size: 13px; }

/* --------------------------------------------------------------- charms */

.charm-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 10px;
}
.charm-pick {
  border: 2px solid var(--line); background: var(--card);
  border-radius: 20px; padding: 10px 6px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--ink); font-size: 12.5px; font-weight: 600;
}
.charm-pick canvas { width: 56px; height: 56px; }
.charm-pick[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--card));
}

/* ------------------------------------------------------------- pen case */

.case-list { display: flex; flex-direction: column; gap: 8px; }
.case-row {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--line); border-radius: 20px;
  padding: 8px 12px; background: var(--paper); color: var(--ink);
  text-align: left; width: 100%;
}
.case-row canvas { width: 132px; height: 34px; flex: none; }
.case-row .case-label { font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------ wallpaper */

.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.swatch {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  /* a milky ring, then a soft outline: the swatch reads as a candy */
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--line);
  margin: 3px;
}
.swatch[aria-pressed="true"] {
  border-color: var(--card);
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--accent);
}

.wall-preview {
  display: block; width: 100%; max-width: 210px; margin: 0 auto;
  border-radius: 20px; box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- stars */

.stars { display: flex; gap: 6px; margin: 4px 0 14px; }
.star {
  border: none; background: none; padding: 2px; cursor: pointer;
  font-size: 27px; line-height: 1; color: var(--line);
}
.star[data-on="1"] { color: #FFD08A; }

#fbForm textarea, #fbForm input { margin-bottom: 10px; }

/* --------------------------------------------------------------- dragging */

/* the bead that follows the pointer while it is being threaded or moved */
.drag-bead {
  position: fixed; left: 0; top: 0;
  pointer-events: none; z-index: 40;
  filter: drop-shadow(0 6px 10px rgba(120, 80, 60, .28));
}
body.dragging {
  cursor: grabbing;
  user-select: none; -webkit-user-select: none;
}
body.dragging .tray-cell { cursor: grabbing; }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 12px 20px; border-radius: var(--radius-pill);
  font-family: var(--font-round);
  font-size: 14px; font-weight: 600; z-index: 30;
  box-shadow: var(--shadow);
  animation: rise .26s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

.about-links { display: flex; gap: 8px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* `hidden` must win over any display set above it, or every sheet stays open
   and swallows clicks meant for the page underneath. */
[hidden] { display: none !important; }

/* ---------------------------------------------------------- bead editor */

.edit-bar {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin: 0 0 14px;
}
.edit-bar .ghost[disabled] { opacity: .4; cursor: default; }
.edit-bar .ghost[data-armed="1"] { border-color: #D9707A; color: #D9707A; }
.primary.small { padding: 9px 18px; font-size: 14px; border-radius: var(--radius-pill); }

.lang-select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-family: var(--font-round);
  font-size: 14px; font-weight: 600;
  padding: 9px 16px;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius-pill);
  cursor: pointer;
}

.style-wrap {
  display: grid; gap: 14px; margin: 14px 0 0;
}
@media (min-width: 620px) { .style-wrap { grid-template-columns: auto 1fr; gap: 28px; } }
.style-group .tray-title { margin-bottom: 8px; }

/* the pen types: a scrolling strip of little pens, like a pencil case tray.
   A grid item is min-width:auto by default, which would let the strip push the
   whole page wide instead of scrolling inside itself — hence the min-width:0. */
.style-types { grid-column: 1 / -1; }
.style-group { min-width: 0; }
.type-row {
  display: flex; gap: 8px;
  margin-bottom: 4px;
  padding: 2px 0 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.type-row::-webkit-scrollbar { display: none; }

.type-pick {
  flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 2px solid var(--line); background: var(--card);
  border-radius: 18px; padding: 7px 10px 6px;
  color: var(--muted); font-size: 12px; font-weight: 600;
  font-family: var(--font-round);
  white-space: nowrap;
  cursor: pointer;
}
.type-pick canvas { width: 118px; height: 30px; display: block; }
.type-pick:hover { border-color: var(--accent); color: var(--ink); }
.type-pick[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 16%, var(--card));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 3px 0 rgba(200, 120, 140, .18);
}

.charm-row { display: flex; gap: 8px; flex-wrap: wrap; }
.charm-row .charm-pick { width: 62px; padding: 6px 2px; font-size: 12px; }
.charm-row .charm-pick canvas { width: 44px; height: 44px; }

.swatch.barrel {
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--line);
}
.swatch.barrel[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--accent);
}

/* ink swatches are smaller than barrel swatches — a nib's worth, not a pen's */
.swatch.ink { width: 30px; height: 30px; }

.tools { margin: 18px 0 8px; }

.count-badge {
  margin-left: 6px;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 700;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5);
}

.case-row { cursor: pointer; }
.case-row .case-main {
  flex: 1; display: flex; align-items: center; gap: 12px;
  background: none; border: none; padding: 0; color: inherit; font: inherit; text-align: left;
  cursor: pointer; min-width: 0;
}
.case-row .case-del {
  border: none; background: none; color: var(--muted);
  font-size: 13px; padding: 6px 4px; cursor: pointer; white-space: nowrap;
}
.case-row .case-del[data-armed="1"] { color: #D9707A; }

/* ----------------------------------------------------------- kept lines */

/* The pen is the decorative object; these are the words it keeps. Same milk
   candy as everything else: 26px cards, a 2px milky border, rounded heads. */

.quotes {
  margin: 26px 0 0;
  padding-top: 24px;
  border-top: 2px solid var(--line);
  scroll-margin-top: 12px;
}
.quotes-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.quotes-head h2 {
  margin: 0; font-family: var(--font-round); font-size: 21px; font-weight: 700;
}
.quotes-tally {
  color: var(--muted); font-size: 13px;
  font-family: var(--font-round); font-variant-numeric: tabular-nums;
}
.quotes-lead { margin: 6px 0 14px; color: var(--muted); font-size: 15px; line-height: 1.65; }

.quote-compose {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.quote-compose textarea { font-size: 16px; }
.quote-compose .compose-row { align-items: stretch; }
.quote-compose .compose-row .primary { flex: none; }

.quotes-empty { margin: 14px 2px 0; line-height: 1.7; }

.quote-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.quote-card {
  padding: 15px 18px;
  background: var(--card);
  border: 2px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.quote-text {
  margin: 0; font-size: 16.5px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
}
.quote-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-top: 8px;
}
.quote-meta {
  margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6;
  min-width: 0; word-break: break-word;
}
.quote-meta a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.quote-meta a:hover { color: var(--accent-ink); }
.quote-del {
  border: none; background: none; color: var(--muted);
  font-size: 13px; padding: 6px 4px; cursor: pointer; white-space: nowrap;
  font-family: var(--font-round);
}
.quote-del[data-armed="1"] { color: #D9707A; }

.quotes-actions {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 14px;
}

/* ------------------------------------------------------- install page */

.plain-page { max-width: 620px; }
.plain-page h1 {
  margin: 22px 0 4px; font-family: var(--font-round);
  font-size: 24px; font-weight: 700;
}
.plain-page .steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.plain-page .steps li {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 26px; box-shadow: var(--shadow); padding: 14px 16px;
  font-size: 14.5px; line-height: 1.7;
}
.plain-page .steps .step-no { margin-top: 2px; }
.plain-page code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 1px 6px;
}
.plain-page .dl { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }

/* Thai stacks tone marks and vowels above and below the line; the 1.5-ish
   leading the rest of the site uses clips them. */
html[lang="th"] body,
html[lang="th"] p,
html[lang="th"] li,
html[lang="th"] .quote-text,
html[lang="th"] .how-step p,
html[lang="th"] .priv-sec p,
html[lang="th"] .route p { line-height: 1.75; }
