:root {
  --paper: #fff7e8; --card: #ffffff; --ink: #2b2118; --muted: #6b5b4d; --line: #eadcc6;
  --accent: #d9482b; --accent-ink: #ffffff; --soft: #ffe3d9; --me: #2f63d6; --me-ink: #ffffff;
  --radius: 18px; --shadow: 0 2px 10px rgba(80, 50, 20, 0.08);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); }
.app { display: flex; flex-direction: column; min-height: 100dvh; max-width: 720px; margin: 0 auto; padding: 0 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand h1 { font-size: 1.3rem; margin: 0; }
@media (max-width: 360px) { .brand h1 { font-size: 1.05rem; } }
.logo { font-size: 1.6rem; }
.top-actions { display: flex; gap: 6px; align-items: center; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; align-items: center; }
.row { display: flex; gap: 8px; align-items: center; }
.wrap { flex-wrap: wrap; }
h2 { margin: 0; font-size: 1.2rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.btn, .icon-btn, .chip-btn, .send-btn { font: inherit; border: 0; cursor: pointer; border-radius: 999px; min-height: 44px; }
.btn { background: var(--accent); color: var(--accent-ink); padding: 10px 18px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.secondary { background: var(--soft); color: var(--ink); }
.btn.big { font-size: 1.1rem; padding: 16px 20px; flex: 1; }
.btn:disabled { opacity: 0.45; cursor: default; }
.icon-btn { background: var(--card); border: 1px solid var(--line); min-width: 44px; font-size: 1.2rem; }
.chip-btn { background: var(--card); border: 1px solid var(--line); padding: 4px 10px; min-height: 44px; white-space: nowrap; }
.tick { display: flex; gap: 8px; align-items: flex-start; }
.tick input { width: 22px; height: 22px; flex: none; }
.chat { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; padding-bottom: 8px; }
.honest { font-size: 0.85rem; color: var(--muted); text-align: center; margin: 0; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: var(--radius); line-height: 1.4; overflow-wrap: anywhere; }
.bubble.bot { background: var(--card); border: 1px solid var(--line); align-self: flex-start; }
.bubble.me { background: var(--me); color: var(--me-ink); align-self: flex-end; }
.bubble a { color: inherit; font-weight: 700; }
.proposal { background: var(--soft); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.proposal p { margin: 0; }
.proposal select { font: inherit; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); padding: 0 8px; background: var(--card); }
.note { background: var(--card); border-left: 4px solid var(--accent); padding: 8px 12px; border-radius: 8px; margin: 0; }
.composer { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--paper); padding: 8px 0 12px; }
.text-input { flex: 1; font: inherit; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); min-width: 0; }
.send-btn { background: var(--accent); color: var(--accent-ink); min-width: 48px; font-size: 1.2rem; }
.page { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.sheet { width: 100%; max-width: 480px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.grid figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.thumb { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; cursor: pointer; }
.thumb img { width: 100%; display: block; aspect-ratio: 3 / 4; object-fit: contain; }
figcaption { font-size: 0.85rem; display: flex; justify-content: space-between; gap: 6px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; min-height: 24px; }
.foot { text-align: center; font-size: 0.85rem; padding: 12px 0; color: var(--muted); }
.foot a { color: inherit; }
.print-area { display: none; }
:focus-visible { outline: 3px solid var(--me); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print {
  @page { size: A4 portrait; margin: 0; }
  .app { display: none; }
  .print-area { display: block; }
  .print-area img { width: 100%; height: auto; display: block; }
}
