:root {
  color-scheme: light;
  --bg: #fff8e7;
  --panel: #fffdfa;
  --ink: #213044;
  --muted: #687385;
  --line: #e5d8bd;
  --blue: #226dff;
  --blue-dark: #1554cf;
  --mint: #15b886;
  --coral: #ff6b51;
  --yellow: #ffd65a;
  --violet: #8a65e8;
  --rose: #ff7eb6;
  --shadow: 0 20px 50px rgba(61, 47, 19, 0.14);
  --radius: 8px;
  --sky-a: #36456d;
  --sky-b: #6b7b9e;
  --sky-c: #c7d3e6;
  --cloud-opacity: 1;
  --storm-opacity: 1;
  --sun-opacity: 0.18;
  --sun-x: 72%;
  --sun-y: 42px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 6%, rgba(255, 214, 90, 0.18), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(34, 109, 255, 0.16), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0)),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body[data-step-theme="1"] {
  --sky-a: #465d87;
  --sky-b: #7f9bc2;
  --sky-c: #d6e3f1;
  --cloud-opacity: 0.9;
  --storm-opacity: 0.78;
  --sun-opacity: 0.28;
  --sun-x: 74%;
  --sun-y: 34px;
}

body[data-step-theme="2"] {
  --sky-a: #5175a9;
  --sky-b: #8eb9de;
  --sky-c: #eef8ff;
  --cloud-opacity: 0.7;
  --storm-opacity: 0.48;
  --sun-opacity: 0.44;
  --sun-x: 76%;
  --sun-y: 25px;
}

body[data-step-theme="3"] {
  --sky-a: #4e91c8;
  --sky-b: #9bd3ee;
  --sky-c: #f8fdff;
  --cloud-opacity: 0.5;
  --storm-opacity: 0.26;
  --sun-opacity: 0.62;
  --sun-x: 79%;
  --sun-y: 18px;
}

body[data-step-theme="4"] {
  --sky-a: #39a5dc;
  --sky-b: #a9e4f7;
  --sky-c: #fff5cf;
  --cloud-opacity: 0.32;
  --storm-opacity: 0.12;
  --sun-opacity: 0.82;
  --sun-x: 82%;
  --sun-y: 12px;
}

body[data-step-theme="5"] {
  --sky-a: #18a6e8;
  --sky-b: #9ee8ff;
  --sky-c: #fff2b6;
  --cloud-opacity: 0.18;
  --storm-opacity: 0;
  --sun-opacity: 1;
  --sun-x: 84%;
  --sun-y: 8px;
}

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

button {
  cursor: pointer;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

textarea,
input {
  padding: 14px 15px;
}

select {
  padding: 13px 14px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(36, 107, 254, 0.12);
}

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

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 4vw, 4.4rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr auto;
  gap: 20px;
  align-items: center;
  overflow: hidden;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.2)),
    linear-gradient(180deg, var(--sky-a), var(--sky-b) 58%, var(--sky-c));
  box-shadow: 0 12px 32px rgba(37, 54, 85, 0.2);
  backdrop-filter: blur(14px);
  transition: background 700ms ease, box-shadow 700ms ease;
}

.topbar > *:not(.sky-scene) {
  position: relative;
  z-index: 2;
}

.sky-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.sky-cloud {
  position: absolute;
  width: 154px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  filter: drop-shadow(0 8px 14px rgba(55, 70, 96, 0.18));
  opacity: var(--cloud-opacity);
  transition: opacity 700ms ease, transform 700ms ease;
  animation: cloudDrift 12s ease-in-out infinite;
}

.sky-cloud::before,
.sky-cloud::after {
  content: "";
  position: absolute;
  bottom: 10px;
  border-radius: 999px;
  background: inherit;
}

.sky-cloud::before {
  left: 24px;
  width: 56px;
  height: 56px;
}

.sky-cloud::after {
  right: 24px;
  width: 72px;
  height: 72px;
}

