:root {
  color-scheme: light;
  --paper: #fff4e6;
  --paper-2: #fffbf4;
  --surface: #ffffff;
  --surface-2: #ffe4d7;
  --ink: #33261f;
  --muted: #7a6a5f;
  --line: #ecd8ca;
  --brand: #e8735a;
  --brand-2: #3a6b5c;
  --accent: #e8735a;
  --accent-2: #f5c556;
  --blue: #4c5a8a;
  --rose: #b85265;
  --green-soft: #edf4ea;
  --yellow-soft: #fff3c4;
  --red-soft: #ffe4df;
  --shadow: 0 22px 60px rgba(51, 38, 31, 0.12);
  --radius: 16px;
  --font: "Inter", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(232, 115, 90, 0.12), rgba(255, 244, 230, 0) 280px),
    var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: var(--brand);
}

.app-shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.boot,
.noscript {
  display: grid;
  min-height: 60vh;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}

.brand-lockup {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 1px solid rgba(36, 49, 47, 0.08);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(49, 93, 90, 0.16);
}

.brand-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.18;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.header-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pill,
.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.is-safe {
  border-color: rgba(49, 93, 90, 0.24);
  color: var(--brand);
}

.status-pill.is-yellow {
  border-color: #e0b243;
  background: var(--yellow-soft);
  color: #72580b;
}

.status-pill.is-red {
  border-color: #d06b60;
  background: var(--red-soft);
  color: #893327;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 18px;
}

.tab-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

.tab-button[aria-selected="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 30px rgba(49, 93, 90, 0.2);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.main-grid > *,
.companion-rail,
.workbench {
  min-width: 0;
}

.companion-rail,
.workbench,
.section-panel,
.modal-panel,
.reply-item,
.metric-tile,
.ledger-row,
.sample-row,
.memory-item,
.event-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 34px rgba(36, 49, 47, 0.08);
}

.companion-rail {
  position: sticky;
  top: 14px;
  overflow: hidden;
}

.avatar-frame {
  background: var(--surface-2);
}

.avatar-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.06;
  object-fit: cover;
}

.avatar-frame .trainer-avatar {
  width: 100%;
}

.companion-body {
  padding: 14px;
}

.compact-actions {
  margin-top: 12px;
}

.preset-reselect-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.preset-reselect-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.preset-reselect-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 6px;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.preset-reselect-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 5px;
}

.preset-reselect-card.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(49, 93, 90, 0.12);
}

.companion-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.companion-name h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.mood-meter {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.meter-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e4d8;
}

.meter-fill {
  height: 100%;
  width: var(--meter, 72%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--brand-2));
}

.rail-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.rail-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.88rem;
}

.rail-list li span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workbench {
  min-height: 680px;
  padding: 16px;
}

.section-panel {
  padding: 16px;
  margin-bottom: 14px;
}

.section-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header h2,
.section-header h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.section-header p,
.panel-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.composer {
  display: grid;
  gap: 12px;
}

.textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

.textarea:focus,
.input:focus,
.select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(49, 93, 90, 0.13);
}

.composer-tools,
.chip-row,
.action-row,
.inline-fields,
.metric-grid,
.sample-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  border: 1px solid rgba(49, 93, 90, 0.18);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--brand);
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.chip.is-warm {
  border-color: rgba(227, 111, 74, 0.24);
  background: #fde7dc;
  color: #9c4326;
}

.chip.is-blue {
  border-color: rgba(76, 90, 138, 0.22);
  background: #e7ebfb;
  color: var(--blue);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  padding: 8px 13px;
  font-weight: 850;
  text-decoration: none;
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--brand);
}

.button.danger {
  border-color: var(--rose);
  background: var(--rose);
}

.button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.input,
.select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px 11px;
  outline: none;
}

.field {
  display: grid;
  gap: 6px;
  flex: 1 1 210px;
}

.field label,
.field > span,
.checkline {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.checkline {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.checkline input {
  margin-top: 5px;
}

.reply-list,
.memory-list,
.event-list,
.ledger-list,
.sample-list {
  display: grid;
  gap: 10px;
}

.reply-item {
  padding: 14px;
}

.reply-meta,
.item-meta,
.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.reply-text {
  margin: 0;
  white-space: pre-wrap;
}

.disclaimer-link {
  margin: 8px 0 0;
  font-size: 0.78rem;
}

.disclaimer-link a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.legal-link-grid a {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 900;
  padding: 12px;
  text-align: center;
  text-decoration: none;
}

.legal-page {
  max-width: 780px;
}

.legal-page .section-panel {
  gap: 18px;
}

.legal-section {
  display: grid;
  gap: 8px;
}

.legal-section h2 {
  margin: 0;
  font-size: 1.08rem;
}

.legal-section p,
.legal-section li {
  color: #5f4d43;
  line-height: 1.75;
}

.legal-section ul {
  margin: 0;
  padding-left: 1.2em;
}

.pfc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.pfc-item {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 10px;
}

.pfc-item strong {
  display: block;
  font-size: 1.22rem;
  line-height: 1.1;
}

.pfc-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.safety-banner {
  border: 1px solid #e0b243;
  border-radius: var(--radius);
  background: var(--yellow-soft);
  color: #5e4907;
  padding: 12px;
  margin: 10px 0;
}

.safety-banner.is-red {
  border-color: #d06b60;
  background: var(--red-soft);
  color: #803025;
}

.safety-banner h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.safety-banner p {
  margin: 0;
}

.memory-item,
.event-row,
.sample-row,
.ledger-row {
  padding: 12px;
}

.memory-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-tile {
  min-height: 108px;
  padding: 12px;
}

.metric-tile strong {
  display: block;
  margin-top: 4px;
  font-size: 1.55rem;
  line-height: 1.1;
}

.metric-tile span {
  color: var(--muted);
  font-size: 0.82rem;
}

.score-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6e0d2;
}

.score-fill {
  width: var(--score, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--accent-2), var(--brand-2));
}

.rubric {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rubric th,
.rubric td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.rubric th {
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.82rem;
}

.rubric tr:last-child td {
  border-bottom: 0;
}

.ledger-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 150px minmax(180px, 1.2fr);
  gap: 10px;
  align-items: center;
}

.ledger-row label {
  font-weight: 800;
}

.ledger-row small {
  color: var(--muted);
}

.cost-total {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(49, 93, 90, 0.18);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
  margin: 12px 0;
}

.cost-total strong {
  font-size: 1.5rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: auto;
  background: rgba(36, 49, 47, 0.52);
  padding: 20px;
}

.modal-panel {
  width: min(960px, 100%);
  overflow: hidden;
  background: var(--paper-2);
}

.onboarding-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
}

.onboarding-visual {
  min-height: 100%;
  background: var(--surface-2);
}

.onboarding-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
}

.onboarding-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.modal-title {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.22;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pricing-card {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  text-align: left;
}

.pricing-card strong {
  display: block;
  margin-bottom: 4px;
}

.pricing-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.onboarding-mobile {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  background:
    radial-gradient(circle at 18% 8%, rgba(245, 197, 86, 0.34), transparent 28%),
    linear-gradient(180deg, rgba(232, 115, 90, 0.16), rgba(255, 244, 230, 0) 250px),
    var(--paper);
}

.onboarding-phone {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper-2);
  box-shadow: 0 24px 70px rgba(51, 38, 31, 0.16);
}

