@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #081016;
  --bg2: #0c171e;
  --card: #111b21;
  --card2: #162229;
  --line: #24343d;
  --text: #e9edef;
  --muted: #8696a0;
  --faint: #5b6b73;
  --green: #25d366;
  --green2: #1fb855;
  --teal: #128c7e;
  --blue: #53bdeb;
  --brand-a: #3dff8a;
  --brand-i: #4ec8ff;
  --danger: #f15c6d;
  --warn: #ffd56a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --sidebar: 260px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
button, a, .nav-item, .chat-item { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { margin: 0 0 8px; letter-spacing: -0.03em; }
p { margin: 0 0 10px; }

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 16, 22, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: #07140f;
  border: 1px solid rgba(61, 255, 138, 0.28);
  display: flex; align-items: center; justify-content: center;
  gap: 0;
  font-weight: 800; font-size: 15px;
  letter-spacing: -0.08em;
  box-shadow: 0 0 18px rgba(61, 255, 138, 0.18);
}
.brand-word { letter-spacing: 0.08em; }
.brand span { color: inherit; }
.ch-a {
  color: var(--brand-a) !important;
  font-weight: 800;
  text-shadow: 0 0 14px rgba(61, 255, 138, 0.55);
}
.ch-i {
  color: var(--brand-i) !important;
  font-weight: 800;
  text-shadow: 0 0 14px rgba(78, 200, 255, 0.6);
}
.topnav .links { display: flex; gap: 18px; }
.topnav .links a { color: var(--muted); font-weight: 600; font-size: 14px; }
.topnav .links a:hover { color: var(--text); }
.grow { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--card2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; cursor: pointer; font-weight: 650; font-size: 14px;
  transition: 0.15s ease;
}
.btn:hover { border-color: var(--green); }
.btn.primary { background: var(--green); color: #052012; border: none; }
.btn.primary:hover { background: #2be070; }
.btn.ghost { background: transparent; }
.btn.danger { background: #3a151c; color: #ffc0c8; border-color: #5a2430; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px;
  align-items: center; padding: 56px 0 32px;
}
.kicker {
  display: inline-flex; gap: 8px; align-items: center;
  color: var(--green); font-weight: 700; font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 14px;
}
.hero h1 { font-size: 52px; line-height: 1.08; font-weight: 800; }
.hero .lead { color: var(--muted); font-size: 18px; max-width: 540px; }
.hero-card {
  background: linear-gradient(180deg, #162229, #111b21);
  border: 1px solid var(--line); border-radius: 24px; padding: 22px;
  box-shadow: var(--shadow);
}
.mock-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mock-row:last-child { border-bottom: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(37,211,102,.15); }
.dot.off { background: var(--faint); box-shadow: none; }

.section { padding: 28px 0 8px; }
.section h2 { font-size: 28px; margin-bottom: 6px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { font-size: 17px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 13px; }
.price { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; }
.price small { font-size: 14px; color: var(--muted); font-weight: 600; }
.featured { border-color: var(--green); box-shadow: 0 0 0 1px rgba(37,211,102,.25); position: relative; }
.ribbon {
  position: absolute; top: 14px; right: 14px;
  background: var(--green); color: #052012;
  font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 999px;
}

.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; margin: 12px 0; font-weight: 600;
}
.flash.ok { background: #0d3b24; color: var(--green); }
.flash.err { background: #3b1518; color: #ffb4bc; }
.flash.info { background: #132832; color: var(--blue); }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; font-weight: 600; }
.field { width: 100%; max-width: 100%;
  background: #0e181e; color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; outline: none;
}
.field:focus { border-color: var(--green); }
textarea.field { min-height: 110px; resize: vertical; }
.switch {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin: 10px 0;
  background: #0e181e;
}
.switch input { margin-top: 3px; accent-color: var(--green); width: 18px; height: 18px; }
.switch b { display: block; }
.switch span { color: var(--muted); font-size: 13px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--faint); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:hover td { background: rgba(255,255,255,.02); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: #202c33; color: var(--muted);
}
.badge.on { background: #0d3b24; color: var(--green); }
.badge.wait { background: #3b2f0d; color: var(--warn); }
.badge.err { background: #3b1518; color: #ffb4bc; }
.badge.blue { background: #123040; color: var(--blue); }

.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.sidebar .nav-list { margin-top: 22px; display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 12px; color: var(--muted); font-weight: 600;
}
.nav-item:hover { background: #162229; color: var(--text); }
.nav-item.active { background: #162229; color: var(--green); }
.nav-ico { width: 18px; text-align: center; opacity: .85; }
.mode-switch {
  display: flex; gap: 2px; margin-top: 16px; flex-shrink: 0;
  background: #0e181e; border: 1px solid var(--line); border-radius: 12px; padding: 3px;
}
.mode-switch a {
  flex: 1; text-align: center; padding: 8px 6px; border-radius: 9px;
  font-weight: 700; font-size: 11px; color: var(--muted); letter-spacing: .01em;
  cursor: pointer; display: block;
}
.mode-switch a.on { background: #162229; color: var(--green); }
.role-pill {
  display: inline-block; margin-top: 16px; font-size: 11px; font-weight: 700;
  color: var(--green); background: #1c3a32; padding: 6px 10px; border-radius: 99px;
}
.table-plain { width: 100%; border-collapse: collapse; }
.table-plain th, .table-plain td {
  text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top;
}
.table-plain th { color: var(--muted); font-weight: 700; }
.side-foot { margin-top: auto; padding: 16px 8px; color: var(--faint); font-size: 12px; flex-shrink: 0; }
.main { min-width: 0; overflow-x: hidden; }
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card2); color: var(--text);
  font-size: 20px; cursor: pointer; flex-shrink: 0;
  place-items: center;
}
.nav-scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 30;
}
.chat-back { display: none; }
.thread-head { display: flex; align-items: center; gap: 10px; }
.mainbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,16,22,.7);
  position: sticky; top: 0; z-index: 8;
}
.crumbs { color: var(--faint); font-size: 13px; }
.userchip { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.avatar {
  width: 36px; height: 36px; border-radius: 12px;
  background: #1c3a32; color: var(--green); display: grid; place-items: center; font-weight: 800;
}
.content { padding: 24px 28px 64px; }

.stat { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.stat-card { padding: 18px; }
.learn-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.learn-tag {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.learn-tag.on { border-color: var(--green); color: var(--green); }
.learn-bar {
  height: 8px;
  background: var(--card2);
  border-radius: 99px;
  overflow: hidden;
  margin: 4px 0 8px;
}
.learn-bar span { display: block; height: 100%; background: var(--green); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.space { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 22px; }
.step { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #0e181e; }
.step.on { border-color: var(--green); }
.step b { display: block; }
.qr {
  background: #fff; padding: 16px; border-radius: 18px;
  display: inline-block; box-shadow: var(--shadow);
}
.pair-code {
  font-size: 28px; letter-spacing: 0.28em; font-weight: 800;
  background: #0e181e; padding: 12px 16px; border-radius: 12px; display: inline-block;
}

.chat-layout { display: grid; grid-template-columns: 320px 1fr; min-height: 640px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.chat-list { background: #0e181e; border-right: 1px solid var(--line); overflow: auto; }
.chat-item { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.chat-item:hover, .chat-item.active { background: #162229; }
.chat-item .preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; background: #0b141a; }
.thread-head { padding: 14px 18px; border-bottom: 1px solid var(--line); background: #111b21; }
.bubbles { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.bubble { max-width: 72%; padding: 10px 12px; border-radius: 14px; font-size: 14px; }
.bubble.in { background: #202c33; align-self: flex-start; }
.bubble.out { background: #005c4b; align-self: flex-end; }
.composer { padding: 12px; border-top: 1px solid var(--line); background: #111b21; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 16px; background: #0e181e; border-radius: 14px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bars .col i { display: block; width: 100%; max-width: 36px; background: linear-gradient(180deg, var(--green), var(--teal)); border-radius: 8px 8px 0 0; min-height: 4px; }
.bars .col span { font-size: 11px; color: var(--muted); margin-top: 8px; text-align: center; }

.empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty h3 { color: var(--text); margin-bottom: 8px; }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.catalog-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0e181e;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.catalog-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  background: #162229;
}
.catalog-pdf {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #162229;
  color: var(--muted);
  font-weight: 700;
}
.profile-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.profile-row {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  color: inherit; text-decoration: none;
}
.profile-row.on { border-color: var(--green); background: #122018; }
.check-grid { display: grid; gap: 6px; margin-top: 8px; }
.city-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.city-toolbar .field { max-width: 240px; margin: 0; }
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e181e;
}
.city-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.city-chip:hover { background: #162229; }
.city-chip input { margin: 0; }
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.check { list-style: none; padding: 0; margin: 0; }
.check li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check .ok { color: var(--green); font-weight: 800; }
.check .no { color: var(--faint); font-weight: 800; }
.progress {
  height: 8px; background: #0e181e; border-radius: 99px; overflow: hidden; margin-top: 8px;
}
.progress > b { display: block; height: 100%; background: var(--green); }

.auth-split { display: grid; grid-template-columns: 1.05fr .95fr; min-height: calc(100vh - 64px); }
.auth-copy { padding: 64px 56px; }
.auth-form { padding: 64px 56px; background: var(--bg2); border-left: 1px solid var(--line); }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 8px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.footer-bar { color: var(--faint); font-size: 12px; margin-top: 48px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.activity { font-size: 13px; }
.activity li { padding: 8px 0; border-bottom: 1px solid var(--line); list-style: none; }
.hat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

@media (max-width: 1100px) {
  .hero, .auth-split, .grid-4, .grid-3, .grid-2, .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .auth-copy, .auth-form { padding: 28px 20px; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .nav-toggle { display: grid; }
  .nav-scrim.show { display: block; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(86vw, 300px);
    height: 100dvh;
    z-index: 40;
    transform: translateX(-110%);
    transition: transform .22s ease;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-y: auto;
    padding: calc(14px + env(safe-area-inset-top)) 14px 24px;
    border-right: 1px solid var(--line);
    border-bottom: none;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar .nav-list {
    flex-direction: column;
    flex-wrap: nowrap;
    margin-top: 18px;
    overflow: visible;
  }
  .nav-item { min-height: 44px; }
  .side-foot { display: block; }
  .mode-switch, .role-pill { margin-top: 12px; }
  .mainbar { padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .content, .wrap { padding: 16px 14px calc(48px + env(safe-area-inset-bottom)); }
  .userchip > div:first-child { display: none; }
  .chat-layout {
    grid-template-columns: 1fr;
    min-height: calc(100dvh - 150px);
  }
  .chat-layout.has-thread .chat-list { display: none; }
  .chat-layout:not(.has-thread) .thread { display: none; }
  .chat-back { display: inline-flex; }
  .bubble { max-width: 88%; }
  .topnav {
    flex-wrap: wrap;
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top));
  }
  .topnav .links {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 4px;
  }
  .topnav.menu-open .links { display: flex; }
  .hat-grid { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .pair-code { font-size: 18px; letter-spacing: .12em; }
  .qr { max-width: 100%; }
  .qr img { max-width: min(100%, 260px); height: auto; }
}

@media (max-width: 640px) {
  .hero { padding: 28px 0 16px; gap: 24px; }
  .hero h1 { font-size: 28px; }
  .hero .lead { font-size: 16px; }
  .stat { font-size: 24px; }
  .price { font-size: 26px; }
  .btn { min-height: 44px; }
  .field, select.field, textarea.field, input.field {
    font-size: 16px;
  }
  .mainbar h2 { font-size: 18px; }
  .crumbs { display: none; }
  .composer { flex-wrap: nowrap; }
  .composer .field { min-width: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .auth-split { min-height: auto; }
  .city-toolbar .field { max-width: none; flex: 1 1 100%; }
  .city-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: 220px; }
}