.cloud-one {
  left: 15%;
  top: 18px;
}

.cloud-two {
  left: 48%;
  top: 44px;
  transform: scale(0.78);
  animation-delay: -4s;
}

.cloud-three {
  right: 8%;
  top: 64px;
  transform: scale(0.62);
  animation-delay: -7s;
}

@keyframes cloudDrift {
  0%,
  100% {
    translate: -12px 0;
  }
  50% {
    translate: 18px -3px;
  }
}

.sky-lightning {
  position: absolute;
  width: 22px;
  height: 46px;
  opacity: var(--storm-opacity);
  clip-path: polygon(45% 0, 100% 0, 64% 38%, 96% 38%, 28% 100%, 45% 50%, 0 50%);
  background: #ffe85c;
  filter: drop-shadow(0 0 12px rgba(255, 232, 92, 0.78));
  animation: lightningFlash 4.2s steps(1, end) infinite;
  transition: opacity 700ms ease;
}

.bolt-one {
  left: 28%;
  top: 52px;
}

.bolt-two {
  left: 61%;
  top: 24px;
  animation-delay: -1.8s;
  transform: scale(0.72);
}

@keyframes lightningFlash {
  0%,
  72%,
  100% {
    opacity: 0;
  }
  74%,
  77% {
    opacity: var(--storm-opacity);
  }
}

.sky-sun {
  position: absolute;
  left: var(--sun-x);
  top: var(--sun-y);
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: radial-gradient(circle, #fff9b7 0 28%, #ffd65a 29% 62%, rgba(255, 214, 90, 0) 63%);
  box-shadow:
    0 0 0 12px rgba(255, 214, 90, 0.16),
    0 0 46px rgba(255, 214, 90, 0.58);
  opacity: var(--sun-opacity);
  transform: translate(-50%, -18%);
  animation: sunSpark 3.8s ease-in-out infinite;
  transition:
    left 700ms ease,
    top 700ms ease,
    opacity 700ms ease;
}

@keyframes sunSpark {
  0%,
  100% {
    scale: 1;
  }
  50% {
    scale: 1.06;
  }
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 22px rgba(43, 58, 90, 0.12);
}

.brand-mark {
  position: relative;
  display: block;
  width: 58px;
  min-width: 58px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #dff4ff);
  box-shadow:
    inset 0 -8px 14px rgba(34, 109, 255, 0.08),
    0 8px 16px rgba(33, 48, 68, 0.16);
}

.logo-head {
  position: absolute;
  left: 11px;
  bottom: 8px;
  width: 27px;
  height: 30px;
  border: 3px solid var(--ink);
  border-radius: 45% 45% 38% 38%;
  background: #ffc785;
}

.logo-head::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -12px;
  width: 14px;
  height: 10px;
  border: 3px solid var(--ink);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.logo-eye {
  position: absolute;
  left: 8px;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 10px 0 0 var(--ink);
}

.logo-mouth {
  position: absolute;
  left: 10px;
  bottom: 7px;
  width: 9px;
  height: 5px;
  border-bottom: 2px solid var(--ink);
  border-radius: 0 0 999px 999px;
}

.logo-cloud {
  position: absolute;
  left: 3px;
  top: 7px;
  width: 28px;
  height: 12px;
  border-radius: 999px;
  background: #69748a;
  box-shadow:
    7px -6px 0 2px #596377,
    18px -3px 0 0 #7a8497;
}

.logo-cloud::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 12px;
  width: 10px;
  height: 18px;
  clip-path: polygon(44% 0, 100% 0, 62% 40%, 92% 40%, 20% 100%, 42% 52%, 0 52%);
  background: #ffe85c;
}

.logo-sun {
  position: absolute;
  right: 5px;
  top: 6px;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  background: #ffd65a;
  box-shadow: 0 0 0 5px rgba(255, 214, 90, 0.24);
  animation: logoSun 2.6s ease-in-out infinite;
}