.onboarding-topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(255, 250, 241, 0.92);
  border-bottom: 1px solid rgba(236, 216, 202, 0.78);
  backdrop-filter: blur(14px);
}

.mini-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
}

.mini-brand img {
  border-radius: 8px;
}

.onboarding-demo {
  min-height: 34px;
  padding: 5px 8px;
}

.onboarding-progress {
  position: sticky;
  top: 64px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 16px;
  background: rgba(255, 250, 241, 0.9);
  backdrop-filter: blur(14px);
}

.progress-dot {
  height: 6px;
  border-radius: 999px;
  background: #f1dfcc;
}

.progress-dot.is-active {
  background: var(--brand);
}

.onboarding-screen {
  display: grid;
  gap: 18px;
  min-height: calc(100dvh - 116px);
  padding: 20px 20px calc(12px + env(safe-area-inset-bottom));
}

.onboarding-hero {
  position: relative;
  overflow: hidden;
  min-height: 176px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.onboarding-hero.compact img {
  position: absolute;
  right: -18px;
  bottom: -60px;
  width: 230px;
  max-width: 62%;
}

.hero-bubble {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: min(230px, 58%);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 14px 34px rgba(36, 49, 47, 0.12);
  color: var(--ink);
  font-weight: 850;
  line-height: 1.45;
  padding: 11px 12px;
}

.onboarding-copy {
  display: grid;
  gap: 6px;
}

.step-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
}

.onboarding-copy h2 {
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 1.58rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.onboarding-copy p {
  margin: 0;
  color: var(--muted);
}

.group-label {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.choice-list,
.quick-picker {
  display: grid;
  gap: 10px;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.style-card {
  display: grid;
  gap: 8px;
  min-height: 154px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 11px;
  text-align: left;
  box-shadow: 0 10px 28px rgba(36, 49, 47, 0.06);
}

.style-card[aria-pressed="true"] {
  border-color: var(--brand);
  background: #eef6f1;
  box-shadow: 0 0 0 3px rgba(49, 93, 90, 0.13);
}

.style-card strong {
  font-size: 1rem;
}

.style-card span:not(.style-swatch) {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.style-swatch {
  display: block;
}

.preview-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -20px;
  padding: 4px 20px 2px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.preview-strip::-webkit-scrollbar {
  display: none;
}

.preview-strip.is-animated {
  width: max-content;
  min-width: 100%;
  overflow: visible;
  animation: previewMarquee 22s linear infinite;
}

.preview-strip img {
  width: 112px;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  border: 1px solid rgba(49, 93, 90, 0.16);
  border-radius: 999px;
  object-fit: cover;
  object-position: center;
  scroll-snap-align: start;
  background: #fff;
  box-shadow: 0 12px 28px rgba(36, 49, 47, 0.08);
}

@keyframes previewMarquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 5px));
  }
}

.start-hero-panel {
  display: grid;
  gap: 18px;
  overflow: hidden;
  margin: -20px -20px 0;
  padding: 28px 20px 18px;
  background:
    radial-gradient(circle at 84% 12%, rgba(255, 255, 255, 0.95) 0 42px, transparent 43px),
    linear-gradient(145deg, #fff1df, #ffe1d6 56%, #fffaf1);
}

.diet-proof {
  display: grid;
  gap: 8px;
}

.diet-proof span {
  color: var(--brand-2);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.05em;
}

.diet-proof strong {
  display: block;
  max-width: 11em;
  color: var(--ink);
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 8.7vw, 2.75rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.05;
}

.diet-proof p {
  max-width: 18em;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.55;
}

.route-card,
.input-card,
.tip-card,
.generated-image-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 13px;
  text-align: left;
  box-shadow: 0 10px 28px rgba(36, 49, 47, 0.06);
}

.route-card {
  min-height: 112px;
}

.route-card.is-primary {
  border-color: rgba(232, 115, 90, 0.3);
  background: #fff2e8;
}

.start-screen .route-card {
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 6px 12px;
}

.start-screen .route-card strong,
.start-screen .route-card span:not(.route-icon) {
  grid-column: 2;
}

.route-icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
}

.route-icon.is-soft {
  background: var(--accent-2);
  color: var(--ink);
}

.route-card strong,
.input-card h3,
.tip-card strong,
.generated-image-card strong {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.route-card span,
.input-card .mini-note,
.tip-card p,
.generated-image-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.48;
}

.field-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  border-radius: 999px;
  background: #f3f0e8;
  color: var(--muted);
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 900;
  vertical-align: middle;
}

.field-label.required {
  background: #fff0df;
  color: var(--brand);
}

.loading-note,
.mini-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.45;
}

.loading-note {
  display: block;
  border: 1px solid rgba(49, 93, 90, 0.16);
  border-radius: var(--radius);
  background: #f3faf6;
  color: var(--brand);
  padding: 8px 10px;
}

.mini-note.center {
  text-align: center;
}

.chip-choice {
  min-height: 40px;
  border: 1px solid rgba(49, 93, 90, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 7px 11px;
  font-size: 0.86rem;
  font-weight: 850;
}

.chip-choice.is-selected,
.chip-choice[aria-pressed="true"] {
  border-color: var(--brand);
  background: #fff0df;
  color: var(--brand);
}

.sample-hero {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(232, 115, 90, 0.18);
  border-radius: 24px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 18px 42px rgba(51, 38, 31, 0.09);
}

.sample-hero .trainer-photo,
.sample-hero .trainer-avatar {
  width: 148px;
  border-radius: 999px;
}

.sample-hero span,
.name-edit span {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
}

.sample-hero strong {
  display: block;
  margin-top: 2px;
  font-size: 1.28rem;
  line-height: 1.25;
}

.sample-hero p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sample-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  padding: 8px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 850;
}

.sample-card .trainer-photo,
.sample-card .trainer-avatar {
  width: 100%;
  border-radius: 999px;
}

.sample-card.is-selected,
.method-card.is-selected,
.action-card.is-selected {
  border-color: var(--brand);
  background: #fff0df;
  box-shadow: 0 0 0 3px rgba(232, 115, 90, 0.12);
}

.sample-canon-screen {
  gap: 10px;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(12px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 18% 10%, rgba(245, 197, 86, 0.18), transparent 24%),
    linear-gradient(180deg, #fff9ef 0%, #fff5e8 100%);
}

.sample-canon-screen .onboarding-actions {
  position: static;
  border-top: 0;
  background: transparent;
  padding: 0;
}

.sample-step-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: #a39182;
  font-size: 0.72rem;
  font-weight: 900;
}

.sample-step-dots span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: #f2e1c9;
}

.sample-step-dots .is-active {
  background: var(--brand);
  color: #fff;
}

.sample-title {
  gap: 0;
  text-align: center;
}

.sample-title h2 {
  font-size: 1.26rem;
}

.sample-title h2::before,
.sample-title h2::after {
  content: "✦";
  color: var(--brand);
  font-size: 0.78rem;
  margin: 0 8px;
}

.sample-hero-canon {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1.08;
  border: 1px solid rgba(232, 115, 90, 0.22);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(51, 38, 31, 0.12);
}

