:root {
  --paper: #fff8fc;
  --ink: #4a2038;
  --strong: #351127;
  --soft: #806778;
  --glass: rgba(255, 255, 255, 0.52);
  --glass-strong: rgba(255, 255, 255, 0.74);
  --glass-line: rgba(255, 255, 255, 0.78);
  --line: rgba(74, 32, 56, 0.13);
  --gradient: linear-gradient(105deg, #6ea8ff, #b794ff 38%, #ff8fab 70%, #5eead4);
  --shadow: 0 28px 85px rgba(121, 65, 105, 0.14);
  --shell: min(1040px, calc(100% - 40px));
  color-scheme: light;
  font-synthesis: none;
}

:root[data-mood="dusk"] {
  --paper: #160b19;
  --ink: #fff0f7;
  --strong: #fff7fb;
  --soft: #cdb7c7;
  --glass: rgba(42, 20, 38, 0.56);
  --glass-strong: rgba(47, 22, 42, 0.8);
  --glass-line: rgba(255, 235, 248, 0.16);
  --line: rgba(255, 235, 248, 0.13);
  --shadow: 0 28px 90px rgba(7, 0, 8, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 108px;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: transparent;
  font-family: "Nunito", "Noto Sans TC", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid rgba(183, 148, 255, 0.62);
  outline-offset: 4px;
}

.hidden {
  display: none !important;
}

.section-shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: -70px;
  left: 18px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: var(--strong);
}

.skip-link:focus {
  top: 18px;
}

.dream-background {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background: var(--paper);
}

.dream-background i {
  position: absolute;
  width: 65vw;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.58;
  filter: blur(18px);
  animation: drift 18s ease-in-out infinite alternate;
}

.dream-background i:nth-child(1) {
  top: -28%;
  left: -18%;
  background: radial-gradient(circle, #ffd1e2, #efcaff 42%, transparent 70%);
}

.dream-background i:nth-child(2) {
  top: 12%;
  right: -28%;
  background: radial-gradient(circle, #cddcff, #c9fff0 42%, transparent 70%);
  animation-delay: -7s;
}

.dream-background i:nth-child(3) {
  bottom: -45%;
  left: 28%;
  background: radial-gradient(circle, #ffcadc, #cdb8ff 42%, transparent 70%);
  animation-delay: -12s;
}

.dream-background span {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 249, 253, 0.58) 72%, rgba(255, 255, 255, 0.82));
}

[data-mood="dusk"] .dream-background i {
  opacity: 0.28;
  filter: blur(35px);
}

[data-mood="dusk"] .dream-background i:nth-child(1) {
  background: #742d58;
}

[data-mood="dusk"] .dream-background i:nth-child(2) {
  background: #273450;
}

[data-mood="dusk"] .dream-background i:nth-child(3) {
  background: #21463f;
}

[data-mood="dusk"] .dream-background span {
  background: linear-gradient(180deg, rgba(12, 5, 16, 0.12), rgba(18, 8, 20, 0.48) 72%, rgba(10, 5, 14, 0.78));
}

.page-grain {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  opacity: 0.035;
  background-image: radial-gradient(rgba(69, 24, 52, 0.72) 0.55px, transparent 0.75px);
  background-size: 4px 4px;
}

@keyframes drift {
  to {
    transform: translate3d(5vw, 3vh, 0) scale(1.08);
  }
}

.site-header {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 400;
  width: min(760px, calc(100% - 30px));
  min-height: 66px;
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translateX(-50%);
  border: 1px solid var(--glass-line);
  border-radius: 23px;
  background: var(--glass);
  box-shadow: 0 12px 50px rgba(94, 48, 84, 0.09), inset 0 1px rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(24px) saturate(1.35);
}

.brand-link {
  padding-right: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  font: 700 0.9rem "Comfortaa", sans-serif;
}

.brand-link span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  color: #351127;
  background: var(--gradient);
  box-shadow: 0 8px 24px rgba(183, 148, 255, 0.22);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.site-header nav > * {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 13px;
  color: var(--soft);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 800;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.site-header nav > *:is(:hover, :active) {
  color: var(--strong);
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.points-balance i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5eead4;
  box-shadow: 0 0 12px #5eead4;
}

.points-balance b {
  font: 500 0.68rem "DM Mono", monospace;
}

.theme-toggle {
  width: 40px;
  padding: 0 !important;
  justify-content: center;
  font-size: 1rem !important;
}

.hero {
  min-height: 100svh;
  padding: 145px 0 90px;
  display: grid;
  grid-template-columns: 1.18fr 0.72fr;
  align-items: center;
  gap: clamp(40px, 8vw, 100px);
}

.hero h1 {
  margin: 0;
  color: var(--strong);
  font-family: "Comfortaa", sans-serif;
  font-size: clamp(3.15rem, 6vw, 5.7rem);
  line-height: 1.04;
  letter-spacing: -0.075em;
}

.hero h1 span {
  color: transparent;
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero p {
  max-width: 620px;
  margin: 27px 0 0;
  color: var(--soft);
  font-size: clamp(0.92rem, 1.4vw, 1.05rem);
  font-weight: 600;
}

.primary-button {
  min-height: 52px;
  margin-top: 31px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 17px;
  color: #351127;
  background: var(--gradient);
  box-shadow: 0 15px 36px rgba(125, 73, 137, 0.2), inset 0 1px rgba(255, 255, 255, 0.65);
  font-weight: 800;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.primary-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 21px 45px rgba(125, 73, 137, 0.28);
}

.primary-button.full {
  width: 100%;
}

.scope-visual {
  position: relative;
  min-height: 480px;
  display: grid;
  place-items: center;
}

.scope-visual::before,
.scope-visual::after {
  content: "";
  position: absolute;
  width: 88%;
  aspect-ratio: 1;
  border: 1px solid rgba(183, 148, 255, 0.3);
  border-radius: 50%;
  transform: rotate(18deg) scaleY(0.6);
}

.scope-visual::after {
  border-color: rgba(94, 234, 212, 0.28);
  transform: rotate(-42deg) scaleY(0.68);
}

.scope-core {
  position: relative;
  z-index: 2;
  width: 245px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  border: 1px solid var(--glass-line);
  border-radius: 38%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.2));
  box-shadow: 0 38px 100px rgba(80, 37, 70, 0.2), inset 0 1px rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(28px);
  transform: rotate(-6deg);
}

[data-mood="dusk"] .scope-core {
  background: linear-gradient(145deg, rgba(62, 30, 56, 0.78), rgba(30, 14, 28, 0.42));
}

.scope-core span,
.scope-core strong {
  display: block;
  font-family: "Comfortaa", sans-serif;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -0.07em;
}

.scope-core span {
  color: var(--soft);
}

.scope-core strong {
  margin-top: 6px;
  color: transparent;
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
}

.scope-chip {
  position: absolute;
  z-index: 3;
  padding: 10px 15px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-strong);
  box-shadow: 0 14px 35px rgba(76, 34, 66, 0.13);
  font-size: 0.7rem;
  font-weight: 800;
  backdrop-filter: blur(18px);
  animation: float 4s ease-in-out infinite alternate;
}

.chip-one {
  top: 17%;
  left: 7%;
}

.chip-two {
  top: 32%;
  right: 0;
  animation-delay: -1.5s;
}

.chip-three {
  bottom: 18%;
  left: 15%;
  animation-delay: -2.8s;
}

@keyframes float {
  to {
    translate: 0 -10px;
  }
}

.builder-section {
  min-height: 100svh;
  padding: 125px 0 140px;
  display: grid;
  place-items: center;
}

.builder-shell {
  width: min(780px, 100%);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: 34px;
  background: var(--glass-strong);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(28px) saturate(1.2);
}

.research-disclosure {
  max-width: 720px;
  margin: 14px auto 0;
  color: var(--soft);
  text-align: center;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.6;
}

.builder-topbar {
  min-height: 78px;
  padding: 17px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.builder-topbar span {
  color: var(--soft);
  font: 500 0.58rem "DM Mono", monospace;
}

.builder-topbar strong {
  font-size: 0.82rem;
}

.progress-track {
  height: 3px;
  background: var(--line);
}

.progress-track span {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--gradient);
  transition: width 0.3s ease;
}

.builder-content {
  min-height: 599px;
  padding: clamp(28px, 6vw, 52px);
  display: flex;
  flex-direction: column;
}

.step-title {
  margin: 0 0 30px;
  color: var(--strong);
  font: 700 clamp(1.8rem, 4vw, 2.8rem) / 1.15 "Comfortaa", sans-serif;
  letter-spacing: -0.055em;
}

.field-label {
  display: block;
  margin: 0 0 9px;
  color: var(--soft);
  font-size: 0.7rem;
  font-weight: 800;
}

.idea-textarea,
.compact-textarea,
.text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--strong);
  background: rgba(255, 255, 255, 0.25);
}

