:root {
  --navy: #00264d;
  --navy-2: #01356a;
  --blue: #00c7ff;
  --blue-deep: #0099c7;
  --ink: #00264d;
  --muted: #5c6e86;
  --bg: #f3f6fb;
  --card: #ffffff;
  --line: #e1e8f2;
  --ok: #0c8f62;
  --warn: #9a6700;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(0, 38, 77, 0.08);
  --radius: 18px;
  --nav: 72px;
  font-family: "Segoe UI", "Avenir Next", "Nunito Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { padding-bottom: calc(var(--nav) + 28px + env(safe-area-inset-bottom)); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy-2); text-decoration: underline; text-underline-offset: 2px; }
a.card, a.btn, a.brand, .nav a { text-decoration: none; }

.shell { max-width: 920px; margin: 0 auto; padding: 16px 16px 28px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand img { width: 46px; height: 46px; object-fit: contain; }
.brand strong { font-size: 1.2rem; letter-spacing: -0.04em; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; gap: 12px; align-items: center; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 12px;
}
.hero {
  background: radial-gradient(120% 90% at 100% 0%, #00c7ff 0%, #046 42%, #00264d 78%);
  color: white;
  border: 0;
}
.hero .muted, .hero a { color: rgba(255,255,255,.82); }
.hero h1 { margin: 8px 0; font-size: 1.7rem; letter-spacing: -0.04em; }

h1, h2, h3 { letter-spacing: -0.03em; margin: 0 0 8px; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }

.btn, .tab {
  border: 0; border-radius: 999px; padding: 12px 16px; background: white; color: var(--navy);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; font-weight: 700;
}
.btn-primary { background: var(--blue); color: var(--navy); }
.btn-navy { background: var(--navy); color: white; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-danger { background: #fde8e6; color: var(--danger); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.full { width: 100%; }

input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: #f8fbff; border-radius: 12px;
  padding: 12px 14px; margin: 6px 0;
}
textarea { min-height: 90px; resize: vertical; }
label { font-size: .86rem; font-weight: 700; }

.banner {
  background: #e7f9ff; color: var(--navy); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px;
  font-size: .92rem;
}
.badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px;
  background: #e7f0fa; color: var(--navy); font-size: .75rem; font-weight: 800; letter-spacing: .02em;
}
.badge-demo { background: #fff4d6; color: #7a5400; }
.badge-pro { background: var(--blue); color: var(--navy); }
.badge-ok { background: #e5f8ef; color: var(--ok); }
.badge-warn { background: #fff4d6; color: var(--warn); }

.price { font-variant-numeric: tabular-nums; font-weight: 800; }
.unit { color: var(--blue-deep); font-weight: 800; }
.offer { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.offer:first-of-type { border-top: 0; }
.stack { display: grid; gap: 8px; }
.grid-2 { display: grid; gap: 12px; }
.searchbar { display: flex; gap: 8px; }
.searchbar input { margin: 0; }

.level-track { height: 8px; background: #d7e3f1; border-radius: 99px; overflow: hidden; }
.level-track span { display: block; height: 100%; background: var(--blue); }

.chart { width: 100%; height: 160px; }
.tabs { display: flex; gap: 8px; overflow: auto; margin-bottom: 12px; }
.chat { display: grid; gap: 8px; }
.bubble { padding: 10px 12px; border-radius: 14px; background: #eef4fb; }
.bubble.user { background: var(--navy); color: white; margin-left: 18%; }
.bubble.assistant { margin-right: 12%; }

.video-wrap { position: relative; border-radius: 16px; overflow: hidden; background: #001226; aspect-ratio: 16/10; max-height: 280px; }
.video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.check-ok { color: var(--ok); font-weight: 700; }
.check-bad { color: var(--danger); font-weight: 700; }
.error { color: var(--danger); min-height: 1.2em; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: white; border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.nav a {
  text-decoration: none; color: var(--muted); text-align: center; font-size: .72rem; font-weight: 700;
  padding: 6px 2px; border-radius: 12px;
}
.nav a.active { color: var(--navy); background: #e7f9ff; }
.nav .scan {
  width: 44px; height: 44px; margin: 0 auto; border-radius: 14px;
  background: var(--navy); color: var(--blue); display: grid; place-items: center; font-size: 1.05rem;
}

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table td:first-child { white-space: nowrap; }
.table th { text-align: left; color: var(--muted); font-size: .75rem; }
.table td, .table th { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }

@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 220px; }
  .nav {
    top: 0; bottom: 0; left: 0; right: auto; width: 200px;
    display: flex; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 18px 10px;
  }
  .nav a { text-align: left; font-size: .95rem; padding: 10px 12px; }
  .nav .scan { width: auto; height: auto; margin: 0; background: var(--navy); color: white; }
  .shell { padding-top: 28px; }
  .grid-2 { grid-template-columns: 1.2fr .8fr; }
}
