/* ===========================================================================
   Mochii Manual — Liquid Glass theme
   Palette + glass recipe pulled from the live app (src/index.css):
     coral primary   hsl(358 83% 65%)     peach   hsl(24 95% 62%)
     teal            hsl(173 58% 39%)     gold    hsl(35 100% 50%)
     bright teal     hsl(174 71% 50%)     navy    hsl(218 39% 14%)
     lavender        hsl(271 54% 58%)
     brand gradient  135deg, coral -> peach
     glass: translucent tint + backdrop-blur + white hairline + inset highlight
   Font: Montserrat (same as the app).
   =========================================================================== */

:root {
  --coral: hsl(358 83% 65%);
  --coral-dark: hsl(358 75% 52%);
  --peach: hsl(24 95% 62%);
  --teal: hsl(173 58% 39%);
  --teal-bright: hsl(174 71% 45%);
  --gold: hsl(35 100% 47%);
  --lavender: hsl(271 54% 58%);
  --navy: hsl(218 39% 14%);

  --grad-primary: linear-gradient(135deg, hsl(358 83% 65%), hsl(24 95% 62%));

  --ink: hsl(222 22% 14%);
  --ink-soft: hsl(220 14% 28%);
  --ink-faint: hsl(220 10% 42%);

  /* Liquid Glass tokens */
  --glass-blur: 20px;
  --glass-sat: 1.5;
  --glass-white: 255 255 255;            /* light frosted tint */
  --glass-sheet-opacity: .80;            /* reading sheet: more opaque for legibility */
  --glass-card-opacity: .55;             /* cards/callouts: airier */
  --glass-border: rgba(255,255,255,.55);
  --glass-hairline: rgba(255,255,255,.7);
  --glass-highlight: inset 0 1px 0 0 rgba(255,255,255,.6);

  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(40,30,20,.04), 0 10px 30px rgba(40,30,20,.10);
  --shadow-lg: 0 20px 60px rgba(40,30,20,.18);

  --sidebar-w: 17.5rem;
  --content-max: 50rem;
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }

/* ---------- Mochii wallpaper (color behind the glass) -------------------- */
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-color: #f7f1e3;
  background-image:
    radial-gradient(38rem 38rem at 12% -6%, hsla(358 83% 65% / .26), transparent 60%),
    radial-gradient(34rem 34rem at 96% 4%, hsla(24 95% 62% / .24), transparent 58%),
    radial-gradient(40rem 40rem at 82% 92%, hsla(173 58% 45% / .22), transparent 60%),
    radial-gradient(32rem 32rem at 6% 88%, hsla(271 54% 60% / .20), transparent 58%),
    radial-gradient(26rem 26rem at 50% 50%, hsla(35 100% 55% / .12), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Reusable glass recipe */
.glass {
  background: rgba(var(--glass-white), var(--glass-card-opacity));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--shadow);
}

/* ---------- Layout shell ------------------------------------------------- */
.layout { display: flex; min-height: 100vh; gap: 0; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 1.5rem 1rem 2rem;
  color: hsl(210 40% 96%);
  /* dark frosted glass */
  background: hsla(218 39% 13% / .72);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-right: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,.08);
}

.sidebar__brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: .55rem;
  padding: .25rem .5rem 1.35rem; margin-bottom: .35rem;
  border-bottom: 1px solid rgba(255,255,255,.1); text-decoration: none;
}
.sidebar__logo { height: 52px; width: 52px; object-fit: cover; border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.sidebar__platform { font-weight: 800; font-size: .95rem; line-height: 1; text-transform: uppercase; letter-spacing: .26em; color: var(--teal-bright); }
.sidebar__sub { font-size: .64rem; font-weight: 600; line-height: 1; text-transform: uppercase; letter-spacing: .2em; color: rgba(255,255,255,.5); }

.search {
  width: 100%; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08); color: #fff;
  border-radius: var(--radius-sm); padding: .6rem .8rem; font: inherit; font-size: .85rem; margin-bottom: 1rem;
  backdrop-filter: blur(6px);
}
.search::placeholder { color: rgba(255,255,255,.55); }
.search:focus { outline: 2px solid var(--teal-bright); outline-offset: 1px; }