@keyframes logoSun {
  0%,
  100% {
    scale: 1;
  }
  50% {
    scale: 1.1;
  }
}

.brand strong {
  color: #1d2b3e;
  font-size: 1.02rem;
}

.brand strong,
.brand small,
.map-header strong,
.map-header small {
  display: block;
}

.brand small,
.map-header small {
  color: var(--muted);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(72px, 1fr));
  gap: 8px;
}

.step-dot {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  color: #46566c;
  box-shadow: 0 8px 16px rgba(31, 48, 70, 0.08);
}

.step-dot span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #f4ead0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.step-dot small {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-dot.active {
  border-color: rgba(255, 214, 90, 0.8);
  background: #ffffff;
  color: var(--ink);
  box-shadow:
    0 9px 24px rgba(255, 214, 90, 0.2),
    0 0 0 3px rgba(255, 255, 255, 0.35);
}

.step-dot.active span {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #ffffff;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  gap: 22px;
  width: min(1440px, calc(100% - 40px));
  margin: 28px auto 120px;
}

.workspace {
  min-height: calc(100vh - 140px);
}

.step-panel {
  display: none;
  min-height: 640px;
  padding: clamp(24px, 4vw, 58px);
  border: 1px solid rgba(229, 216, 189, 0.92);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 98% 0%, rgba(255, 126, 182, 0.13), transparent 28%),
    radial-gradient(circle at 6% 0%, rgba(255, 214, 90, 0.18), transparent 32%),
    var(--panel);
  box-shadow: var(--shadow);
  animation: enterPanel 240ms ease both;
}

.step-panel.active {
  display: block;
}

@keyframes enterPanel {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--violet);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 720px;
  margin-bottom: 28px;
  color: #5d697a;
  font-size: 1.06rem;
  line-height: 1.55;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

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

.actions.right {
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.ghost-button,
.mini-button,
.icon-button,
.map-button {
  min-height: 48px;
  border-radius: var(--radius);
  font-weight: 850;
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    background 170ms ease,
    border-color 170ms ease;
}

.primary-button {
  border: 0;
  padding: 0 22px;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(36, 107, 254, 0.22);
}

.primary-button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.primary-button.compact {
  min-width: 112px;
}

.secondary-button {
  border: 1px solid rgba(16, 185, 129, 0.38);
  padding: 0 18px;
  background: #eafff7;
  color: #047857;
}

.secondary-button:hover {
  border-color: var(--mint);
  transform: translateY(-1px);
}

.ghost-button {
  border: 1px solid var(--line);
  padding: 0 18px;
  background: #ffffff;
  color: var(--ink);
}

.ghost-button:hover,
.mini-button:hover,
.icon-button:hover,
.map-button:hover {
  border-color: #bfb6a7;
  transform: translateY(-1px);
}

.mini-button {
  min-height: 36px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: #ffffff;
}

.icon-button {
  display: grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 1.35rem;
}

.ai-strip {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid rgba(16, 185, 129, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(90deg, #f3fff9, #ffffff);
}

.ai-strip strong,
.ai-strip span {
  display: block;
}

.strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.ai-strip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.92rem;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 18px;
}

.criteria-form {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(150px, 0.9fr) minmax(120px, 0.7fr) auto;
  gap: 10px;
  margin-bottom: 20px;
}

.list-stack,
.criteria-grid,
.weight-list {
  display: grid;
  gap: 12px;
}

.option-row,
.criterion-card,
.weight-row,
.result-card,
.value-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.option-row input {
  border-color: transparent;
  background: #fbfaf7;
  font-weight: 760;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.danger-button {
  min-height: 42px;
  border: 1px solid rgba(245, 106, 77, 0.32);
  border-radius: var(--radius);
  background: #fff1ed;
  color: #b7351f;
  font-weight: 850;
}

.criteria-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.criterion-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.criterion-card header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.criterion-card strong {
  display: block;
  font-size: 1rem;
}

.criterion-card small,
.value-row small,
.result-card small {
  color: var(--muted);
}

.criterion-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1efe8;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
}

.pill.blue {
  background: #edf3ff;
  color: #1648b6;
}

.pill.coral {
  background: #fff1ed;
  color: #b7351f;
}

.pill.mint {
  background: #eafff7;
  color: #047857;
}

.focus-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.focus-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.focus-head small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-weight: 800;
}

.focus-head h3 {
  margin-bottom: 0;
}

.focus-values {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.value-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr) minmax(140px, 0.5fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.value-row.manual {
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr) minmax(120px, 0.45fr);
}

.map-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  border: 1px solid var(--line);
  padding: 0 18px;
  background: #ffffff;
  color: var(--ink);
}

