:root {
  color-scheme: dark;
  --dark-blue: #000c1d;
  --blue: #1e3041;
  --light-blue: #d8e7fa;
  --white: #ffffff;
  --apple-cider: #670000;
  --spearmint: #1a201a;
  --wintergreen: #629e7a;
  --mocha: #402113;
  --citrus: #c14b21;
  --patriot: #a99676;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(216, 231, 250, 0.22);
  --muted: rgba(216, 231, 250, 0.72);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  font-family:
    Arimo, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  background:
    radial-gradient(circle at 12% 8%, rgba(193, 75, 33, 0.32), transparent 26rem),
    radial-gradient(circle at 86% 16%, rgba(98, 158, 122, 0.2), transparent 24rem),
    linear-gradient(135deg, #000814 0%, var(--dark-blue) 48%, #081626 100%);
}

body.locked-mode .app-shell {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100vh;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(30, 48, 65, 0.96), rgba(0, 12, 29, 0.98)),
    var(--blue);
  border-right: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--light-blue);
  border-radius: 999px;
  color: var(--dark-blue);
  background: var(--light-blue);
  font-size: 1.55rem;
  font-weight: 950;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  border: 2px solid var(--light-blue);
  border-radius: 999px;
  color: var(--dark-blue);
  background:
    radial-gradient(circle at 35% 25%, #ffffff, var(--light-blue) 64%, #a8bed8);
  box-shadow: inset 0 -10px 20px rgba(0, 12, 29, 0.14);
}

.brand-logo span {
  display: block;
  font-size: 0.86rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.brand-logo small {
  display: block;
  margin-top: 2px;
  font-size: 0.36rem;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 12, 29, 0.72);
  backdrop-filter: blur(16px);
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(440px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(30, 48, 65, 0.96), rgba(0, 12, 29, 0.98)),
    var(--blue);
  box-shadow: var(--shadow);
}

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

#loginStatus {
  min-height: 20px;
  color: var(--light-blue);
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--light-blue);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0;
  font-size: 1.45rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

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

.admin-only,
.visitor-only {
  display: none;
}

.admin-mode .admin-only,
.visitor-mode .visitor-only {
  display: grid;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--light-blue);
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.tab-button.active {
  color: var(--dark-blue);
  background: var(--light-blue);
  border-color: var(--light-blue);
}

.icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 900;
}

.tab-button.active .icon {
  background: rgba(0, 12, 29, 0.12);
}

.share-panel,
.respondent-panel,
.version-panel {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.share-panel,
.version-panel {
  gap: 10px;
}

.version-panel {
  margin-top: 0;
}

.share-panel h2,
.respondent-panel h2,
.version-panel h2 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.share-panel p,
.respondent-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.view {
  display: none;
  padding: 34px;
}

.active-view {
  display: block;
}

.hero-band,
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.hero-band {
  min-height: 260px;
  padding: clamp(22px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(0, 12, 29, 0.4), rgba(0, 12, 29, 0.88)),
    linear-gradient(135deg, rgba(103, 0, 0, 0.92), rgba(193, 75, 33, 0.86) 42%, rgba(30, 48, 65, 0.94));
  box-shadow: var(--shadow);
}

.hero-band h2,
.view-header h2 {
  margin-bottom: 0;
  max-width: 780px;
  font-size: clamp(2.2rem, 6vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-band p {
  max-width: 380px;
  margin-bottom: 0;
  color: var(--light-blue);
  line-height: 1.55;
}

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

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

.question-block,
.analysis-panel,
.metric-card,
.section-note,
.progress-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.question-block {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.wide {
  grid-column: 1 / -1;
}

.section-note {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--muted);
  line-height: 1.4;
}

.section-note span {
  flex: 0 0 auto;
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

.progress-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
}

.progress-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.progress-card span {
  color: var(--muted);
  font-weight: 900;
}

.progress-card strong {
  color: var(--white);
  text-transform: uppercase;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--citrus), var(--light-blue));
  transition: width 0.2s ease;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
label {
  color: var(--white);
  font-weight: 900;
  line-height: 1.35;
}

legend {
  margin-bottom: 10px;
}

.hint,
.optional {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

select,
input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--white);
  background: rgba(0, 12, 29, 0.42);
}

select,
input[type="text"],
input[type="number"] {
  height: 46px;
  margin-top: 8px;
  padding: 0 12px;
}

select {
  appearance: none;
}

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

input::placeholder,
textarea::placeholder {
  color: rgba(216, 231, 250, 0.45);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid var(--light-blue);
  outline-offset: 2px;
}

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

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--light-blue);
  font-weight: 800;
}

