@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;520;620;700&family=Playfair+Display:wght@500;600&display=swap");

:root {
  --ink: #2d2524;
  --ink-2: #4a3936;
  --paper: #faf7f2;
  --surface: #fffdfa;
  --soft: #f0e5dc;
  --line: #e4c0bc;
  --muted: #7b746e;
  --blue: #7c7890;
  --powder: #d9a59a;
  --green: #9aa27b;
  --coral: #c9828b;
  --gold: #bda16b;
  --rose: #f0c7b2;
  --clay: #c9828b;
  --espresso: #5d674f;
  --pearl: #fffdf9;
  --shadow: 0 22px 54px rgba(45, 37, 36, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--espresso);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--espresso);
  color: var(--ink);
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto;
  background: linear-gradient(160deg, #5d674f 0%, #798265 56%, #a39b7f 100%);
}

.mirror-pane {
  min-height: 0;
  padding: 18px 16px 22px;
  color: var(--paper);
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) auto;
  gap: 12px;
  position: relative;
  overflow: visible;
}

.mirror-pane::before,
.mirror-pane::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.mirror-pane::before {
  inset: 82px 18px auto;
  height: 62%;
  border-radius: 999px 999px 48px 48px;
  background: linear-gradient(180deg, rgba(255, 253, 250, 0.11), rgba(255, 253, 250, 0));
  filter: blur(20px);
}

.mirror-pane::after {
  left: 50%;
  bottom: 104px;
  width: 190px;
  height: 26px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(32, 34, 26, 0.34);
  filter: blur(12px);
}

.control-pane {
  position: relative;
  margin-top: 10px;
  padding: 20px 16px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.99), rgba(250, 247, 242, 0.99));
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -22px 52px rgba(45, 37, 36, 0.22);
}

.control-pane::before {
  content: "";
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #c7baaa;
  align-self: center;
  margin-bottom: 2px;
}

.section-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
}

.mirror-pane .section-label {
  color: rgba(250, 247, 242, 0.66);
  margin-bottom: 9px;
}

.intent-panel {
  position: relative;
  z-index: 5;
}

.top-bar,
.answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #d7aa83;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 8vw, 50px);
  color: var(--paper);
  text-shadow: 0 2px 18px rgba(45, 37, 36, 0.34);
}

h2 {
  font-size: 27px;
  line-height: 1.08;
}

.icon-btn,
.mini-btn,
.flip-btn {
  border: 1px solid rgba(255, 247, 232, 0.3);
  background: rgba(255, 253, 250, 0.12);
  color: inherit;
  height: 46px;
  min-width: 46px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  backdrop-filter: blur(12px);
}

.voice-toggle {
  grid-auto-flow: column;
  gap: 7px;
  min-width: 104px;
  padding: 0 14px;
  color: rgba(250, 247, 242, 0.86);
  background: rgba(255, 253, 250, 0.11);
  font-size: 13px;
  font-weight: 620;
}

.voice-toggle.active,
.voice-toggle[aria-pressed="true"] {
  border-color: rgba(242, 181, 190, 0.7);
  background: linear-gradient(180deg, rgba(217, 154, 165, 0.42), rgba(154, 162, 123, 0.22));
  color: #fffdf9;
  box-shadow:
    0 10px 22px rgba(90, 72, 62, 0.16),
    inset 0 1px 0 rgba(255, 253, 250, 0.22);
}

.voice-toggle .icon {
  width: 19px;
  height: 19px;
}

.mini-btn {
  height: 34px;
  padding: 0 12px;
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
  border-radius: 999px;
}

.camera-frame {
  position: relative;
  width: min(66vw, 34vh, 330px);
  min-width: 220px;
  height: auto;
  aspect-ratio: 3 / 4.05;
  justify-self: center;
  align-self: center;
  margin: 22px 0 4px;
  border: 18px solid transparent;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, 0.12), transparent 42%) padding-box,
    linear-gradient(#2f2726, #241d1d) padding-box,
    conic-gradient(
      from 208deg,
      #6d4b1d,
      #f6dda1 9%,
      #a87327 18%,
      #fff0bd 27%,
      #8f6024 40%,
      #d5a349 54%,
      #fff5c8 63%,
      #8a5a20 76%,
      #e5bd65 88%,
      #6d4b1d
    ) border-box;
  overflow: visible;
  display: grid;
  place-items: center;
  z-index: 1;
  box-shadow:
    0 26px 56px rgba(24, 18, 17, 0.42),
    0 0 0 1px rgba(255, 247, 232, 0.16),
    inset 0 0 0 2px rgba(255, 247, 232, 0.24),
    inset 0 -22px 36px rgba(45, 37, 36, 0.32);
}

