:root {
  --bg: #0f0f12;
  --panel: #15151b;
  --panel-alt: #1f1f29;
  --text: #fdfdfd;
  --muted: #a0a0b4;
  --accent: #f3be4f;
  font-family: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
body[data-theme="light"] {
  --bg: #f5f7ff;
  --panel: #ffffff;
  --panel-alt: #f2f4ff;
  --text: #1a1c2b;
  --muted: #6d7084;
  --accent: #c9771a;
}
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}
.hero {
  background: linear-gradient(135deg, #1c1c2b, #0d0d12);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem;
  padding: 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.hero h1 {
  margin: 0 0 .35rem;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
}
.eyebrow {
  letter-spacing: .4rem;
  text-transform: uppercase;
  margin-bottom: .35rem;
  color: var(--muted);
}
.lede {
  color: var(--muted);
  max-width: 40rem;
}
.hero-stats {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .9rem;
  color: var(--accent);
}
.layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1rem;
  flex: 1;
}
.sidebar {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.sidebar-title {
  font-size: .8rem;
  letter-spacing: .3rem;
  text-transform: uppercase;
  color: var(--muted);
}
.accordion {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.category {
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: .85rem;
  padding: .75rem;
  background: var(--panel-alt);
}
.category button {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1rem;
  text-align: left;
  padding: 0;
  cursor: pointer;
}
.topic-list {
  margin: .5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.category .topic-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}
.category.open .topic-list {
  max-height: 800px;
}
.topic-list button {
  border: none;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  padding: .4rem .6rem;
  border-radius: .5rem;
  cursor: pointer;
  text-align: left;
}
.topic-list button.active,
.topic-list button:hover {
  color: var(--text);
  background: rgba(243,190,79,0.15);
}
.main {
  background: var(--panel);
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}
.empty-state {
  font-size: 1rem;
  color: var(--muted);
}
.topic-detail header {
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: .75rem;
}
.score-card {
  background: rgba(243,190,79,0.04);
  border: 1px solid rgba(243,190,79,0.4);
  border-radius: .85rem;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.score-body {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.score-title {
  font-size: .8rem;
  letter-spacing: .2rem;
  text-transform: uppercase;
  color: var(--accent);
}
.score-bands {
  display: flex;
  gap: .5rem;
  font-size: .8rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.score-bands span {
  padding: .15rem .5rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: .5rem;
}
.score-actions {
  display: flex;
  gap: .5rem;
}
.ghost {
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: var(--text);
  padding: .5rem .75rem;
  border-radius: .6rem;
  cursor: pointer;
}
.alt-card ul {
  margin: .35rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
}
.alt-suggestions p {
  margin: 0;
  font-size: .85rem;
  color: var(--accent);
}
.muted {
  color: var(--muted);
  font-size: .85rem;
}
.topic-detail h2 {
  margin: .3rem 0;
}
.cat-label {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .2rem;
  font-size: .7rem;
}
.alt-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}
.alt-card {
  padding: .85rem;
  border-radius: .85rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  min-height: 160px;
}
.alt-card h3 {
  margin: 0 0 .35rem;
  font-size: 1rem;
}
.alt-card p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.panel-note {
  font-size: .95rem;
  color: var(--muted);
  margin: .25rem 0 1rem;
}

.survey-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.survey-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
  padding: .35rem .75rem;
  border-radius: .6rem;
  background: rgba(255,255,255,0.03);
}

.header-actions {
  display: flex;
  gap: .5rem;
}

.theme-toggle {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: .45rem .9rem;
  border-radius: .6rem;
  cursor: pointer;
}

.survey-meta {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: .85rem;
  background: var(--panel-alt);
}

.survey-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
}

.survey-range {
  margin: .35rem 0 0;
  color: var(--muted);
}

.survey-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.survey-panel.with-suggestions {
  grid-template-columns: minmax(260px, 320px) 1fr;
}

.survey-main {
  background: var(--panel);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.suggestions {
  background: var(--panel-alt);
  border-radius: .85rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.08);
}

.suggestions h3 {
  margin: 0 0 .5rem;
  font-size: 1rem;
}

.likert-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.likert-row {
  border-radius: .85rem;
  border: 1px solid rgba(255,255,255,0.08);
  padding: .9rem 1rem;
  background: var(--panel-alt);
  display: grid;
  gap: .5rem;
}

.likert-row legend {
  font-weight: 600;
  color: var(--text);
}

.likert-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .4rem;
}

.likert-option {
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: .6rem;
  padding: .35rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  position: relative;
  font-size: .85rem;
  color: var(--text);
  font-weight: 600;
}

.likert-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.likert-option input:checked + span {
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.likert-option span {
  position: relative;
  z-index: 1;
}

.score-value {
  font-size: 1.4rem;
  margin: 0;
}

.form-error {
  background: rgba(255, 79, 79, 0.1);
  border: 1px solid rgba(255, 79, 79, 0.4);
  padding: .75rem 1rem;
  border-radius: .75rem;
  color: #ff9a9a;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items:flex-start; }
  .survey-panel { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items:flex-start; }
}

/* Alt card descriptions */
.alt-measurement,
.alt-importance {
  font-size: 0.9rem;
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: var(--panel-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0.5rem;
}

.alt-measurement strong,
.alt-importance strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--accent);
}

/* Survey actions */
.survey-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.btn-calculate,
.btn-report {
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-calculate {
  background: var(--accent);
  color: white;
  border: none;
}

.btn-calculate:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(243, 190, 79, 0.3);
}

.btn-report {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-report:hover {
  background: var(--accent);
  color: white;
}

/* Print styles */
@media print {
  .back-link,
  .theme-toggle,
  .btn-calculate,
  .btn-report {
    display: none;
  }
}