.nav__group-label { font-size: .67rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.42); font-weight: 700; padding: 1rem .5rem .35rem; }
.nav a { display: flex; align-items: center; gap: .6rem; color: rgba(255,255,255,.84); text-decoration: none; padding: .55rem .65rem; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500; transition: background .12s, color .12s; }
.nav a .ico { width: 1.2rem; text-align: center; flex: 0 0 1.2rem; opacity: .92; }
.nav a .ico-img { width: 1.45rem; height: 1.45rem; flex: 0 0 1.45rem; object-fit: contain; }
.nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav a.is-active { background: var(--teal-bright); color: var(--navy); font-weight: 700; box-shadow: 0 4px 16px hsla(174 71% 45% / .45); }
.nav a.is-soon { color: rgba(255,255,255,.4); }
.nav a.is-soon::after { content: "soon"; margin-left: auto; font-size: .58rem; text-transform: uppercase; letter-spacing: .05em; background: rgba(255,255,255,.12); padding: .1rem .35rem; border-radius: 5px; }
.nav a.is-hidden { display: none; }

/* ---------- Main column: the glass reading sheet ------------------------- */
.main { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; gap: 1.25rem; padding: 1.75rem 1.5rem 3rem; }

.page {
  width: 100%; max-width: var(--content-max);
  padding: 2.75rem 2.75rem 3rem;
  border-radius: var(--radius);
  background: rgba(var(--glass-white), var(--glass-sheet-opacity));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-hairline);
  box-shadow: var(--glass-highlight), var(--shadow-lg);
}

.crumbs { font-size: .8rem; color: var(--ink-faint); margin-bottom: 1.25rem; }
.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { color: var(--teal); }

.eyebrow { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--coral-dark); margin-bottom: .6rem; }

h1 {
  font-size: 2.6rem; line-height: 1.08; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .75rem;
  background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: 1.2rem; color: var(--ink-soft); margin: 0 0 2rem; line-height: 1.55; }

h2 { font-size: 1.55rem; font-weight: 800; color: var(--ink); letter-spacing: -.01em; margin: 2.75rem 0 .25rem; padding-top: .5rem; scroll-margin-top: 1rem; }
h2 .anchor, h3 .anchor { opacity: 0; text-decoration: none; color: var(--teal); margin-left: .4rem; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
h3 { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin: 1.75rem 0 .25rem; }

p { margin: .85rem 0; }
a { color: var(--teal); text-decoration-color: hsl(173 58% 75%); text-underline-offset: 2px; }
a:hover { color: var(--coral); }
strong { color: var(--ink); font-weight: 700; }
ul, ol { padding-left: 1.3rem; }
li { margin: .4rem 0; }

code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .85em; background: hsla(358 83% 65% / .12); color: var(--coral-dark); padding: .12rem .42rem; border-radius: 6px; }

pre {
  position: relative;
  background: var(--navy); color: hsl(220 20% 92%);
  border-radius: var(--radius-md); padding: 1.1rem 1.3rem; margin: 1.25rem 0;
  overflow-x: auto; box-shadow: 0 6px 18px rgba(40,30,20,.12);
}
pre code { background: none; color: inherit; padding: 0; border-radius: 0; font-size: .85rem; line-height: 1.6; }
.copy-btn {
  position: absolute; top: .6rem; right: .6rem;
  font: inherit; font-size: .74rem; font-weight: 600; letter-spacing: .01em;
  color: hsl(220 20% 85%); background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14); border-radius: 7px;
  padding: .28rem .6rem; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.copy-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.copy-btn.is-copied { background: hsla(174 71% 45% / .25); color: var(--teal-bright); border-color: hsla(174 71% 45% / .4); }