.compare-frame {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 330px;
}

.compare-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
}

.mini-mirror {
  position: relative;
  min-height: 250px;
  border: 6px solid transparent;
  border-radius: 50% 50% 42% 42% / 38% 38% 18% 18%;
  background:
    linear-gradient(#372c2a, #2d2524) padding-box,
    linear-gradient(145deg, #fff3db, #bda16b 30%, #f8dfad 54%, #8f7140) border-box;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 20px 42px rgba(45, 37, 36, 0.3);
  background-size: cover;
  background-position: center;
}

.mini-mirror::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  border: 1px solid rgba(255, 247, 232, 0.36);
  pointer-events: none;
}

.mini-mirror span {
  position: relative;
  z-index: 2;
  color: rgba(250, 247, 242, 0.82);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 19px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(45, 37, 36, 0.56);
  text-align: center;
}

.mini-mirror.has-photo span {
  align-self: end;
  margin-bottom: 12px;
  color: var(--paper);
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
}

.mini-actions {
  display: grid;
  gap: 8px;
}

.mini-actions button,
.mini-actions label {
  min-height: 40px;
  border: 1px solid rgba(255, 247, 232, 0.18);
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.1);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 520;
}

.mini-actions label input {
  display: none;
}

body.compare-mode .camera-frame,
body.compare-mode .primary-actions {
  display: none;
}

body.compare-mode .compare-frame {
  display: grid;
}

body.compare-mode .submit-actions {
  grid-template-columns: 1fr;
}

body.compare-mode .submit-compliment {
  display: none;
}

.dialog-photo-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.dialog-message .dialog-photo-group img {
  height: 180px;
  margin-bottom: 0;
}

.camera-frame .flip-btn,
.camera-frame .status-pill,
.camera-frame video,
.camera-frame .camera-placeholder {
  z-index: 6;
}

