/* Melo Help Center — shared stylesheet.
   Tokens mirror Melo/Shared/MeloDesignSystem.swift and ui/theme/MeloPalette.kt.
   Dark mode: prefers-color-scheme AND html[data-theme="dark"] (set by help.js from ?theme=). */

:root {
  --bg: #FBF5EE;            /* parchment50 */
  --bg-elevated: #FFFFFF;
  --text: #212121;
  --text-secondary: #5F5A55;
  --primary: #1C7C54;       /* turfGreen400 */
  --link: #146140;          /* turfGreen600 */
  --border: #E8E0D8;
  --note-bg: #EDF6EF;
  --note-border: #C6DEA4;
  --step-num-bg: #1C7C54;
  --step-num-text: #FFFFFF;
  --button-bg: #1C7C54;
  --button-text: #FFFFFF;
  --button-secondary-bg: #FFFFFF;
  --button-secondary-text: #146140;
  --shadow: 0 1px 2px rgba(33, 33, 33, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #5B4136;
    --bg-elevated: #52362B;
    --text: #FFF2DF;         /* darkCoffee50 */
    --text-secondary: #D5CBC3;
    --primary: #C6DEA4;
    --link: #73E2A7;         /* celadon200 */
    --border: #6E5347;
    --note-bg: #4A3A2F;
    --note-border: #73E2A7;
    --step-num-bg: #73E2A7;
    --step-num-text: #042A17;
    --button-bg: #73E2A7;
    --button-text: #042A17;
    --button-secondary-bg: #52362B;
    --button-secondary-text: #73E2A7;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  --bg: #5B4136;
  --bg-elevated: #52362B;
  --text: #FFF2DF;
  --text-secondary: #D5CBC3;
  --primary: #C6DEA4;
  --link: #73E2A7;
  --border: #6E5347;
  --note-bg: #4A3A2F;
  --note-border: #73E2A7;
  --step-num-bg: #73E2A7;
  --step-num-text: #042A17;
  --button-bg: #73E2A7;
  --button-text: #042A17;
  --button-secondary-bg: #52362B;
  --button-secondary-text: #73E2A7;
  --shadow: none;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Lexend", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

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

img, video { max-width: 100%; height: auto; display: block; border-radius: 12px; }

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

/* Site header: shown only when the page is opened outside the app (help.js). */
.site-header { display: none; align-items: center; gap: 10px; padding: 8px 0 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.site-header a { color: var(--text); text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.site-header .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); display: inline-block; }
.site-header .crumb { color: var(--text-secondary); font-size: 14px; margin-left: auto; }
html[data-embedded="false"] .site-header { display: flex; }

h1 { font-size: 24px; font-weight: 500; line-height: 1.25; margin: 4px 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 500; margin: 28px 0 8px; }
h3 { font-size: 16px; font-weight: 500; margin: 20px 0 6px; }
p { margin: 0 0 12px; }
.lede { color: var(--text-secondary); font-size: 17px; margin-bottom: 20px; }
.meta { color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; }

/* Numbered steps */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 16px; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin-bottom: 16px; }
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--step-num-bg); color: var(--step-num-text);
  font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: center;
}
ol.steps > li > strong { display: block; margin-bottom: 2px; }
ol.steps figure { margin: 10px 0 0; }
ol.steps figcaption { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

ul { padding-left: 20px; margin: 0 0 12px; }
li { margin-bottom: 6px; }

/* Platform-specific sections. help.js hides the other platform when ?platform= is set. */
/* Any element can carry data-platform; sections additionally get a heading on the web. */
section[data-platform] > .platform-heading { display: none; }
html[data-embedded="false"] section[data-platform] > .platform-heading { display: block; }
html[data-platform="ios"] [data-platform="android"],
html[data-platform="android"] [data-platform="ios"] { display: none !important; }

/* Callouts */
.note {
  background: var(--note-bg);
  border-left: 3px solid var(--note-border);
  padding: 12px 14px;
  border-radius: 10px;
  margin: 16px 0;
  font-size: 15px;
}
.note strong { font-weight: 500; }

/* Cards on the index */
.card-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; }
.wrap > h2 + .card-list { margin-top: 10px; }
.card {
  display: block; text-decoration: none; color: var(--text);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; box-shadow: var(--shadow);
}
.card:active { opacity: 0.85; }
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.card .time { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }

/* App actions ("Set it up now"). Only rendered inside the app; help.js hides them otherwise. */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 8px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px; border-radius: 12px;
  background: var(--button-bg); color: var(--button-text);
  text-decoration: none; font-weight: 500; font-size: 15px;
}
.button.secondary { background: var(--button-secondary-bg); color: var(--button-secondary-text); border: 1px solid var(--border); }
html[data-embedded="false"] .app-only { display: none !important; }
.web-only { display: none !important; }
html[data-embedded="false"] .web-only { display: inline !important; }
html[data-embedded="false"] div.web-only, html[data-embedded="false"] p.web-only { display: block !important; }

/* Inline UI names */
kbd, .ui {
  font-family: inherit; font-weight: 500;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px; font-size: 0.95em; white-space: nowrap;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; }

footer.page-footer { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-secondary); }
footer.page-footer a { color: var(--link); }