/* ---------- Callouts (frosted) ------------------------------------------ */
.callout {
  border-radius: var(--radius-md); padding: 1rem 1.15rem; margin: 1.5rem 0;
  display: flex; gap: .85rem; align-items: flex-start;
  background: rgba(255,255,255,.5);
  backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,.6), 0 6px 18px rgba(40,30,20,.08);
}
.callout .emoji { font-size: 1.3rem; line-height: 1.4; flex: 0 0 auto; }
.callout p { margin: .2rem 0; font-size: .96rem; }
.callout p:first-child { margin-top: 0; }
.callout .label { font-weight: 800; color: var(--ink); display: block; margin-bottom: .15rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.callout--tip   { border-left: 4px solid var(--teal);     background: hsla(173 58% 55% / .16); }
.callout--plain { border-left: 4px solid var(--lavender); background: hsla(271 54% 60% / .15); }
.callout--watch { border-left: 4px solid var(--coral);    background: hsla(358 83% 65% / .15); }
.callout--soon  { border-left: 4px solid var(--gold);     background: hsla(35 100% 55% / .18); }
.callout--try   { border-left: 4px solid var(--teal-bright); background: rgba(255,255,255,.6); }

/* ---------- Try-it steps ------------------------------------------------- */
.steps { counter-reset: step; list-style: none; padding-left: 0; margin: 1.25rem 0; }
.steps > li { position: relative; padding-left: 2.85rem; margin: .9rem 0; min-height: 1.9rem; }
.steps > li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 0; top: -.1rem;
  width: 1.95rem; height: 1.95rem; border-radius: 50%;
  background: var(--grad-primary); color: #fff; font-weight: 800; font-size: .9rem;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px hsla(358 83% 60% / .4);
}

/* ---------- Cards / grids (frosted) ------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card {
  border-radius: var(--radius-md); padding: 1.25rem; text-decoration: none; color: inherit; display: block;
  background: rgba(255,255,255,.5);
  backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,.6), 0 6px 18px rgba(40,30,20,.08);
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
a.card:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 0 rgba(255,255,255,.7), var(--shadow-lg); border-color: hsl(173 58% 60%); }
.card .emoji { font-size: 1.6rem; display: block; margin-bottom: .5rem; }
.card .card-mark { width: 3rem; height: 3rem; display: block; margin-bottom: .4rem; object-fit: contain; }
.card h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.card p { margin: 0; font-size: .88rem; color: var(--ink-faint); }
.card .tier { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--teal); }

/* ---------- Tables (frosted) -------------------------------------------- */
table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.5rem 0; font-size: .92rem;
  border-radius: var(--radius-md); overflow: hidden;
  background: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid rgba(120,90,40,.12); vertical-align: top; }
th { background: rgba(255,255,255,.45); font-weight: 800; color: var(--ink); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: hsla(35 100% 55% / .08); }