.sample-hero-canon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.sample-name-badge,
.sample-check {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(232, 115, 90, 0.22);
}

.sample-name-badge {
  top: 18px;
  left: 14px;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 0.82rem;
  font-weight: 900;
}

.sample-check {
  top: 18px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 950;
}

.sample-canon-screen .sample-grid {
  gap: 8px;
}

.sample-canon-screen .sample-card {
  position: relative;
  overflow: hidden;
  min-height: 0;
  aspect-ratio: 1 / 0.9;
  border: 2px solid rgba(232, 115, 90, 0.14);
  border-radius: 12px;
  background: #fff;
  padding: 0;
}

.sample-canon-screen .sample-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.sample-canon-screen .sample-card.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(232, 115, 90, 0.2);
}

.sample-canon-screen .sample-card.is-selected::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
}

.sample-custom-link {
  display: inline-flex;
  justify-content: center;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 900;
}

.method-grid,
.action-list {
  display: grid;
  gap: 8px;
}

.method-card,
.action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 11px;
  text-align: left;
}

.method-card strong,
.action-card strong {
  font-size: 0.96rem;
}

.method-card span,
.action-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.action-card {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
}

.action-card.is-static {
  pointer-events: none;
}

.action-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 900;
}

.hair-range {
  width: 100%;
  accent-color: var(--brand);
}

.hair-labels {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.swatch-button {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(36, 49, 47, 0.15);
}

.swatch-button.is-selected {
  box-shadow: 0 0 0 3px var(--brand);
}

.loader-card {
  display: grid;
  min-height: 240px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 40%, rgba(245, 197, 86, 0.42), transparent 34%),
    linear-gradient(135deg, #fffaf1, #ffe3d3);
  box-shadow: 0 18px 44px rgba(51, 38, 31, 0.08);
}

.loader-card span {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-weight: 900;
  box-shadow: 0 18px 44px rgba(36, 49, 47, 0.12);
}

.loader-card.is-birth span {
  animation: pulseBirth 1.7s ease-in-out infinite;
}

@keyframes pulseBirth {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

.reference-image-drop {
  display: grid;
  gap: 4px;
  min-height: 76px;
  place-items: center;
  border: 1px dashed rgba(232, 115, 90, 0.42);
  border-radius: 18px;
  background: #fff7ee;
  color: var(--brand);
  padding: 12px;
  text-align: center;
  font-weight: 900;
}

.reference-image-drop small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.meal-photo {
  display: grid;
  min-height: 132px;
  place-items: center;
  border: 1px dashed rgba(49, 93, 90, 0.34);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brand);
  font-weight: 900;
}

.helper-row {
  display: flex;
  justify-content: flex-start;
}

.mini-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  padding: 6px 11px;
  font-size: 0.82rem;
  font-weight: 850;
}

.reveal-portrait {
  display: grid;
  place-items: center;
}

.reveal-portrait .trainer-photo,
.reveal-portrait .trainer-avatar {
  width: min(280px, 78vw);
  border-radius: 999px;
}

.reveal-portrait.small .trainer-photo,
.reveal-portrait.small .trainer-avatar {
  width: 190px;
}

.name-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.name-edit strong {
  font-size: 1.3rem;
}

.generated-image-card {
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  background: #fff7ee;
  border-color: rgba(227, 111, 74, 0.24);
}

.ready-character-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(49, 93, 90, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  padding: 12px;
}

.ready-character-head {
  display: grid;
  gap: 2px;
}

.ready-character-head strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.ready-character-head span {
  color: var(--muted);
  font-size: 0.84rem;
}

.ready-character-list {
  display: grid;
  gap: 8px;
}

.choice-card,
.quick-choice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 28px rgba(36, 49, 47, 0.06);
}

.choice-card {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 12px;
}

.choice-card strong {
  font-size: 1rem;
}

.choice-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.choice-card[aria-pressed="true"],
.quick-choice[aria-pressed="true"] {
  border-color: var(--brand);
  background: #eef6f1;
  box-shadow: 0 0 0 3px rgba(49, 93, 90, 0.13);
}

.quick-picker {
  grid-template-columns: 1fr 1fr;
}

.quick-choice {
  min-height: 72px;
  padding: 11px;
  font-weight: 850;
  line-height: 1.45;
}

.look-grid,
.preset-row {
  display: grid;
  gap: 10px;
}

.preset-row {
  grid-template-columns: 1fr;
}

.look-card,
.preset-card,
.ready-character-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
  box-shadow: 0 10px 28px rgba(36, 49, 47, 0.06);
}

.look-card[aria-pressed="true"],
.preset-card[aria-pressed="true"],
.ready-character-card:active,
.look-option[aria-pressed="true"] {
  border-color: var(--brand);
  background: #eef6f1;
  box-shadow: 0 0 0 3px rgba(49, 93, 90, 0.13);
}

.look-card-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.look-card-copy strong {
  font-size: 1rem;
  line-height: 1.35;
}

.look-card-copy em {
  color: var(--brand);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 850;
}

.look-card-copy small {
  color: var(--muted);
  line-height: 1.45;
}

.custom-look-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(49, 93, 90, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.option-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.look-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.look-preview div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.look-preview span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.look-preview strong {
  font-size: 1.12rem;
}

.look-preview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.look-option-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.look-option-group legend {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 850;
}

.look-option-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.look-option {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px;
  font-weight: 800;
}

.freeform-look-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.freeform-look-panel > div {
  display: grid;
  gap: 2px;
}

.freeform-look-panel strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.freeform-look-panel span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.compact-textarea {
  min-height: 82px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.url-chip {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--brand);
  font-size: 0.86rem;
  line-height: 1.45;
}

.ai-image-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(76, 90, 138, 0.18);
  border-radius: var(--radius);
  background: #f7f8fb;
  padding: 12px;
}

.ai-image-head {
  display: grid;
  gap: 2px;
}

.ai-image-head span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.ai-image-head strong {
  color: var(--ink);
  font-size: 1rem;
}

.prompt-preview {
  width: 100%;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.55;
  resize: vertical;
}

.prompt-status {
  border: 1px solid rgba(49, 93, 90, 0.14);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brand);
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 850;
}

.prompt-details {
  display: grid;
  gap: 8px;
}

.prompt-details summary {
  width: fit-content;
  color: var(--blue);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 850;
}

.prompt-details .prompt-preview {
  margin-top: 8px;
}

.ai-image-actions,
.image-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.trainer-avatar {
  --avatar-bg: #e9f2ef;
  --avatar-bg-2: #fff7e6;
  --skin: #f1bea0;
  --hair: #293937;
  --wear: #f7faf4;
  --trim: #315d5a;
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 76px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(49, 93, 90, 0.16);
  border-radius: 16px;
  background: var(--avatar-bg);
  box-shadow: inset 0 -18px 36px rgba(36, 49, 47, 0.08);
}

.trainer-photo {
  display: block;
  flex: 0 0 auto;
  width: 76px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(49, 93, 90, 0.16);
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 -18px 36px rgba(36, 49, 47, 0.08);
}

.trainer-photo.is-sheet-source {
  object-position: top center;
}

.trainer-avatar.is-rail {
  width: 100%;
  aspect-ratio: 1 / 1.06;
  border: 0;
  border-radius: 0;
}

