/* Rose paper, readable rows, and thumb-reachable navigation. */
:root {
  color-scheme: light;
  --bg: #fff7fa; --paper: #fffcfd; --ink: #49323f; --muted: #795b6e;
  --pink: #ad3f71; --wash: #f8e6ee; --wash-strong: #efcadc; --line: #ead0dc;
  --on-pink: #fff; --rose: #ad3f71; --done: #35694f;
  --sheet-shadow: 0 -16px 64px -24px #49223555;
  --ease-out: cubic-bezier(.23,1,.32,1);
  scrollbar-color: var(--wash-strong) var(--bg); scroll-padding-bottom: 110px;
}
.login-methods { display: flex; gap: 8px; margin: 24px 0 12px; }
.login-methods button { flex: 1; min-width: 0; }
.login-methods button[aria-pressed="true"] { background: var(--pink); color: var(--on-pink); border-color: var(--pink); }
#password-form { margin-bottom: 24px; }
#password-help { margin: 8px 0 0; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171219; --paper: #241b25; --ink: #f6e8f0; --muted: #c4a9bb;
  --pink: #f29fc4; --wash: #382432; --wash-strong: #563349; --line: #68475a;
  --on-pink: #24131d; --rose: #f29fc4; --done: #a4d2b9;
  --sheet-shadow: 0 -16px 64px -24px #0009;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 "LXGW WenKai", KaiTi, serif; }
