/* deldown survey UI styles — strictly built on tokens.css and deldown-design */

@supports (scrollbar-width: thin) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--sep) transparent;
  }
}
@supports not (scrollbar-width: thin) {
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--sep); border-radius: 980px; }
}

html, body {
  min-height: 100%;
}

.theme-switching,
.theme-switching * {
  transition: none !important;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Top bar: 56px, sticky frosted blur */
.bar-in {
  height: 56px;
  width: min(880px, 100% - 40px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
}
.brand:hover { text-decoration: none; }
.brand img {
  display: block;
  height: 16px;
  width: auto;
}
.brand-sep {
  width: 1px;
  height: 16px;
  background: var(--sep);
}
.brand-sub {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.01em;
}

.nav-r {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-select {
  height: 44px;
  padding: 0 28px 0 12px;
  font-size: 14px;
  border-radius: 980px;
  border: 1px solid var(--sep);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  max-width: 150px;
}
.lang-select:hover {
  background: var(--fill);
}
.lang-select option {
  background: var(--card);
  color: var(--text);
}
.lang-chevron {
  position: absolute;
  right: 10px;
  pointer-events: none;
  color: var(--text-2);
}

.nav-r button.icon {
  width: 44px;
  height: 44px;
}

/* Main single-purpose centered column */
.page-main {
  flex: 1 0 auto;
  width: min(880px, 100% - 40px);
  margin: 0 auto;
  padding: 28px 0 64px;
}

/* Chapter progress sits directly on the canvas */
.progress-wrap {
  margin-bottom: 18px;
}

.progress-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-2);
}

.progress-chapter {
  color: var(--text);
  font-weight: 600;
}

.progress-bars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.progress-seg {
  height: 4px;
  border-radius: 980px;
  background: color-mix(in srgb, var(--text) 16%, transparent);
  transition: background-color 0.18s ease;
}

.progress-seg.done {
  background: var(--blue);
}

.progress-seg.current {
  background: color-mix(in srgb, var(--blue) 55%, color-mix(in srgb, var(--text) 16%, transparent));
}

/* Main card: never a card inside a card */
.survey-card {
  width: 100%;
}

.step-kicker {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}

.step-title {
  font-size: clamp(24px, 3.2vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
}

.step-lead {
  margin-top: 10px;
  font-size: 16px;
  color: var(--text-2);
  max-width: 64ch;
}

/* Flat sections separated only by spacing and 1px --sep hairline */
.q-section {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--sep);
}

.q-section:first-of-type.no-top-sep {
  margin-top: 22px;
  padding-top: 0;
  border-top: 0;
}

.q-heading {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 4px;
}

.q-sub {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 12px;
}

/* Flat facts list on intro */
.fact-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  border-top: 1px solid var(--sep);
}

.fact-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--sep);
  font-size: 15px;
  color: var(--text);
}

.fact-list svg {
  flex: none;
  margin-top: 3px;
  color: var(--blue);
}

.privacy-callout {
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

/* Option list: flat hairline rows, tinted only when selected */
.opt-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  border-top: 1px solid var(--sep);
}

.opt-list.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
  border-top: 0;
}

.opt-list.two-col > .opt-item:nth-child(-n+2) {
  border-top: 1px solid var(--sep);
}

.opt-list.two-col + .opt-list {
  margin-top: 18px;
}

.opt-item {
  border-bottom: 1px solid var(--sep);
  display: flex;
}

.opt-btn {
  width: 100%;
  height: auto;
  min-height: 48px;
  padding: 11px 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.38;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  white-space: normal;
  gap: 12px;
  margin: 2px 0;
}

.opt-btn:hover:not(:disabled) {
  background: var(--fill);
}

.opt-btn[aria-checked="true"],
.opt-btn[aria-pressed="true"] {
  background: var(--tint);
  font-weight: 600;
}

.opt-btn[aria-checked="true"]:hover:not(:disabled),
.opt-btn[aria-pressed="true"]:hover:not(:disabled) {
  background: var(--tint);
}

.opt-indicator {
  width: 18px;
  height: 18px;
  flex: none;
  border: 1.5px solid var(--text-2);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-blue);
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.opt-indicator.multi {
  border-radius: 5px;
}

.opt-btn[aria-checked="true"] .opt-indicator,
.opt-btn[aria-pressed="true"] .opt-indicator {
  background: var(--blue);
  border-color: var(--blue);
}

