:root {
  color-scheme: dark;
  --bg: #07080c;
  --sheet: #10131a;
  --card: #181c26;
  --card-hi: #1f2430;
  --line: #2a3040;
  --fg: #f4f6f8;
  --muted: #8d95a3;
  --gold: #d4a017;
  --accent: #3ee087;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  background: #050608;
}

#app {
  min-height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  background: linear-gradient(180deg, #12151c 0%, var(--bg) 100%);
  border-bottom: 1px solid #1c212c;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  object-fit: cover;
  background: #1c1608;
  box-shadow: 0 0 0 2px var(--gold), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-name {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.brand-name span {
  color: var(--gold);
}

.brand-tag {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page {
  flex: 1;
  padding: 8px 16px 24px;
}

.hello {
  margin: 10px 0 18px;
}

.hello b {
  display: block;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.hello span {
  color: var(--muted);
  font-size: 14px;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tile {
  appearance: none;
  border: 0;
  text-align: left;
  background: var(--card);
  color: inherit;
  border-radius: 20px;
  min-height: 118px;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 0 0 1px var(--line);
}

.tile.wide { grid-column: 1 / -1; min-height: 86px; flex-direction: row; align-items: center; gap: 14px; }
.tile:active { background: var(--card-hi); transform: scale(0.985); }

.glyph {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #222836;
  color: var(--gold);
  font-size: 16px;
  font-weight: 800;
}

.tile-label {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
}

.tile-hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.list {
  display: grid;
  gap: 8px;
}

.row {
  appearance: none;
  width: 100%;
  border: 0;
  background: var(--card);
  color: inherit;
  border-radius: 16px;
  min-height: 64px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--line);
}

.row:active { background: var(--card-hi); }
.row .grow { flex: 1; }
.row .chev { color: var(--muted); font-size: 18px; }

.back {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 15px;
  font-weight: 650;
  padding: 8px 0 14px;
}

.stack { display: grid; gap: 10px; }

input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  font: inherit;
}

.cta {
  appearance: none;
  border: 0;
  border-radius: 14px;
  min-height: 50px;
  background: var(--gold);
  color: #1a1404;
  font-weight: 750;
  font-size: 16px;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.hidden { display: none; }
.err { color: #ff8b8b; }
.note { color: var(--muted); font-size: 14px; line-height: 1.45; }

textarea, select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  font: inherit;
}

.lbl {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cta:disabled { opacity: 0.55; }
.cta.danger { background: #d45b4a; color: #fff8f6; }

.pills { display: flex; gap: 8px; }
.pill {
  appearance: none;
  flex: 1;
  border: 0;
  min-height: 40px;
  border-radius: 12px;
  background: var(--card);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 650;
}
.pill.on { background: #2a2414; box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold); }
.row.static { pointer-events: none; }

.explain {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.explain b { color: var(--fg); font-weight: 650; }

.filter-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}

.ghost {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-weight: 650;
  font-size: 13px;
  padding: 4px 0;
  flex-shrink: 0;
}

.row-main {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  flex: 1;
  min-width: 0;
  padding: 0;
}
