:root {
  --bg: #000;
  --surface: #111;
  --surface-2: #1b1b1b;
  --line: #303030;
  --text: #fff;
  --muted: #a3a3a3;
  --accent: #d3ff3e;
  --danger: #ff8d8d;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button, input { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--accent);
  color: #000;
}

.skip-link:focus { top: 12px; }

#app { height: 100dvh; }

.login-shell,
.product-shell {
  width: 100%;
  height: 100dvh;
  min-height: 0;
}

.login-shell {
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 80% 10%, rgba(211, 255, 62, .14), transparent 32%),
    #000;
}

.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
}

.wordmark {
  margin: 0;
  font: 800 52px/0.9 Impact, "Arial Narrow", sans-serif;
  letter-spacing: .04em;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.login-card h1,
.area-card h1 {
  margin: 0;
  font: 800 44px/.94 Impact, "Arial Narrow", sans-serif;
  letter-spacing: .015em;
}

.supporting {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.login-form { display: grid; gap: 12px; }

.field { display: grid; gap: 7px; }
.field span { color: var(--muted); font-size: 13px; font-weight: 700; }
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 15px;
  background: var(--surface);
  color: var(--text);
  outline: 0;
}
.field input:focus { border-color: var(--accent); }

.primary,
.secondary,
.quiet {
  min-height: 46px;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 850;
}

.primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #000;
}

.primary:disabled { cursor: default; opacity: .45; }

.secondary {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.quiet {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.form-error { min-height: 20px; color: var(--danger); font-size: 13px; }

.product-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding-top: env(safe-area-inset-top);
}

.app-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.app-header .wordmark { font-size: 34px; }
.account { min-width: 0; display: grid; justify-items: end; gap: 2px; }
.account-email {
  max-width: min(52vw, 310px);
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 16px 20px;
  overflow: hidden;
}

.area-card {
  width: min(100%, 680px);
  max-height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
}

.status-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.pill::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}
.pill.online { color: var(--text); }
.pill.online::before { background: var(--accent); box-shadow: 0 0 10px rgba(211, 255, 62, .65); }

.panel {
  min-height: 0;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: linear-gradient(145deg, var(--surface), #090909);
}

.panel-title { margin: 0; font-size: 15px; font-weight: 850; }
.panel-copy { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.code {
  margin: 0;
  color: var(--accent);
  font: 800 32px/1 Impact, "Arial Narrow", sans-serif;
  letter-spacing: .11em;
}

.result-list {
  min-height: 0;
  display: grid;
  gap: 7px;
  overflow: auto;
  scrollbar-width: thin;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  font-size: 13px;
}
.result-item span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-state { color: var(--accent); font-size: 11px; font-weight: 850; }

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, .96);
}

.nav-button {
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.nav-button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.nav-state { display: block; margin-top: 2px; color: var(--accent); font-size: 9px; font-weight: 700; }

@media (min-width: 800px) {
  .product-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }
  .app-header { padding-inline: 30px; }
  .content { grid-row: 2; padding: 32px; }
}

@media (max-height: 700px) {
  .app-header { min-height: 58px; padding-block: 8px; }
  .area-card { gap: 9px; }
  .area-card h1 { font-size: 36px; }
  .panel { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.bali-open { display: block; text-align: center; text-decoration: none; }
.bali-connection { --accent: #ff7840; }
.bali-connection .login-shell {
  background: radial-gradient(ellipse at top right, #3d204544, transparent 65%);
}
.bali-connection h1 { font-family: inherit; font-size: 32px; }
