/* =========================================================
   今天吃什么 · visual system
   ========================================================= */

:root {
  --ink: #1b1a17;
  --ink-soft: #403d36;
  --paper: #fffdf8;
  --paper-warm: #f8f3e7;
  --page: #f4efe3;
  --muted: #726d61;
  --line: rgba(27, 26, 23, 0.16);
  --line-strong: rgba(27, 26, 23, 0.72);
  --danger: #b4233d;
  --danger-soft: #fff0f2;
  --success: #2f7d4a;

  --accent: #8ee5f5;
  --accent-strong: #46cfe6;
  --accent-deep: #0d6b7b;
  --accent-soft: #e8fafd;
  --accent-wash: #d3f5fb;
  --accent-contrast: #062f36;
  --page-glow: rgba(142, 229, 245, 0.64);
  --page-glow-two: rgba(255, 224, 138, 0.34);

  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --shadow-hard: 6px 6px 0 var(--ink);
  --shadow-panel: 4px 4px 0 rgba(27, 26, 23, 0.14);
  --shadow-soft: 0 24px 70px rgba(51, 43, 24, 0.1);
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-english: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

html[data-theme="sky"] {
  --accent: #8ee5f5;
  --accent-strong: #46cfe6;
  --accent-deep: #0d6b7b;
  --accent-soft: #e8fafd;
  --accent-wash: #d3f5fb;
  --accent-contrast: #062f36;
  --page-glow: rgba(142, 229, 245, 0.64);
  --page-glow-two: rgba(255, 224, 138, 0.34);
}

html[data-theme="coral"] {
  --accent: #f55877;
  --accent-strong: #d92b50;
  --accent-deep: #9f1735;
  --accent-soft: #fff0f3;
  --accent-wash: #ffdce4;
  --accent-contrast: #390814;
  --page-glow: rgba(245, 88, 119, 0.28);
  --page-glow-two: rgba(142, 229, 245, 0.32);
}

html[data-theme="lime"] {
  --accent: #ccffb8;
  --accent-strong: #85dc62;
  --accent-deep: #3d782b;
  --accent-soft: #f3ffed;
  --accent-wash: #e1ffd4;
  --accent-contrast: #17330e;
  --page-glow: rgba(204, 255, 184, 0.76);
  --page-glow-two: rgba(142, 229, 245, 0.22);
}

html[data-theme="cream"] {
  --accent: #fffce6;
  --accent-strong: #e8d76a;
  --accent-deep: #7d6200;
  --accent-soft: #fffdf2;
  --accent-wash: #fff7c9;
  --accent-contrast: #3d2f00;
  --page-glow: rgba(255, 236, 128, 0.52);
  --page-glow-two: rgba(245, 88, 119, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  background:
    radial-gradient(1000px 620px at 0% -8%, var(--page-glow), transparent 62%),
    radial-gradient(900px 540px at 102% 8%, var(--page-glow-two), transparent 62%),
    var(--page);
  overflow-x: hidden;
  transition: background-color 0.35s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.14;
  background-image: radial-gradient(rgba(27, 26, 23, 0.7) 0.55px, transparent 0.55px);
  background-size: 5px 5px;
  mask-image: linear-gradient(to bottom, #000, rgba(0, 0, 0, 0.35));
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
label:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  color: var(--accent-contrast);
  background: var(--accent);
}

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

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(4px);
  opacity: 0.72;
  transition: background 0.4s ease;
}

.ambient-a {
  top: 60%;
  left: -260px;
  background: var(--accent);
}

.ambient-b {
  top: 20%;
  right: -310px;
  background: var(--accent-wash);
}

/* ---------- header ---------- */

.site-header {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-5deg);
  transition: transform 0.2s ease, background-color 0.35s ease;
}

.brand:hover .brand-mark {
  transform: rotate(2deg) translateY(-1px);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.brand-text strong {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.brand-text small {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--font-english);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.7);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.save-pill.is-saved {
  color: var(--success);
  border-color: rgba(47, 125, 74, 0.25);
}

.save-pill.is-error {
  color: var(--danger);
  border-color: rgba(180, 35, 61, 0.3);
}

.save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #57a36e;
  box-shadow: 0 0 0 3px rgba(87, 163, 110, 0.13);
}

.save-pill.is-error .save-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 61, 0.12);
}

