:root {
  --bg: #0d1116;
  --surface: #171d24;
  --surface-soft: #202832;
  --ink: #f5f7f8;
  --muted: #aab4bd;
  --line: #2d3742;
  --line-strong: #536171;
  --brand: #ff5a2f;
  --accent: #ffb03a;
  --water: #37b7e4;
  --ok: #3ddc97;
  --grad-fire: linear-gradient(120deg, #ff5a2f, #ffb03a);
  --grad-fw: linear-gradient(120deg, #ff5a2f 0%, #ffb03a 45%, #37b7e4 100%);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Inter", system-ui, -apple-system, sans-serif; }
body { min-height: 100dvh; }
h1, h2, h3 { font-family: "Space Grotesk", "Inter", sans-serif; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }

/* app header */
.app-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: max(env(safe-area-inset-top, 0px), 10px) 12px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.app-bar .back {
  font-size: 1.5rem; line-height: 1; color: var(--accent); font-weight: 700;
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; text-decoration: none;
}
.app-bar .back:active { background: rgba(255,176,58,0.14); }
.app-bar > div:not(.back) { min-width: 0; }
.app-bar img { width: 28px; height: 28px; border-radius: 7px; }
.app-bar .title { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.05rem; }
.app-bar .sub { color: var(--muted); font-size: 0.78rem; }

/* launcher */
.launcher-hero { padding: 26px 18px 8px; }
.launcher-hero h1 { margin: 0 0 6px; font-size: 1.7rem; }
.launcher-hero .grad { background: var(--grad-fw); -webkit-background-clip: text; background-clip: text; color: transparent; }
.launcher-hero p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 18px calc(28px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 620px) { .tool-grid { grid-template-columns: repeat(3, 1fr); max-width: 760px; margin: 0 auto; } }
.tool-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 16px; min-height: 116px; transition: transform .12s ease, border-color .2s ease;
}
.tool-card:active { transform: scale(0.97); }
.tool-card .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.25rem; background: var(--grad-fire); color: #1a0d06; }
.tool-card h3 { margin: 0; font-size: 1rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.tool-card.soon { opacity: 0.55; }
.tool-card.soon .ic { background: var(--surface-soft); color: var(--muted); }
.badge-soon { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); font-weight: 700; }

/* generic tool page */
.tool-page { padding: 18px 18px calc(40px + env(safe-area-inset-bottom, 0px)); max-width: 640px; margin: 0 auto; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.field input, .field select {
  width: 100%; font-size: 1.05rem; padding: 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font-family: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--water); box-shadow: 0 0 0 3px rgba(55,183,228,0.2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.btn { width: 100%; font-size: 1.05rem; font-weight: 700; padding: 15px; border: 0; border-radius: 13px; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--grad-fire); color: #1a0d06; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.result-card {
  margin-top: 18px; background: linear-gradient(135deg, rgba(255,90,47,0.08), transparent 60%, rgba(55,183,228,0.08)), var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 20px;
}
.result-card .big { font-family: "Space Grotesk", sans-serif; font-size: 2rem; font-weight: 700; }
.result-card .lbl { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.result-row { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); font-size: 0.95rem; }
.result-row:first-child { border-top: 0; }
.result-row .v { font-weight: 700; }
.hint { color: var(--line-strong); font-size: 0.82rem; margin-top: 14px; line-height: 1.4; }
.install-tip { margin: 0 18px 18px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 0.82rem; }
