:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --ink: #111111;
  --mute: #666666;
  --line: #dddddd;
  --soft: #eeeeee;
  --btn: #222222;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #cf222e;
  --offline: #fff8c5;
  --offline-ink: #7d4e00;
  --radius: 10px;
  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { overflow-x: hidden; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #e8e8e8;
  overflow-x: hidden;
}

.demo-chrome {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: #1c1c1c;
  color: #f5f5f5;
  font-size: 13px;
  max-width: 100%;
}
.demo-chrome > div:first-child {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-chrome strong { font-weight: 700; }
.demo-chrome .meta { color: #bbbbbb; margin-left: 8px; }
.demo-chrome nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  max-width: min(720px, 58vw);
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.demo-chrome a {
  color: #f5f5f5;
  text-decoration: none;
  border: 1px solid #444;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.demo-chrome a:hover,
.demo-chrome a.active { background: #333; border-color: #777; }

.screen { display: none; min-height: calc(100vh - 52px); }
.screen.active { display: block; }

.desktop {
  max-width: 1120px;
  margin: 0 auto;
  background: var(--bg);
  min-height: calc(100vh - 52px);
}
.desktop.wide { max-width: none; }
.desktop.landing {
  max-width: 1120px;
  width: 100%;
  overflow-x: clip;
}
.landing-shell {
  width: min(960px, calc(100% - 48px));
  margin: 0 auto;
  padding-bottom: 8px;
}

.phone-wrap {
  min-height: calc(100vh - 52px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 12px 40px;
  background: #dcdcdc;
}
.phone {
  width: 390px;
  max-width: 100%;
  background: var(--bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.desktop.landing {
  display: flex;
  flex-direction: column;
}
.desktop.landing > .topnav {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px max(24px, calc((100% - 960px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topnav .brand { font-weight: 700; font-size: 16px; flex: 0 0 auto; }
.topnav .links {
  display: flex;
  gap: 14px;
  flex-wrap: nowrap;
  color: var(--mute);
  font-size: 14px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav .links::-webkit-scrollbar { display: none; }
.topnav .links a { color: inherit; text-decoration: none; white-space: nowrap; }
.topnav .actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
@media (max-width: 900px) {
  .topnav { flex-wrap: wrap; }
  .topnav .links { order: 3; width: 100%; padding-top: 4px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  background: var(--soft);
}
.btn.primary { background: var(--btn); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.hero {
  padding: 40px 0 24px;
  max-width: none;
  margin: 0;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  max-width: 18ch;
}
.hero p { margin: 0 0 20px; color: var(--mute); font-size: 16px; line-height: 1.5; max-width: 52ch; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.hero .note { font-size: 12px; color: var(--mute); }
.hero-visual {
  height: 220px;
  margin: 8px 0 0;
  border-radius: var(--radius);
  background: var(--soft);
  width: 100%;
}

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px 0 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--mute);
  font-size: 13px;
}

.section { padding: 28px 0; max-width: none; margin: 0; }
.section h2 { margin: 0 0 6px; font-size: 22px; }
.section .sub { margin: 0 0 16px; color: var(--mute); font-size: 13px; }

.grid-3, .grid-4 {
  display: grid;
  gap: 12px;
}
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.card .icon {
  width: 36px; height: 36px;
  background: var(--soft);
  border-radius: 8px;
  margin-bottom: 10px;
}
.card h3 { margin: 0 0 6px; font-size: 15px; }
.card p { margin: 0; color: var(--mute); font-size: 13px; line-height: 1.4; }

.steps { display: grid; gap: 8px; }
.step {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.step .n {
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--btn); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; flex: 0 0 auto;
}
.step strong { display: block; margin-bottom: 2px; }
.step span { color: var(--mute); font-size: 13px; }

.cta-band {
  text-align: center;
  padding: 36px 0;
  margin: 8px 0 0;
  background: transparent;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cta-band h2 { margin: 0 0 8px; }
.cta-band p { margin: 0 0 16px; color: var(--mute); }

.packages {
  padding: 28px 0 36px;
  max-width: none;
  margin: 0;
}
.packages h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pkg-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--mute);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}
.pkg-note {
  margin: 0 0 14px;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.4;
}
.pkg-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.pkg {
  display: grid;
  gap: 6px;
  align-content: start;
  text-align: left;
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.pkg:hover { background: #e6e6e6; }
.pkg strong { font-size: 15px; }
.pkg span { font-size: 12px; color: var(--mute); }
.pkg em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--mute); margin-top: auto; }
@media (max-width: 800px) { .pkg-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .pkg-row { grid-template-columns: 1fr; } }

.footer {
  display: block;
  padding: 0;
  background: #222;
  color: #ddd;
  font-size: 13px;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
  width: min(960px, calc(100% - 48px));
}
.footer a { color: inherit; text-decoration: none; margin-right: 12px; }

.auth-shell {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.auth-shell h1 { margin: 0 0 8px; font-size: 28px; }
.auth-shell .lead { margin: 0 0 20px; color: var(--mute); font-size: 13px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--mute); font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  background: var(--surface);
}
.field textarea { min-height: 88px; resize: vertical; }

.cover {
  height: 140px;
  border-radius: var(--radius);
  background: var(--soft);
  margin-bottom: 8px;
}
.muted { color: var(--mute); font-size: 12px; }

.page-pad { padding: 24px; max-width: 920px; margin: 0 auto; }
.page-pad h1 { margin: 0 0 8px; font-size: 28px; }
.row-between {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px;
}
.tab {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.tab.active { background: var(--btn); color: #fff; border-color: var(--btn); }

.list { display: grid; gap: 10px; }
.list-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.list-item h3 { margin: 0 0 4px; font-size: 15px; }
.list-item p { margin: 0; color: var(--mute); font-size: 13px; }
.actions-inline { display: flex; gap: 8px; flex-wrap: wrap; }

.setting-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 800px) { .setting-grid { grid-template-columns: 1fr; } }
.setting-grid .card strong { display: block; font-size: 18px; margin: 4px 0; }

.two-col {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 20px;
  padding: 24px;
  max-width: 1000px;
  margin: 0 auto;
}
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.banner {
  height: 180px;
  background: var(--soft);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.reg-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.result-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 32px 24px;
  max-width: 900px;
  margin: 0 auto;
}
@media (max-width: 700px) { .result-pair { grid-template-columns: 1fr; } }
.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.result-card .slot {
  height: 100px;
  background: var(--soft);
  border-radius: 8px;
  margin: 12px 0;
}
.ticket {
  max-width: 420px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}
.qr {
  width: 180px; height: 180px;
  margin: 16px auto;
  background:
    linear-gradient(90deg, #111 25%, transparent 25%) 0 0 / 20px 20px,
    linear-gradient(#111 25%, transparent 25%) 0 0 / 20px 20px,
    #fff;
  border: 8px solid #fff;
  outline: 1px solid var(--line);
}

.phone-header {
  background: var(--surface);
  padding: 20px;
}
.phone-header h1 { margin: 0 0 6px; font-size: 22px; }
.phone-header p { margin: 0; color: var(--mute); font-size: 13px; }
.phone-body { padding: 20px; display: grid; gap: 12px; }
.camera {
  height: 220px;
  background: var(--soft);
  border-radius: 12px;
}
.status-dot {
  width: 72px; height: 72px;
  border-radius: 999px;
  margin: 8px auto 0;
}
.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.bad { background: var(--bad); }
.center { text-align: center; }
.offline-banner {
  background: var(--offline);
  color: var(--offline-ink);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
}
.event-pick {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  text-align: left;
}
.event-pick.selected { border-color: var(--btn); border-width: 2px; padding: 13px; }
.event-pick strong { display: block; margin-bottom: 4px; font-size: 13px; }
.event-pick span { color: var(--mute); font-size: 11px; }

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #111;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 60;
}
.toast.show { opacity: 1; }