.idea-textarea {
  min-height: 190px;
  padding: 18px;
  resize: vertical;
  line-height: 1.7;
}

.idea-textarea.medium {
  min-height: 145px;
}

.compact-textarea {
  width: 100%;
  min-height: 120px;
  padding: 15px;
  resize: vertical;
  line-height: 1.65;
}

.text-input {
  min-height: 50px;
  padding: 0 15px;
}

.idea-textarea:focus,
.compact-textarea:focus,
.text-input:focus {
  outline: none;
  border-color: rgba(183, 148, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(183, 148, 255, 0.13);
}

.field-meta,
.field-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 0.65rem;
  font-weight: 700;
  text-align: right;
}

.field-error {
  color: #b4336d;
  text-align: left;
}

.field-group + .field-group,
.field-block + .field-group,
.field-group + .field-block,
.option-groups + .field-group {
  margin-top: 26px;
}

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

.selection-limit {
  min-height: auto;
  margin-top: 9px;
}

.option-groups {
  display: grid;
  gap: 8px;
}

.option-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.12);
}

.option-group summary {
  min-height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--strong);
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.option-group summary::-webkit-details-marker {
  display: none;
}

.option-group summary::after {
  content: "+";
  color: var(--soft);
  font: 500 0.9rem "DM Mono", monospace;
}