.theme-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(8px);
}

.theme-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.theme-swatch {
  position: relative;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.58);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.theme-swatch:hover {
  transform: translateY(-2px) scale(1.05);
}

.theme-swatch[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72), 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);
  transform: scale(0.92);
}

.swatch-sky {
  background: #8ee5f5;
}

.swatch-coral {
  background: #f55877;
}

.swatch-lime {
  background: #ccffb8;
}

.swatch-cream {
  background: #fffce6;
}

/* ---------- layout ---------- */

.page {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 6px 0 90px;
}

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  align-items: start;
  gap: 28px;
}

.studio-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

.intro {
  padding: 20px 6px 24px;
  animation: rise-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-family: var(--font-english);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.19em;
  line-height: 1.2;
}

.eyebrow-line {
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--ink);
}

.intro h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(68px, 8.2vw, 116px);
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 0.92;
}

.accent-word {
  display: inline-block;
  margin: 0.06em 0.04em 0.04em 0;
  padding: 0.015em 0.085em 0.08em;
  border: 2px solid var(--ink);
  border-radius: 0.2em;
  background: var(--accent);
  box-shadow: 0.055em 0.055em 0 var(--ink);
  transform: rotate(-1.3deg);
  transition: background-color 0.35s ease;
}

.title-punct {
  display: inline-block;
  transform: translateY(-0.03em);
}

.intro-copy {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.intro-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.58);
  color: var(--ink-soft);
  font-weight: 650;
}

.meta-chip span {
  font-weight: 850;
}

.meta-separator {
  opacity: 0.38;
}

/* ---------- wheel ---------- */

.wheel-card {
  position: relative;
  padding: 25px 25px 20px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-xl);
  background: var(--accent);
  box-shadow: var(--shadow-hard);
  transition: background-color 0.35s ease;
  animation: rise-in 0.7s 0.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.wheel-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 0 2px;
}

.kicker {
  display: block;
  color: var(--ink-soft);
  font-family: var(--font-english);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

.wheel-card h2,
.panel h2,
.section-head h2 {
  margin: 4px 0 0;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.wheel-card h2 {
  font-size: 25px;
  line-height: 1.1;
}

.count-badge {
  display: inline-grid;
  min-width: 45px;
  height: 36px;
  padding: 0 10px;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 13px;
  background: var(--paper);
  font-family: var(--font-english);
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 2px 2px 0 rgba(27, 26, 23, 0.2);
}

.count-badge-small {
  min-width: 37px;
  height: 30px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: none;
}

.wheel-wrap {
  position: relative;
  width: min(100%, 610px);
  margin: 10px auto 17px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

#wheelCanvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: drop-shadow(0 18px 22px rgba(39, 45, 43, 0.16));
}

.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 5;
  width: 44px;
  height: auto;
  color: var(--ink);
  transform: translateX(-50%) rotate(0.5deg);
  filter: drop-shadow(0 3px 0 rgba(255, 253, 248, 0.7));
  pointer-events: none;
}

.wheel-pointer svg {
  display: block;
  width: 100%;
  height: auto;
}

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: 27%;
  min-width: 114px;
  max-width: 158px;
  aspect-ratio: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(27, 26, 23, 0.18), inset 0 0 0 7px var(--accent-soft);
  transform: translate(-50%, -50%);
  transition: background-color 0.35s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.wheel-hub:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.035);
  box-shadow: 0 7px 0 rgba(27, 26, 23, 0.16), inset 0 0 0 7px var(--accent-wash);
}

.wheel-hub:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.98);
}

.wheel-hub:disabled {
  cursor: not-allowed;
}

.wheel-hub span {
  color: var(--muted);
  font-family: var(--font-english);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.wheel-hub strong {
  margin: -1px 0 -3px;
  font-family: var(--font-english);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 900;
  line-height: 1;
}

.wheel-hub small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.wheel-empty {
  position: absolute;
  inset: 22%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.92);
  text-align: center;
}

.wheel-empty span {
  font-size: 30px;
}

.wheel-empty strong {
  margin-top: 4px;
  font-size: 17px;
}