.opt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.opt-title {
  color: var(--text);
}

.opt-desc {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
}

.prod-icon {
  width: 24px;
  height: 24px;
  flex: none;
  object-fit: contain;
  display: block;
}

.prod-icon-spacer {
  width: 24px;
  height: 24px;
  flex: none;
}

.opt-meta {
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  flex: none;
}

/* Product status rows (Chapter 1.2) */
.status-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--sep);
}

.status-row:first-child {
  border-top: 1px solid var(--sep);
}

.status-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.status-name {
  font-size: 16px;
  font-weight: 600;
}

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

.status-choices .opt-btn {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 14px;
  margin: 0;
}

.freq-wrap {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sep);
}

.freq-label {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.freq-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.freq-row .opt-btn {
  width: auto;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 14px;
  margin: 0;
}

/* 5-step labeled horizontal scale (no card boxes, hairline separated) */
.scale-group {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--sep);
  border-bottom: 1px solid var(--sep);
  margin-top: 10px;
}

.scale-btn {
  height: auto;
  min-height: 68px;
  padding: 12px 8px;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  white-space: normal;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 6px;
  margin: 4px 2px;
}

.scale-btn:hover:not(:disabled) {
  background: var(--fill);
}

.scale-btn[aria-checked="true"] {
  background: var(--tint);
  font-weight: 600;
}

.scale-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.scale-btn[aria-checked="true"] .scale-num {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--on-blue);
}

/* Design elements rows (3.5) */
.element-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--sep);
}

.element-row:first-child {
  border-top: 1px solid var(--sep);
}

.element-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.verdict-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.verdict-btn {
  min-height: 44px;
  height: auto;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  gap: 8px;
}

.verdict-btn:hover:not(:disabled) {
  background: var(--fill);
}

.verdict-btn[aria-checked="true"] {
  background: var(--tint);
  color: var(--text);
  font-weight: 600;
}

.verdict-btn[aria-checked="true"] .opt-indicator {
  background: var(--blue);
  border-color: var(--blue);
}

/* Tone A/B comparison quotes (flat hairline quote, no box fill) */
.quote-pair {
  margin-top: 12px;
  border-top: 1px solid var(--sep);
}

.quote-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sep);
}

.quote-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

.quote-text {
  font-size: 16px;
  color: var(--text);
}

/* Offer tabs & Euro input (Chapter 4) */
.offer-scope {
  margin-top: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--sep);
  border-bottom: 1px solid var(--sep);
  font-size: 15px;
  color: var(--text-2);
}

.euro-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.euro-field {
  display: flex;
  flex-direction: column;
}

.euro-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.euro-input {
  width: 120px;
}

.euro-unit {
  font-size: 15px;
  color: var(--text-2);
}

/* 100-Point Budget (Chapter 5.2) */
.budget-bar-wrap {
  margin-top: 12px;
}

.budget-readout {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  font-size: 14px;
  margin-bottom: 8px;
}

.budget-readout.over {
  color: var(--red);
  font-weight: 600;
}

.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }

.budget-progress {
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 980px;
  background: var(--fill);
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
}

.budget-progress::-webkit-progress-bar {
  background: var(--fill);
  border-radius: 980px;
}

.budget-progress::-webkit-progress-value {
  background: var(--blue);
  border-radius: 980px;
  transition: width 0.16s ease, background-color 0.16s ease;
}

.budget-progress::-moz-progress-bar {
  background: var(--blue);
  border-radius: 980px;
}

.budget-progress.over::-webkit-progress-value {
  background: var(--red);
}

.budget-progress.over::-moz-progress-bar {
  background: var(--red);
}

.budget-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  border-top: 1px solid var(--sep);
}

.budget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--sep);
}

.budget-info {
  min-width: 0;
  flex: 1;
}

.budget-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.budget-desc {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 2px;
}

.budget-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.budget-step {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 600;
}

.budget-input {
  width: 72px;
  height: 44px;
  padding: 0 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.budget-input,
.euro-input {
  appearance: textfield;
  -moz-appearance: textfield;
}
.budget-input::-webkit-inner-spin-button,
.budget-input::-webkit-outer-spin-button,
.euro-input::-webkit-inner-spin-button,
.euro-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input,
textarea,
select,
.lang-select {
  border-color: rgba(20, 24, 31, 0.50);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-2);
  opacity: 1;
}

