:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: #111217;
  --panel-2: #171922;
  --panel-3: #0d0e13;
  --text: #f7f7f8;
  --muted: #9b9daa;
  --dim: #6f7280;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #a855f7;
  --accent-2: #5eead4;
  --amber: #fbbf24;
  --danger: #fb7185;
  --green: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 30% -10%, rgba(168, 85, 247, 0.26), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(94, 234, 212, 0.12), transparent 28%),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
}

.boot-card,
.login-screen,
.mobile-frame {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 18px;
}

.boot-card {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 0;
  background: transparent;
  opacity: 0;
  animation: bootFadeIn 180ms ease-out forwards;
}

.boot-card.is-leaving {
  pointer-events: none;
  animation: bootFadeOut 260ms ease-in forwards;
}

.boot-inner {
  display: grid;
  place-items: center;
  gap: 18px;
}

.boot-logo {
  width: min(56vw, 238px);
  height: min(56vw, 238px);
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 34px rgba(255, 255, 255, 0.16));
}

.boot-inner p {
  margin: 0;
  color: rgba(247, 247, 248, 0.78);
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0;
}

.boot-content-enter {
  animation: contentFadeIn 260ms ease-out both;
}

@keyframes bootFadeIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bootFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.015);
  }
}

@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-screen {
  display: grid;
  align-content: start;
  position: relative;
  overflow: hidden;
  gap: 18px;
  padding-top: max(16px, calc(env(safe-area-inset-top) + 10px));
  background:
    linear-gradient(90deg, rgba(56, 189, 248, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(168, 85, 247, 0.11) 1px, transparent 1px);
  background-size: 104px 104px;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 44%, rgba(56, 189, 248, 0.24) 44% 45%, transparent 45% 100%),
    linear-gradient(45deg, transparent 0 58%, rgba(168, 85, 247, 0.18) 58% 59%, transparent 59% 100%);
  opacity: 0.42;
}

.login-screen > * {
  position: relative;
  z-index: 1;
}

.login-card,
.hero-panel,
.section-block,
.route-panel,
.store-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  justify-self: center;
  width: min(100%, 378px);
  gap: 12px;
  padding: 16px;
}

.login-card h1,
.hero-panel h1,
.section-heading h2,
.panel-header h2,
.store-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-card .login-subtitle {
  color: var(--fg);
  font-size: 17px;
  font-weight: 650;
}

.login-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-hero {
  padding: 34px 0 8px;
}

.login-hero h1 {
  max-width: 11ch;
  margin: 0;
  font-size: 48px;
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.brand-row,
.header-line,
.meta-strip,
.panel-header,
.toggle-row,
.inline-actions,
.store-meta {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 9px;
  color: var(--text);
  font-weight: 750;
}

.brand-row.compact {
  font-size: 14px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  display: block;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  object-fit: cover;
  background: #050505;
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.12);
}

.brand-row.compact .logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.primary-action,
.secondary-action,
.test-entry-button,
.feature-button,
.icon-button,
.bottom-nav button,
.bottom-nav a,
.inline-actions button,
.choice-card,
.segmented button,
.role-switch button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  color: #fff;
  font-weight: 800;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent),
    var(--accent);
  border-color: rgba(255, 255, 255, 0.2);
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 760;
}

.test-entry {
  justify-self: start;
  width: min(100%, 286px);
}

.test-entry-button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  background: rgba(255, 255, 255, 0.035);
}

.test-panel {
  display: grid;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)),
    var(--panel-3);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.test-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.test-panel-header strong {
  font-size: 13px;
}

.test-panel .icon-button {
  width: 32px;
  height: 32px;
  font-size: 24px;
}

.test-gate {
  display: grid;
  gap: 10px;
}

.test-gate label {
  display: grid;
  gap: 7px;
}

.test-gate span {
  color: var(--muted);
  font-size: 12px;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.dev-logins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.dev-logins span {
  grid-column: 1 / -1;
  color: var(--dim);
  font-size: 12px;
}

.dev-logins a {
  min-height: 34px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.035);
}

.app-header {
  display: grid;
  gap: 12px;
}

.header-line {
  justify-content: space-between;
  gap: 12px;
}

.language-select,
select,
input,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-3);
}