.option-group[open] summary::after {
  content: "−";
}

.option-group .choice-grid {
  padding: 0 8px 8px;
}

.option-group .choice {
  min-height: 52px;
  border-radius: 13px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.choice-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.choice {
  position: relative;
  min-height: 64px;
  padding: 14px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.18);
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.choice:hover {
  transform: translateY(-3px);
  border-color: rgba(183, 148, 255, 0.48);
}

.choice.is-selected {
  border-color: rgba(183, 148, 255, 0.72);
  background: linear-gradient(120deg, rgba(183, 148, 255, 0.2), rgba(255, 143, 171, 0.16));
}

.choice.is-selected::after {
  content: "✓";
  position: absolute;
  right: 13px;
  font-size: 0.7rem;
}

.choice strong {
  padding-right: 18px;
  color: var(--strong);
  font-size: 0.76rem;
}

.step-nav {
  margin-top: auto;
  padding-top: 30px;
  display: flex;
  gap: 9px;
}

.step-nav button,
.copy-button,
.text-button {
  min-height: 45px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 800;
}

.back-button,
.text-button,
.copy-button {
  border: 1px solid var(--line);
  background: transparent;
}

.next-button {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.68);
  color: #351127;
  background: var(--gradient);
}

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

.review-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
}

.review-item.full {
  grid-column: 1 / -1;
}

.review-item span,
.result-label {
  display: block;
  margin-bottom: 6px;
  color: var(--soft);
  font: 500 0.55rem "DM Mono", monospace;
}

.review-item p,
.result-card p {
  margin: 0;
  color: var(--strong);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.55;
}

.upload-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-picker {
  min-height: 78px;
  padding: 18px;
  display: grid;
  place-content: center;
  gap: 4px;
  border: 1px dashed rgba(183, 148, 255, 0.58);
  border-radius: 18px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.16);
}

.file-picker strong {
  color: var(--strong);
  font-size: 0.78rem;
}

.file-picker span,
.visual-detail span,
.selected-files small,
.generating-note {
  color: var(--soft);
  font-size: 0.62rem;
  font-weight: 700;
}

