:root {
  color-scheme: light;
  --cream: #fbf4e5;
  --cream-deep: #f5e8cf;
  --surface: #fffdf8;
  --surface-warm: #fff3d4;
  --amber: #efad52;
  --amber-strong: #de8f2e;
  --amber-soft: #ffe7ae;
  --caramel: #9b5b33;
  --brown: #4f3730;
  --brown-soft: #76594d;
  --line: rgba(79, 55, 48, .14);
  --line-strong: rgba(79, 55, 48, .24);
  --success: #41634a;
  --success-bg: #e3eee2;
  --danger: #973b34;
  --danger-bg: #f8dfda;
  --warning: #7a4c16;
  --warning-bg: #fff0c8;
  --shadow-sm: 0 8px 24px rgba(100, 63, 33, .07);
  --shadow-md: 0 20px 54px rgba(100, 63, 33, .11);
  --shadow-glow: 0 20px 68px rgba(239, 173, 82, .2);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --font-ui: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-emotion: "STKaiti", "KaiTi", "Kaiti SC", serif;
  --content: 1180px;
  --motion: 180ms cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--brown);
  background:
    radial-gradient(circle at 82% 3%, rgba(255, 205, 101, .22), transparent 29rem),
    radial-gradient(circle at 12% 48%, rgba(246, 222, 170, .3), transparent 30rem),
    var(--cream);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
}
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 200; top: 12px; left: 12px; border-radius: 999px; padding: 9px 16px; color: var(--surface); background: var(--brown); text-decoration: none; transform: translateY(-170%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--amber-strong); outline-offset: 3px; }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  min-height: 78px;
  grid-template-columns: minmax(260px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 10px clamp(20px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 244, 229, .88);
  backdrop-filter: blur(20px);
}
.product-brand { display: flex; min-width: 0; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.product-brand > img { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(178, 105, 39, .13)); }
.product-brand > span { display: grid; min-width: 0; line-height: 1.3; }
.product-brand strong { font-size: 1.25rem; letter-spacing: .04em; }
.product-brand small { overflow: hidden; color: var(--brown-soft); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.desktop-nav { display: flex; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 4px; background: rgba(255, 253, 248, .7); }
.desktop-nav button { display: flex; min-height: 42px; align-items: center; gap: 7px; border: 0; border-radius: 999px; padding: 0 15px; color: var(--brown-soft); background: transparent; cursor: pointer; transition: color var(--motion), background var(--motion), box-shadow var(--motion); }
.desktop-nav button:hover { color: var(--brown); background: var(--surface-warm); }
.desktop-nav button.is-active { color: var(--brown); background: var(--amber-soft); box-shadow: var(--shadow-sm); font-weight: 700; }
.producer-mark { display: flex; justify-self: end; align-items: center; gap: 7px; }
.producer-mark img { width: 42px; height: 42px; object-fit: cover; object-position: 50% 22%; mix-blend-mode: multiply; }
.producer-mark > span { display: grid; font-size: .78rem; font-weight: 700; line-height: 1.2; }
.producer-mark small { color: var(--brown-soft); font-family: Georgia, serif; font-size: .55rem; font-weight: 400; letter-spacing: .1em; }

main { min-width: 0; }
.route-view { min-height: calc(100dvh - 78px); }
.talk-shell, .page-shell { width: min(var(--content), 100%); margin-inline: auto; padding: clamp(28px, 5vw, 68px) clamp(18px, 4vw, 44px) 100px; }
.talk-shell { width: min(1040px, 100%); }
.talk-intro { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: center; gap: clamp(24px, 5vw, 70px); margin-bottom: clamp(26px, 5vw, 58px); }
.eyebrow, .step-label { color: var(--caramel); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.talk-intro h1, .page-heading h1 { margin: 12px 0 14px; font-family: var(--font-emotion); font-size: clamp(2.2rem, 5vw, 4.6rem); font-weight: 700; letter-spacing: -.045em; line-height: 1.12; text-wrap: balance; }
.talk-intro p, .page-heading p { max-width: 660px; margin: 0; color: var(--brown-soft); font-size: 1.06rem; }
.lamp-stage { position: relative; display: grid; min-height: 270px; place-items: center; }
.lamp-stage img { position: relative; z-index: 1; width: min(100%, 280px); filter: drop-shadow(0 18px 24px rgba(167, 94, 35, .13)); }
.lamp-glow { position: absolute; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 204, 94, .36), rgba(255, 225, 158, .14) 45%, transparent 72%); animation: breathe 3.8s ease-in-out infinite; }