.wheel-empty small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.spin-btn {
  display: grid;
  width: 100%;
  min-height: 61px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  border-radius: 19px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 0 rgba(27, 26, 23, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.2s ease;
}

.spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(27, 26, 23, 0.2);
}

.spin-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(27, 26, 23, 0.24);
}

.spin-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.spin-btn-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  transition: background-color 0.35s ease;
}

.spin-btn-icon .icon {
  width: 20px;
  height: 20px;
}

.spin-arrow {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 253, 248, 0.3);
  border-radius: 50%;
}

.spin-btn.is-spinning .spin-btn-icon {
  animation: spin 1.1s linear infinite;
}

.spin-hint {
  margin: 11px 0 0;
  color: var(--accent-contrast);
  font-size: 11px;
  font-weight: 550;
  text-align: center;
  opacity: 0.72;
}

/* ---------- result ---------- */

.result-card {
  min-height: 98px;
  padding: 17px 20px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-panel);
}

.result-idle {
  display: flex;
  min-height: 61px;
  align-items: center;
  gap: 15px;
}

.result-idle .result-emoji {
  display: grid;
  width: 51px;
  height: 51px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--accent-soft);
  font-size: 25px;
  transform: rotate(-3deg);
}

.result-idle p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.result-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  animation: result-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.result-emoji {
  font-size: 44px;
  line-height: 1;
}

.result-copy {
  min-width: 0;
}

.result-copy h2 {
  margin: 2px 0 1px;
  overflow: hidden;
  font-size: clamp(24px, 3vw, 33px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
}

.result-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1.5px solid var(--ink);
  border-radius: 13px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.btn-dark {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 3px 0 rgba(27, 26, 23, 0.17);
}

.btn-dark:hover:not(:disabled) {
  background: #050504;
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 3px 0 rgba(27, 26, 23, 0.17);
  transition: background-color 0.35s ease, transform 0.15s ease;
}

.btn-ghost {
  background: var(--paper);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--accent-soft);
}

.btn.full {
  width: 100%;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: rgba(27, 26, 23, 0.23);
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.text-btn:hover {
  color: var(--ink);
}

.text-btn .icon {
  width: 14px;
  height: 14px;
}

.text-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* ---------- side panels ---------- */

.studio-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
  padding-top: 20px;
  animation: rise-in 0.7s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.panel {
  padding: 21px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-panel);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  font-size: 22px;
  line-height: 1.15;
}

.panel-head.compact h2 {
  font-size: 19px;
}

.add-form {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 17px;
  padding: 4px;
  border: 1.5px solid var(--line-strong);
  border-radius: 15px;
  background: var(--paper-warm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.add-form:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.add-form input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.add-form input::placeholder {
  color: #8a8579;
}

.add-btn {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.add-btn:hover {
  transform: rotate(4deg) scale(1.03);
  background: var(--accent-deep);
}

.add-btn .icon {
  width: 18px;
  height: 18px;
}

.form-hint {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 10px;
}

.form-hint.is-error {
  color: var(--danger);
}

.item-list {
  display: flex;
  max-height: 314px;
  flex-direction: column;
  gap: 4px;
  margin: 14px -5px 0;
  padding: 0 5px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(27, 26, 23, 0.22) transparent;
}

.item-list::-webkit-scrollbar,
.recognized-list::-webkit-scrollbar {
  width: 5px;
}

.item-list::-webkit-scrollbar-thumb,
.recognized-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(27, 26, 23, 0.2);
}

.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 7px;
  border-radius: 13px;
  transition: background-color 0.15s ease;
}

.item-row:hover,
.item-row:focus-within {
  background: var(--accent-soft);
}

.item-emoji {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  font-size: 18px;
}

.item-name {
  overflow: hidden;
  flex: 1;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  opacity: 0.58;
  transition: opacity 0.15s ease;
}

.item-row:hover .item-actions,
.item-row:focus-within .item-actions {
  opacity: 1;
}

.icon-btn {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--paper);
  color: var(--ink);
}

.icon-btn.is-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-btn .icon {
  width: 14px;
  height: 14px;
}

.menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.auto-save-note {
  color: var(--muted);
  font-size: 10px;
}

.empty-state.small {
  padding: 23px 12px 15px;
  text-align: center;
}

.empty-state.small > span {
  font-size: 28px;
}