.weight-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1fr) 56px;
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.weight-row strong,
.weight-row small {
  display: block;
}

.weight-row small {
  margin-top: 4px;
  color: var(--muted);
}

.weight-value {
  display: grid;
  width: 52px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  font-weight: 900;
}

input[type="range"] {
  accent-color: var(--blue);
  padding: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.result-card.winner {
  border-color: rgba(245, 197, 66, 0.78);
  box-shadow: 0 18px 32px rgba(245, 197, 66, 0.2);
  animation: winnerPulse 1.8s ease-in-out infinite;
}

@keyframes winnerPulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.rank {
  display: inline-grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 900;
}

.score {
  margin: 18px 0 8px;
  font-size: 3rem;
  font-weight: 950;
  line-height: 0.9;
}

.score small {
  font-size: 1rem;
}

.score-bars {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece8df;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
}

.summary-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.summary-head {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.summary-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

#summaryText {
  padding: 16px;
  color: var(--ink);
  line-height: 1.55;
}

#summaryText p {
  margin-bottom: 10px;
}

.decision-map {
  position: sticky;
  top: 100px;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.map-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.map-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.map-stats div {
  padding: 14px;
  border-right: 1px solid var(--line);
}

.map-stats div:last-child {
  border-right: 0;
}

.map-stats span,
.map-stats small {
  display: block;
}

.map-stats span {
  font-size: 1.35rem;
  font-weight: 950;
}

.map-stats small {
  color: var(--muted);
  font-size: 0.75rem;
}

.mini-table {
  max-height: 520px;
  overflow: auto;
  padding: 12px;
}

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eee9df;
  font-size: 0.86rem;
}

.mini-row:last-child {
  border-bottom: 0;
}

.mini-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-row span {
  color: var(--muted);
}

.guide {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 25;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}

