:root {
  color-scheme: light;
  --ink: #19211f;
  --muted: #68736f;
  --line: #d9e1dd;
  --surface: #f8faf7;
  --panel: #ffffff;
  --primary: #2f6f68;
  --primary-dark: #1e4c48;
  --accent: #c56d3f;
  --soft: #edf5f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 14px 28px;
}

.shell.compact {
  width: min(calc(100% - 40px), 640px);
}

.topbar,
.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.18;
}

h2 {
  font-size: 26px;
  line-height: 1.2;
}

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

.badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  background: var(--surface);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 58px;
  margin: 0 -14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 247, 0.96);
  backdrop-filter: blur(16px);
}

.title-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.title-copy p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.search-toggle {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--primary-dark);
  background: #fff;
  font-size: 14px;
  font-weight: 900;
}

.search-toggle.active {
  border-color: rgba(47, 111, 104, 0.62);
  color: #fff;
  background: var(--primary);
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  margin-top: 56px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 24px 80px rgba(25, 33, 31, 0.08);
}

.filter-panel {
  display: grid;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.search,
.sort-row label {
  display: grid;
  gap: 8px;
}

.search span,
.sort-row span,
.sort-row label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search input,
.sort-row select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.segment {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  font-weight: 800;
}

.segment.active {
  border-color: rgba(47, 111, 104, 0.62);
  color: #fff;
  background: var(--primary);
}

.sort-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.hero-copy {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.hero-copy p:last-child,
.result p {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.primary,
.secondary,
.ghost,
.option {
  min-height: 48px;
  border-radius: 8px;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.primary {
  padding: 0 22px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.primary:hover,
.option:hover {
  transform: translateY(-1px);
}

.secondary,
.ghost {
  padding: 0 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.panel {
  min-width: 0;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.metric {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
}

.panel p {
  color: var(--muted);
  font-weight: 700;
}

.test-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.test-card {
  display: grid;
  gap: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  text-align: left;
}

.test-card.active {
  border-color: rgba(47, 111, 104, 0.62);
  background: #fff;
}

.test-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.test-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.test-title small,
.test-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.test-title strong {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.test-meta {
  flex: 0 0 auto;
  white-space: nowrap;
}

.test-detail {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.test-detail p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.detail-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-metrics span {
  border-radius: 999px;
  padding: 6px 8px;
  color: var(--primary-dark);
  background: var(--soft);
  font-size: 12px;
  font-weight: 900;
}

.compact-button {
  width: 100%;
  min-height: 42px;
}

.test-card em {
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 24px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.empty-state p:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.question-header {
  margin-bottom: 24px;
}

.question-header span {
  color: var(--muted);
  font-weight: 800;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce7e3;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.question,
.result {
  display: grid;
  gap: 20px;
  min-width: 0;
  margin-top: 48px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  text-align: left;
  font-weight: 750;
  line-height: 1.35;
}

.option span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.option:hover {
  border-color: rgba(47, 111, 104, 0.48);
  background: var(--soft);
}

.result-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 16px;
  background: var(--result-bg);
}

.result-identity h1 {
  color: var(--result-ink);
}

.result-identity p {
  margin-top: 6px;
}

.result-emoji {
  font-size: 44px;
  line-height: 1;
}

.score-list {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.score-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-note {
  display: grid;
  gap: 10px;
}

.web-result-ad {
  min-height: 90px;
  margin: 18px 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-note h2 {
  font-size: 18px;
}

.result-note ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.ability-list {
  display: grid;
  gap: 10px;
}

.ability {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  overflow: hidden;
  padding: 12px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 750;
}

.ability i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  background: var(--accent);
}

@media (max-width: 680px) {
  .shell {
    width: min(100%, 480px);
    padding: 0 14px 28px;
  }

  .shell.compact {
    width: calc(100% - 28px);
    padding: 22px 0;
  }

  .topbar {
    align-items: center;
  }

  .hero {
    grid-template-columns: 1fr;
    margin-top: 34px;
    padding: 22px;
  }

  .filter-panel {
    margin-top: 10px;
    padding: 12px;
  }

  .sort-row {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .test-list {
    grid-template-columns: 1fr;
  }

  .primary,
  .secondary {
    width: 100%;
  }
}