.empty-state.small p {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.panel-desc {
  margin: 10px 0 13px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.removed-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.removed-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 4px 4px 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-warm);
  font-size: 11.5px;
  font-weight: 650;
}

.removed-chip > span {
  overflow: hidden;
  max-width: 178px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-btn {
  display: inline-flex;
  width: 23px;
  height: 23px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.chip-btn:hover {
  background: var(--accent);
  color: var(--ink);
}

.chip-btn .icon {
  width: 12px;
  height: 12px;
}

.mini-empty {
  margin: 2px 0 0;
  color: #938e82;
  font-size: 11px;
  font-style: italic;
}

.removed-panel .text-btn {
  margin-top: 11px;
}

/* ---------- section headings / AI ---------- */

.ai-section,
.history-section {
  margin-top: 74px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 20px;
}

.section-head .eyebrow {
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(34px, 4.4vw, 50px);
  line-height: 1.05;
}

.section-desc {
  max-width: 420px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
  text-align: right;
}

.config-notice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1.5px solid #c59100;
  border-radius: 16px;
  background: #fff5ce;
  color: #4e3b00;
  box-shadow: 3px 3px 0 rgba(197, 145, 0, 0.13);
}

.notice-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border: 1.5px solid #4e3b00;
  border-radius: 50%;
  font-family: var(--font-english);
  font-size: 14px;
  font-weight: 900;
}

.config-notice strong {
  display: block;
  font-size: 12.5px;
}

.config-notice p {
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
}

.ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: start;
  gap: 22px;
}

.ai-card {
  position: relative;
  padding: 24px;
  border-width: 1.5px;
  border-radius: 29px;
  box-shadow: 5px 5px 0 rgba(27, 26, 23, 0.13);
}

.recommend-card {
  background:
    linear-gradient(145deg, var(--accent-soft) 0%, rgba(255, 253, 248, 0) 58%),
    var(--paper);
  transition: background 0.35s ease;
}

.ai-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ai-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-2deg);
  transition: background-color 0.35s ease;
}

.ai-icon .icon {
  width: 20px;
  height: 20px;
}