.guide-controls {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.guide-toggle {
  min-height: 30px;
  border: 1px solid rgba(229, 216, 189, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #506073;
  font-size: 0.72rem;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.1);
}

.guide-body {
  display: grid;
  grid-template-columns: 88px minmax(210px, 320px);
  gap: 12px;
  align-items: end;
}

.guide-mascot {
  position: relative;
  width: 88px;
  height: 96px;
  transform-origin: 50% 80%;
  pointer-events: none;
  animation: squirrelBounce 2.2s ease-in-out infinite;
}

.squirrel-tail {
  position: absolute;
  left: 2px;
  top: 11px;
  width: 48px;
  height: 68px;
  border: 5px solid #8a4d22;
  border-right-width: 12px;
  border-bottom-width: 10px;
  border-radius: 60% 25% 70% 45%;
  background: linear-gradient(135deg, #d88736, #ffbd6b 58%, #f47f45);
  transform: rotate(-18deg);
  box-shadow: inset -8px -6px 0 rgba(122, 65, 24, 0.18);
}

.squirrel-body {
  position: absolute;
  right: 5px;
  bottom: 15px;
  width: 58px;
  height: 62px;
  border: 3px solid #213044;
  border-radius: 46% 46% 42% 42%;
  background:
    radial-gradient(circle at 50% 72%, #ffe0b5 0 17px, transparent 18px),
    linear-gradient(145deg, #c46f2c, #f39a47 58%, #ffbe71);
  box-shadow: 0 12px 18px rgba(31, 41, 51, 0.16);
}

.squirrel-ear {
  position: absolute;
  top: -14px;
  width: 17px;
  height: 19px;
  border: 3px solid #213044;
  border-radius: 70% 70% 35% 35%;
  background: #d88736;
}

.ear-left {
  left: 9px;
  transform: rotate(-20deg);
}

.ear-right {
  right: 7px;
  transform: rotate(20deg);
}

.squirrel-eye {
  position: absolute;
  top: 18px;
  width: 6px;
  height: 7px;
  border-radius: 999px;
  background: #213044;
}

.eye-left {
  left: 18px;
}

.eye-right {
  right: 17px;
}

.squirrel-cheek {
  position: absolute;
  left: 15px;
  top: 31px;
  width: 30px;
  height: 14px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 7px 7px, rgba(255, 126, 182, 0.55) 0 5px, transparent 6px),
    radial-gradient(circle at 23px 7px, rgba(255, 126, 182, 0.55) 0 5px, transparent 6px);
}

.squirrel-mouth {
  position: absolute;
  left: 25px;
  top: 35px;
  width: 11px;
  height: 7px;
  border-bottom: 3px solid #213044;
  border-radius: 0 0 999px 999px;
}

.squirrel-arm {
  position: absolute;
  top: 37px;
  width: 18px;
  height: 7px;
  border-radius: 999px;
  background: #8a4d22;
}

.arm-left {
  left: -6px;
  transform: rotate(28deg);
}

.arm-right {
  right: -8px;
  transform: rotate(-28deg);
}

.squirrel-snack,
.squirrel-camera {
  position: absolute;
  opacity: 0;
  transition: opacity 180ms ease;
}

.squirrel-snack {
  right: -10px;
  top: 47px;
  width: 14px;
  height: 19px;
  border-radius: 999px 999px 8px 8px;
  background: #7a4d25;
  transform: rotate(22deg);
}

.squirrel-camera {
  right: -18px;
  top: 28px;
  width: 24px;
  height: 17px;
  border: 3px solid #213044;
  border-radius: 5px;
  background:
    radial-gradient(circle at 13px 9px, #9ee8ff 0 4px, #213044 5px 7px, transparent 8px),
    #fffdfa;
}

.squirrel-shadow {
  position: absolute;
  left: 20px;
  bottom: 4px;
  width: 56px;
  height: 12px;
  border-radius: 999px;
  background: rgba(31, 41, 51, 0.16);
  filter: blur(1px);
}

.guide-bubble {
  position: relative;
  padding: 13px 15px;
  border: 1px solid rgba(229, 216, 189, 0.95);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 220, 0.95)),
    #ffffff;
  box-shadow: 0 14px 30px rgba(31, 41, 51, 0.14);
  pointer-events: auto;
}

.guide-bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  bottom: 22px;
  width: 16px;
  height: 16px;
  border-left: 1px solid rgba(229, 216, 189, 0.95);
  border-bottom: 1px solid rgba(229, 216, 189, 0.95);
  background: #fffdf5;
  transform: rotate(45deg);
}

.guide-bubble small {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 6px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eafff7;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 900;
}

.guide p {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.35;
}

.guide.hide-speech .guide-bubble {
  display: none;
}

.guide.hide-speech .guide-body {
  grid-template-columns: 88px;
}

.guide.hide-all .guide-body {
  display: none;
}

.guide.hide-all .guide-controls {
  opacity: 0.78;
}

@keyframes squirrelBounce {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

.guide-mascot.action-look .squirrel-eye {
  transform: translateX(3px);
}

.guide-mascot.action-scratch .ear-left,
.guide-mascot.action-scratch .ear-right {
  animation: earScratch 420ms ease-in-out infinite;
}

@keyframes earScratch {
  50% {
    transform: rotate(0deg) translateY(2px);
  }
}

.guide-mascot.action-spin {
  animation: squirrelSpin 1.1s ease-in-out infinite;
}

@keyframes squirrelSpin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  55% {
    transform: rotate(370deg) scale(1.04);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.guide-mascot.action-tease .squirrel-mouth {
  width: 13px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: #ff4f86;
}

.guide-mascot.action-laugh .squirrel-mouth {
  left: 22px;
  top: 34px;
  width: 17px;
  height: 12px;
  border: 3px solid #213044;
  border-top: 0;
  background: #ffffff;
}

.guide-mascot.action-think::after {
  content: "?";
  position: absolute;
  right: -2px;
  top: -12px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #ffffff;
  color: var(--violet);
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.14);
}

.guide-mascot.action-eat .squirrel-snack,
.guide-mascot.action-photo .squirrel-camera {
  opacity: 1;
}

.modal {
  width: min(560px, calc(100% - 28px));
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  background: transparent;
}

.modal.wide {
  width: min(1120px, calc(100% - 28px));
}

.modal::backdrop {
  background: rgba(31, 41, 51, 0.38);
  backdrop-filter: blur(5px);
}

.modal-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-head h3 {
  margin-bottom: 0;
}

.notice {
  margin: 12px 0 0;
  padding: 12px;
  border-left: 4px solid var(--yellow);
  background: #fff8dc;
  color: #6d5510;
  line-height: 1.45;
}

.data-table-wrap {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfaf7;
  font-size: 0.82rem;
}

.data-table td:first-child,
.data-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  max-width: 190px;
  background: #fbfaf7;
}

.data-table input {
  min-width: 150px;
  padding: 10px;
  font-size: 0.86rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  width: min(520px, calc(100% - 32px));
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow);
  text-align: center;
  transform: translate(-50%, 120px);
  opacity: 0;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
}