.trainer-avatar.is-style-photo {
  box-shadow: inset 0 -18px 36px rgba(36, 49, 47, 0.08), 0 0 0 1px rgba(49, 93, 90, 0.08);
}

.trainer-avatar.is-style-anime .avatar-eye {
  width: 8.5%;
  height: 11%;
}

.trainer-avatar.is-style-anime .avatar-smile {
  height: 11%;
}

.trainer-avatar.is-style-semi {
  box-shadow: inset 0 -22px 42px rgba(36, 49, 47, 0.11), 0 12px 24px rgba(36, 49, 47, 0.08);
}

.trainer-avatar.is-style-simple {
  box-shadow: none;
}

.trainer-avatar.is-style-simple .avatar-back {
  background: linear-gradient(135deg, var(--avatar-bg), var(--avatar-bg-2));
}

.trainer-photo.is-rail {
  width: 100%;
  aspect-ratio: 1 / 1.06;
  border: 0;
  border-radius: 0;
}

.trainer-avatar.is-card {
  width: 54px;
  border-radius: 12px;
}

.trainer-photo.is-card {
  width: 54px;
  border-radius: 12px;
}

.trainer-avatar.is-hero {
  width: 118px;
  border-radius: 18px;
}

.trainer-photo.is-hero {
  width: 118px;
  border-radius: 18px;
}

.trainer-avatar.is-mini {
  width: 40px;
  border-radius: 10px;
}

.trainer-photo.is-mini {
  width: 40px;
  border-radius: 10px;
}

.trainer-avatar.is-feedback-face,
.trainer-photo.is-feedback-face {
  width: 54px;
  height: 54px;
  border-radius: 999px;
}

.trainer-photo.is-feedback-face {
  object-fit: cover;
  object-position: center 24%;
}

.trainer-avatar.is-feedback-face .avatar-body,
.trainer-avatar.is-feedback-face .avatar-neck {
  display: none;
}

.trainer-avatar.is-feedback-face .avatar-head {
  left: 19%;
  top: 19%;
  width: 62%;
  height: 58%;
}

.trainer-avatar.is-feedback-face .avatar-hair {
  top: -21%;
  height: 42%;
}

.trainer-avatar .avatar-back,
.trainer-avatar .avatar-neck,
.trainer-avatar .avatar-body,
.trainer-avatar .avatar-head,
.trainer-avatar .avatar-hair,
.trainer-avatar .avatar-eye,
.trainer-avatar .avatar-smile {
  position: absolute;
  display: block;
}

.trainer-avatar .avatar-back {
  inset: 0;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.92) 0 17%, transparent 18%),
    linear-gradient(135deg, var(--avatar-bg), var(--avatar-bg-2));
}

.trainer-avatar .avatar-neck {
  left: 43%;
  bottom: 32%;
  width: 14%;
  height: 16%;
  border-radius: 999px;
  background: var(--skin);
}

.trainer-avatar .avatar-body {
  left: 17%;
  bottom: -2%;
  width: 66%;
  height: 36%;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  background: var(--wear);
}

.trainer-avatar .avatar-body span {
  position: absolute;
  left: 22%;
  top: 28%;
  width: 56%;
  height: 10%;
  border-radius: 999px;
  background: var(--trim);
  box-shadow: 0 12px 0 rgba(255, 255, 255, 0.55);
}

.trainer-avatar .avatar-head {
  left: 29%;
  top: 22%;
  width: 42%;
  height: 43%;
  border-radius: 44% 44% 48% 48%;
  background: var(--skin);
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.03);
}

.trainer-avatar .avatar-hair {
  left: -5%;
  top: -17%;
  width: 110%;
  height: 38%;
  border-radius: 60% 60% 38% 38%;
  background: var(--hair);
}

.trainer-avatar.is-medium .avatar-hair {
  top: -13%;
  height: 46%;
  border-radius: 64% 64% 42% 42%;
}

.trainer-avatar.is-long .avatar-hair {
  left: -10%;
  top: -9%;
  width: 120%;
  height: 58%;
  border-radius: 66% 66% 48% 48%;
}

.trainer-avatar.is-cool .avatar-hair,
.trainer-avatar.is-short .avatar-hair {
  top: -11%;
  height: 32%;
  border-radius: 54% 54% 30% 30%;
}

.trainer-avatar .avatar-eye {
  top: 43%;
  width: 7%;
  height: 9%;
  border-radius: 999px;
  background: var(--ink);
}

.trainer-avatar .avatar-eye.is-left {
  left: 35%;
}

.trainer-avatar .avatar-eye.is-right {
  right: 35%;
}

.trainer-avatar .avatar-smile {
  left: 38%;
  bottom: 29%;
  width: 24%;
  height: 12%;
  border-bottom: 3px solid var(--ink);
  border-radius: 0 0 999px 999px;
}

.insight-strip,
.chat-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(49, 93, 90, 0.18);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
}

.trainer-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(49, 93, 90, 0.2);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 34px rgba(36, 49, 47, 0.08);
  padding: 13px;
}

.danger-zone {
  border-color: rgba(214, 91, 77, 0.24);
  background: #fff8f6;
}

.danger-zone-body {
  display: grid;
  gap: 10px;
}

.danger-zone-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.trainer-portrait {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(49, 93, 90, 0.2);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 14px 34px rgba(36, 49, 47, 0.08);
  padding: 13px;
}

.trainer-portrait div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.trainer-portrait span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.trainer-portrait strong {
  font-size: 1.22rem;
  line-height: 1.28;
}

.trainer-portrait p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.character-sheet-source-panel {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(49, 93, 90, 0.18);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.character-sheet-source-panel img {
  display: block;
  width: 92px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.character-sheet-source-panel div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.character-sheet-source-panel span {
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.character-sheet-source-panel strong {
  font-size: 0.98rem;
  line-height: 1.35;
}

.character-sheet-source-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.trainer-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trainer-card-head img {
  flex: 0 0 auto;
  border-radius: 8px;
}

.trainer-card-head strong {
  display: block;
  line-height: 1.35;
}

.trainer-card-head span {
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 850;
}

.trainer-profile {
  display: grid;
  gap: 8px;
  margin: 0;
}

.trainer-profile div {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.trainer-profile dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.trainer-profile dd {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
  line-height: 1.55;
}

.trainer-settings-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(76, 90, 138, 0.18);
  border-radius: var(--radius);
  background: #f7f8fb;
  padding: 12px;
}

.trainer-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trainer-settings-head span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.trainer-settings-head strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.sheet-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.sheet-list div {
  display: grid;
  gap: 3px;
}

.sheet-list dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.sheet-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sheet-edit-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(49, 93, 90, 0.18);
  border-radius: var(--radius);
  background: #f8fbf6;
  padding: 12px;
}

.sheet-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet-edit-head span {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
}

.sheet-edit-head strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.sheet-edit-actions {
  display: grid;
  gap: 8px;
}

.sheet-edit-actions span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.45;
}

.insight-strip {
  display: grid;
}

.insight-strip span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.insight-strip strong {
  font-size: 1rem;
}

.mobile-field {
  flex: none;
}

.nickname-input {
  min-height: 52px;
  font-size: 1rem;
}

.chat-preview {
  background: #fff7ee;
  border-color: rgba(227, 111, 74, 0.24);
}

.chat-preview img {
  flex: 0 0 auto;
  border-radius: 8px;
}

.chat-preview p {
  margin: 0;
  font-weight: 800;
}

.feedback-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(232, 115, 90, 0.22);
  border-radius: 22px;
  background: #fff7ee;
  box-shadow: 0 16px 34px rgba(51, 38, 31, 0.08);
  padding: 16px;
}