.ai-card-head h3 {
  margin: 2px 0 0;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.ai-badge {
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-family: var(--font-english);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.ai-desc {
  margin: 14px 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.ai-desc strong {
  color: var(--ink);
}

.drop-zone {
  display: block;
  min-height: 94px;
  padding: 14px;
  border: 1.5px dashed rgba(27, 26, 23, 0.42);
  border-radius: 17px;
  background: rgba(255, 253, 248, 0.54);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragover {
  border-color: var(--ink);
  background: var(--accent-soft);
}

.drop-zone.is-dragover {
  transform: scale(1.008);
}

.upload-idle {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
}

.upload-icon {
  display: grid;
  width: 47px;
  height: 47px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-wash);
  color: var(--ink);
}

.upload-icon .icon {
  width: 22px;
  height: 22px;
}

.upload-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.upload-copy strong {
  font-size: 12.5px;
  font-weight: 750;
}

.upload-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.upload-cta {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 10px;
  font-weight: 700;
}

.upload-preview {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
}

.upload-preview img {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: cover;
}

.preview-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.preview-copy strong {
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

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

.ai-actions .btn {
  flex: 0 0 auto;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid rgba(27, 26, 23, 0.2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.alert {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(180, 35, 61, 0.32);
  border-radius: 12px;
  background: var(--danger-soft);
  color: #86172c;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.6;
}

.recognize-results {
  margin-top: 17px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.recognize-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.recognize-head h4 {
  margin: 3px 0 0;
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.025em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.recognize-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.check-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10.5px;
  white-space: nowrap;
}

.check-all input,
.recognized-item input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent-deep);
  cursor: pointer;
}

.recognized-list {
  display: flex;
  max-height: 248px;
  flex-direction: column;
  gap: 3px;
  margin: 12px -4px 12px 0;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(27, 26, 23, 0.22) transparent;
}

.recognized-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 8px;
  border-radius: 10px;
  background: var(--paper-warm);
  transition: background-color 0.15s ease;
}

.recognized-item:hover {
  background: var(--accent-soft);
}

.recognized-item label {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.recognized-name {
  overflow: hidden;
  flex: 1;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recognized-price {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.recognized-item.is-added {
  opacity: 0.5;
}

.recognized-empty {
  padding: 18px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.field-label {
  display: block;
  margin: 16px 0 6px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
}

.field-label span {
  color: var(--muted);
  font-weight: 500;
}

.mood-input,
.modal-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 253, 248, 0.76);
  color: var(--ink);
  font-size: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mood-input::placeholder,
.modal-input::placeholder {
  color: #938e82;
}

.mood-input:focus,
.modal-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.recommend-card > .btn {
  margin-top: 12px;
}

.recommend-result {
  margin-top: 15px;
  padding: 17px;
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 3px 3px 0 rgba(27, 26, 23, 0.13);
  animation: result-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.recommend-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-pick-emoji {
  font-size: 27px;
  line-height: 1;
}

.recommend-result h4 {
  margin: 2px 0 4px;
  font-size: 32px;
  font-weight: 950;
  letter-spacing: -0.05em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.recommend-reason {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.recommend-tip {
  margin: 11px 0 0;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.recommend-alt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 11px;
  font-size: 10px;
  color: var(--muted);
}

.recommend-alt > span {
  padding-top: 3px;
}

.recommend-alt > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.alt-chip {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-warm);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

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

.recommend-actions .btn {
  flex: 1;
}

/* ---------- history ---------- */

.history-head {
  align-items: flex-end;
}

.history-tools {
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

.history-tools .text-btn {
  flex: 0 0 auto;
  padding-bottom: 3px;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.history-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 17px;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 3px 3px 0 rgba(27, 26, 23, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.history-card:hover {
  transform: translateY(-2px);
  box-shadow: 4px 5px 0 rgba(27, 26, 23, 0.13);
}

.history-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-time {
  color: var(--muted);
  font-family: var(--font-english);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.history-source {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 650;
}

.history-pick {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.history-pick span {
  font-size: 24px;
  line-height: 1;
}

.history-pick strong {
  overflow: hidden;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-snapshot-preview {
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card details {
  margin-top: 8px;
}

.history-card summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  list-style: none;
  user-select: none;
}

.history-card summary::-webkit-details-marker {
  display: none;
}

.history-card summary .icon {
  width: 12px;
  height: 12px;
  transition: transform 0.18s ease;
}

.history-card details[open] summary .icon {
  transform: rotate(180deg);
}

.snapshot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.snapshot-chip {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-warm);
  color: var(--ink-soft);
  font-size: 9.5px;
}

.history-restore {
  width: 100%;
  margin-top: auto;
  padding-top: 13px;
}

.history-restore .btn {
  width: 100%;
  min-height: 35px;
  font-size: 11px;
}

.empty-state.history-empty {
  padding: 49px 24px;
  border: 1.5px dashed rgba(27, 26, 23, 0.32);
  border-radius: 27px;
  background: rgba(255, 253, 248, 0.42);
  text-align: center;
}

.empty-wheel {
  display: inline-grid;
  width: 55px;
  height: 55px;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--accent-soft);
}

.empty-wheel .icon {
  width: 25px;
  height: 25px;
}

.empty-state h3 {
  margin: 12px 0 3px;
  font-size: 17px;
  font-weight: 850;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  width: min(1320px, calc(100% - 48px));
  align-items: center;
  justify-content: space-between;
  column-gap: 20px;
  row-gap: 8px;
  margin: 0 auto;
  padding: 23px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
}

.site-signature {
  flex: 1 0 100%;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--ink-soft);
  font-weight: 650;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- modals, toast, confetti ---------- */

.modal {
  width: min(92vw, 454px);
  max-height: 90vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(20, 18, 13, 0.48);
  backdrop-filter: blur(5px);
}

.modal[open] {
  animation: modal-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-card {
  padding: 27px;
  border: 2px solid var(--ink);
  border-radius: 25px;
  background: var(--paper);
  box-shadow: 9px 9px 0 rgba(27, 26, 23, 0.48);
}

.modal-card h2 {
  margin: 4px 0 14px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.modal-input {
  min-height: 49px;
  font-size: 14px;
  font-weight: 600;
}

.modal-copy {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-line;
}

.form-error {
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 21px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 120;
  display: flex;
  max-width: min(90vw, 560px);
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border: 1.5px solid rgba(255, 253, 248, 0.25);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 550;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.toast button {
  flex: 0 0 auto;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 110;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  background: var(--confetti-color, var(--accent));
  opacity: 0;
  animation: confetti 1.05s cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}

/* ---------- animations ---------- */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes result-pop {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes confetti {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--confetti-x)), calc(-50% + var(--confetti-y))) rotate(var(--confetti-r));
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1120px) {
  .studio {
    grid-template-columns: minmax(0, 1fr) 368px;
    gap: 22px;
  }

  .ai-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }

  .intro h1 {
    font-size: clamp(64px, 8.4vw, 95px);
  }

  .history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .studio {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio-side {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: start;
    padding-top: 0;
  }

  .item-list {
    max-height: 280px;
  }

  .ai-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .recommend-card {
    min-height: 0;
  }

  .section-desc {
    max-width: 330px;
  }
}

@media (max-width: 720px) {
  .site-header {
    width: min(100% - 28px, 1320px);
    padding: 18px 0 13px;
    gap: 10px;
  }

  .brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 13px;
    font-size: 21px;
  }

  .brand-text strong {
    font-size: 14px;
  }

  .brand-text small {
    font-size: 8px;
  }

  .save-pill {
    display: none;
  }

  .theme-picker {
    gap: 6px;
    padding: 4px 6px;
  }

  .theme-label {
    display: none;
  }

  .theme-swatch {
    width: 24px;
    height: 24px;
  }

  .page {
    width: min(100% - 28px, 1320px);
    padding-bottom: 62px;
  }

  .intro {
    padding: 16px 2px 20px;
  }

  .intro h1 {
    font-size: clamp(54px, 16vw, 78px);
    letter-spacing: -0.08em;
  }

  .intro-copy {
    margin-top: 19px;
    font-size: 13px;
  }

  .wheel-card {
    padding: 19px 17px 16px;
    border-radius: 27px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .wheel-card h2 {
    font-size: 22px;
  }

  .wheel-wrap {
    margin-top: 5px;
  }

  .wheel-pointer {
    width: 37px;
    top: -8px;
  }

  .wheel-hub {
    min-width: 92px;
    box-shadow: 0 4px 0 rgba(27, 26, 23, 0.17), inset 0 0 0 5px var(--accent-soft);
  }

  .wheel-hub strong {
    font-size: 30px;
  }

  .spin-btn {
    min-height: 56px;
    font-size: 15px;
  }

  .result-card {
    padding: 15px;
  }

  .result-active {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }

  .result-actions {
    width: 100%;
  }

  .result-actions .btn {
    flex: 1;
  }

  .studio-side {
    display: flex;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .ai-section,
  .history-section {
    margin-top: 54px;
  }

  .section-head,
  .history-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
    margin-bottom: 16px;
  }

  .section-head h2 {
    font-size: clamp(31px, 9.5vw, 40px);
  }

  .section-desc {
    max-width: none;
    text-align: left;
  }

  .history-tools {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .ai-card {
    padding: 18px;
    border-radius: 23px;
  }

  .ai-badge {
    display: none;
  }

  .upload-cta {
    display: none;
  }

  .history-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer {
    width: min(100% - 28px, 1320px);
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 28px;
  }

  .site-signature {
    align-self: center;
  }

  .modal-card {
    padding: 23px;
    box-shadow: 5px 5px 0 rgba(27, 26, 23, 0.42);
  }

  .toast {
    bottom: 14px;
    width: max-content;
    max-width: calc(100vw - 24px);
    border-radius: 16px;
  }
}

@media (max-width: 410px) {
  .brand-text small {
    display: none;
  }

  .intro h1 {
    font-size: 53px;
  }

  .intro-meta {
    font-size: 10px;
  }

  .wheel-hub {
    min-width: 82px;
  }

  .wheel-hub strong {
    font-size: 26px;
  }

  .wheel-hub small {
    font-size: 9px;
  }

  .result-copy h2 {
    font-size: 23px;
  }

  .result-emoji {
    font-size: 36px;
  }

  .result-actions {
    flex-direction: column-reverse;
  }

  .result-actions .btn {
    width: 100%;
  }
}

@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;
    scroll-behavior: auto !important;
  }
}