:root[data-theme=dark] input,
:root[data-theme=dark] textarea,
:root[data-theme=dark] select,
:root[data-theme=dark] .lang-select {
  border-color: rgba(255, 255, 255, 0.40);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) input,
  :root:not([data-theme=light]) textarea,
  :root:not([data-theme=light]) select,
  :root:not([data-theme=light]) .lang-select {
    border-color: rgba(255, 255, 255, 0.40);
  }
}

button.plain {
  min-height: 44px;
  padding: 0 8px;
}

/* Text fields & textareas */
.field-block {
  margin-top: 14px;
}

.field-block input[type="text"],
.field-block textarea {
  width: 100%;
}

.field-block textarea {
  height: auto;
  min-height: 88px;
  padding: 11px 14px;
  resize: vertical;
  line-height: 1.45;
}

.field-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
}

/* Action bar at bottom of card */
.actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--sep);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.actions-right {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.done-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

/* Native dialog for keyboard shortcuts */
dialog.dd-dialog {
  border: 1px solid var(--sep);
  border-radius: 22px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  width: min(440px, calc(100% - 32px));
  max-width: 100%;
}

dialog.dd-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dialog-head h2 {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.kbd-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--sep);
}

.kbd-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sep);
  font-size: 15px;
}

kbd {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--fill);
  color: var(--text);
}

/* Privacy / 404 prose sections inside the single card */
.prose-sec {
  padding: 18px 0;
  border-top: 1px solid var(--sep);
}

.prose-sec h2 {
  font-size: 17px;
  margin-bottom: 6px;
}

.prose-sec p {
  font-size: 15px;
  color: var(--text-2);
}

.draft-note {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-2);
}

.err {
  margin-top: 14px;
}

/* Footer width alignment */
.dd-footer {
  --dd-width: 880px;
  --dd-gutter: 40px;
  margin-top: auto;
}

.dd-footer-legal-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}

/* Responsive */
@media (max-width: 720px) {
  .bar-in,
  .page-main {
    width: calc(100% - 28px);
  }
  .dd-footer {
    --dd-gutter: 28px;
  }
  .page-main {
    padding: 20px 0 48px;
  }
  .opt-list.two-col,
  .status-choices {
    grid-template-columns: 1fr;
  }
  .opt-list.two-col > .opt-item:nth-child(2) {
    border-top: 0;
  }
  .lang-select {
    max-width: 96px;
    padding: 0 22px 0 9px;
  }
  .lang-chevron {
    right: 7px;
  }
  .bar-in {
    gap: 6px;
  }
  .brand {
    gap: 6px;
  }
  .nav-r {
    gap: 2px;
  }
  .scale-group {
    grid-template-columns: 1fr;
  }
  .scale-btn {
    min-height: 44px;
    font-size: 14px;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    padding: 10px 12px;
    gap: 12px;
    margin: 2px 0;
  }
  .budget-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .budget-controls {
    justify-content: flex-end;
  }
  .actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .actions-right {
    margin-left: 0;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }
  .actions button.pri,
  .actions button#btn-back {
    width: 100%;
  }
  .actions-right button.plain {
    width: 100%;
    min-height: 44px;
    text-align: center;
    padding: 0 12px;
  }
}

@media (max-width: 350px) {
  .brand-sep,
  .brand-sub {
    display: none;
  }
}

/* Screenshots of other deldown apps in the design part */
.app-shots {
  margin: 20px 0 0;
}

.app-shots-row {
  display: flex;
  gap: 12px;
  margin: 8px 0 0;
  padding: 0 0 10px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--sep) transparent;
}

.app-shots-row:focus-visible {
  outline: 2px solid var(--accent, #2f6fb0);
  outline-offset: 4px;
  border-radius: 14px;
}

.app-shots-heading {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.app-shots-row.desktop .app-shot {
  flex-basis: min(340px, 78vw);
}

.app-shot {
  flex: 0 0 148px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-snap-align: start;
}

.app-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--sep);
  border-radius: 14px;
}

.app-shot-name {
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
}

.app-shot .shot-dark {
  display: none;
}

:root[data-theme=dark] .app-shot .shot-light {
  display: none;
}

:root[data-theme=dark] .app-shot .shot-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .app-shot .shot-light {
    display: none;
  }

  :root:not([data-theme=light]) .app-shot .shot-dark {
    display: block;
  }
}
