/* =========================================================
   Simple Launcher - How-to guides (shared design)
   Monochrome palette + Inter, matching budgex.online/launcher.
   Theme follows the device by default (works whether these
   pages are opened in a browser or embedded in the app),
   and honours an explicit choice via html[data-theme].
   ========================================================= */

:root {
  --bg:          #f7f7f7;
  --surface:     #ffffff;
  --surface-2:   #eeeeee;
  --text:        #0f0f0f;
  --text-muted:  #555555;
  --text-dim:    #767676;
  --line:        #e2e2e2;
  --line-strong: #cccccc;
  --accent:      #0f0f0f;
  --accent-ink:  #ffffff;
  --accent-weak: rgba(0, 0, 0, 0.08);
  --nav-bg:      rgba(247, 247, 247, 0.9);
  --frame:       #d6d6d6;
  --frame-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.22);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --maxw: 820px;
  --ease: cubic-bezier(.4,0,.2,1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0b0b0b;
    --surface:     #141414;
    --surface-2:   #1c1c1c;
    --text:        #efefef;
    --text-muted:  #a3a3a3;
    --text-dim:    #8a8a8a;
    --line:        #272727;
    --line-strong: #3a3a3a;
    --accent:      #efefef;
    --accent-ink:  #0b0b0b;
    --accent-weak: rgba(255, 255, 255, 0.12);
    --nav-bg:      rgba(11, 11, 11, 0.88);
    --frame:       #3a3a3a;
    --frame-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 18px 40px -16px rgba(0,0,0,0.75);
  }
}

:root[data-theme="dark"] {
  --bg:          #0b0b0b;
  --surface:     #141414;
  --surface-2:   #1c1c1c;
  --text:        #efefef;
  --text-muted:  #a3a3a3;
  --text-dim:    #8a8a8a;
  --line:        #272727;
  --line-strong: #3a3a3a;
  --accent:      #efefef;
  --accent-ink:  #0b0b0b;
  --accent-weak: rgba(255, 255, 255, 0.12);
  --nav-bg:      rgba(11, 11, 11, 0.88);
  --frame:       #3a3a3a;
  --frame-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 18px 40px -16px rgba(0,0,0,0.75);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .25s var(--ease), color .25s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.hd {
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.hd .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.hd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 0.95rem;
}
.hd-brand:hover { text-decoration: none; }
.hd-brand img { width: 26px; height: 26px; border-radius: 7px; }
.hd-back {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.hd-back:hover { color: var(--text); text-decoration: none; }

/* ---------- page shell ---------- */
.page { padding: 44px 0 8px; }
.page > .wrap > h1 {
  font-size: clamp(1.6rem, 4.2vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--text);
}
.lead { margin-top: 10px; color: var(--text-muted); max-width: 60ch; }

/* ---------- hub: search + question grid ---------- */
.search { position: relative; margin: 26px 0 22px; }
.search svg {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-dim); pointer-events: none;
}
#searchInput {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
#searchInput::placeholder { color: var(--text-dim); }
#searchInput:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

#questionList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.q-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font-weight: 500;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.q-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
  text-decoration: none;
}
.q-card svg {
  width: 18px; height: 18px; color: var(--text-muted); flex: none;
  transition: transform .18s var(--ease), color .18s var(--ease);
}
.q-card:hover svg { color: var(--text); transform: translateX(2px); }
.q-card[hidden] { display: none; }
.q-empty { padding: 28px; color: var(--text-muted); text-align: center; }

/* ---------- guide: step timeline ---------- */
.guide .meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.guide .intro { margin-top: 16px; color: var(--text-muted); max-width: 62ch; }

.guide section { margin-top: 40px; }
.guide section > h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 4px;
}

.steps { list-style: none; position: relative; margin-top: 12px; }
.steps::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--line-strong);
}
.step { position: relative; padding: 0 0 32px 54px; scroll-margin-top: 80px; }
.step:last-child { padding-bottom: 0; }
.step-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.85rem;
  border: 3px solid var(--bg);
}
.step-text { color: var(--text); font-size: 1.02rem; padding-top: 4px; }
.step-media { margin-top: 14px; }
.step-media picture { display: inline-block; }
.step-media img {
  width: 100%;
  max-width: 240px;
  height: auto;
  border: 1px solid var(--frame);
  border-radius: 14px;
  box-shadow: var(--frame-shadow);
  background: var(--surface);
}

.step-note { margin-top: 12px; color: var(--text-muted); font-size: 0.96rem; }
.step-note a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- footer ---------- */
.ft { border-top: 1px solid var(--line); margin-top: 56px; }
.ft .wrap {
  padding: 24px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
}
.ft p { color: var(--text-dim); font-size: 0.85rem; }
.ft a { font-size: 0.9rem; color: var(--text-muted); }
.ft a:hover { color: var(--text); }

.social-links { display: flex; align-items: center; gap: 4px; }
.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--text-muted);
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.social-links a:hover { background: var(--surface-2); color: var(--text); }
.social-links svg { width: 19px; height: 19px; fill: currentColor; }

@media (max-width: 600px) {
  .page { padding: 28px 0 4px; }
  #questionList { grid-template-columns: 1fr; }
  .step { padding-left: 48px; padding-bottom: 28px; }
  .step-media img { max-width: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; }
  .q-card:hover, .q-card:hover svg { transform: none; }
}