.language-select {
  width: auto;
  min-height: 34px;
  color: var(--muted);
}

textarea {
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
}

.hero-panel {
  padding: 18px;
}

.hero-panel h1 {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.14;
}

.kicker,
.muted,
.feature-button small,
.metric-grid span,
.store-meta,
.record-list span,
.mini-list span,
.score-bars span {
  color: var(--muted);
}

.kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  margin: 0;
  line-height: 1.55;
}

.meta-strip {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.meta-strip span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 700;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.feature-button {
  display: grid;
  align-content: space-between;
  min-height: 120px;
  padding: 13px;
  text-align: left;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--panel-2);
}

.feature-button span {
  font-weight: 800;
  line-height: 1.25;
}

.feature-button strong {
  display: block;
  margin-top: 12px;
  color: var(--accent-2);
  font-size: 24px;
  line-height: 1;
}

.feature-button small {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.35;
}

.feature-button.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.section-block {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
}

.test-cta {
  border-color: rgba(94, 234, 212, 0.24);
}

.section-heading {
  display: grid;
  gap: 6px;
}

.identity-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.identity-list div {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.identity-list span {
  color: var(--muted);
  font-size: 12px;
}

.identity-list code {
  min-width: 0;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric-grid div {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.metric-grid strong {
  display: block;
  color: var(--accent-2);
  font-size: 24px;
}

.metric-grid span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.mini-list,
.record-list,
.choice-list,
.score-bars {
  display: grid;
  gap: 8px;
}

.mini-list div,
.record-list div,
.score-bars div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.record-list strong,
.mini-list strong,
.score-bars strong {
  flex: 0 0 auto;
}

.store-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-top: 10px;
}

.store-meta {
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.inline-actions {
  gap: 8px;
}

.inline-actions button {
  flex: 1;
  min-height: 36px;
  color: var(--muted);
}

.bottom-nav {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 14, 19, 0.86);
  backdrop-filter: blur(18px);
}

.bottom-nav button,
.bottom-nav a {
  flex: 1;
  min-height: 38px;
  padding: 0 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.bottom-nav button {
  display: grid;
  place-items: center;
}

.bottom-nav a {
  display: grid;
  place-items: center;
}

.route-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: min(100%, 460px);
  margin: 0 auto;
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
}

.panel-header {
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h2 {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.panel-header .language-select {
  flex: 0 0 auto;
}

.icon-button {
  width: 42px;
  height: 42px;
  font-size: 30px;
  line-height: 1;
}

.stack {
  display: grid;
  gap: 13px;
}

.stack label,
.field-label,
.rating-row {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.rating-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.rating-row label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dimension-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
  line-height: 1.45;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

.range-control {
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: center;
  gap: 10px;
}

.range-control strong {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 8px;
  color: var(--accent-2);
  background: rgba(94, 234, 212, 0.08);
  font-size: 18px;
}

[hidden] {
  display: none !important;
}

.toggle-row {
  justify-content: space-between;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.toggle-row input {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.check-list input {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}

.segmented,
.role-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.segmented button,
.role-switch button {
  min-height: 42px;
  color: var(--muted);
}

.segmented button.selected,
.role-switch button.selected {
  border-color: rgba(168, 85, 247, 0.55);
  color: #fff;
  background: rgba(168, 85, 247, 0.22);
}

.choice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  text-align: left;
}

.choice-card strong {
  line-height: 1.35;
}

.choice-card span {
  flex: 0 0 auto;
  color: var(--accent-2);
  font-weight: 900;
}

.choice-card.status-card span {
  max-width: 42%;
  text-align: right;
  white-space: normal;
}

.primary-action:disabled,
.secondary-action:disabled,
.choice-card:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.empty-state {
  padding: 20px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(12px);
}

.modal-card {
  width: min(100%, 360px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-card h2,
.modal-card p {
  margin: 0;
}

.modal-card p {
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 360px) {
  .action-grid,
  .metric-grid,
  .segmented,
  .role-switch {
    grid-template-columns: 1fr;
  }

  .login-hero {
    padding-top: 26px;
  }

  .login-hero h1 {
    font-size: 40px;
  }

  .hero-panel h1 {
    font-size: 24px;
  }
}