.start-card, .conversation-card, .settings-card, .human-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, .92);
  box-shadow: var(--shadow-md);
}
.start-card { padding: clamp(22px, 4vw, 42px); }
.card-heading, .conversation-header, .page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.card-heading h2, .conversation-header h2 { margin: 5px 0 0; font-size: clamp(1.35rem, 2.5vw, 1.85rem); line-height: 1.35; }
.saved-draft { color: var(--success); font-size: .78rem; }
.scenario-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 24px 0 28px; }
.scenario-option { position: relative; display: grid; min-height: 78px; align-content: center; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 13px 15px; text-align: left; background: rgba(251, 244, 229, .55); cursor: pointer; transition: border-color var(--motion), background var(--motion), box-shadow var(--motion); }
.scenario-option:hover { border-color: var(--line-strong); background: var(--surface); }
.scenario-option.is-selected { border-color: rgba(222, 143, 46, .46); background: var(--amber-soft); box-shadow: inset 0 0 0 1px rgba(222, 143, 46, .15); }
.scenario-option strong { font-size: .95rem; }
.scenario-option small { color: var(--brown-soft); font-size: .74rem; line-height: 1.45; }
.scenario-option .selected-mark { position: absolute; top: 9px; right: 9px; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: var(--surface); background: var(--amber-strong); opacity: 0; }
.scenario-option .selected-mark svg { width: 13px; height: 13px; }
.scenario-option.is-selected .selected-mark { opacity: 1; }