.selected-files {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.selected-files li {
  padding: 8px 2px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  color: var(--strong);
  font-size: 0.68rem;
  font-weight: 700;
}

.clear-files {
  min-height: 34px;
  margin-top: 8px;
  padding: 0 10px;
  font-size: 0.6rem;
}

.visual-detail {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.visual-detail input {
  width: 17px;
  height: 17px;
  accent-color: #b794ff;
}

.result-view {
  gap: 9px;
}

.result-view .step-title {
  margin-bottom: 8px;
}

.quote-card {
  min-height: 290px;
  padding: 38px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(145deg, rgba(183, 148, 255, 0.17), rgba(94, 234, 212, 0.1));
}

.quote-card strong {
  color: transparent;
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  font: 700 clamp(3rem, 10vw, 5.5rem) "Comfortaa", sans-serif;
}

.quote-card p {
  max-width: 430px;
  margin: 0;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.6;
}

.quote-actions {
  margin-top: 10px;
}

.usage-note {
  margin: -10px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--soft);
  font-size: 0.64rem;
}

.usage-note strong {
  color: var(--strong);
  font: 700 0.85rem "Comfortaa", sans-serif;
}

.result-card,
.result-prompt {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
}

.result-plan {
  margin-top: 20px;
  display: grid;
  gap: 9px;
}

.result-section-title {
  margin: 0 0 8px;
  color: var(--strong);
  font: 700 clamp(1.35rem, 4vw, 1.8rem) "Comfortaa", sans-serif;
}

.result-overview h3:not(:first-child) {
  margin-top: 16px;
}

.result-card h3 {
  margin: 0 0 8px;
  color: var(--strong);
  font: 700 1.05rem "Comfortaa", sans-serif;
}

.direction-list,
.result-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.direction-list li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  color: var(--strong);
  font-size: 0.74rem;
  font-weight: 700;
}

.direction-list strong,
.direction-list span {
  display: block;
}

.direction-list span {
  margin-top: 4px;
  color: var(--soft);
  font-weight: 600;
  line-height: 1.55;
}

.generating-state {
  min-height: 430px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  text-align: center;
}

.generating-state > span {
  width: 42px;
  height: 42px;
  border: 3px solid var(--line);
  border-top-color: #b794ff;
  border-radius: 50%;
  animation: generating-spin 0.8s linear infinite;
}

.generating-state .step-title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.generating-note {
  margin: -12px 0 0;
}

@keyframes generating-spin {
  to {
    transform: rotate(360deg);
  }
}

.result-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.result-list li {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  font-size: 0.68rem;
  font-weight: 700;
}

.result-prompt {
  padding: 0;
  overflow: hidden;
  border-color: rgba(183, 148, 255, 0.62);
  background: linear-gradient(145deg, rgba(183, 148, 255, 0.22), rgba(255, 143, 171, 0.12));
  box-shadow: 0 18px 50px rgba(112, 76, 166, 0.14);
}