.choice input {
  margin-top: 3px;
  accent-color: var(--citrus);
}

.choice:has(input:checked) {
  color: var(--white);
  border-color: rgba(216, 231, 250, 0.65);
  background: rgba(216, 231, 250, 0.12);
}

.choice:has(input:disabled) {
  opacity: 0.45;
}

.standalone {
  width: fit-content;
  max-width: 100%;
}

.follow-up-fields {
  display: grid;
  gap: 12px;
}

.follow-up {
  display: grid;
}

.hidden {
  display: none !important;
}

.star-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(42px, 1fr));
  gap: 8px;
}

.star-row label {
  min-width: 0;
}

.star-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.star-row span {
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--light-blue);
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.1rem;
  font-weight: 950;
}

.star-row input:checked + span {
  color: var(--dark-blue);
  background: var(--light-blue);
  border-color: var(--light-blue);
}

.range-wrap {
  display: grid;
  gap: 12px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--citrus);
}

output {
  display: grid;
  place-items: center;
  width: 58px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  font-weight: 950;
}

.identity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  margin-bottom: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
}

.form-status {
  margin: 0;
  color: var(--light-blue);
  font-weight: 900;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 950;
  border: 2px solid transparent;
}

.primary-button {
  color: var(--dark-blue);
  background: var(--light-blue);
}

.primary-button:hover {
  color: var(--white);
  background: var(--citrus);
}

.secondary-button {
  color: var(--light-blue);
  background: transparent;
  border-color: var(--light-blue);
}

.sidebar .secondary-button {
  width: 100%;
}

.danger-button {
  color: #ffd7d7;
  background: rgba(103, 0, 0, 0.4);
  border-color: rgba(255, 215, 215, 0.4);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  padding: 18px;
}

.metric-card:nth-child(2) {
  border-color: rgba(98, 158, 122, 0.55);
}

.metric-card:nth-child(3) {
  border-color: rgba(193, 75, 33, 0.55);
}

.metric-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  line-height: 1;
}

.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
}

.analysis-panel {
  min-width: 0;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
  text-transform: uppercase;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.bar-list,
.segment-list,
.quote-list,
.priority-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 240px) minmax(0, 1fr) 58px;
  align-items: center;
  gap: 12px;
}

.bar-label {
  color: var(--light-blue);
  font-weight: 900;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--citrus), var(--wintergreen), var(--light-blue));
}

.bar-score {
  color: var(--white);
  font-weight: 950;
  text-align: right;
}

.insight-copy {
  display: grid;
  gap: 12px;
  color: var(--light-blue);
  line-height: 1.55;
}

.insight-copy p {
  margin-bottom: 0;
  padding-left: 12px;
  border-left: 4px solid var(--citrus);
}

.segment-item {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 52px;
  gap: 12px;
  align-items: center;
  color: var(--light-blue);
  font-weight: 900;
}

.segment-item span:last-child {
  text-align: right;
  color: var(--white);
}

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

.theme-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(216, 231, 250, 0.1);
  color: var(--light-blue);
  font-weight: 900;
}

.priority-item,
.quality-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.priority-item strong,
.quality-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--white);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.priority-item p,
.quality-item p {
  margin-bottom: 0;
  color: var(--light-blue);
  line-height: 1.45;
}

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

blockquote {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

blockquote p {
  margin-bottom: 10px;
  color: var(--light-blue);
  line-height: 1.45;
}

cite {
  color: var(--white);
  font-style: normal;
  font-weight: 950;
}

.empty-state {
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .metrics-grid,
  .analytics-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .view,
  .sidebar {
    padding: 20px;
  }

  .hero-band,
  .view-header,
  .form-actions,
  .section-note {
    flex-direction: column;
    align-items: stretch;
  }

  .survey-grid,
  .metrics-grid,
  .analytics-layout,
  .option-grid,
  .identity-grid,
  .quality-grid {
    grid-template-columns: 1fr;
  }

  .range-labels,
  .panel-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .bar-score {
    text-align: left;
  }
}
