:root {
  --bg: #e8eef6;
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --font: "Manrope", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse at top left, rgba(37,99,235,0.12), transparent 45%),
    var(--bg);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; }

.demo-bar {
  display: flex; justify-content: space-between;
  padding: 0.55rem 1.2rem; background: #0f172a; color: #f8fafc; font-size: 0.82rem;
}
.demo-bar a { color: #93c5fd; font-weight: 700; }

.stage {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.2rem 3.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}
.kicker {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.intro h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  font-weight: 800;
}
.intro > p { color: var(--muted); max-width: 28rem; }
.hints { padding-left: 1.1rem; color: var(--muted); }
.hints li { margin: 0.35rem 0; }
.mail {
  display: inline-flex;
  margin-top: 1rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.phone-wrap {
  position: relative;
  padding-bottom: 2.5rem;
}
.phone {
  width: min(100vw - 2rem, 340px);
  height: min(720px, calc(100vh - 110px));
  min-height: 620px;
  border-radius: 42px;
  background: #0b1220;
  padding: 12px 12px 10px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.phone-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 30px;
  overflow: hidden;
  background: #fff;
}
.status-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.55rem 0.9rem 0.35rem;
  background: #eff6ff;
}
.screen-stack {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.screen {
  display: none;
  position: absolute;
  inset: 0;
  overflow: auto;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  padding: 0.9rem 1.1rem 1.1rem;
}
.screen.is-active { display: block; animation: fade 0.25s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.hi { margin: 0; color: var(--muted); font-size: 0.88rem; }
.screen h2 {
  margin: 0.2rem 0 1rem;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}
.sub { margin: -0.4rem 0 1rem; color: var(--muted); }
.stat {
  background: #fff;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(15,23,42,0.06);
}
.stat span { display: block; color: var(--muted); font-size: 0.8rem; }
.stat strong { font-size: 2rem; letter-spacing: -0.03em; }
.progress {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  margin: 0.8rem 0 1rem;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  border-radius: inherit;
  transition: width 0.35s ease;
}
.card-btn, .mini, .primary-full, .routine {
  width: 100%;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  font-weight: 700;
  text-align: left;
}
.card-btn { background: #dbeafe; color: #1d4ed8; margin-bottom: 0.8rem; }
.card.dark {
  background: #0f172a;
  color: #fff;
  border-radius: 18px;
  padding: 1rem;
}
.card.dark span { display: block; opacity: 0.65; font-size: 0.78rem; }
.card.dark strong { display: block; margin: 0.25rem 0 0.8rem; }
.mini {
  background: #fff;
  color: #0f172a;
  text-align: center;
  width: auto;
  padding: 0.55rem 0.9rem;
}
.card.dark.is-on { background: #1d4ed8; }

.routine-list { display: grid; gap: 0.6rem; }
.routine {
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.routine strong { display: block; }
.routine small { color: var(--muted); font-weight: 500; }
.routine .state {
  font-size: 0.78rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
}
.routine.is-running { border-color: rgba(37,99,235,0.35); background: #eff6ff; }
.routine.is-running .state { background: #2563eb; color: #fff; }

.screen[data-screen="map"] {
  padding: 0;
  background: #0f172a;
  display: none;
  flex-direction: column;
}
.screen[data-screen="map"].is-active { display: flex; }
.map {
  position: relative;
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(circle at 50% 55%, rgba(96,165,250,0.35), transparent 30%),
    linear-gradient(160deg, #1e293b, #0f172a);
}
.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  background: transparent;
  font-size: 1.3rem;
  transition: transform 0.15s ease;
}
.pin:hover, .pin.is-active { transform: translate(-50%, -110%) scale(1.15); }
.you {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #38bdf8;
  border: 3px solid #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 8px rgba(56,189,248,0.2);
}
.sheet {
  flex-shrink: 0;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 1rem 1.1rem 1.1rem;
}
.sheet p { margin: 0.25rem 0 0.9rem; color: var(--muted); }
.primary-full {
  background: #0f172a;
  color: #fff;
  text-align: center;
}
.primary-full:disabled { opacity: 0.4; cursor: not-allowed; }
.primary-full.is-live { background: #2563eb; }

.tabbar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  padding: 0.45rem;
  background: #fff;
  border-top: 1px solid rgba(15,23,42,0.08);
  margin: 0;
}
.tab {
  padding: 0.75rem 0.4rem;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}
.tab.is-active { background: #eff6ff; color: #1d4ed8; }

.home-indicator {
  flex-shrink: 0;
  width: 118px;
  height: 5px;
  margin: 10px auto 2px;
  border-radius: 999px;
  background: #334155;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 0);
  background: #0f172a;
  color: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 5;
}

@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; justify-items: center; }
  .intro { text-align: center; }
  .hints { display: inline-block; text-align: left; }
  .phone {
    height: min(680px, calc(100vh - 90px));
    min-height: 560px;
  }
}
