/* ==========================================================================
   MeniWorld Documentation — shared stylesheet
   Used by index.html and every file inside /docs/
   ========================================================================== */

:root {
  --brand:          #1f5eff;
  --brand-dark:     #1746c4;
  --brand-soft:     #eaf0ff;
  --accent:         #00b894;

  --bg:             #f6f7fb;
  --surface:        #ffffff;
  --surface-alt:    #f2f4f9;
  --border:         #e2e6ef;
  --border-strong:  #ced5e3;

  --text:           #131722;
  --text-soft:      #4d5568;
  --text-faint:     #7b8398;

  --warn-bg:        #fff8e6;
  --warn-border:    #f0c24b;
  --warn-text:      #6b5312;

  --tip-bg:         #e9f8f2;
  --tip-border:     #4ec9a2;
  --tip-text:       #14624a;

  --radius:         14px;
  --radius-sm:      9px;
  --shadow:         0 1px 2px rgba(19, 23, 34, .05), 0 8px 24px rgba(19, 23, 34, .06);
  --shadow-lg:      0 12px 40px rgba(19, 23, 34, .14);
  --maxw:           1180px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand:         #6f9bff;
    --brand-dark:    #8fb2ff;
    --brand-soft:    #17224a;

    --bg:            #0d1017;
    --surface:       #161a24;
    --surface-alt:   #1c2230;
    --border:        #262d3d;
    --border-strong: #35405a;

    --text:          #eef1f7;
    --text-soft:     #b3bcd0;
    --text-faint:    #8a94ab;

    --warn-bg:       #2a2313;
    --warn-border:   #8a6c1d;
    --warn-text:     #f2d894;

    --tip-bg:        #102a23;
    --tip-border:    #2c7a63;
    --tip-text:      #93e0c6;

    --shadow:        0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg:     0 12px 40px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.02em;
}
.logo .mark {
  width: 32px; height: 32px;
  display: block;
  object-fit: contain;
}
.logo .name { font-size: 16.5px; }
.logo .name span { color: var(--text-faint); font-weight: 500; }
.site-header nav {
  margin-left: auto;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.site-header nav a {
  text-decoration: none;
  color: var(--text-soft);
  font-size: 14px; font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
}
.site-header nav a:hover { background: var(--surface-alt); color: var(--text); }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.doc-layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px 80px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}
@media (max-width: 900px) { .doc-layout { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 34px; }
.hero .eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 5px 11px; border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.15; letter-spacing: -.03em;
}
.hero p { margin: 0; max-width: 62ch; color: var(--text-soft); font-size: 17px; }

.meta-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 22px;
}
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
}

/* ---------- Cards (index) ---------- */
.section-title {
  display: flex; align-items: baseline; gap: 12px;
  margin: 40px 0 4px;
  font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint);
}
.section-title::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 18px;
  margin: 22px 0 8px;
}
.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: var(--shadow-lg);
}
.card .icon {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 19px;
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 7px; font-size: 17.5px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--text-soft); font-size: 14.5px; line-height: 1.55; }
.card .card-foot {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text-faint); font-weight: 600;
}
.tag {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent);
  background: var(--tip-bg);
  padding: 3px 9px; border-radius: 6px;
}
.card.soon { opacity: .62; pointer-events: none; }
.card.soon .tag { color: var(--text-faint); background: var(--surface-alt); }

/* ---------- Sidebar TOC ---------- */
.toc {
  position: sticky; top: 84px;
  border-left: 2px solid var(--border);
  padding: 4px 0 4px 16px;
  font-size: 14px;
}
.toc h4 {
  margin: 0 0 10px;
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint);
}
.toc a {
  display: block;
  padding: 5px 0;
  color: var(--text-soft);
  text-decoration: none;
  line-height: 1.4;
}
.toc a:hover { color: var(--brand); }
@media (max-width: 900px) { .toc { display: none; } }

/* ---------- Article ---------- */
article { min-width: 0; }
article h2 {
  margin: 46px 0 14px;
  font-size: 24px; letter-spacing: -.02em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
article h3 { margin: 28px 0 10px; font-size: 18px; letter-spacing: -.01em; }
article p { margin: 0 0 14px; color: var(--text-soft); }
article ul, article ol { margin: 0 0 16px; padding-left: 22px; color: var(--text-soft); }
article li { margin-bottom: 7px; }
article strong { color: var(--text); }

code {
  font-family: var(--mono);
  font-size: .885em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 1.5px 6px;
  border-radius: 6px;
  color: var(--text);
  word-break: break-word;
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 460px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  background: var(--surface-alt);
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint);
}
tbody tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 600; color: var(--text); white-space: nowrap; }
td { color: var(--text-soft); }

/* ---------- Steps ---------- */
.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 262px;
  gap: 30px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
@media (max-width: 720px) { .step { grid-template-columns: 1fr; gap: 20px; } }

.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.step-num {
  flex: none;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 800;
}
.step h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.step p:last-child, .step ul:last-child, .step ol:last-child { margin-bottom: 0; }