.empty-state {
  padding: 18px;
  border: 1px dashed #cfc8ba;
  border-radius: var(--radius);
  background: #fffefa;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .brand {
    max-width: min(100%, 520px);
  }

  .stepper {
    grid-column: 1 / -1;
    order: 3;
  }

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

  .decision-map {
    position: static;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px;
  }

  .brand {
    gap: 9px;
    padding: 7px;
  }

  .brand-mark {
    width: 50px;
    min-width: 50px;
    height: 48px;
  }

  .brand small {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stepper {
    grid-template-columns: repeat(6, 42px);
    overflow-x: auto;
    justify-content: start;
  }

  .step-dot {
    min-height: 42px;
    padding: 0;
  }

  .step-dot small {
    display: none;
  }

  .app-shell {
    width: min(100% - 20px, 1440px);
    margin-top: 14px;
  }

  .step-panel {
    min-height: auto;
    padding: 22px;
  }

  .ai-strip,
  .summary-head {
    align-items: stretch;
    flex-direction: column;
  }

  .strip-actions {
    justify-content: stretch;
  }

  .strip-actions button {
    width: 100%;
  }

  .inline-form,
  .criteria-form,
  .value-row,
  .value-row.manual,
  .weight-row {
    grid-template-columns: 1fr;
  }

  .guide {
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
  }

  .guide-controls {
    max-width: 100%;
  }

  .guide-toggle {
    min-height: 28px;
    padding: 0 9px;
    font-size: 0.68rem;
  }

  .guide-body {
    grid-template-columns: 66px minmax(160px, 1fr);
    max-width: calc(100vw - 24px);
  }

  .guide-mascot {
    width: 66px;
    height: 76px;
    transform: scale(0.78);
    transform-origin: bottom right;
  }

  .guide-bubble {
    padding: 10px 12px;
  }

  .guide-bubble small {
    min-height: 22px;
    margin-bottom: 5px;
    font-size: 0.68rem;
  }

  .guide p {
    font-size: 0.82rem;
  }
}