.result-prompt-header {
  padding: 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.result-prompt-header span {
  display: block;
  margin-bottom: 5px;
  color: var(--soft);
  font: 600 0.54rem "DM Mono", monospace;
  letter-spacing: 0.08em;
}

.result-prompt-header h3 {
  margin: 0;
  color: var(--strong);
  font: 700 clamp(1.15rem, 4vw, 1.55rem) "Comfortaa", sans-serif;
}

.result-prompt .copy-button {
  min-height: 44px;
  padding: 0 18px;
  color: #351127;
  border: 0;
  background: var(--gradient);
  box-shadow: 0 9px 25px rgba(183, 148, 255, 0.24);
  font-size: 0.7rem;
}

.result-prompt details {
  border-top: 1px solid var(--line);
}

.result-prompt summary {
  padding: 14px 21px;
  color: var(--strong);
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.result-prompt details[open] summary {
  border-bottom: 1px solid var(--line);
}

.prompt-outline {
  padding: 6px 21px 22px;
}

.prompt-outline section {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.prompt-outline section:last-child {
  border-bottom: 0;
}

.prompt-outline h4 {
  margin: 0 0 7px;
  color: var(--strong);
  font: 800 0.82rem "Comfortaa", sans-serif;
}

.prompt-outline p,
.prompt-outline ul {
  margin: 0;
  color: var(--strong);
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.65;
}

.prompt-outline ul {
  padding-left: 18px;
}

.prompt-outline li + li {
  margin-top: 6px;
}

.copy-button {
  min-height: 36px;
  font-size: 0.64rem;
}

.result-actions {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.result-actions > * {
  min-height: 43px;
  margin: 0;
  padding: 0 14px;
  font-size: 0.7rem;
}

.site-footer {
  min-height: 100px;
  padding: 25px 0 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.67rem;
  font-weight: 800;
}

.site-footer > span {
  color: transparent;
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  font: 700 0.9rem "Comfortaa", sans-serif;
}

.dashboard-main {
  min-height: 100vh;
  padding: 150px 0 90px;
}

.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-heading h1 {
  margin: 0;
  color: transparent;
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  font: 700 clamp(3rem, 9vw, 6rem) "Comfortaa", sans-serif;
}

.dashboard-heading p {
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 0.7rem;
  font-weight: 700;
}

.dashboard-heading span {
  padding-bottom: 10px;
  color: var(--soft);
  font: 500 0.64rem "DM Mono", monospace;
}

.dashboard-tabs {
  margin: 34px 0 18px;
  display: flex;
  gap: 7px;
}

.dashboard-tabs button,
.admin-toolbar button,
.admin-auth button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  font-size: 0.68rem;
  font-weight: 800;
}

.dashboard-tabs button.is-active {
  color: #351127;
  background: var(--gradient);
}

.dashboard-panel {
  min-height: 430px;
  padding: 25px;
  border: 1px solid var(--glass-line);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.dashboard-section-heading {
  margin: 28px 0 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-section-heading:first-child {
  margin-top: 0;
}

.dashboard-section-heading h2 {
  margin: 0;
  color: var(--strong);
  font: 700 clamp(1rem, 3vw, 1.35rem) "Comfortaa", sans-serif;
}

.dashboard-section-heading span {
  color: var(--soft);
  font-size: 0.58rem;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.admin-metrics {
  grid-template-columns: repeat(3, 1fr);
}

.metric {
  min-height: 130px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.17);
}

.metric span,
.metric small {
  color: var(--soft);
  font: 500 0.56rem "DM Mono", monospace;
}

.metric strong {
  color: var(--strong);
  font: 700 clamp(1.2rem, 4vw, 2.1rem) "Comfortaa", sans-serif;
}

.band-grid {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.band {
  padding: 14px;
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--soft);
  font-size: 0.65rem;
  font-weight: 800;
}

.band strong { color: var(--strong); }
.band.normal { border-color: rgba(94, 234, 212, 0.4); }
.band.elevated { border-color: rgba(110, 168, 255, 0.45); }
.band.heavy { border-color: rgba(255, 190, 100, 0.48); }
.band.extreme { border-color: rgba(255, 95, 135, 0.48); }

.usage-history,
.admin-users,
.admin-events,
.admin-interactions {
  margin-top: 15px;
  display: grid;
  gap: 7px;
}

.research-event-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.research-event-grid > div {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.research-event-grid span { color: var(--soft); font-size: 0.6rem; font-weight: 700; }
.research-event-grid strong { color: var(--strong); font: 700 0.75rem "DM Mono", monospace; }

.interaction-row {
  padding: 13px 15px;
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.interaction-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.interaction-row strong { color: var(--strong); font-size: 0.7rem; }
.interaction-row span,
.interaction-row small { overflow-wrap: anywhere; color: var(--soft); font: 500 0.56rem/1.5 "DM Mono", monospace; }

.admin-users {
  margin-top: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.history-row {
  padding: 13px 15px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.history-row > div {
  display: grid;
  gap: 2px;
}

.history-row > div:last-child { text-align: right; }
.history-row strong { color: var(--strong); font-size: 0.72rem; }
.history-row span,
.empty-state,
#admin-auth-status { color: var(--soft); font-size: 0.6rem; font-weight: 700; }

.admin-auth {
  max-width: 520px;
  margin: 75px auto 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.admin-auth input,
.admin-toolbar input {
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-strong);
}

#admin-auth-status {
  display: block;
  margin-top: 12px;
  text-align: center;
}

.admin-toolbar {
  margin-bottom: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.admin-event {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
}

.admin-event summary {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  cursor: pointer;
  font-size: 0.67rem;
  font-weight: 800;
}

.admin-event dl {
  margin: 0;
  padding: 0 16px 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.admin-event dl div {
  padding: 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
}

.admin-event dt { color: var(--soft); font-size: 0.55rem; }
.admin-event dd { margin: 3px 0 0; overflow-wrap: anywhere; color: var(--strong); font: 500 0.6rem "DM Mono", monospace; }

.site-footer nav {
  display: flex;
  gap: 18px;
}

.modal {
  width: min(500px, calc(100% - 28px));
  padding: 44px;
  border: 1px solid var(--glass-line);
  border-radius: 30px;
  color: var(--ink);
  background: var(--glass-strong);
  box-shadow: 0 45px 140px rgba(39, 12, 32, 0.32);
  backdrop-filter: blur(28px) saturate(1.2);
}

.modal::backdrop {
  background: rgba(43, 16, 36, 0.38);
  backdrop-filter: blur(10px);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: transparent;
  font-size: 1.25rem;
}

.modal h2 {
  margin: 0 0 24px;
  color: var(--strong);
  font: 700 clamp(1.6rem, 5vw, 2.3rem) "Comfortaa", sans-serif;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.email-control {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.22);
}

.email-control input {
  min-width: 0;
  height: 54px;
  padding: 0 15px;
  border: 0;
  outline: 0;
  background: transparent;
}

.email-control button {
  margin: 5px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: #351127;
  background: var(--gradient);
  font-size: 0.7rem;
  font-weight: 800;
}

.modal small {
  display: block;
  margin-top: 10px;
  color: var(--soft);
  font-size: 0.65rem;
  font-weight: 700;
}

#auth-code-step .text-button {
  width: 100%;
  margin-top: 8px;
}

.payment-modal {
  text-align: center;
}

.plan-list {
  display: grid;
  gap: 7px;
}

.plan-list span {
  padding: 13px 15px;
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 700;
}

.plan-list b {
  color: var(--strong);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  max-width: calc(100% - 36px);
  padding: 12px 15px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass-strong);
  box-shadow: 0 18px 55px rgba(55, 21, 47, 0.2);
  font-size: 0.72rem;
  font-weight: 800;
  backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 800px) {
  .hero {
    min-height: auto;
    padding-top: 150px;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero p {
    margin-inline: auto;
  }

  .scope-visual {
    width: min(500px, 100%);
    margin-inline: auto;
  }
}

@media (max-width: 620px) {
  :root {
    --shell: min(100% - 26px, 1040px);
  }

  .brand-link {
    font-size: 0;
  }

  .brand-link span {
    width: 38px;
    height: 38px;
    font-size: 0.8rem;
  }

  .site-header nav > * {
    padding-inline: 9px;
  }

  .site-header nav > a {
    display: none;
  }

  .hero {
    padding: 140px 0 80px;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 11.5vw, 4.4rem);
  }

  .hero h1 br {
    display: initial;
  }

  .scope-visual {
    min-height: 410px;
  }

  .scope-core {
    width: 210px;
  }

  .builder-section {
    padding: 105px 0;
  }

  .builder-shell {
    min-height: 640px;
    border-radius: 27px;
  }

  .builder-content {
    min-height: 560px;
    padding: 28px 20px;
  }

  .result-prompt-header {
    align-items: stretch;
    flex-direction: column;
  }

  .result-prompt .copy-button {
    width: 100%;
  }

  .choice-grid,
  .choice-grid.three,
  .review-grid,
  .two-fields {
    grid-template-columns: 1fr;
  }

  .review-item.full {
    grid-column: auto;
  }

  .dashboard-main { padding-top: 125px; }
  .dashboard-panel { padding: 16px; border-radius: 22px; }
  .metric-grid,
  .admin-metrics { grid-template-columns: 1fr 1fr; }
  .band-grid { grid-template-columns: 1fr 1fr; }
  .admin-event dl { grid-template-columns: 1fr; }
  .admin-auth { grid-template-columns: 1fr; }
  .dashboard-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .research-event-grid { grid-template-columns: 1fr 1fr; }
  .interaction-row { grid-template-columns: 1fr; gap: 7px; }

  .modal {
    padding: 42px 20px 25px;
    border-radius: 25px;
  }

  .email-control {
    grid-template-columns: 1fr;
    padding: 5px;
  }

  .email-control button {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