/* ---------- Tier pills --------------------------------------------------- */
.pill { display: inline-block; font-size: .68rem; font-weight: 800; padding: .15rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.pill--everyone { background: hsla(173 58% 55% / .2); color: var(--teal); }
.pill--power    { background: hsla(35 100% 55% / .22); color: hsl(35 90% 32%); }
.pill--admin    { background: hsla(271 54% 60% / .2); color: var(--lavender); }

/* ---------- Hero banner / title mark ------------------------------------ */
.hero-banner { display: block; width: 100%; max-width: 560px; height: auto; border-radius: var(--radius-md); box-shadow: var(--shadow); margin: 0 0 1.75rem; border: 1px solid rgba(255,255,255,.6); }
.title-mark { display: inline-flex; align-items: center; gap: .75rem; }
.title-mark img { width: 3.4rem; height: 3.4rem; object-fit: contain; vertical-align: middle; -webkit-text-fill-color: initial; }

/* ---------- Recap (deep glass) ------------------------------------------ */
.recap {
  margin: 3rem 0 1rem; padding: 1.6rem 1.6rem; border-radius: var(--radius);
  color: hsl(210 40% 95%);
  background: linear-gradient(135deg, hsla(218 39% 14% / .82), hsla(200 40% 20% / .82));
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,.12), var(--shadow-lg);
}
.recap h2 { color: #fff; margin-top: 0; font-size: 1.2rem; }
.recap ul { margin: .5rem 0 0; }
.recap li { margin: .45rem 0; }
.recap strong { color: var(--teal-bright); }

/* ---------- Prev / next pager ------------------------------------------- */
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; }
.pager a { flex: 1; border-radius: var(--radius-md); padding: 1rem 1.25rem; text-decoration: none; background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.6); box-shadow: inset 0 1px 0 0 rgba(255,255,255,.6), var(--shadow); transition: border-color .12s, transform .12s; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pager a:hover { border-color: hsl(173 58% 60%); transform: translateY(-2px); }
.pager .dir { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); }
.pager .ttl { font-weight: 700; color: var(--ink); }
.pager .next { text-align: right; }

/* ---------- On-page TOC -------------------------------------------------- */
.toc { position: sticky; top: 1.75rem; align-self: flex-start; width: 13.5rem; flex: 0 0 13.5rem; padding: 1.25rem 1.1rem; font-size: .82rem; border-radius: var(--radius-md); background: rgba(255,255,255,.42); border: 1px solid rgba(255,255,255,.55); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: inset 0 1px 0 0 rgba(255,255,255,.5); }
.toc b { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; color: var(--ink-faint); margin-bottom: .6rem; }
.toc a { display: block; color: var(--ink-faint); text-decoration: none; padding: .25rem 0 .25rem .75rem; border-left: 2px solid rgba(120,90,40,.18); }
.toc a:hover, .toc a.is-active { color: var(--teal); border-left-color: var(--teal); }

/* ---------- Mobile ------------------------------------------------------- */
.menu-btn { display: none; }
@media (max-width: 1180px) { .toc { display: none; } }
@media (max-width: 880px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; }
  .menu-btn { display: flex; align-items: center; gap: .4rem; position: fixed; top: 1rem; left: 1rem; z-index: 20; background: hsla(218 39% 14% / .9); color: #fff; border: none; border-radius: 10px; padding: .55rem .8rem; font: inherit; font-size: .85rem; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; backdrop-filter: blur(8px); }
  .main { padding: 4rem 1rem 3rem; }
  .page { padding: 2rem 1.35rem; }
  h1 { font-size: 2rem; }
}

/* ===========================================================================
   Embedded reader — the in-app Help → Manual tab loads /manual/<page>.html?embed=1.
   Strip the manual's own chrome so just the article shows inside the panel.
   =========================================================================== */
body.embed .menu-btn,
body.embed .scrim,
body.embed .sidebar,
body.embed .toc,
body.embed .hero-banner,
body.embed .crumbs,
body.embed .pager { display: none !important; }
body.embed .layout { display: block; min-height: 0; }
body.embed .main { display: block; padding: 1.25rem 1.5rem 2rem; }
body.embed .page { max-width: 820px; margin: 0 auto; }

/* Embedded product screenshots */
.screenshot {
  display: block;
  width: 100%;
  max-width: 860px;
  height: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--shadow);
}
.screenshot + .shot-caption { font-size: .78rem; color: var(--ink-faint); margin: -1rem 0 1.75rem; }

/* Language switcher (injected into the sidebar by manual.js) */
.lang-switch { margin: 0 0 1rem; }
.lang-switch select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: .5rem .7rem;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
.lang-switch select:focus { outline: 2px solid var(--teal-bright); outline-offset: 1px; }
.lang-switch option { color: #111; }
