/* Design tokens lifted from the Claude Design mockup (Loch Mini App.dc.html) —
   same palette/spacing, just without the fake phone-frame chrome, which was
   only there to preview the mockup as a screenshot inside the editor. Real
   theme (light/dark) is driven by Telegram itself (see app.js), not a
   manual switch. */

:root {
  --bg: #ffffff;
  --bg2: #f2f3f7;
  --card: #ffffff;
  --text: #0d1117;
  --hint: #8b95a3;
  --sep: rgba(13, 17, 23, .08);
  --accent: #6f9fd0;
  --accentSoft: rgba(111, 159, 208, .12);
  --pink: #dcaecb;
  --danger: #c4697d;
  --shadow: 0 1px 2px rgba(13, 17, 23, .06), 0 8px 24px rgba(13, 17, 23, .05);
}
[data-theme="dark"] {
  --bg: #151b23;
  --bg2: #0e131a;
  --card: #1c242e;
  --text: #eef1f5;
  --hint: #7d8894;
  --sep: rgba(255, 255, 255, .09);
  --accent: #8fb4da;
  --accentSoft: rgba(143, 180, 218, .16);
  --pink: #e3c0d6;
  --danger: #e3899b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Golos Text', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
input, textarea, button { font-family: inherit; }
input:focus, textarea:focus { outline: none; }
a { color: var(--accent); }
button { -webkit-tap-highlight-color: transparent; }

@keyframes lochIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.anim { animation: lochIn .28s ease both; }

#app { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

/* ── Header ─────────────────────────────────────────────────────────── */
.header {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--sep); background: var(--bg);
}
.icon-btn {
  width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer;
  color: var(--text); padding: 0; display: flex; align-items: center; justify-content: center; position: relative;
}
.icon-btn.back { color: var(--accent); font-size: 20px; }
.header-title { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.header-title span:first-child { font-size: 15px; font-weight: 600; }
.header-title span:last-child { font-size: 10.5px; color: var(--hint); }
.dot { position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, #8fb4da, #e3c0d6); }

/* ── Body / screens ─────────────────────────────────────────────────── */
.screen { flex: 1; overflow-y: auto; background: var(--bg2); }
.screen-pad { padding: 18px 16px 26px; display: flex; flex-direction: column; gap: 14px; }

.card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
.section-label {
  font-size: 12px; font-weight: 600; color: var(--hint); letter-spacing: .04em;
  text-transform: uppercase; padding: 2px 4px 0; display: flex; justify-content: space-between; align-items: baseline;
}

.btn-primary {
  border: 0; border-radius: 15px; padding: 14px; font-size: 14.5px; font-weight: 600;
  color: #fff; cursor: pointer; background: linear-gradient(135deg, #8fb4da, #e3c0d6); width: 100%;
}
.btn-secondary {
  border: 1px solid var(--sep); background: transparent; color: var(--text);
  border-radius: 14px; padding: 13px; font-size: 14.5px; cursor: pointer;
}
.btn-danger {
  border: 0; background: var(--danger); color: #fff; border-radius: 12px;
  padding: 11px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; width: 100%;
}
.pill { border: 0; border-radius: 999px; padding: 8px 14px; font-size: 12.5px; cursor: pointer; }
.field {
  width: 100%; border: 1px solid var(--sep); background: var(--bg2); border-radius: 14px;
  padding: 15px; font-size: 16px; color: var(--text);
}

/* ── Tab bar ────────────────────────────────────────────────────────── */
.tabbar {
  flex: none; display: flex; background: var(--bg); border-top: 1px solid var(--sep);
  padding: 7px 6px calc(20px + env(safe-area-inset-bottom, 0px));
}
.tab {
  flex: 1; border: 0; background: transparent; cursor: pointer; display: flex;
  flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--hint);
}
.tab.active { color: var(--accent); }
.tab span { font-size: 10px; }
.tab-icon { font-size: 20px; line-height: 1; }

/* ── Sheet (bottom modal) ───────────────────────────────────────────── */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(10, 14, 20, .45);
  display: flex; align-items: flex-end; z-index: 20;
}
.sheet {
  width: 100%; background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 18px 18px calc(28px + env(safe-area-inset-bottom, 0px));
}
.sheet-handle { width: 38px; height: 4px; border-radius: 2px; background: var(--sep); margin: 0 auto 14px; }

/* ── Onboarding ─────────────────────────────────────────────────────── */
.onb { position: fixed; inset: 0; background: var(--bg); z-index: 30; display: flex; flex-direction: column; }
.onb-bars { flex: none; display: flex; gap: 5px; padding: calc(20px + env(safe-area-inset-top, 0px)) 20px 0; }
.onb-bar { flex: 1; height: 3px; border-radius: 2px; background: var(--sep); }
.onb-bar.done { background: var(--accent); }
.onb-body { flex: 1; overflow-y: auto; padding: 26px 20px 10px; }
.onb-footer { flex: none; padding: 12px 20px calc(26px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 10px; }
.onb-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.onb-sub { font-size: 14px; color: var(--hint); margin-top: 8px; line-height: 1.5; }

.empty { text-align: center; color: var(--hint); font-size: 13px; padding: 30px 0; }
.error-text { color: var(--danger); font-size: 13px; margin-top: 8px; }