.mode-switch { display: inline-flex; gap: 3px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--cream); }
.mode-switch button { display: flex; min-height: 40px; align-items: center; gap: 7px; border: 0; border-radius: 999px; padding: 0 17px; color: var(--brown-soft); background: transparent; cursor: pointer; }
.mode-switch button.is-active { color: var(--brown); background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 700; }
.input-panel label, .answer-form label, .settings-card label, .onboarding-dialog label { display: grid; gap: 7px; color: var(--brown); font-size: .9rem; font-weight: 700; }
textarea, input, select { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-md); color: var(--brown); background: var(--surface); transition: border-color var(--motion), box-shadow var(--motion); }
textarea { min-height: 130px; resize: vertical; padding: 17px 18px; line-height: 1.75; }
input, select { min-height: 48px; padding: 0 14px; }
textarea::placeholder, input::placeholder { color: #9a8176; }
textarea:focus, input:focus, select:focus { border-color: var(--amber-strong); outline: 0; box-shadow: 0 0 0 4px rgba(239, 173, 82, .16); }
.input-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-top: 8px; color: var(--brown-soft); font-size: .76rem; }
.input-meta p { margin: 0; }
.input-meta span { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.input-meta span.is-warning { color: var(--warning); font-weight: 800; }

.voice-panel { border-radius: var(--radius-lg); padding: 24px; text-align: center; background: linear-gradient(180deg, rgba(255, 244, 215, .72), rgba(255, 253, 248, .94)); }
.voice-boundary { max-width: 560px; margin: 0 auto 18px; color: var(--brown-soft); }
.recorder-orb { position: relative; display: grid; width: 210px; min-height: 220px; margin: 0 auto; place-items: center; align-content: center; }
.voice-rings { position: absolute; inset: 5px; border: 1px solid rgba(239, 173, 82, .35); border-radius: 50%; box-shadow: 0 0 0 18px rgba(239, 173, 82, .06), 0 0 0 38px rgba(239, 173, 82, .035); }
.recorder-orb.is-recording .voice-rings { animation: record-pulse 1.7s ease-out infinite; border-color: var(--amber-strong); }
.recorder-orb.is-ending .voice-rings { border-color: var(--danger); box-shadow: 0 0 0 18px rgba(151, 59, 52, .08); }
.recorder-orb button { position: relative; z-index: 1; display: grid; width: 92px; height: 92px; place-items: center; border: 0; border-radius: 50%; color: var(--brown); background: linear-gradient(145deg, #ffd880, var(--amber)); box-shadow: 0 15px 36px rgba(222, 143, 46, .28), inset 0 1px 1px rgba(255,255,255,.75); cursor: pointer; }
.recorder-orb button svg { width: 34px; height: 34px; }
.recorder-orb.is-recording button { color: var(--surface); background: var(--danger); }
.recorder-orb strong { margin-top: 13px; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.recorder-orb > span:last-child { color: var(--brown-soft); font-size: .82rem; }
.voice-panel audio { width: min(480px, 100%); margin: 10px auto; }
.voice-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.transcript-preview { max-width: 620px; margin: 20px auto 0; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 15px 18px; text-align: left; background: var(--surface); }
.transcript-preview span { color: var(--caramel); font-size: .72rem; font-weight: 800; }
.transcript-preview p { margin: 6px 0 0; }

.start-actions { display: grid; justify-items: center; gap: 12px; margin-top: 24px; }
.start-actions p { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--brown-soft); font-size: .75rem; text-align: center; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 0 21px; cursor: pointer; text-decoration: none; transition: background var(--motion), border-color var(--motion), box-shadow var(--motion), opacity var(--motion); }
.button.large { min-height: 54px; min-width: min(330px, 100%); font-size: 1.02rem; }
.button.primary { color: var(--brown); background: linear-gradient(135deg, #f8ca72, var(--amber)); box-shadow: 0 12px 28px rgba(222, 143, 46, .2); font-weight: 800; }
.button.primary:hover { background: linear-gradient(135deg, #f8cf83, #eaa13d); box-shadow: 0 15px 32px rgba(222, 143, 46, .26); }
.button.secondary { border-color: var(--line-strong); background: var(--surface); font-weight: 700; }
.button.secondary:hover, .button.ghost:hover { background: var(--surface-warm); }
.button.ghost { border-color: transparent; color: var(--brown-soft); background: transparent; }
.button.danger { color: var(--danger); border-color: rgba(151, 59, 52, .25); background: var(--danger-bg); font-weight: 700; }
.button:disabled { cursor: not-allowed; opacity: .48; box-shadow: none; }
.icon-button { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; }
.text-button { min-height: 42px; border: 0; color: var(--brown-soft); background: transparent; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.inline-error { margin-top: 14px; border: 1px solid rgba(151, 59, 52, .24); border-radius: var(--radius-sm); padding: 11px 14px; color: var(--danger); background: var(--danger-bg); font-size: .84rem; }

.conversation-card { overflow: hidden; }
.conversation-header { padding: 24px clamp(20px, 4vw, 34px); border-bottom: 1px solid var(--line); background: rgba(255, 246, 222, .74); }
.conversation-body { display: grid; gap: 15px; min-height: 250px; padding: clamp(20px, 4vw, 36px); }
.message { display: grid; max-width: min(76%, 640px); gap: 4px; border-radius: 20px 20px 20px 6px; padding: 14px 17px; background: var(--surface-warm); }
.message.user { justify-self: end; border-radius: 20px 20px 6px 20px; background: #ffe0a0; }
.message small { color: var(--brown-soft); font-size: .66rem; font-weight: 800; letter-spacing: .06em; }
.message p { margin: 0; white-space: pre-wrap; }
.message.question { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.answer-form { display: grid; gap: 12px; margin: 0 clamp(20px, 4vw, 36px) clamp(20px, 4vw, 36px); border-top: 1px solid var(--line); padding-top: 24px; }
.answer-form textarea { min-height: 100px; }
.answer-form .button { justify-self: end; }
.response-result, .safety-result { padding: 0 clamp(20px, 4vw, 36px) clamp(28px, 5vw, 44px); }
.response-heading { margin-bottom: 18px; text-align: center; }
.response-heading h2 { margin: 7px 0; font-family: var(--font-emotion); font-size: clamp(1.7rem, 3vw, 2.5rem); }
.response-heading p { margin: 0; color: var(--brown-soft); }
.response-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.response-piece { position: relative; min-height: 190px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; background: var(--surface); }
.response-piece .piece-number { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: var(--brown); background: var(--amber-soft); font-size: .75rem; font-weight: 800; }
.response-piece span:not(.piece-number) { display: block; margin-top: 17px; color: var(--caramel); font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.response-piece h3 { margin: 5px 0 8px; font-size: 1.05rem; }
.response-piece p { margin: 0; color: var(--brown-soft); font-size: .9rem; }
.phrase-card { margin-top: 18px; border: 1px solid rgba(222, 143, 46, .3); border-radius: var(--radius-lg); padding: clamp(20px, 4vw, 34px); background: linear-gradient(145deg, #fff1c9, #ffe0a0); box-shadow: var(--shadow-glow); }
.phrase-card header { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.phrase-card h3 { margin: 0; font-size: 1.15rem; }
.phrase-tabs { display: inline-flex; gap: 3px; border: 1px solid rgba(79,55,48,.13); border-radius: 999px; padding: 3px; background: rgba(255,255,255,.34); }
.phrase-tabs button { min-height: 36px; border: 0; border-radius: 999px; padding: 0 13px; color: var(--brown-soft); background: transparent; cursor: pointer; }
.phrase-tabs button.is-active { color: var(--brown); background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 800; }
.phrase-quote { margin: 25px 0; font-family: var(--font-emotion); font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: 700; line-height: 1.75; }
.phrase-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.phrase-toolbar > div { display: flex; flex-wrap: wrap; gap: 9px; }
.feedback-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; }
.feedback-row span { color: var(--brown-soft); font-size: .8rem; }
.feedback-row button { min-height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; background: var(--surface); cursor: pointer; }
.new-talk { display: flex; justify-content: center; margin-top: 22px; }
.safety-card { border: 1px solid rgba(151,59,52,.25); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 34px); background: var(--danger-bg); }
.safety-card .safety-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 50%; color: var(--danger); background: rgba(255,255,255,.6); }
.safety-card h2 { margin: 14px 0 7px; font-size: 1.55rem; }
.safety-card p { color: #6d332f; }
.safety-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }

.page-shell.narrow { width: min(900px, 100%); }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { font-size: clamp(2.3rem, 5vw, 4rem); }
.search-box { align-self: end; width: min(320px, 100%); }
.search-box input { background: rgba(255,253,248,.8); }
.phrase-library, .record-list { display: grid; gap: 13px; }
.library-item, .record-item { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; background: rgba(255,253,248,.88); box-shadow: var(--shadow-sm); }
.library-item { grid-template-columns: 1fr auto; }
.library-item blockquote { grid-column: 1 / -1; margin: 0; font-family: var(--font-emotion); font-size: 1.16rem; font-weight: 700; line-height: 1.75; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--brown-soft); font-size: .73rem; }
.item-tag { border-radius: 999px; padding: 3px 9px; color: var(--caramel); background: var(--amber-soft); font-weight: 800; }
.item-actions { display: flex; gap: 6px; }
.item-actions button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; }
.record-item { grid-template-columns: 1fr auto; align-items: center; }
.record-item h2 { margin: 0 0 4px; font-size: 1rem; }
.record-item p { max-width: 680px; margin: 0; overflow: hidden; color: var(--brown-soft); font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.record-actions { display: flex; gap: 8px; }
.record-actions .button { min-height: 42px; padding-inline: 15px; }
.status-tag { border-radius: 999px; padding: 3px 9px; font-size: .68rem; font-weight: 800; }
.status-tag.complete { color: var(--success); background: var(--success-bg); }
.status-tag.question { color: var(--warning); background: var(--warning-bg); }
.status-tag.safety { color: var(--danger); background: var(--danger-bg); }
.empty-state { display: grid; min-height: 320px; place-items: center; align-content: center; gap: 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 30px; text-align: center; }
.empty-state svg { width: 34px; height: 34px; color: var(--caramel); }
.empty-state h2 { margin: 4px 0 0; }
.empty-state p { max-width: 430px; margin: 0; color: var(--brown-soft); }

.profile-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 20px; }
.settings-card, .human-card { padding: clamp(21px, 4vw, 30px); }
.settings-card h2, .human-card h2 { margin: 0 0 18px; font-size: 1.25rem; }
.settings-card { display: grid; gap: 16px; box-shadow: var(--shadow-sm); }
.settings-card label span, .onboarding-dialog label span { color: var(--brown-soft); font-size: .72rem; font-weight: 400; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-card .button { justify-self: start; }
.form-status { min-height: 20px; color: var(--success); font-size: .8rem; }
.profile-aside { display: grid; align-content: start; gap: 15px; }
.human-card { position: relative; overflow: hidden; background: linear-gradient(145deg, #fff2ca, #ffe3a5); }
.human-card::after { position: absolute; right: -40px; bottom: -50px; width: 180px; height: 180px; border: 1px solid rgba(239,173,82,.32); border-radius: 50%; content: ""; }
.human-card > * { position: relative; z-index: 1; }
.human-card .human-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.55); }
.human-card p, .quiet-card p, .danger-zone p { color: var(--brown-soft); }
.service-wechat { display: grid; margin: 18px 0; border-top: 1px solid rgba(79,55,48,.12); border-bottom: 1px solid rgba(79,55,48,.12); padding: 13px 0; }
.service-wechat small { color: var(--brown-soft); }
.service-wechat strong { font-size: 1.18rem; }
.quiet-card, .danger-zone { border-radius: var(--radius-lg); }
.danger-zone { border-color: rgba(151,59,52,.2); }

dialog { color: var(--brown); font-family: var(--font-ui); }
dialog::backdrop { background: rgba(44, 30, 25, .45); backdrop-filter: blur(6px); }
.onboarding-dialog, .confirm-dialog { width: min(600px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 0; background: var(--surface); box-shadow: 0 28px 90px rgba(44,30,25,.24); }
.onboarding-dialog form { display: grid; gap: 16px; padding: clamp(24px, 5vw, 42px); }
.dialog-brand { width: 106px; height: 88px; overflow: hidden; }
.dialog-brand img { width: 150px; max-width: none; transform: translate(-20px, -24px); }
.onboarding-dialog h1 { margin: 0; font-family: var(--font-emotion); font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.25; }
.onboarding-dialog p { margin: 0; color: var(--brown-soft); }
.onboarding-dialog details { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 13px 15px; background: var(--cream); }
.onboarding-dialog summary { cursor: pointer; font-weight: 700; }
.onboarding-dialog details > div, .onboarding-dialog details > label { margin-top: 14px; }
.onboarding-dialog .button, .onboarding-dialog .text-button { justify-self: center; }
.confirm-dialog { width: min(460px, calc(100% - 28px)); }
.confirm-dialog form { display: grid; justify-items: center; padding: 32px; text-align: center; }
.dialog-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; color: var(--danger); background: var(--danger-bg); }
.dialog-icon svg { width: 26px; height: 26px; }
.confirm-dialog h2 { margin: 18px 0 8px; }
.confirm-dialog p { margin: 0; color: var(--brown-soft); }
.dialog-actions { display: flex; gap: 9px; margin-top: 24px; }

.mobile-nav { display: none; }
.brand-footer { display: flex; width: min(var(--content), calc(100% - 36px)); align-items: center; justify-content: space-between; gap: 24px; margin: 0 auto 28px; border-top: 1px solid var(--line); padding: 22px 0; color: var(--brown-soft); font-size: .72rem; }
.brand-footer > div { display: flex; align-items: center; gap: 8px; }
.brand-footer img { width: 52px; height: 38px; object-fit: cover; object-position: 50% 22%; mix-blend-mode: multiply; }
.brand-footer > div > span { display: grid; line-height: 1.2; }
.brand-footer strong { color: var(--brown); font-size: .76rem; }
.brand-footer small { font-family: Georgia, serif; font-size: .52rem; letter-spacing: .1em; }
.toast { position: fixed; z-index: 180; right: 22px; bottom: 22px; max-width: min(380px, calc(100% - 36px)); border-radius: var(--radius-md); padding: 12px 17px; color: var(--surface); background: var(--brown); box-shadow: var(--shadow-md); font-size: .84rem; }
.loading-layer { position: fixed; z-index: 160; inset: 0; display: grid; place-content: center; justify-items: center; padding: 24px; text-align: center; background: rgba(251, 244, 229, .9); backdrop-filter: blur(9px); }
.loading-lamp { position: relative; display: grid; width: 170px; height: 150px; place-items: center; }
.loading-lamp img { position: relative; z-index: 1; width: 160px; }
.loading-lamp span { position: absolute; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, rgba(255,204,94,.4), transparent 70%); animation: breathe 1.9s ease-in-out infinite; }
.loading-layer strong { font-family: var(--font-emotion); font-size: 1.45rem; }
.loading-layer p { max-width: 420px; margin: 6px 0; color: var(--brown-soft); }

@keyframes breathe { 0%,100% { opacity: .68; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes record-pulse { 0% { opacity: 1; transform: scale(.82); } 100% { opacity: 0; transform: scale(1.16); } }

@media (max-width: 1050px) {
  .site-header { grid-template-columns: minmax(210px, 1fr) auto; }
  .producer-mark { display: none; }
  .scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .response-grid { grid-template-columns: 1fr; }
  .response-piece { min-height: auto; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 72px; }
  body { padding-bottom: 78px; }
  .site-header { min-height: 68px; grid-template-columns: 1fr; padding-block: 7px; }
  .product-brand > img { width: 48px; height: 48px; }
  .product-brand strong { font-size: 1.1rem; }
  .desktop-nav { display: none; }
  .talk-shell, .page-shell { padding: 28px 16px 60px; }
  .talk-intro { grid-template-columns: 1fr; gap: 8px; margin-bottom: 24px; }
  .intro-copy { order: 2; }
  .lamp-stage { min-height: 210px; }
  .lamp-stage img { width: 220px; }
  .lamp-glow { width: 190px; height: 190px; }
  .talk-intro h1 { margin-top: 8px; font-size: clamp(2.05rem, 11vw, 3.2rem); }
  .talk-intro p { font-size: .96rem; }
  .start-card { border-radius: var(--radius-lg); }
  .card-heading, .conversation-header, .page-heading { display: grid; }
  .scenario-grid { grid-template-columns: 1fr; margin-block: 20px; }
  .scenario-option { min-height: 70px; }
  .mode-switch { display: grid; grid-template-columns: 1fr 1fr; }
  .mode-switch button { justify-content: center; }
  .input-meta { align-items: flex-end; }
  .start-actions p { align-items: flex-start; text-align: left; }
  .voice-panel { padding: 18px 10px; }
  .recorder-orb { transform: scale(.9); }
  .message { max-width: 90%; }
  .answer-form .button { width: 100%; justify-self: stretch; }
  .phrase-card header { display: grid; }
  .phrase-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
  .phrase-toolbar { display: grid; }
  .phrase-toolbar > div, .phrase-toolbar .button { width: 100%; }
  .phrase-toolbar .button { flex: 1; }
  .page-heading { gap: 18px; }
  .search-box { width: 100%; }
  .library-item, .record-item { grid-template-columns: 1fr; }
  .item-actions, .record-actions { justify-content: flex-end; }
  .profile-layout { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; z-index: 70; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 22px; padding: 5px; background: rgba(255,253,248,.94); box-shadow: 0 14px 42px rgba(79,55,48,.16); backdrop-filter: blur(18px); }
  .mobile-nav button { display: grid; min-height: 54px; place-items: center; align-content: center; gap: 1px; border: 0; border-radius: 17px; color: var(--brown-soft); background: transparent; cursor: pointer; font-size: .66rem; }
  .mobile-nav button.is-active { color: var(--brown); background: var(--amber-soft); font-weight: 800; }
  .toast { right: 14px; bottom: 84px; }
  .brand-footer { align-items: flex-start; flex-direction: column; margin-bottom: 82px; }
}

@media (max-width: 430px) {
  .field-row { grid-template-columns: 1fr; }
  .start-card { padding: 20px 16px; }
  .conversation-header { padding-inline: 18px; }
  .conversation-body { padding-inline: 16px; }
  .answer-form, .response-result, .safety-result { margin-inline: 16px; padding-inline: 0; }
  .phrase-tabs button { padding-inline: 8px; font-size: .75rem; }
  .dialog-actions { display: grid; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .scenario-option.is-selected, .desktop-nav button.is-active, .mobile-nav button.is-active, .phrase-tabs button.is-active { outline: 2px solid CanvasText; }
}
