:root {
  --ink: #010521;
  --muted: #6b7085;
  --line: rgba(1, 5, 33, 0.1);
  --blue: #d9ebff;
  --bg: #f4f6f8;
  --danger: #9f2d2d;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body, #app { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(900px 480px at 50% 80px, #e7eef8 0%, rgba(244, 246, 248, 0) 70%),
    var(--bg);
  color: var(--ink);
  font-family: Geist, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

button, input { font: inherit; color: inherit; }
input { font-size: 16px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

:focus-visible {
  outline: 2px solid rgba(1, 5, 33, 0.7);
  outline-offset: 2px;
}

.nav-wrap {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(1080px, 100%);
  padding: 6px 6px 6px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(1, 5, 33, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  background: transparent;
  padding: 0;
}

.brand img { width: 22px; height: 22px; border-radius: 6px; }

.links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.links button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 999px;
}

.links button:hover,
.links button.is-on { color: var(--ink); }
.links button.is-on { background: #f3f4f6; }

.nav-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.btn-blue { background: var(--blue); border-color: transparent; }
.btn-quiet { border-color: transparent; color: var(--muted); }
.btn-danger { color: var(--danger); }

.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 72px; }

.hero { max-width: 640px; margin-bottom: 28px; }
.hero h1, .login-card h1 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.12;
}
.hero h1 { font-size: clamp(34px, 5vw, 52px); }
.lede, .hint { margin: 12px 0 0; color: var(--muted); }
.hint { font-size: 14px; }

.drop {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 168px;
  margin-bottom: 28px;
  padding: 28px 20px;
  background: #fff;
  border: 1px dashed rgba(1, 5, 33, 0.18);
  border-radius: 22px;
  text-align: center;
  cursor: pointer;
}
.drop.is-over { background: #eef5ff; border-color: #8eb7ff; }
.drop strong { font-weight: 600; }
.drop span { color: var(--muted); font-size: 14px; }

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card, .login-card, .panel, .empty, .dialog {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(1, 5, 33, 0.04);
}

.card { padding: 8px 8px 18px; overflow: hidden; min-width: 0; }
.card-media {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
  border-radius: 16px;
  background: #eef1f4;
}
.card video.card-media { background: #010521; }
.card-icon {
  display: grid;
  place-items: center;
  height: 168px;
  border-radius: 16px;
  background: #eef1f4;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card h3 {
  margin: 14px 10px 4px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card p, .share {
  margin: 0 10px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share { display: block; color: var(--muted); text-decoration: none; }
.share:hover { color: var(--ink); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 10px 0; }
.card-actions .btn { height: 34px; padding: 0 12px; font-size: 13px; }

.progress {
  width: 100%;
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: #eef1f4;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  background: #2f6fe4;
  width: 0;
}

.empty { margin: 0; padding: 22px; color: var(--muted); }

.login-wrap {
  min-height: 100dvh;
  display: grid;
  align-content: start;
  gap: 48px;
  padding: 0 0 48px;
}
.login-card {
  width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 28px;
}
.login-card h1 { font-size: 32px; }
.form { display: grid; gap: 12px; margin-top: 22px; }
.lbl { display: grid; gap: 6px; font-size: 13px; font-weight: 500; }
.field {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
}
.alert { margin: 0; color: var(--danger); font-size: 14px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 13px;
  font-weight: 500;
}
.chip-on { background: #d7f3e4; }
.panel { padding: 22px; display: grid; gap: 12px; }
.panel h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.qr { width: 220px; height: 220px; border-radius: 16px; background: #fff; }
.secret {
  margin: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
}
.codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.codes code {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3f4f6;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(1, 5, 33, 0.18);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1, 5, 33, 0.28);
}
.dialog { width: min(420px, 100%); padding: 24px; }
.dialog h2 { margin: 0 0 8px; font-size: 22px; }
.dialog p { margin: 0 0 18px; color: var(--muted); }

.mobile-only { display: none; }

@media (max-width: 800px) {
  .cards, .codes { grid-template-columns: 1fr; }
  .hero { padding-top: 12px; }
  .shell { padding-top: 32px; }
  .card-media, .card-icon { height: 140px; }
  .nav { width: 100%; }
  .links { display: none; }
  .mobile-only { display: inline-flex; }
}