body:has(dialog[open]) { overflow: hidden; }
::selection { background: var(--wash-strong); color: var(--ink); }
button,input,select,textarea { font: inherit; color: inherit; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; }
button,a,input,select,textarea,summary { -webkit-tap-highlight-color: #ad3f7120; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button,select { min-height: 48px; padding: 10px 16px; }
button,summary,select { cursor: pointer; }
button { transition: transform 140ms var(--ease-out); }
button:active:not(:disabled) { transform: scale(.98); }
button:disabled { opacity: .55; cursor: default; }
button[aria-busy="true"] { cursor: wait; }
input,textarea { width: 100%; padding: 13px 14px; min-height: 50px; font-size: 16px; caret-color: var(--pink); }
input::placeholder,textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; }
label { display: block; margin: 20px 0 8px; font-size: 16px; }
form .primary { margin-top: 20px; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 4px; }
main:focus { outline: none; }
h1,h2,h3,p { margin: 0 0 12px; }
h1,h2,h3 { text-wrap: balance; overflow-wrap: anywhere; }
h1 { font-size: clamp(30px,3vw,40px); line-height: 1.3; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 24px; font-weight: 700; line-height: 1.45; }
h3 { font-size: 20px; font-weight: 700; line-height: 1.5; }
hr { border: 0; height: 1px; background: var(--line); margin: 28px 0; }
.muted { color: var(--muted); }
.small,.category-label { font-size: 14px; }
.category-label { color: var(--pink); }
.heart { color: var(--pink); flex: 0 0 auto; }
.primary { background: var(--pink); color: var(--on-pink); border-color: transparent; font-weight: 600; }
.quiet { background: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: 8px; left: 20px; z-index: 100; padding: 10px 16px; background: var(--paper); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.topbar { max-width: 1100px; margin: auto; padding: 22px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; font-size: 22px; font-weight: 700; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions select,.top-actions button { font-size: 16px; }
.top-actions select { background: var(--bg); border-color: transparent; padding-inline: 8px; }
main { max-width: 1036px; margin: auto; padding: 0 32px; }
.demo-notice { font-size: 12px; text-align: center; color: var(--muted); margin: 0 0 8px; }
.gate { max-width: 440px; margin: 24px auto 50px; text-align: center; }
.gate-art { margin-bottom: 20px; }
.gate-art img { width: 136px; height: 150px; }
.gate h1 { font-size: 32px; }
.gate-caption { color: var(--pink); font-size: 16px; margin-bottom: 20px; }
.login-form { text-align: left; margin: 28px 0 20px; }
.login-form button { width: 100%; }
#login-error { color: var(--pink); font-size: 16px; margin-top: 12px; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 0 32px; }
.welcome > div { min-width: 0; }
.welcome h1 { margin-bottom: 8px; }
.welcome img { width: 100px; height: 114px; flex: 0 0 auto; }
.welcome p { margin-bottom: 6px; }
#pair-name { color: var(--pink); font-size: 16px; }
.welcome-note { color: var(--muted); font-size: 16px; }
.mobile-break { display: none; }
.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(600px,100%); display: flex; gap: 8px; padding: 8px 18px calc(8px + env(safe-area-inset-bottom)); z-index: 40; background: var(--paper); border-top: 1px solid var(--line); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; position: relative; min-height: 58px; padding: 6px; border: 0; font-size: 13px; color: var(--muted); }
.tabs button.selected { color: var(--pink); background: var(--wash); }
.tabs .badge { position: absolute; right: calc(50% - 29px); top: 2px; font: 12px/19px "LXGW WenKai",serif; background: var(--pink); color: var(--on-pink); border-radius: 10px; min-width: 19px; padding-inline: 4px; font-variant-numeric: tabular-nums; }
#room { padding-bottom: calc(95px + env(safe-area-inset-bottom)); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head > div { min-width: 0; }
.section-head h2 { margin-bottom: 4px; }
.section-head p { margin: 0; font-size: 15px; }
.section-head button { flex-shrink: 0; }
.distance-hub { background: var(--wash); border-radius: 16px; padding: 22px 24px; margin-bottom: 32px; }
.distance-hub .section-head { margin-bottom: 12px; }
.distance-hub h2 { font-size: 22px; margin: 0; }
.distance-hub .section-head button { border: 0; padding: 8px 0 8px 12px; font-size: 15px; color: var(--pink); }
.distance-hub > p { margin: 12px 0 0; }
.distance-shortcuts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.idea-shortcut { display: flex; align-items: center; justify-content: center; gap: 9px; text-align: left; border: 0; min-height: 48px; font-size: 16px; padding: 12px; }
.idea-shortcut svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--pink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 20px; }
.chips button { min-height: 44px; padding: 8px 18px; border: 0; border-radius: 24px; background: transparent; font-size: 15px; }
.chips button.active { color: var(--on-pink); background: var(--pink); }
.menu-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 24px; }
.menu-card { display: grid; grid-template-columns: 32px minmax(0,1fr); column-gap: 14px; padding: 22px; min-width: 0; border-radius: 16px; background: var(--paper); }
.menu-card .symbol { grid-column: 1; grid-row: 1/3; padding-top: 4px; color: var(--pink); }
.menu-card .symbol svg { width: 28px; height: 28px; }
.menu-card h3 { grid-column: 2; margin-bottom: 6px; }
.menu-card p { grid-column: 2; color: var(--muted); font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 0; }
.menu-card .card-bottom { grid-column: 2; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.card-bottom > span { font-size: 14px; color: var(--muted); }
.card-bottom button { padding: 8px 14px; min-height: 44px; font-size: 15px; border: 0; background: var(--wash); color: var(--pink); }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); background: var(--wash); border-radius: 16px; grid-column: 1/-1; }
.custom-order { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; text-align: left; padding: 22px; margin-top: 20px; border: 0; background: var(--wash); }
.custom-order > span:first-child { grid-row: 1/3; align-self: center; color: var(--pink); font-size: 28px; }
.custom-order > span:nth-child(3) { grid-column: 2; color: var(--muted); font-size: 15px; }
.custom-order > span:last-child { grid-column: 3; grid-row: 1/3; align-self: center; }
.filter-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.filter-row label { margin: 0; }
.filter-row select { flex: 1; max-width: 250px; }
.ticket-list,.template-list { display: grid; gap: 12px; }
.ticket-row { text-align: left; padding: 22px; width: 100%; border: 0; background: var(--paper); }
.ticket-row strong { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.ticket-row .row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ticket-row p { margin: 8px 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.status { display: inline-block; flex-shrink: 0; padding: 4px 10px; border-radius: 6px; background: var(--wash); color: var(--pink); font-size: 13px; white-space: nowrap; }
.status.done { color: var(--done); }
.settings-card { max-width: 680px; background: var(--paper); padding: 28px; border-radius: 16px; margin-inline: auto; }
.settings-card p { color: var(--muted); font-size: 16px; }
.settings-card form .primary { width: 100%; }
.wide-link { width: 100%; text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; padding: 16px 18px; background: var(--wash); border: 0; }
.wide-link span { color: var(--muted); font-size: 14px; }
.settings-card .wide-link + .wide-link { margin-top: 10px; }
#profile-form { margin-top: 28px; }
footer { text-align: center; color: var(--muted); padding: 36px 0 12px; font-size: 14px; }
dialog { color: var(--ink); background: var(--paper); border: 0; border-radius: 20px; width: min(600px,calc(100% - 40px)); max-height: 90dvh; padding: 28px; box-shadow: var(--sheet-shadow); overscroll-behavior: contain; }
dialog::backdrop { background: #26121e88; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog-head h2 { font-size: 24px; margin: 0; }
.dialog-head p { margin: 0; }
.close { flex-shrink: 0; min-width: 48px; height: 48px; padding: 0; font-size: 28px; background: var(--wash); border: 0; }
dialog form .primary { width: 100%; min-height: 50px; }
.cart-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; }
.cart-row > span { min-width: 0; overflow-wrap: anywhere; }
.cart-row .quantity { display: flex; align-items: center; gap: 10px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.cart-row button { padding: 0; min-width: 44px; min-height: 44px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.timeline { padding: 16px; font-size: 14px; color: var(--muted); margin: 0 0 24px; background: var(--wash); border-radius: 12px; }
.timeline p:last-child { margin-bottom: 0; }
.comment { background: var(--wash); border-radius: 12px; padding: 14px 18px; margin-bottom: 12px; }
.comment .small { color: var(--muted); }
.comment p { margin: 4px 0; }
.panel > p.small { margin-top: 16px; }
#toast { position: fixed; left: 50%; bottom: calc(94px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 40px); padding: 13px 20px; background: var(--ink); color: var(--bg); border-radius: 12px; box-shadow: var(--sheet-shadow); z-index: 200; pointer-events: none; font-size: 15px; }
dialog #toast { bottom: calc(24px + env(safe-area-inset-bottom)); max-width: min(540px,calc(100% - 40px)); }
#ticket-content h2 { overflow-wrap: anywhere; }
.meeting-compose,.backup-intro { padding: 24px; margin: 32px 0 24px; border-radius: 16px; background: var(--wash); }
.meeting-compose h2 { margin-bottom: 16px; }
.compose-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.meeting-compose .compose-bottom { margin-top: 14px; }
.meeting-compose form .primary { margin-top: 0; }
.todo-card,.backup-card,.template-card { padding: 24px; background: var(--paper); border-radius: 16px; min-width: 0; }
.todo-card.is-done .todo-body { color: var(--muted); text-decoration: line-through; }
.backup-intro { margin-top: 0; }
.backup-card h3 { font-size: 19px; }
#restore-selected { background: var(--wash); padding: 16px; border-radius: 12px; color: var(--pink); }
.wish-library { background: var(--wash); border-radius: 12px; padding: 14px; margin-bottom: 20px; }
.wish-library summary { color: var(--pink); min-height: 48px; padding: 10px 0; font-size: 16px; }
.wish-library h3 { margin: 14px 0 10px; font-size: 17px; }
.template-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.template-choice { text-align: left; font-size: 15px; min-height: 52px; padding: 12px; overflow-wrap: anywhere; }
.template-picker > p { grid-column: 1/-1; }
.template-card h3 { overflow-wrap: anywhere; }
.template-card .action-row { margin: 16px 0 0; }
.template-card > p { font-size: 16px; }
#wish-form > .small { margin: 10px 0; }
#save-wish-template { width: 100%; margin-top: 10px; }
@media (hover: hover) {
  button:hover:not(:disabled),.wide-link:hover { background: var(--wash-strong); color: var(--ink); }
  .primary:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
  .brand:hover { color: var(--pink); }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  main { padding-inline: 20px; }
  .topbar { padding: 12px 20px 8px; }
  .brand { font-size: 20px; gap: 8px; }
  .brand svg { width: 21px; height: 21px; }
  .top-actions #logout { display: none; }
  .top-actions select { max-width: 120px; }
  .welcome { padding: 12px 0 16px; gap: 16px; }
  .welcome > div { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: baseline; }
  .welcome h1 { font-size: 30px; margin: 0; }
  .welcome #pair-name { margin: 0; }
  .welcome img { width: 76px; height: 90px; }
  .mobile-break { display: initial; }
  .welcome-note { font-size: 15px; grid-column: 1/-1; margin: 0; }
  .section-head { gap: 12px; margin-bottom: 16px; }
  .section-head h2 { font-size: 22px; }
  .section-head .primary { font-size: 15px; padding-inline: 14px; }
  #panel-menu > .section-head { flex-wrap: wrap; }
  #open-cart { margin-left: auto; }
  .distance-hub { padding: 16px; margin-bottom: 20px; }
  .distance-hub .section-head { gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
  .distance-hub h2 { font-size: 20px; }
  .distance-hub .section-head button { font-size: 14px; margin-left: auto; min-height: 44px; }
  .distance-shortcuts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .idea-shortcut { font-size: 15px; padding: 8px 10px; min-height: 44px; }
  .distance-hub > p { font-size: 13px; margin-top: 10px; }
  .chips { gap: 4px; margin: -4px -4px 12px; padding: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .chips button { padding-inline: 14px; flex-shrink: 0; }
  .menu-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .menu-card { padding: 20px; column-gap: 12px; grid-template-columns: 26px minmax(0,1fr); }
  .menu-card .symbol svg { width: 25px; height: 25px; }
  .menu-card .card-bottom { margin-top: 12px; }
  .menu-card h3 { font-size: 20px; }
  .menu-card p { font-size: 15px; }
  .ticket-row,.template-card,.todo-card,.backup-card { padding: 20px; }
  .ticket-row .row-top { flex-wrap: wrap; gap: 8px; }
  .settings-card { padding: 22px 20px; }
  .meeting-compose,.backup-intro { padding: 20px; }
  .meeting-compose h2,.meeting-todos h2 { font-size: 22px; }
  .custom-order { padding: 20px; }
  .backup-card button { width: 100%; margin-top: 10px; }
  .template-card .action-row button { flex: 1; padding-inline: 10px; }
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh; border-radius: 20px 20px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
  .dialog-head { position: sticky; top: -20px; padding: 8px 0; background: var(--paper); z-index: 2; }
  .dialog-head h2 { font-size: 22px; }
  .gate { margin-top: 20px; }
  .gate h1 { font-size: 28px; }
  .gate-art img { width: 118px; height: 130px; }
}
@media (max-width: 360px) {
  main { padding-inline: 16px; }
  .topbar { padding-inline: 16px; }
  .brand { font-size: 19px; }
  .welcome img { width: 60px; height: 74px; }
  .welcome > div { column-gap: 8px; }
  .welcome h1 { font-size: 28px; }
  #panel-tickets > .section-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