.camera-frame::before {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 5%, #fff4c8 0 4px, #9a6a24 5px 9px, transparent 10px),
    radial-gradient(circle at 50% 95%, #fff4c8 0 4px, #9a6a24 5px 9px, transparent 10px),
    radial-gradient(circle at 5% 50%, #fff4c8 0 4px, #9a6a24 5px 9px, transparent 10px),
    radial-gradient(circle at 95% 50%, #fff4c8 0 4px, #9a6a24 5px 9px, transparent 10px),
    repeating-conic-gradient(
      from 4deg,
      rgba(255, 236, 177, 0.92) 0 3deg,
      rgba(125, 83, 27, 0.82) 3deg 6deg,
      rgba(31, 130, 132, 0.88) 6deg 9deg,
      rgba(11, 74, 80, 0.72) 9deg 12deg
    );
  -webkit-mask: radial-gradient(ellipse at center, transparent 0 61%, #000 62% 70%, transparent 71%);
  mask: radial-gradient(ellipse at center, transparent 0 61%, #000 62% 70%, transparent 71%);
  filter: drop-shadow(0 2px 2px rgba(45, 37, 36, 0.24));
}

.camera-frame::after {
  content: "";
  position: absolute;
  top: 34px;
  left: 24%;
  width: 20%;
  height: 30%;
  z-index: 7;
  pointer-events: none;
  border-radius: 999px;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
  transform: rotate(12deg);
}

.sun-rays {
  position: absolute;
  inset: -15px;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-conic-gradient(
      from -7deg,
      rgba(255, 229, 154, 0) 0deg,
      rgba(255, 229, 154, 0) 8deg,
      rgba(244, 210, 121, 0.72) 9deg,
      rgba(113, 76, 28, 0.4) 11deg,
      rgba(255, 229, 154, 0) 15deg
    );
  -webkit-mask: radial-gradient(ellipse at center, transparent 0 73%, #000 74% 80%, transparent 81%);
  mask: radial-gradient(ellipse at center, transparent 0 73%, #000 74% 80%, transparent 81%);
  opacity: 0.86;
}

.sun-rays i {
  display: none;
}

.sun-rays i:nth-child(1) { transform: rotate(0deg) translateY(-50%); }
.sun-rays i:nth-child(2) { transform: rotate(45deg) translateY(-50%); }
.sun-rays i:nth-child(3) { transform: rotate(90deg) translateY(-50%); }
.sun-rays i:nth-child(4) { transform: rotate(135deg) translateY(-50%); }
.sun-rays i:nth-child(5) { transform: rotate(180deg) translateY(-50%); }
.sun-rays i:nth-child(6) { transform: rotate(225deg) translateY(-50%); }
.sun-rays i:nth-child(7) { transform: rotate(270deg) translateY(-50%); }
.sun-rays i:nth-child(8) { transform: rotate(315deg) translateY(-50%); }

#camera {
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  object-fit: contain;
  object-position: center;
  background: #424a36;
  display: none;
  border-radius: 50%;
  overflow: hidden;
}

#camera.landscape-feed {
  object-fit: cover;
}

.camera-placeholder {
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  border: 1px solid rgba(255, 247, 232, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 253, 250, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(223, 204, 148, 0.42), rgba(116, 126, 94, 0.82) 52%, #525b43);
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  color: #cfd5df;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  overflow: hidden;
}

.camera-placeholder.has-photo .face-mark {
  display: none;
}

.camera-placeholder.has-photo p {
  position: absolute;
  bottom: 22px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(45, 37, 36, 0.5);
  color: var(--paper);
  backdrop-filter: blur(12px);
}

.face-mark {
  width: 108px;
  height: 132px;
  border: 2px solid #d8d0c3;
  border-radius: 48% 48% 42% 42%;
  position: relative;
}

.face-mark::after {
  content: "";
  position: absolute;
  left: -34px;
  right: -34px;
  bottom: -78px;
  height: 64px;
  border: 2px solid #d8d0c3;
  border-bottom: 0;
  border-radius: 52px 52px 0 0;
}

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

.flip-btn {
  position: static;
  grid-column: 1 / -1;
  justify-self: center;
  z-index: 8;
  width: min(220px, 72%);
  min-width: 0;
  height: 42px;
  padding: 0 16px;
  grid-auto-flow: column;
  align-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 620;
  border: 2px solid rgba(255, 226, 183, 0.88);
  border-radius: 999px;
  background: linear-gradient(180deg, #dc9ca6, #bd737f);
  color: #fffdf9;
  transform: none;
  box-shadow:
    0 10px 24px rgba(91, 55, 61, 0.34),
    0 0 0 4px rgba(240, 199, 178, 0.15),
    inset 0 1px 0 rgba(255, 253, 250, 0.38);
}

.flip-btn:active {
  transform: scale(0.97);
}

.primary-actions {
  position: relative;
  z-index: 7;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.capture-btn,
.upload-btn,
.say-btn {
  border: 0;
  min-height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 620;
  letter-spacing: 0;
}

.capture-btn {
  background: linear-gradient(180deg, #fffdf9, #f1e6dc);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(45, 37, 36, 0.16);
}

.capture-btn .icon,
.say-btn .icon,
.dialog-voice .icon,
.dialog-reset .icon {
  color: #c9828b;
}

.voice-btn {
  background: linear-gradient(180deg, #d49a91, #c9828b);
  color: #fff;
  box-shadow: 0 10px 22px rgba(201, 130, 139, 0.24);
}

.upload-btn {
  background: linear-gradient(180deg, rgba(154, 162, 123, 0.82), rgba(116, 126, 94, 0.82));
  color: var(--paper);
  border: 1px solid rgba(228, 192, 188, 0.36);
  box-shadow:
    0 10px 22px rgba(116, 126, 94, 0.13),
    inset 0 1px 0 rgba(255, 247, 232, 0.16);
}

.upload-btn input {
  display: none;
}

.camera-fallback-input {
  display: none;
}

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

.scenario {
  position: relative;
  min-height: 108px;
  border: 1px solid rgba(255, 247, 232, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.2), rgba(255, 253, 250, 0.1)),
    rgba(113, 123, 92, 0.68);
  color: var(--paper);
  border-radius: 16px;
  padding: 17px 16px 15px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 8px;
  box-shadow:
    0 10px 20px rgba(28, 32, 24, 0.2),
    inset 0 1px 0 rgba(255, 253, 250, 0.2),
    inset 0 -1px 0 rgba(42, 43, 32, 0.28);
  overflow: hidden;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.scenario:active {
  transform: translateY(1px);
}

.scenario::before {
  display: none;
}

.scenario::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 247, 232, 0.42);
  background: rgba(255, 253, 250, 0.06);
}

.scenario-title {
  color: var(--paper);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 20.5px;
  line-height: 1.08;
  font-weight: 600;
  max-width: 190px;
  padding-right: 10px;
  text-shadow: 0 1px 12px rgba(35, 34, 26, 0.2);
}

.scenario span:not(.scenario-title) {
  color: rgba(250, 247, 242, 0.72);
  font-size: 14px;
  line-height: 1.32;
}

.scenario.active {
  border-color: rgba(242, 181, 190, 0.96);
  background:
    linear-gradient(180deg, rgba(236, 173, 181, 0.58), rgba(183, 112, 122, 0.42)),
    linear-gradient(135deg, rgba(255, 238, 208, 0.22), rgba(255, 253, 250, 0.04)),
    rgba(130, 128, 92, 0.56);
  box-shadow:
    0 16px 32px rgba(143, 78, 88, 0.34),
    0 0 0 1px rgba(242, 181, 190, 0.18),
    inset 0 1px 0 rgba(255, 253, 250, 0.24),
    inset 0 -2px 0 rgba(102, 63, 58, 0.24);
}

.scenario.active::before {
  display: none;
}

.scenario.active::after {
  background: #f1a5b4;
  border-color: #f8d3d9;
  box-shadow:
    0 0 0 6px rgba(201, 130, 139, 0.2),
    inset 0 1px 0 rgba(255, 253, 250, 0.5);
}

.scenario-hint {
  display: none;
  margin: 10px 0 0;
  color: rgba(250, 247, 242, 0.72);
  font-size: 13px;
  line-height: 1.35;
}

.context-row,
.input-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.context-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.chip,
.submit-advice,
.submit-compliment {
  min-height: 39px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf9, #fbefec);
  color: var(--ink);
  border-radius: 999px;
  padding: 0 13px;
  font-weight: 560;
  white-space: nowrap;
}

.chip {
  width: max-content;
}

.chip.active {
  background: linear-gradient(180deg, #d49a91, #c9828b);
  color: #fff;
  border-color: #c9828b;
  box-shadow: 0 8px 18px rgba(201, 130, 139, 0.2);
}

.context-hint {
  display: none;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
}

.question-box {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: 0 0 56px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

textarea {
  width: 100%;
  resize: none;
  min-height: 112px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--ink);
  padding: 14px 14px 4px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: none;
  outline: none;
}

textarea::placeholder {
  color: #8f817a;
  opacity: 1;
}

.say-btn {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 10px;
  width: min(220px, calc(100% - 28px));
  min-height: 38px;
  padding: 0 16px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
}

.say-btn {
  background: linear-gradient(180deg, #f2efe1, #d9d4bb);
  color: #525b43;
  border-color: rgba(201, 130, 139, 0.7);
  box-shadow:
    0 12px 24px rgba(63, 68, 49, 0.1),
    inset 0 1px 0 rgba(255, 253, 249, 0.85);
}

.say-btn.is-recording,
.dialog-voice.is-recording {
  background: linear-gradient(180deg, #d99aa5, #c9828b);
  border-color: rgba(255, 219, 224, 0.9);
  color: #fff;
  box-shadow:
    0 14px 28px rgba(201, 130, 139, 0.28),
    0 0 0 4px rgba(201, 130, 139, 0.14),
    inset 0 1px 0 rgba(255, 253, 249, 0.4);
  animation: recordingPulse 0.9s ease-in-out infinite alternate;
}

.say-btn.is-recording .icon,
.dialog-voice.is-recording .icon {
  color: #fff;
}

.submit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

.submit-advice,
.submit-compliment {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  line-height: 1.16;
  border-width: 1px;
  border-style: solid;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
}

.submit-advice span,
.submit-compliment span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.submit-advice {
  background: linear-gradient(180deg, #9aa27b, #727d5f);
  color: var(--paper);
  border-color: rgba(217, 165, 154, 0.74);
  box-shadow:
    0 8px 0 rgba(82, 91, 67, 0.2),
    0 15px 26px rgba(116, 126, 94, 0.2),
    inset 0 1px 0 rgba(255, 247, 232, 0.22);
}

.submit-advice .icon-spark {
  color: #f0a8b0;
}

.submit-compliment {
  background: linear-gradient(180deg, #d49a91, #c9828b);
  color: #fff;
  border-color: #c9828b;
  box-shadow:
    0 8px 0 rgba(151, 89, 96, 0.2),
    0 15px 26px rgba(201, 130, 139, 0.28),
    inset 0 1px 0 rgba(255, 247, 232, 0.22);
}

.answer-card {
  background: linear-gradient(180deg, #fffdf9, #fff9f5);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 16px 34px rgba(45, 37, 36, 0.1);
}

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

.answer-card p {
  color: var(--muted);
  line-height: 1.55;
}

.mini-btn {
  min-height: 36px;
  border: 1px solid rgba(201, 130, 139, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(240, 199, 178, 0.28), rgba(201, 130, 139, 0.12));
  color: var(--ink-2);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 520;
}

.dialog-feed {
  display: grid;
  gap: 12px;
  max-height: 340px;
  overflow-y: auto;
  padding: 2px 2px 8px;
  scroll-behavior: smooth;
  transition: height 0.22s ease, max-height 0.22s ease;
}

.dialog-feed.has-answer {
  height: min(56vh, 560px);
  max-height: min(56vh, 560px);
  align-content: start;
}

.empty-dialog {
  padding: 2px 0 4px;
}

.empty-dialog h2,
.dialog-message h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 24px;
  line-height: 1.12;
  font-weight: 600;
}

.empty-dialog p,
.dialog-message p {
  margin: 0;
  font-size: 15px;
  white-space: pre-line;
}

.dialog-message {
  max-width: 88%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 22px rgba(45, 37, 36, 0.08);
}

.dialog-message.user {
  justify-self: end;
  background: linear-gradient(180deg, #f5e7df, #efe0d6);
  border-color: rgba(201, 130, 139, 0.25);
}

.dialog-message.assistant {
  justify-self: start;
  background: linear-gradient(180deg, #fffdf9, #f7f0e8);
}

.dialog-message.is-loading {
  animation: softPulse 1.15s ease-in-out infinite alternate;
}

.dialog-message img {
  display: block;
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  background: rgba(116, 126, 94, 0.12);
  border-radius: 14px;
  margin-bottom: 10px;
  border: 1px solid rgba(223, 209, 198, 0.75);
}

.dialog-composer {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(223, 209, 198, 0.82);
}

.dialog-photo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dialog-upload,
.dialog-shot {
  min-height: 46px;
  border: 1px dashed rgba(189, 161, 107, 0.65);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.95), rgba(240, 229, 220, 0.72));
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  font-weight: 520;
  text-align: center;
  cursor: pointer;
}

.dialog-shot {
  border-style: solid;
  border-color: rgba(189, 161, 107, 0.42);
  background: linear-gradient(180deg, rgba(250, 246, 232, 0.98), rgba(226, 214, 181, 0.76));
}

.dialog-upload input {
  display: none;
}

.dialog-photo-preview {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(201, 130, 139, 0.42);
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf6, #f5e9df);
  box-shadow: 0 8px 18px rgba(45, 37, 36, 0.08);
}

.dialog-photo-preview[hidden] {
  display: none;
}

.dialog-photo-preview img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: rgba(116, 126, 94, 0.12);
  border-radius: 10px;
  border: 1px solid rgba(201, 130, 139, 0.3);
}

.dialog-photo-preview div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dialog-photo-preview strong {
  color: var(--ink);
  font-size: 14px;
}

.dialog-photo-preview span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.dialog-photo-preview button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(201, 130, 139, 0.45);
  border-radius: 50%;
  background: #fffdf9;
  color: var(--coral);
  font-size: 22px;
  line-height: 1;
}

.dialog-textbox {
  position: relative;
  display: block;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.dialog-textbox textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  padding: 14px 14px 62px;
  font-size: 14px;
}

.dialog-textbox textarea::placeholder {
  color: rgba(74, 57, 54, 0.58);
}

.dialog-voice {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 10px;
  width: min(220px, calc(100% - 28px));
  min-height: 38px;
  border: 1px solid rgba(201, 130, 139, 0.7);
  border-radius: 14px;
  background: linear-gradient(180deg, #f2efe1, #d9d4bb);
  color: #525b43;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 560;
  transform: translateX(-50%);
  box-shadow:
    0 10px 20px rgba(63, 68, 49, 0.1),
    inset 0 1px 0 rgba(255, 253, 249, 0.85);
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-width: 0;
}

.dialog-send,
.dialog-reset {
  min-width: 0;
  min-height: 48px;
  border-radius: 14px;
  padding: 0 12px;
  line-height: 1.16;
  font-weight: 700;
  text-align: center;
}

.dialog-send {
  border: 1px solid #c9828b;
  background: linear-gradient(180deg, #d49a91, #c9828b);
  color: #fff;
  box-shadow:
    0 8px 0 rgba(151, 89, 96, 0.2),
    0 15px 26px rgba(201, 130, 139, 0.24),
    inset 0 1px 0 rgba(255, 247, 232, 0.22);
}

.dialog-reset {
  margin-top: 12px;
  border: 1px solid rgba(217, 165, 154, 0.74);
  background: linear-gradient(180deg, #9aa27b, #727d5f);
  color: var(--paper);
  box-shadow:
    0 8px 0 rgba(82, 91, 67, 0.2),
    0 15px 26px rgba(116, 126, 94, 0.15),
    inset 0 1px 0 rgba(255, 247, 232, 0.22);
}

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

.icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn .icon,
.flip-btn .icon {
  width: 24px;
  height: 24px;
}

.flip-btn .icon {
  width: 19px;
  height: 19px;
}

.voice-toggle .icon {
  width: 19px;
  height: 19px;
}

.is-recording {
  background: var(--coral);
}

@keyframes softPulse {
  from {
    opacity: 0.72;
  }
  to {
    opacity: 1;
  }
}

@keyframes recordingPulse {
  from {
    filter: brightness(1);
  }

  to {
    filter: brightness(1.08);
  }
}

@media (min-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    grid-template-rows: 100vh;
    padding: 0;
  }

  .mirror-pane {
    height: 100vh;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr) 78px;
    padding: 14px 28px 10px;
    gap: 6px;
    overflow: hidden;
  }

  .top-bar {
    min-height: 0;
  }

  .top-bar h1 {
    font-size: 54px;
    line-height: 0.98;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .voice-toggle {
    height: 38px;
    min-width: 92px;
    padding: 0 11px;
    font-size: 12px;
  }

  .mirror-pane .section-label {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .control-pane {
    min-height: 100vh;
    margin-top: 0;
    border-radius: 0;
    padding: 28px;
    overflow-y: auto;
  }

  .control-pane::before {
    display: none;
  }

  .camera-frame {
    border-radius: 50%;
    width: min(26vw, 27vh, 245px);
    min-width: 190px;
    max-height: none;
    aspect-ratio: 3 / 4.05;
    align-self: center;
    justify-self: center;
    margin: 0;
    border-width: 12px;
  }

  .status-pill {
    width: 1px;
    height: 1px;
  }

  .flip-btn {
    position: static;
    width: min(176px, 62%);
    height: 30px;
    padding: 0 12px;
    font-size: 11px;
    border-width: 1px;
  }

  .scenario-grid {
    gap: 5px 8px;
  }

  .scenario {
    min-height: 52px;
    border-radius: 12px;
    padding: 6px 14px;
    gap: 1px;
  }

  .scenario-title {
    font-size: 15.5px;
    line-height: 1;
    max-width: none;
    padding-right: 18px;
  }

  .scenario span:not(.scenario-title) {
    font-size: 10px;
    line-height: 1.08;
  }

  .scenario::after {
    top: 7px;
    right: 8px;
    width: 9px;
    height: 9px;
  }

  .scenario-hint {
    display: none;
  }

  .capture-btn,
  .upload-btn {
    min-height: 38px;
    border-radius: 12px;
    font-size: 12px;
  }

  .primary-actions {
    height: 78px;
    align-self: end;
    align-content: end;
    gap: 5px 10px;
    margin: 0;
    padding-bottom: 2px;
  }
}

@media (min-width: 641px) and (max-width: 899px) {
  .mirror-pane {
    height: 100vh;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr) 76px;
    padding: 14px 28px 8px;
    gap: 6px;
    overflow: hidden;
  }

  .top-bar h1 {
    font-size: 44px;
    line-height: 1;
  }

  .eyebrow {
    margin-bottom: 3px;
    font-size: 11px;
  }

  .voice-toggle {
    height: 40px;
    min-width: 96px;
    padding: 0 12px;
    font-size: 12px;
  }

  .mirror-pane .section-label {
    margin-bottom: 5px;
    font-size: 12px;
  }

  .scenario-grid {
    gap: 7px;
  }

  .scenario {
    min-height: 50px;
    padding: 6px 13px;
    gap: 1px;
    border-radius: 12px;
  }

  .scenario-title {
    max-width: none;
    padding-right: 18px;
    font-size: 15px;
    line-height: 1;
  }

  .scenario span:not(.scenario-title) {
    font-size: 9.5px;
    line-height: 1.06;
  }

  .scenario::after {
    top: 8px;
    right: 9px;
    width: 10px;
    height: 10px;
  }

  .scenario-hint {
    display: none;
  }

  .camera-frame {
    width: min(31vw, 26vh, 235px);
    min-width: 185px;
    margin: 0;
    border-width: 11px;
  }

  .primary-actions {
    height: 76px;
    align-self: end;
    align-content: end;
    gap: 5px 10px;
    margin: 0;
    padding-bottom: 2px;
  }

  .flip-btn {
    width: min(174px, 60%);
    height: 30px;
    padding: 0 12px;
    font-size: 11px;
    border-width: 1px;
  }

  .capture-btn,
  .upload-btn {
    min-height: 38px;
    border-radius: 12px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .scenario-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .scenario {
    min-height: 84px;
    padding: 12px 12px;
    align-content: center;
  }

  .scenario-title {
    font-size: 20.5px;
    line-height: 1.08;
    max-width: 158px;
    padding-right: 6px;
  }

  .scenario > span:not(.scenario-title) {
    display: none;
  }

  .scenario-hint {
    display: none;
  }
}

@media (max-width: 430px) {
  .mirror-pane {
    padding: 14px 12px 22px;
  }

  .control-pane {
    margin-top: 8px;
    padding: 18px 12px 24px;
  }

  .scenario-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .scenario {
    min-height: 84px;
    border-radius: 16px;
    padding: 12px 12px;
    align-content: center;
  }

  .scenario-title {
    font-size: 20.5px;
    line-height: 1.08;
    max-width: 158px;
    padding-right: 6px;
  }

  .scenario > span:not(.scenario-title) {
    display: none;
  }

  .scenario::before {
    left: 13px;
    bottom: 11px;
    width: 28px;
  }

  .scenario::after {
    top: 10px;
    right: 10px;
  }

  .scenario-hint {
    display: none;
  }

  .primary-actions {
    grid-template-columns: 1fr 1fr;
  }

  .compare-frame {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mini-mirror {
    min-height: 190px;
  }

  .mini-actions {
    gap: 6px;
  }

  .mini-actions button,
  .mini-actions label {
    min-height: 38px;
    padding: 4px 6px;
    font-size: 12px;
  }

  .submit-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .submit-advice,
  .submit-compliment {
    min-height: 56px;
    border-radius: 15px;
    font-size: 14px;
    gap: 6px;
  }

  .dialog-photo-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .dialog-upload,
  .dialog-shot {
    min-height: 50px;
    border-radius: 15px;
    padding: 0 10px;
    font-size: 13px;
    line-height: 1.15;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .dialog-send,
  .dialog-reset {
    min-height: 46px;
    border-radius: 14px;
    font-size: 14px;
    padding: 0 10px;
  }

  .dialog-reset {
    margin-top: 12px;
  }
}