.feedback-card strong {
  font-size: 1.04rem;
  line-height: 1.35;
}

.feedback-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.first-report-screen {
  align-content: start;
}

.onboarding-meal {
  min-height: 178px;
  font-size: 1rem;
}

.onboarding-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.onboarding-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: grid;
  gap: 8px;
  margin: 8px -20px calc(-12px - env(safe-area-inset-bottom));
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0), rgba(255, 250, 241, 0.94) 18px),
    var(--paper-2);
  border-top: 1px solid rgba(236, 216, 202, 0.72);
}

.onboarding-primary,
.onboarding-skip,
.onboarding-back {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
}

.onboarding-actions .button.secondary {
  border-color: rgba(51, 38, 31, 0.14);
  background: rgba(255, 255, 255, 0.82);
}

.onboarding-actions .button.ghost {
  min-height: 38px;
  color: var(--muted);
}

.onboarding-phone {
  width: min(100%, 390px);
}

.onboarding-phone.is-start .onboarding-topbar,
.onboarding-phone.is-start .onboarding-progress,
.onboarding-phone.is-sample .onboarding-topbar,
.onboarding-phone.is-sample .onboarding-progress,
.onboarding-phone.is-firstReport .onboarding-topbar,
.onboarding-phone.is-firstReport .onboarding-progress,
.onboarding-phone.is-reveal .onboarding-topbar,
.onboarding-phone.is-reveal .onboarding-progress {
  display: none;
}

.onboarding-phone.is-start .onboarding-screen,
.onboarding-phone.is-sample .onboarding-screen,
.onboarding-phone.is-firstReport .onboarding-screen,
.onboarding-phone.is-reveal .onboarding-screen {
  min-height: 100dvh;
}

.onboarding-phone.is-feedback .onboarding-topbar,
.onboarding-phone.is-paywall .onboarding-topbar {
  display: none;
}

.onboarding-phone.is-feedback .onboarding-progress,
.onboarding-phone.is-paywall .onboarding-progress {
  display: none;
}

.button.onboarding-primary {
  border: 0;
  background: linear-gradient(180deg, #ff725c, #ed654f);
  color: #fff;
  box-shadow: 0 14px 30px rgba(232, 115, 90, 0.28);
  font-size: 1.03rem;
  font-weight: 950;
}

.button.onboarding-primary::after {
  content: "  ♥";
  font-size: 0.9em;
}

.button.onboarding-primary[data-action="prepare-first-feedback"]::after,
.button.onboarding-primary[data-action="apply-onboarding-adjustment"]::after,
.button.onboarding-primary[data-action="onboarding-next"]::after {
  content: "";
}

.hero-handwriting {
  margin: 0 auto -2px;
  color: var(--brand);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.36;
  text-align: center;
  transform: rotate(-3deg);
}

.start-hero-panel {
  position: relative;
  gap: 11px;
  min-height: auto;
  padding: calc(24px + env(safe-area-inset-top)) 18px 15px;
  background:
    radial-gradient(circle at 8% 17%, rgba(255, 255, 255, 0.9) 0 42px, transparent 43px),
    radial-gradient(circle at 92% 6%, rgba(245, 197, 86, 0.2), transparent 27%),
    linear-gradient(180deg, #fffaf1 0%, #fff2df 58%, #fff8ef 100%);
}

.start-hero-panel::before,
.start-hero-panel::after {
  position: absolute;
  z-index: 0;
  color: rgba(239, 126, 93, 0.36);
  font-family: Georgia, serif;
  font-size: 2.3rem;
  line-height: 1;
  pointer-events: none;
}

.start-hero-panel::before {
  content: "♡";
  top: calc(51px + env(safe-area-inset-top));
  left: 38px;
  transform: rotate(-12deg);
}

.start-hero-panel::after {
  content: "〃";
  top: calc(35px + env(safe-area-inset-top));
  right: 32px;
  color: rgba(239, 126, 93, 0.44);
  transform: rotate(18deg);
}

.start-hero-panel > * {
  position: relative;
  z-index: 1;
}

.diet-proof {
  place-items: center;
  text-align: center;
}

.diet-proof strong {
  position: relative;
  width: 100%;
  max-width: none;
  color: var(--ink);
  font-size: clamp(1.86rem, 8.5vw, 2.18rem);
  font-weight: 950;
  line-height: 1.18;
}

.diet-proof strong span {
  display: inline-block;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: 0;
  white-space: nowrap;
}

.diet-proof strong::after {
  content: "";
  display: block;
  width: 142px;
  height: 10px;
  margin: 5px auto 0;
  border-bottom: 4px solid rgba(239, 126, 93, 0.72);
  border-radius: 999px;
  transform: rotate(-5deg);
}

.diet-proof mark {
  background: none;
  color: var(--brand);
}

.diet-proof p {
  max-width: 18.6em;
  color: #6f5d53;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.48;
}

.preview-stage {
  position: relative;
  min-height: 180px;
  margin: 2px -18px 0;
}

.preview-face {
  position: absolute;
  top: 5px;
  width: 88px;
  height: 170px;
  border: 4px solid rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  object-fit: cover;
  object-position: center top;
  background: #fff;
  box-shadow: 0 14px 30px rgba(51, 38, 31, 0.14);
}

.preview-face.is-1 {
  left: -7px;
  top: 24px;
  transform: rotate(-5deg);
}

.preview-face.is-2 {
  left: 52px;
  top: 12px;
  z-index: 2;
}

.preview-face.is-3 {
  left: 113px;
  width: 96px;
  height: 186px;
  top: 0;
  z-index: 3;
}

.preview-face.is-4 {
  left: 185px;
  top: 12px;
  z-index: 2;
}

.preview-face.is-5 {
  left: 246px;
  top: 10px;
  z-index: 3;
}

.preview-face.is-6 {
  left: 309px;
  top: 16px;
  transform: rotate(5deg);
}

.start-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: -2px 0 9px;
}

.start-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #efd8bd;
}

.start-dots .is-active {
  width: 7px;
  height: 7px;
  background: var(--brand);
}

.promise-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 5px;
}

