:root {
  color-scheme: light;

  /* Color system */
  --color-bg: #f2f4f6;
  --color-canvas: #f8f9fa;
  --color-surface: #ffffff;
  --color-surface-secondary: #eef1f3;
  --color-surface-raised: #fffdf9;
  --color-text: #172b3d;
  --color-text-secondary: #596974;
  --color-text-tertiary: #7b8992;
  --color-border: rgba(23, 43, 61, 0.12);
  --color-border-strong: rgba(23, 43, 61, 0.22);
  --color-accent: #0f8f80;
  --color-accent-pressed: #0b6f65;
  --color-accent-soft: #dcf5ef;
  --color-cta: #ef7545;
  --color-cta-pressed: #d95d30;
  --color-success: #16896f;
  --color-success-soft: #dbf4eb;
  --color-warning: #d87528;
  --color-warning-soft: #fff1dc;
  --color-error: #c4473a;
  --color-error-soft: #fde9e6;
  --color-star: #f1b632;
  --color-scrim: 13, 28, 40;

  /* Type scale */
  --font-system: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.75rem, 7.4vw, 2.125rem);
  --leading-tight: 1.18;
  --leading-heading: 1.28;
  --leading-body: 1.65;

  /* Spatial system */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 2.5rem;

  /* Shape and depth */
  --radius-sm: 0.625rem;
  --radius-md: 1rem;
  --radius-lg: 1.375rem;
  --radius-xl: 1.75rem;
  --radius-full: 999px;
  --shadow-low: 0 0.25rem 1rem rgba(18, 39, 55, 0.07);
  --shadow-medium: 0 1rem 3rem rgba(18, 39, 55, 0.13);
  --shadow-sheet: 0 -1rem 3.5rem rgba(10, 25, 37, 0.2);

  /* Motion */
  --motion-press: 100ms;
  --motion-ui: 180ms;
  --motion-screen: 320ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-screen: cubic-bezier(0.22, 0.8, 0.26, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  color: var(--color-text);
  font: 100%/var(--leading-body) var(--font-system);
  background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-optical-sizing: auto;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(15, 143, 128, 0.08), transparent 28rem),
    var(--color-bg);
}

button,
textarea,
input {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  border: 0;
}

button,
[role="button"],
.choice,
.post-media-button,
.meal-chips label {
  user-select: none;
  -webkit-user-select: none;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: clip;
  background: var(--color-canvas);
  box-shadow: var(--shadow-medium);
}

.app-shell.is-post-mode {
  background: var(--color-surface);
}

.app-shell.is-post-mode .app-header {
  display: none;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-5) var(--space-3);
  background: rgba(248, 249, 250, 0.83);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}

.app-header::after {
  position: absolute;
  right: 0;
  bottom: -0.625rem;
  left: 0;
  height: 0.625rem;
  content: "";
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(248, 249, 250, 0.72), transparent);
}

.brand-row,
.progress-copy,
.receipt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-row {
  gap: var(--space-3);
}

.brand {
  display: inline-flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.625rem;
  color: var(--color-text);
  text-decoration: none;
}

.brand > span:last-child {
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--color-text);
  border-radius: 50%;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  max-width: 100%;
  overflow: hidden;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  margin-top: -0.0625rem;
  color: var(--color-text-secondary);
  font-size: 0.625rem;
  letter-spacing: 0.01em;
}

.demo-chip {
  flex: 0 0 auto;
  padding: 0.34rem 0.58rem;
  color: var(--color-accent-pressed);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--color-accent-soft);
  border-radius: var(--radius-full);
}

.progress-wrap {
  margin-top: 0.625rem;
}

.progress-copy {
  margin-bottom: 0.375rem;
  color: var(--color-text-secondary);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.06em;
}

#progressCount {
  color: var(--color-text);
}

.progress-track {
  height: 0.25rem;
  overflow: hidden;
  background: rgba(23, 43, 61, 0.09);
  border-radius: var(--radius-full);
}

#progressBar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--color-accent);
  border-radius: inherit;
  transition: width var(--motion-ui) var(--ease-out);
}