.shot {
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-alt);
  cursor: zoom-in;
}
.shot-media { position: relative; line-height: 0; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption {
  padding: 7px 10px;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Tap-target marker overlaid on a screenshot: "tap here" pulse + dot. */
.tap-marker {
  position: absolute;
  width: 26px; height: 26px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.tap-marker::before,
.tap-marker::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.tap-marker::before {
  inset: 0;
  border: 2px solid #ff5252;
  background: rgba(255, 82, 82, .28);
  animation: tap-pulse 1.7s ease-out infinite;
}
.tap-marker::after {
  top: 50%; left: 50%;
  width: 9px; height: 9px;
  transform: translate(-50%, -50%);
  background: #ff5252;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .92), 0 0 8px rgba(255, 82, 82, .85);
}
@keyframes tap-pulse {
  0%   { transform: scale(.4); opacity: 1; }
  70%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tap-marker::before { animation: none; opacity: .7; }
}

/* Privacy blur panel: hides rows of a screenshot (e.g. other accounts). */
.privacy-blur {
  position: absolute;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(9px) saturate(120%);
  -webkit-backdrop-filter: blur(9px) saturate(120%);
  background: rgba(15, 17, 24, .38);
  z-index: 1;
}
.privacy-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  color: rgba(255, 255, 255, .92);
  background: rgba(0, 0, 0, .38);
  border: 1px solid rgba(255, 255, 255, .25);
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Arrow pointing at a tap target from the side. */
.tap-arrow {
  position: absolute;
  transform: translateY(-50%);
  font-size: 26px;
  line-height: 1;
  color: #ff5252;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55));
  animation: arrow-nudge 1.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
@keyframes arrow-nudge {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%      { transform: translateY(-50%) translateX(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .tap-arrow { animation: none; }
}

/* ---------- Callouts ---------- */
.note {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0 0 16px;
  font-size: 14.5px;
  border: 1px solid;
}
.note p { margin: 0; color: inherit; }
.note p + p { margin-top: 8px; }
.note strong { color: inherit; }
.note.warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.note.tip  { background: var(--tip-bg);  border-color: var(--tip-border);  color: var(--tip-text); }

/* ---------- FAQ ---------- */
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
}
details[open] { box-shadow: var(--shadow); }
summary { cursor: pointer; font-weight: 650; color: var(--text); }
summary::-webkit-details-marker { display: none; }
summary::before { content: "＋ "; color: var(--brand); font-weight: 700; }
details[open] summary::before { content: "－ "; }
details p { margin: 10px 0 0; font-size: 14.5px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6, 8, 14, .9);
  display: none; place-items: center;
  padding: 26px;
  cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox-media {
  position: relative;
  line-height: 0;
  max-width: 100%;
  max-height: 92vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.lightbox-media img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
}
/* Tap markers are only useful at thumbnail size; hide them when enlarged. */
.lightbox-media .tap-marker,
.lightbox-media .tap-arrow { display: none; }
.lightbox .hint {
  position: absolute; bottom: 16px; left: 0; right: 0;
  text-align: center; color: rgba(255,255,255,.65); font-size: 13px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 60px;
  padding: 30px 0;
}
.site-footer .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-size: 13.5px; color: var(--text-faint);
}
.site-footer a { color: var(--text-soft); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--brand); }
.site-footer .right { margin-left: auto; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 26px 0 0;
  font-size: 14px; font-weight: 600;
  color: var(--text-soft); text-decoration: none;
}
.back-link:hover { color: var(--brand); }

/* ---------- Small-screen refinements ---------- */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .doc-layout { padding: 0 16px 56px; gap: 0; }
  .site-header .inner { padding: 11px 16px; gap: 10px; }
  .site-header nav { gap: 2px; }
  .site-header nav a { padding: 6px 9px; font-size: 13px; }

  .hero { padding: 34px 0 24px; }
  .hero .eyebrow { margin-bottom: 12px; }
  .hero p { font-size: 15.5px; }
  .meta-row { margin-top: 18px; gap: 8px; }
  .pill { font-size: 12.5px; padding: 5px 10px; }

  .section-title { margin: 30px 0 4px; }
  .card { padding: 18px; }

  article h2 { margin: 36px 0 12px; font-size: 21px; }
  article h3 { font-size: 16.5px; }

  .step { padding: 18px; border-radius: 12px; }
  .step-num { width: 27px; height: 27px; font-size: 13px; }
  .step h3 { font-size: 16.5px; }

  th, td { padding: 10px 12px; font-size: 13.5px; }

  .site-footer { padding: 22px 0; }
  .site-footer .inner { padding: 0 16px; }
}

@media (max-width: 380px) {
  .logo .name { font-size: 15px; }
  .logo .mark { width: 28px; height: 28px; }
  .hero h1 { font-size: 25px; }
  .site-header nav a { padding: 5px 7px; font-size: 12.5px; }
}

@media print {
  .site-header, .toc, .site-footer, .back-link, .lightbox { display: none !important; }
  body { background: #fff; }
  .step, .card { break-inside: avoid; box-shadow: none; }
  .doc-layout { grid-template-columns: 1fr; }
}