.promise-pills span {
  display: grid;
  grid-template-rows: 18px auto;
  gap: 3px;
  min-height: 56px;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: #6c5549;
  box-shadow: 0 10px 24px rgba(51, 38, 31, 0.08);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.promise-pills svg {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.start-screen {
  gap: 12px;
}

.start-screen .onboarding-copy {
  display: none;
}

.start-screen .route-card {
  grid-template-columns: 45px minmax(0, 1fr) 20px;
  min-height: 58px;
  border-radius: 15px;
  padding: 10px 13px;
  font-size: 1rem;
}

.start-screen .route-card strong {
  grid-column: 2;
  font-size: 1.03rem;
}

.start-screen .route-card span:not(.route-icon) {
  grid-column: auto;
}

.start-screen .route-card.is-primary {
  border: 0;
  background: linear-gradient(180deg, #ff725c, #ec654f);
  color: #fff;
  box-shadow: 0 12px 22px rgba(232, 115, 90, 0.3);
}

.start-screen .route-card.is-primary strong,
.start-screen .route-card.is-primary span:not(.route-icon) {
  color: #fff;
}

.start-screen .route-card:not(.is-primary) {
  border-color: rgba(232, 115, 90, 0.5);
  background: rgba(255, 255, 255, 0.74);
}

.start-screen .route-icon {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  font-size: 1rem;
}

.start-screen .route-icon svg {
  width: 20px;
  height: 20px;
}

.start-screen .route-icon.is-soft {
  background: #fff7eb;
  color: var(--brand);
}

.trust-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.g3-canon-screen {
  display: block;
  min-height: 100dvh;
  padding: 0;
  background: #fff7ec;
}

.g3-canon-stage {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 390 / 844;
  margin: 0 auto;
  overflow: hidden;
  background-position: top center;
  background-repeat: no-repeat;
  background-size: 100% auto;
}

.g3-canon-stage.is-start {
  background-image: url("assets/g3-ui-images/g3-img-001-start.png");
}

.g3-canon-stage.is-start::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 38.7%;
  top: 35.4%;
  width: 22.6%;
  height: 3%;
  border-radius: 999px;
  background: #fff7ec;
  box-shadow: 0 0 18px 16px rgba(255, 247, 236, 0.98);
  pointer-events: none;
}

.g3-image-button {
  position: absolute;
  z-index: 2;
  display: block;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0);
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(232, 115, 90, 0.16);
}

.g3-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.g3-image-button:focus-visible {
  outline: 3px solid rgba(232, 115, 90, 0.72);
  outline-offset: 2px;
}

.g3-image-button.is-start-custom {
  left: 5.64%;
  top: 74.41%;
  width: 88.72%;
  height: 8.06%;
}

.g3-image-button.is-start-sample {
  left: 5.64%;
  top: 84.6%;
  width: 88.72%;
  height: 7.11%;
}

.start-legal-note {
  position: absolute;
  z-index: 2;
  left: 8%;
  right: 8%;
  bottom: 1.6%;
  margin: 0;
  color: rgba(95, 77, 67, 0.78);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.start-legal-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.style-screen .style-grid {
  grid-template-columns: 1fr;
}

.style-card {
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  min-height: 132px;
  border-radius: 22px;
  padding: 12px;
}

.style-card .style-swatch {
  grid-row: 1 / span 2;
}

.style-card .trainer-photo.is-card,
.style-card .trainer-avatar.is-card {
  width: 104px;
  height: 104px;
  border-radius: 24px;
}

.style-card strong {
  align-self: end;
  font-size: 1.08rem;
}

.style-card span:not(.style-swatch) {
  align-self: start;
}

.style-card[aria-pressed="true"] {
  border-color: var(--brand);
  background: #fff2e9;
  box-shadow: 0 0 0 3px rgba(232, 115, 90, 0.13), 0 18px 34px rgba(51, 38, 31, 0.08);
}

.feedback-screen {
  gap: 9px;
  padding-top: calc(12px + env(safe-area-inset-top));
}

.feedback-profile {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.feedback-profile .trainer-photo,
.feedback-profile .trainer-avatar {
  width: 54px;
  height: 54px;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(51, 38, 31, 0.12);
}

.feedback-profile strong {
  display: block;
  font-size: 1.26rem;
}

.feedback-profile span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.partner-bubble {
  position: relative;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(232, 115, 90, 0.24);
  border-radius: 22px 22px 22px 8px;
  background: #fff1df;
  padding: 13px 14px;
  box-shadow: 0 14px 30px rgba(51, 38, 31, 0.06);
}

.partner-bubble::before {
  content: "";
  position: absolute;
  left: -9px;
  bottom: 12px;
  width: 18px;
  height: 18px;
  border-bottom: 1px solid rgba(232, 115, 90, 0.24);
  border-left: 1px solid rgba(232, 115, 90, 0.24);
  background: #fff1df;
  transform: rotate(32deg);
}

.partner-bubble strong {
  font-size: 1.02rem;
}

.partner-bubble p {
  margin: 0;
  color: #6c5549;
  font-weight: 750;
  font-size: 0.86rem;
  line-height: 1.5;
}

.meal-summary-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(232, 115, 90, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  padding: 9px;
  box-shadow: 0 12px 26px rgba(51, 38, 31, 0.06);
}

.meal-thumb {
  position: relative;
  height: 82px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 25%, #fff 0 17px, transparent 18px),
    linear-gradient(135deg, #fff5df, #f4c16f 45%, #8fc073 100%);
}

.plate {
  position: absolute;
  display: block;
  border: 4px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(51, 38, 31, 0.12);
}

.plate.rice {
  left: 12px;
  top: 12px;
  width: 42px;
  height: 34px;
  background: #fff;
}

.plate.soup {
  left: 60px;
  top: 10px;
  width: 48px;
  height: 36px;
  background: #8a5a38;
}

.plate.main {
  left: 18px;
  bottom: 13px;
  width: 74px;
  height: 34px;
  background: linear-gradient(90deg, #ef8d55, #f8d7a8);
}

.plate.salad {
  right: 10px;
  bottom: 12px;
  width: 54px;
  height: 46px;
  background: radial-gradient(circle at 35% 45%, #e45c4f 0 6px, transparent 7px), #8fc96b;
}

.meal-label {
  color: var(--brand-2);
  font-size: 0.78rem;
  font-weight: 950;
}

.meal-summary-card strong {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
  line-height: 1.42;
}

.meal-summary-card small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-weight: 750;
}

.metric-chip-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-chip-row span {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid rgba(232, 115, 90, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.metric-chip-row em {
  color: #8a6f60;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.metric-chip-row strong {
  color: var(--brand);
  font-size: 0.82rem;
}

.feedback-story-card {
  display: grid;
  border: 1px solid rgba(232, 115, 90, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  padding: 4px 14px;
}

.feedback-story-card section {
  display: block;
  padding: 9px 0;
}

.feedback-story-card section + section {
  border-top: 1px dashed rgba(122, 106, 95, 0.24);
}

.feedback-story-card strong {
  font-size: 0.94rem;
}

.feedback-story-card p {
  margin: 3px 0 0;
  color: #6c5549;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.55;
}

.support-art-card {
  position: relative;
  min-height: 146px;
  overflow: hidden;
  border: 1px solid rgba(232, 115, 90, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.86), transparent 24%),
    linear-gradient(135deg, #fff7ea, #ffe2cf);
  box-shadow: 0 16px 34px rgba(51, 38, 31, 0.1);
}

.support-art-card.is-compact {
  margin-top: 14px;
  min-height: 138px;
}

.support-art-copy {
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 2;
  max-width: 56%;
}

.support-art-copy span {
  display: block;
  color: #8a5f42;
  font-size: 0.86rem;
  font-weight: 950;
}

.support-art-copy strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 950;
  line-height: 1.35;
}

.support-art-copy p {
  margin: 8px 0 0;
  color: #6c5549;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.45;
}

.support-art-button {
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 8px 18px rgba(51, 38, 31, 0.12);
  min-height: 38px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 950;
}

.support-art-button:disabled {
  opacity: 0.72;
}

.support-art-output {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: 52%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 28px 0 0 0;
}

.trainer-photo.is-support,
.trainer-avatar.is-support {
  position: absolute;
  right: 24px;
  bottom: -10px;
  z-index: 1;
  width: 134px;
  height: 154px;
  border: 0;
  border-radius: 34px 34px 0 0;
  object-fit: cover;
  object-position: center top;
  box-shadow: none;
}

.support-meal {
  position: absolute;
  right: 6px;
  bottom: 12px;
  display: flex;
  gap: 7px;
}

.support-meal span {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 -8px 0 rgba(238, 169, 94, 0.5);
}

.paywall-screen {
  gap: 16px;
  padding-top: 0;
}

.post-gate-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(31, 25, 21, 0.34);
}

.post-gate-card {
  position: relative;
  width: min(100%, 430px);
  max-height: min(88vh, 760px);
  overflow: auto;
  border-radius: 26px;
  background: #fffaf3;
  border: 1px solid rgba(232, 115, 90, 0.22);
  box-shadow: 0 24px 60px rgba(51, 38, 31, 0.24);
  padding: 22px;
}

.post-gate-card h2 {
  margin: 5px 0 8px;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.25;
}

.post-gate-card > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.6;
}

.post-gate-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.action-list.compact {
  gap: 8px;
  margin: 12px 0;
}

.waitlist-card.compact {
  margin: 12px 0;
}

.paywall-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 144px;
  gap: 8px;
  align-items: end;
  min-height: 270px;
  margin: -20px -20px 0;
  overflow: hidden;
  padding: calc(40px + env(safe-area-inset-top)) 20px 24px;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.88), transparent 30%),
    linear-gradient(135deg, #fff9ed 0%, #ffe1cf 100%);
}

.paywall-hero h2 {
  margin: 0;
  color: var(--ink);
  font-size: 2.05rem;
  font-weight: 950;
  line-height: 1.2;
}

.paywall-hero p {
  max-width: 15em;
  margin: 14px 0 0;
  color: #6c5549;
  font-weight: 850;
  line-height: 1.7;
}

.trainer-photo.is-paywall,
.trainer-avatar.is-paywall {
  align-self: end;
  width: 136px;
  height: 210px;
  border: 0;
  border-radius: 60px 60px 0 0;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 18px 38px rgba(51, 38, 31, 0.12);
}

.paywall-lead {
  margin: 0;
  color: #5f4d43;
  font-size: 1rem;
  font-weight: 950;
  text-align: center;
}

.paywall-screen .action-list {
  gap: 10px;
}

.paywall-screen .action-card {
  grid-template-columns: 58px minmax(0, 1fr) 18px;
  min-height: 78px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
  box-shadow: 0 12px 28px rgba(51, 38, 31, 0.07);
}

.paywall-screen .action-icon {
  width: 52px;
  height: 52px;
  background: #fff0df;
  color: var(--brand);
  font-size: 0.86rem;
}

.paywall-screen .action-arrow {
  color: var(--brand);
  font-size: 1.5rem;
  font-weight: 900;
}

.paywall-screen .mini-note {
  color: #8a756a;
  font-size: 0.78rem;
  text-align: left;
}

.waitlist-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(231, 111, 85, 0.24);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(51, 38, 31, 0.07);
  padding: 16px;
}

.waitlist-card h3,
.waitlist-card p {
  margin: 0;
}

.waitlist-card h3 {
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 950;
}

.waitlist-card p {
  color: #6c5549;
  font-weight: 760;
  line-height: 1.65;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #5f4d43;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.55;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
}

.mini-note.is-error {
  color: #b64635;
  font-weight: 900;
}

.onboarding-phone.is-feedback .onboarding-actions,
.onboarding-phone.is-paywall .onboarding-actions {
  margin-top: 0;
}

.pricing-card.is-active {
  border-color: var(--accent);
  background: #fff7ee;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(420px, calc(100% - 36px));
  border: 1px solid rgba(49, 93, 90, 0.22);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.g3-first-report-screen {
  display: block;
  padding: 0;
  background: #fff7ec;
}

.g3-first-report-stage {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 390 / 844;
  margin: 0 auto;
  overflow: hidden;
  background: #fff7ec url("assets/g3-ui-images/g3-img-006-first-meal.png") top center / 100% auto no-repeat;
}

.g3-first-report-stage::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 5.9%;
  top: 47.25%;
  width: 88.2%;
  height: 20.4%;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(85, 61, 48, 0.08);
  pointer-events: none;
}

.g3-first-report-stage::after {
  content: "食事メモ";
  position: absolute;
  z-index: 2;
  left: 13.2%;
  top: 49.1%;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 900;
  pointer-events: none;
}

.g3-first-meal-photo,
.g3-first-meal-text,
.g3-first-meal-sample,
.g3-first-meal-next {
  position: absolute;
  z-index: 2;
}

.g3-first-meal-photo,
.g3-first-meal-sample,
.g3-first-meal-next {
  border: 0;
  background: rgba(255, 255, 255, 0);
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(232, 115, 90, 0.16);
}

.g3-first-meal-photo {
  left: 8.7%;
  top: 20.8%;
  width: 82.6%;
  height: 24.2%;
  display: grid;
  place-items: end center;
  border-radius: 24px;
  padding: 12px;
}

.g3-first-meal-photo span {
  max-width: 86%;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 7px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(51, 38, 31, 0.1);
}

.g3-first-meal-text {
  left: 8.7%;
  top: 52.1%;
  width: 82.6%;
  height: 14.6%;
  border: 0;
  border-radius: 16px;
  outline: 0;
  resize: none;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.62;
  padding: 14px 20px 12px;
  box-shadow: none;
}

.g3-first-meal-text::placeholder {
  color: rgba(91, 75, 66, 0.42);
}

.g3-first-meal-text:focus-visible,
.g3-first-meal-photo:focus-visible,
.g3-first-meal-sample:focus-visible,
.g3-first-meal-next:focus-visible {
  outline: 3px solid rgba(232, 115, 90, 0.55);
  outline-offset: -3px;
}

.g3-first-meal-sample {
  left: 11.03%;
  top: 68.48%;
  width: 77.95%;
  height: 5.7%;
  border-radius: 999px;
}

.g3-first-meal-next {
  left: 7.18%;
  top: 88.63%;
  width: 85.64%;
  height: 6.4%;
  border-radius: 999px;
}

.g3-reveal-screen {
  display: block;
  padding: calc(14px + env(safe-area-inset-top)) 0 calc(10px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 9% 36%, rgba(139, 192, 125, 0.16), transparent 20%),
    radial-gradient(circle at 100% 14%, rgba(255, 221, 187, 0.5), transparent 30%),
    #fff7ec;
  text-align: center;
}

.g3-reveal-screen .reveal-copy {
  display: grid;
  gap: 6px;
  padding: 0 22px;
}

.g3-reveal-screen .step-kicker {
  display: none;
}

.g3-reveal-screen .reveal-copy h2 {
  margin: 0;
  color: var(--brand);
  font-size: 1.9rem;
  line-height: 1.1;
}

.g3-reveal-screen .reveal-copy h2::before,
.g3-reveal-screen .reveal-copy h2::after {
  content: "✦";
  color: #f0b84e;
  font-size: 0.86rem;
  margin: 0 8px;
  vertical-align: 35%;
}

.g3-reveal-screen .reveal-copy p {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.reveal-portrait.is-hero {
  width: min(84%, 328px);
  height: min(46dvh, 354px);
  min-height: 304px;
  margin: 12px auto 0;
  overflow: hidden;
  border: 0;
  border-radius: 30px 30px 16px 16px;
  background: #fff;
  box-shadow: 0 24px 52px rgba(51, 38, 31, 0.18);
}

.reveal-portrait.is-hero .trainer-photo,
.reveal-portrait.is-hero .trainer-avatar {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  object-fit: cover;
  object-position: center top;
  box-shadow: none;
}

.g3-reveal-screen .reveal-confirm-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  width: min(84%, 328px);
  margin: -52px auto 0;
  border: 1px solid rgba(232, 115, 90, 0.18);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 14px 14px;
  box-shadow: 0 22px 44px rgba(51, 38, 31, 0.12);
}

.g3-reveal-screen .name-edit {
  justify-content: center;
  gap: 10px;
}

.g3-reveal-screen .name-edit strong {
  font-size: 1.48rem;
}

.g3-reveal-screen .feedback-card {
  border-radius: 18px 18px 18px 6px;
  background: #fff7ed;
  padding: 10px 12px;
  text-align: left;
}

.g3-reveal-screen .feedback-card strong {
  font-size: 0.98rem;
}

.g3-reveal-screen .feedback-card p {
  font-size: 0.82rem;
  line-height: 1.5;
}

.g3-reveal-screen .mini-note {
  margin: 0;
  font-size: 0.78rem;
}

.g3-reveal-screen .onboarding-actions {
  position: static;
  margin: 0;
  border-top: 0;
  background: transparent;
  padding: 0;
}

.g3-reveal-screen .onboarding-actions .button.secondary {
  min-height: 44px;
}

.meal-thumb {
  background: url("assets/g3-ui-images/g3-img-008-first-feedback.png") -38px -184px / 390px 844px no-repeat;
}

.meal-thumb .plate {
  display: none;
}

@media (max-width: 880px) {
  .app-shell {
    width: min(100% - 20px, 760px);
    padding-top: 12px;
  }

  .app-header,
  .main-grid,
  .onboarding-layout {
    grid-template-columns: 1fr;
  }

  .header-status {
    justify-content: flex-start;
  }

  .tabs {
    grid-template-columns: repeat(5, minmax(72px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .tab-button {
    white-space: nowrap;
  }

  .companion-rail {
    position: static;
  }

  .avatar-frame {
    display: none;
  }

  .workbench {
    min-height: auto;
    padding: 12px;
  }

  .pfc-grid,
  .metric-grid,
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ledger-row,
  .memory-edit {
    grid-template-columns: 1fr;
  }

  .onboarding-visual img {
    min-height: 260px;
    max-height: 360px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .app-shell {
    width: 100%;
    padding: 0 0 28px;
  }

  .app-header,
  .tabs,
  .main-grid {
    padding: 0 10px;
  }

  .tabs {
    display: flex;
    grid-template-columns: none;
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 10px;
  }

  .tab-button {
    flex: 0 0 78px;
  }

  .brand-subtitle {
    display: none;
  }

  .workbench,
  .companion-rail {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .section-panel,
  .reply-item,
  .memory-item,
  .event-row,
  .ledger-row,
  .sample-row,
  .metric-tile {
    border-radius: 8px;
  }

  .section-header {
    display: grid;
  }

  .pfc-grid,
  .metric-grid,
  .pricing-grid,
  .legal-link-grid {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 0;
    place-items: stretch;
  }

  .modal-panel {
    min-height: 100vh;
    border-radius: 0;
  }

  .onboarding-form {
    padding: 16px;
  }
}

/* Editable copy over the historical raster start screen. */
.start-benefits { position:absolute; z-index:3; left:3%; right:3%; top:63.2%; height:8%; display:flex; gap:8px; background:#fff7ec; }
.start-benefits span { flex:1; display:grid; align-content:center; text-align:center; border-radius:18px; background:#fffdf9; color:#725044; font-size:clamp(10px,2.9vw,12px); font-weight:700; line-height:1.5; box-shadow:0 5px 18px #e9c79833; }
.start-old-note-mask { position:absolute; z-index:2; left:8%; right:8%; top:92%; height:4%; background:#fff7ec; }

/* Clear meal-sample action and expandable daily nutrition reference. */
.g3-first-meal-sample.g3-image-button{display:flex;align-items:center;justify-content:center;gap:8px;background:#fff5e8;border:2px solid #ce573d;box-shadow:0 4px 0 #e4b7a6;color:#963b28;font:700 15px/1.2 system-ui,sans-serif;min-height:44px;padding:8px 12px}
.g3-first-meal-sample:hover{background:#ffe7d0}
.g3-first-meal-sample:active{transform:translateY(2px);box-shadow:0 2px 0 #e4b7a6}
.g3-first-meal-sample span{font-size:22px}
.daily-nutrition{margin-top:16px;width:100%;min-width:0}
.daily-nutrition>summary{display:flex;justify-content:space-between;align-items:center;cursor:pointer;border:1px solid #cb6551;border-radius:12px;padding:12px 14px;background:#fff3e9;color:#933c2b;font-weight:700;list-style:none;min-height:44px;box-sizing:border-box}
.daily-nutrition>summary::-webkit-details-marker{display:none}
.daily-nutrition>summary:focus-visible{outline:3px solid #2d686a;outline-offset:3px}
.daily-nutrition>summary span::before{content:"＋"}
.daily-nutrition[open]>summary span::before{content:"−"}
.daily-nutrition-body{padding-top:14px}
.daily-nutrition-body h3{margin:0 0 8px;font-size:16px}
.daily-nutrition-body p,.daily-nutrition-body a{font-size:12px;line-height:1.7}
.daily-nutrient{border:1px solid #eddbd0;border-radius:12px;background:#fffaf4;padding:12px;margin:10px 0}
.daily-nutrient>strong{font-size:14px}
.daily-nutrient dl{margin:8px 0 0;display:grid;gap:8px}
.daily-nutrient dl>div{display:flex;justify-content:space-between;gap:10px;align-items:baseline}
.daily-nutrient dt{font-size:12px;color:#766353}
.daily-nutrient dd{margin:0;font-size:16px;font-weight:700;text-align:right}
.daily-nutrient dd small{font-size:11px}
.daily-nutrient dl>div:last-child{border-top:1px dashed #e3cdbd;padding-top:8px}
.support-art-button{max-width:100%;white-space:normal}

/* Keep the explicit meal classification before the first-meal continue button. */
.g3-first-report-stage .meal-source { position:absolute; z-index:3; left:6%; top:75%; width:88%; box-sizing:border-box; margin:0; padding:7px 10px; gap:3px; border-radius:16px; background:#fff7ec; font-size:12px; }
.g3-first-report-stage .meal-source select { min-height:40px; padding:7px; font-size:12px; }