main {
  position: relative;
  min-height: calc(100vh - 94px);
  min-height: calc(100dvh - 94px);
  overflow: hidden;
  outline: none;
  isolation: isolate;
}

.screen {
  width: 100%;
  min-height: calc(100vh - 94px);
  min-height: calc(100dvh - 94px);
  background: var(--color-canvas);
}

.screen.is-leaving-forward,
.screen.is-leaving-backward {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.screen.is-entering-forward,
.screen.is-entering-backward {
  position: relative;
  z-index: 2;
}

.screen.is-entering-forward {
  animation: screen-enter-forward var(--motion-screen) var(--ease-screen) both;
}

.screen.is-leaving-forward {
  animation: screen-leave-forward var(--motion-screen) var(--ease-screen) both;
}

.screen.is-entering-backward {
  animation: screen-enter-backward var(--motion-screen) var(--ease-screen) both;
}

.screen.is-leaving-backward {
  animation: screen-leave-backward var(--motion-screen) var(--ease-screen) both;
}

@keyframes screen-enter-forward {
  from {
    opacity: 0.7;
    transform: translate3d(15%, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes screen-leave-forward {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0.55;
    transform: translate3d(-8%, 0, 0);
  }
}

@keyframes screen-enter-backward {
  from {
    opacity: 0.7;
    transform: translate3d(-12%, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes screen-leave-backward {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0.55;
    transform: translate3d(12%, 0, 0);
  }
}

.screen-inner {
  display: flex;
  min-height: calc(100vh - 94px);
  min-height: calc(100dvh - 94px);
  flex-direction: column;
  padding: var(--space-7) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
}

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

h1 {
  margin-bottom: 0.75rem;
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-size: var(--text-xl);
  font-weight: 720;
  line-height: var(--leading-heading);
  letter-spacing: -0.035em;
}

.question-number,
.eyebrow {
  color: var(--color-accent-pressed);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.question-number + h1 {
  margin-top: 0.55rem;
}

.subcopy,
.lead {
  color: var(--color-text-secondary);
  font-size: var(--text-md);
  line-height: var(--leading-body);
}

.subcopy {
  margin-bottom: var(--space-6);
}

.field-hint {
  transition: color var(--motion-ui) var(--ease-out);
}

.field-hint.is-valid {
  color: var(--color-success);
}

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

.start-layout {
  text-align: center;
}

.start-visual {
  position: relative;
  width: 100%;
  height: clamp(13.75rem, 56vw, 16.75rem);
  margin: -0.5rem 0 var(--space-6);
  overflow: hidden;
  background: #d7d2ca;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-low);
}

.start-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(to top, rgba(23, 43, 61, 0.16), transparent 40%);
}

.start-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 66%;
}

.eyebrow {
  margin-bottom: var(--space-2);
}

.start-layout h1 {
  margin-bottom: var(--space-3);
}

.start-meta {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
}

.meta-dot {
  width: 0.45rem;
  height: 0.45rem;
  background: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 0 0.25rem rgba(22, 137, 111, 0.12);
}

.choice-list,
.choice-grid {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-list {
  display: grid;
  gap: 0.625rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
}

.choice {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 3.75rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-low);
  transition:
    transform var(--motion-press) var(--ease-out),
    border-color var(--motion-ui) var(--ease-out),
    background-color var(--motion-ui) var(--ease-out),
    box-shadow var(--motion-ui) var(--ease-out);
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice:has(input:focus-visible) {
  outline: 3px solid rgba(239, 117, 69, 0.3);
  outline-offset: 2px;
}

.choice:has(input:checked) {
  background: var(--color-accent-soft);
  border-color: rgba(15, 143, 128, 0.5);
  box-shadow: none;
}

.choice-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2.125rem;
  height: 2.125rem;
  place-items: center;
  color: var(--color-text-secondary);
  font-size: 0.625rem;
  font-weight: 700;
  background: var(--color-surface-secondary);
  border-radius: 0.625rem;
}

.choice:has(input:checked) .choice-icon {
  color: var(--color-accent-pressed);
  background: rgba(255, 255, 255, 0.7);
}

.choice-text {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-size: var(--text-md);
  font-weight: 620;
  line-height: 1.4;
}

.choice-check {
  position: relative;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--color-border-strong);
  border-radius: 50%;
}

.choice:has(input:checked) .choice-check {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.choice:has(input:checked) .choice-check::after {
  position: absolute;
  top: 0.18rem;
  left: 0.38rem;
  width: 0.27rem;
  height: 0.5rem;
  content: "";
  border: solid #fff;
  border-width: 0 0.125rem 0.125rem 0;
  transform: rotate(45deg);
}

.choice-compact {
  min-height: 4.75rem;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-1);
  padding: 0.8rem;
}

.choice-compact .choice-text {
  flex: 0 1 auto;
  font-size: 0.875rem;
}

.choice-plus {
  align-self: flex-end;
  color: var(--color-text-tertiary);
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
  transition: transform var(--motion-ui) var(--ease-out), color var(--motion-ui) var(--ease-out);
}

.choice:has(input:checked) .choice-plus {
  color: var(--color-accent-pressed);
  transform: rotate(45deg);
}

.selection-count {
  min-height: 1.25rem;
  margin-top: 0.75rem;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  text-align: center;
}

.textarea-card {
  display: block;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-low);
  transition: border-color var(--motion-ui) var(--ease-out), box-shadow var(--motion-ui) var(--ease-out);
}

.textarea-card:focus-within {
  border-color: rgba(15, 143, 128, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(15, 143, 128, 0.11);
}

.textarea-label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 650;
}

textarea {
  display: block;
  width: 100%;
  min-height: 8.75rem;
  padding: 0;
  resize: vertical;
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.7;
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: none;
}

textarea::placeholder {
  color: var(--color-text-tertiary);
}

.char-count {
  display: block;
  margin-top: var(--space-2);
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
  text-align: right;
}

.privacy-note {
  margin-top: var(--space-3);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
}

.privacy-note span {
  margin-right: var(--space-2);
  color: var(--color-success);
}

.action-area {
  position: sticky;
  z-index: 8;
  bottom: 0;
  margin-top: auto;
  padding-top: var(--space-7);
  padding-bottom: max(0px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--color-canvas) 72%, rgba(248, 249, 250, 0));
}

.action-row {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 0.625rem;
}

.button {
  min-height: 3.5rem;
  padding: 0.8rem 1.125rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 680;
  line-height: 1.2;
  transition:
    transform var(--motion-press) var(--ease-out),
    background-color var(--motion-ui) var(--ease-out),
    color var(--motion-ui) var(--ease-out),
    box-shadow var(--motion-ui) var(--ease-out);
}

.button-primary {
  color: #fff;
  background: var(--color-cta);
  box-shadow: 0 0.55rem 1.4rem rgba(239, 117, 69, 0.23);
}

.button-primary:hover:not(:disabled) {
  background: var(--color-cta-pressed);
}

.button-secondary {
  color: var(--color-accent-pressed);
  background: var(--color-accent-soft);
}

.button-ghost {
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.button:disabled {
  cursor: not-allowed;
  color: #8b969d;
  background: #e1e5e7;
  box-shadow: none;
}

.button.is-pressed,
.choice.is-pressed,
.text-button.is-pressed,
.back-link.is-pressed,
.post-close.is-pressed,
.post-star-button.is-pressed,
.post-media-button.is-pressed,
.meal-chips label.is-pressed,
.post-submit-button.is-pressed {
  transform: scale(0.98);
  transition-duration: var(--motion-press);
}

.button:focus-visible,
.text-button:focus-visible,
.back-link:focus-visible,
.post-star-button:focus-visible,
.post-close:focus-visible,
.post-submit-button:focus-visible,
.post-media:has(input:focus-visible) .post-media-button {
  outline: 3px solid rgba(239, 117, 69, 0.34);
  outline-offset: 2px;
}

.demo-note {
  margin: 0.8rem 0 0;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  text-align: center;
}

.result-content {
  display: flex;
  min-height: 100%;
  flex: 1;
  flex-direction: column;
}

.result-content.is-revealing {
  animation: result-reveal 300ms var(--ease-out) both;
}

@keyframes result-reveal {
  from {
    opacity: 0;
    transform: translate3d(0, 0.75rem, 0) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.result-mark {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: var(--space-4);
  place-items: center;
  color: var(--color-accent-pressed);
  font-size: 1.2rem;
  font-weight: 800;
  background: var(--color-success-soft);
  border-radius: 0.875rem;
}

.result-card textarea {
  min-height: 10.75rem;
}

.result-notice {
  display: flex;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  line-height: 1.55;
}

.result-notice span {
  display: grid;
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  color: var(--color-accent-pressed);
  font-family: Georgia, serif;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
}

.text-button,
.back-link {
  align-self: center;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  color: var(--color-accent-pressed);
  font-size: 0.875rem;
  font-weight: 620;
  background: transparent;
  border-radius: var(--radius-sm);
  transition: transform var(--motion-press) var(--ease-out), background-color var(--motion-ui) var(--ease-out);
}

.text-button {
  margin-top: var(--space-1);
}

.text-button:hover,
.back-link:hover {
  background: rgba(15, 143, 128, 0.08);
}

.back-link {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.result-actions {
  display: grid;
  gap: 0.625rem;
  padding-top: var(--space-4);
}

.generating-state {
  display: flex;
  min-height: calc(100vh - 180px);
  min-height: calc(100dvh - 180px);
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.generating-orb {
  position: relative;
  width: 5.25rem;
  height: 5.25rem;
  margin: 0 auto var(--space-6);
  overflow: hidden;
  background: var(--color-accent-soft);
  border-radius: 50%;
}

.generating-orb::before,
.generating-orb::after,
.generating-orb span {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.generating-orb::before {
  width: 3.4rem;
  height: 3.4rem;
  top: 0.5rem;
  left: 0.35rem;
  background: rgba(15, 143, 128, 0.45);
  animation: orb-drift 1.1s ease-in-out infinite alternate;
}

.generating-orb::after {
  right: 0.4rem;
  bottom: 0.35rem;
  width: 3rem;
  height: 3rem;
  background: rgba(239, 117, 69, 0.34);
  animation: orb-drift 1.25s ease-in-out infinite alternate-reverse;
}

.generating-orb span {
  z-index: 2;
  inset: 1.35rem;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@keyframes orb-drift {
  to {
    transform: translate3d(0.5rem, 0.35rem, 0) scale(1.08);
  }
}

.generating-state h1 {
  margin-top: var(--space-2);
}

.generating-state > p {
  margin: var(--space-5) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
}

.generation-steps {
  display: grid;
  width: min(100%, 19rem);
  gap: 0.75rem;
  margin: var(--space-5) auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.generation-steps li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  transition: color var(--motion-ui) var(--ease-out), transform var(--motion-ui) var(--ease-out);
}

.generation-steps li > span {
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  border: 2px solid var(--color-border-strong);
  border-radius: 50%;
}

.generation-steps li.is-current {
  color: var(--color-text);
  transform: translate3d(0.2rem, 0, 0);
}

.generation-steps li.is-current > span {
  border-color: var(--color-accent);
  border-top-color: transparent;
  animation: step-spin 650ms linear infinite;
}

.generation-steps li.is-complete {
  color: var(--color-success);
}

.generation-steps li.is-complete > span {
  background: var(--color-success);
  border-color: var(--color-success);
}

.generation-steps li.is-complete > span::after {
  position: absolute;
  top: 0.12rem;
  left: 0.35rem;
  width: 0.28rem;
  height: 0.55rem;
  content: "";
  border: solid #fff;
  border-width: 0 0.125rem 0.125rem 0;
  transform: rotate(45deg);
}

@keyframes step-spin {
  to {
    transform: rotate(1turn);
  }
}

/* Demo review composer */
.app-shell.is-post-mode .post-screen,
.app-shell.is-post-mode .post-screen-inner {
  min-height: 100vh;
  min-height: 100dvh;
}

.post-screen,
.post-screen-inner {
  background: var(--color-surface);
}

.post-screen-inner {
  display: block;
  padding: 0;
}

.post-demo-warning {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  min-height: 3.875rem;
  align-items: center;
  gap: 0.625rem;
  padding: calc(0.55rem + env(safe-area-inset-top)) var(--space-4) 0.55rem;
  color: var(--color-text);
  background: rgba(255, 241, 220, 0.92);
  border-left: 0.3rem solid var(--color-warning);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

.post-demo-warning::after {
  position: absolute;
  right: 0;
  bottom: -0.5rem;
  left: 0;
  height: 0.5rem;
  content: "";
  background: linear-gradient(to bottom, rgba(255, 241, 220, 0.55), transparent);
}

.post-demo-label {
  flex: 0 0 auto;
  padding: 0.28rem 0.48rem;
  color: #fff;
  font-size: 0.56rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  background: var(--color-warning);
  border-radius: var(--radius-full);
}

.post-demo-warning > span:last-child,
.post-demo-warning strong,
.post-demo-warning small {
  display: block;
}

.post-demo-warning strong {
  margin-bottom: 0.1rem;
  font-size: 0.8125rem;
  font-weight: 680;
  line-height: 1.35;
}

.post-demo-warning small {
  color: #694d36;
  font-size: 0.6875rem;
}

.post-composer {
  padding: 0 1.125rem var(--space-7);
}

.post-topbar {
  display: grid;
  min-height: 4.75rem;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.post-close {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  place-items: center;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 1.65rem;
  font-weight: 300;
  background: var(--color-surface-secondary);
  border-radius: 50%;
  transition: transform var(--motion-press) var(--ease-out), background-color var(--motion-ui) var(--ease-out);
}

.post-topbar h1 {
  margin: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: 1.125rem;
  font-weight: 680;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.post-topbar h1 span {
  display: inline-block;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.reviewer-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: var(--space-4) 0;
}

.reviewer-avatar {
  display: grid;
  width: 2.625rem;
  height: 2.625rem;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  background: #278b9a;
  border-radius: 50%;
}

.reviewer-copy {
  min-width: 0;
  flex: 1;
}

.reviewer-copy strong,
.reviewer-copy small {
  display: block;
}

.reviewer-copy strong {
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 650;
}

.reviewer-copy small {
  margin-top: 0.05rem;
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
}

.privacy-dot {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  color: var(--color-text-secondary);
  font-family: Georgia, serif;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 50%;
}

.rating-section,
.meal-section {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rating-section {
  padding: var(--space-2) 0 var(--space-4);
  text-align: center;
}

.rating-section legend,
.meal-section legend {
  width: 100%;
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 650;
}

.rating-section legend span,
.meal-section legend span,
.post-review-field b {
  margin-left: 0.25rem;
  color: var(--color-warning);
  font-size: 0.625rem;
  font-weight: 650;
}

.post-stars {
  display: flex;
  align-items: center;
}

.post-stars-large {
  justify-content: center;
  margin-top: var(--space-1);
}

.post-star-button {
  display: grid;
  width: 3.125rem;
  height: 3.125rem;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  cursor: pointer;
  color: #b8c0c5;
  font-size: 2.4rem;
  line-height: 1;
  background: transparent;
  transition: transform var(--motion-press) var(--ease-out), color var(--motion-ui) var(--ease-out);
}

.post-star-button.is-filled {
  color: var(--color-star);
}

#ratingText {
  min-height: 1.1rem;
  margin: 0.1rem 0 0;
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
}

.detail-ratings {
  padding: var(--space-3) 0 var(--space-4);
  background: var(--color-surface-secondary);
  border-radius: var(--radius-md);
}

.detail-rating-row {
  display: flex;
  min-height: 2.875rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  padding: 0 0.75rem;
}

.detail-rating-row > span {
  flex: 0 0 4.75rem;
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.post-stars-small {
  justify-content: flex-end;
}

.post-stars-small .post-star-button {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.95rem;
}

.post-review-field {
  display: block;
  padding-top: var(--space-5);
}

.post-review-field > span {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 620;
  line-height: 1.5;
}

.post-review-field textarea {
  min-height: 9.5rem;
  padding: 0.8rem 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}

.post-review-field textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 0.2rem rgba(15, 143, 128, 0.11);
}

.post-paste-guide {
  margin: 0.4rem 0 var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
}

.post-media {
  margin-bottom: var(--space-5);
}

.post-media-button {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  color: var(--color-accent-pressed);
  font-size: 0.875rem;
  font-weight: 650;
  background: var(--color-accent-soft);
  border-radius: var(--radius-full);
  transition: transform var(--motion-press) var(--ease-out), background-color var(--motion-ui) var(--ease-out);
}

.post-media-button span {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
  border: 1.5px solid var(--color-accent);
  border-radius: 0.45rem;
}

#mediaStatus {
  margin: 0.4rem 0.25rem 0;
  color: var(--color-text-secondary);
  font-size: 0.625rem;
  text-align: center;
}

.meal-section {
  padding: var(--space-4);
  background: var(--color-surface-secondary);
  border-radius: var(--radius-md);
}

.meal-section legend {
  float: left;
  margin-bottom: 0.7rem;
}

.meal-chips {
  display: flex;
  clear: both;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.meal-chips label {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: transform var(--motion-press) var(--ease-out);
}

.meal-chips input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.meal-chips span {
  display: grid;
  min-height: 2.5rem;
  padding: 0.45rem 0.8rem;
  place-items: center;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: color var(--motion-ui) var(--ease-out), background-color var(--motion-ui) var(--ease-out), border-color var(--motion-ui) var(--ease-out);
}

.meal-chips label:has(input:checked) span {
  color: var(--color-accent-pressed);
  background: var(--color-accent-soft);
  border-color: rgba(15, 143, 128, 0.48);
}

.meal-chips label:has(input:focus-visible) span {
  outline: 3px solid rgba(239, 117, 69, 0.3);
  outline-offset: 2px;
}

.post-submit-bar {
  position: sticky;
  z-index: 35;
  bottom: 0;
  padding: 0.625rem var(--space-4) calc(0.625rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.84);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 -0.75rem 1.5rem rgba(23, 43, 61, 0.06);
}

.post-submit-button {
  width: 100%;
  min-height: 3.375rem;
  padding: 0.75rem 1.125rem;
  cursor: pointer;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 680;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transition: transform var(--motion-press) var(--ease-out), background-color var(--motion-ui) var(--ease-out);
}

.post-submit-button:disabled {
  cursor: not-allowed;
  color: #8d989e;
  background: #e1e5e7;
}

.post-submit-bar > span {
  display: block;
  margin-top: 0.3rem;
  color: var(--color-text-secondary);
  font-size: 0.625rem;
  text-align: center;
}

/* Completion */
.screen-complete {
  background:
    radial-gradient(circle at 50% 16%, rgba(15, 143, 128, 0.12), transparent 15rem),
    var(--color-canvas);
}

.complete-layout {
  text-align: center;
}

.complete-symbol {
  display: grid;
  width: 6.5rem;
  height: 6.5rem;
  margin: 0.5rem auto var(--space-6);
  place-items: center;
  background: rgba(15, 143, 128, 0.1);
  border-radius: 50%;
}

.complete-symbol span {
  display: grid;
  width: 4.25rem;
  height: 4.25rem;
  place-items: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  background: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0.75rem 1.75rem rgba(22, 137, 111, 0.24);
}

.receipt {
  margin-top: var(--space-3);
  padding: var(--space-4);
  color: var(--color-text);
  text-align: left;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-low);
}

.receipt-head {
  margin-bottom: var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-weight: 650;
}

.receipt-stars {
  color: var(--color-star);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.receipt p {
  max-height: 8.5rem;
  margin: 0;
  overflow: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* Gesture-driven bottom sheet */
.sheet-backdrop {
  --scrim-opacity: 0;
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(var(--color-scrim), var(--scrim-opacity));
  pointer-events: auto;
}

.bottom-sheet {
  --sheet-y: 100%;
  width: min(100%, 480px);
  max-height: min(80vh, 34rem);
  max-height: min(80dvh, 34rem);
  overflow: auto;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-sheet);
  transform: translate3d(0, var(--sheet-y), 0);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  overscroll-behavior: contain;
  will-change: transform;
}

.sheet-handle-zone {
  display: grid;
  min-height: 2.75rem;
  place-items: center;
  cursor: grab;
  touch-action: none;
}

.sheet-handle-zone:active {
  cursor: grabbing;
}

.sheet-handle {
  width: 2.5rem;
  height: 0.3rem;
  background: rgba(23, 43, 61, 0.23);
  border-radius: var(--radius-full);
}

.sheet-content {
  padding: 0 var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
  text-align: center;
}

.sheet-icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto var(--space-3);
  place-items: center;
  color: var(--color-warning);
  font-size: 1.1rem;
  font-weight: 750;
  background: var(--color-warning-soft);
  border-radius: 50%;
}

.sheet-content h2 {
  margin-bottom: var(--space-2);
  color: var(--color-text);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.sheet-content p {
  margin-bottom: var(--space-5);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.65;
}

.sheet-actions {
  display: grid;
  gap: 0.625rem;
}

.toast {
  position: fixed;
  z-index: 120;
  right: var(--space-4);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  left: var(--space-4);
  width: fit-content;
  max-width: min(calc(100% - 2rem), 28rem);
  margin: 0 auto;
  padding: 0.7rem 1rem;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 650;
  background: rgba(23, 43, 61, 0.9);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-medium);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  animation: toast-in var(--motion-ui) var(--ease-out) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate3d(0, 0.5rem, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

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

@media (max-width: 359px) {
  .app-header {
    padding-right: var(--space-4);
    padding-left: var(--space-4);
  }

  .screen-inner {
    padding-right: var(--space-4);
    padding-left: var(--space-4);
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .choice-compact {
    min-height: 3.75rem;
    flex-direction: row;
    align-items: center;
  }

  .detail-rating-row {
    min-height: 4.2rem;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }

  .detail-rating-row > span {
    flex-basis: auto;
  }

  .post-stars-small {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (min-width: 481px) {
  body {
    padding: var(--space-6) 0;
  }

  .app-shell {
    min-height: calc(100vh - 3rem);
    border-radius: var(--radius-xl);
  }

  .screen,
  .screen-inner {
    min-height: calc(100vh - 8.875rem);
  }

  .app-shell.is-post-mode .post-screen,
  .app-shell.is-post-mode .post-screen-inner {
    min-height: calc(100vh - 3rem);
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .screen-inner {
    padding-top: var(--space-5);
  }

  .start-visual {
    height: 10.5rem;
  }

  .generating-state {
    min-height: 24rem;
  }
}

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

  .screen.is-entering-forward,
  .screen.is-entering-backward,
  .screen.is-leaving-forward,
  .screen.is-leaving-backward,
  .result-content.is-revealing {
    transform: none !important;
    animation-name: reduced-fade !important;
  }

  .generating-orb::before,
  .generating-orb::after,
  .generation-steps li.is-current > span {
    animation: none !important;
  }

  @keyframes reduced-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

@media (prefers-reduced-transparency: reduce) {
  .app-header,
  .post-demo-warning,
  .post-submit-bar,
  .bottom-sheet,
  .toast {
    background: var(--color-surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .post-demo-warning {
    background: var(--color-warning-soft);
  }
}

@media (prefers-contrast: more) {
  .app-header,
  .bottom-sheet,
  .post-submit-bar {
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
  }

  .choice,
  .textarea-card,
  .post-review-field textarea {
    border-color: var(--color-border-strong);
  }
}
