:root {
  --white: #fff;
  --ivory: #f7f1eb;
  --bg-main: #f7f1eb;
  --bg-soft: #efe4da;
  --card-bg: #fbf8f4;
  --accent-main: #d8bfb4;
  --accent-soft: #e6d2cd;
  --accent-deep: #b5968e;
  --gold: var(--accent-main);
  --gold-dark: var(--accent-deep);
  --gold-light: var(--accent-soft);
  --gold-line: #d9c8bb;
  --ink: #5f524d;
  --muted: #8c7d76;
  --line: #ded0c5;
  --checked: #afa39d;
  --danger: #9a615d;
  --shadow: 0 10px 28px rgba(112, 87, 77, .08);
}

* { box-sizing: border-box; }
html { background: #ede2d9; }
body { margin: 0; color: var(--ink); background: var(--bg-main); font-family: "Noto Sans JP", sans-serif; font-size: 15px; }
button, input, select { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
.app-shell { position: relative; isolation: isolate; overflow: hidden; width: 100%; min-height: 100dvh; margin: 0 auto; background: linear-gradient(180deg, #faf6f1 0%, var(--bg-main) 36%, #f8f2ed 100%); padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.app-shell::before { position: fixed; z-index: 0; right: max(calc((100vw - 520px) / 2), 0px); bottom: calc(72px + env(safe-area-inset-bottom)); width: min(100vw, 520px); height: clamp(300px, 48vh, 470px); background: url("../icons/floral-watermark.png") center bottom / 100% auto no-repeat; content: ""; filter: sepia(.16) saturate(1.08) brightness(.86) contrast(1.06); opacity: .96; pointer-events: none; }
.app-header, main { position: relative; z-index: 1; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 26px 20px 12px; }
.settings-button { display: grid; justify-items: center; gap: 2px; min-width: 58px; min-height: 56px; border: 1px solid rgba(191,163,154,.42); border-radius: 15px; background: rgba(255,253,250,.78); color: #66534c; font-size: 12px; font-weight: 500; box-shadow: 0 2px 8px rgba(112,87,77,.06); }
.settings-button svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.settings-button:active { background: rgba(230,210,205,.28); }
.eyebrow { margin: 0 0 4px; color: var(--gold-dark); font-size: 10px; font-weight: 600; letter-spacing: .2em; }
h1, h2 { margin: 0; font-weight: 600; }
h1 { font-size: 24px; letter-spacing: .03em; }
h2 { font-size: 18px; }
.view { display: none; padding: 10px 18px 26px; }
.view.is-active { display: block; }
.card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(251,248,244,.96); padding: 18px; box-shadow: 0 4px 14px rgba(112,87,77,.035), inset 0 1px rgba(255,255,255,.92); transition: transform .18s ease, border-color .18s ease; }
.card::before { position: absolute; top: 0; right: 18%; left: 18%; height: 1px; background: linear-gradient(90deg, transparent, rgba(216,191,180,.62), transparent); content: ""; }
.card:active { transform: translateY(-1px); border-color: var(--gold-light); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.text-button { min-height: 44px; border: 0; background: none; color: var(--gold-dark); font-size: 13px; }
.voice-status { min-height: 116px; padding: 12px 4px 18px; text-align: center; }
#voice-status-text { margin: 0; color: var(--muted); }
.temporary-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
.temporary-items li, .chip-list li { border: 1px solid #ddcbc3; border-radius: 999px; background: rgba(251,248,244,.95); padding: 6px 11px; color: var(--ink); font-size: 13px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.empty-text { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.voice-actions { display: grid; gap: 14px; margin-top: clamp(28px, 8vh, 74px); }
.voice-button { position: relative; isolation: isolate; overflow: visible; display: flex; align-items: center; justify-content: center; gap: 11px; width: min(100%, 320px); min-height: 74px; margin: 0 auto; border: 1px solid #cdaea3; border-radius: 24px; background: linear-gradient(135deg, #ead8d0 0%, #dcbeb2 50%, #e8d0c7 100%); box-shadow: inset 0 1px rgba(255,255,255,.72), inset 0 -1px rgba(170,133,119,.12), 0 7px 18px rgba(156,116,103,.12); color: #574944; font-size: 18px; font-weight: 600; transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease; }
.voice-button::before { position: absolute; z-index: -1; inset: -8px; border: 1px solid rgba(216,191,180,.42); border-radius: 30px; opacity: 0; content: ""; pointer-events: none; }
.voice-button::after { position: absolute; z-index: 1; top: -18px; bottom: -18px; left: -25%; width: 32px; border-radius: 999px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.1), rgba(255,250,246,.58), rgba(255,255,255,.1), transparent); clip-path: inset(18px 0 round 24px); content: ""; opacity: 0; transform: skewX(-22deg); pointer-events: none; }
.voice-button:active { transform: translateY(2px) scale(.992); border-color: var(--accent-deep); box-shadow: inset 0 2px 5px rgba(135,101,91,.1), 0 3px 9px rgba(156,116,103,.09); }
.voice-button.is-starting::before { animation: gold-ring .78s ease-out 1; }
.voice-button.is-starting::after, .voice-button.is-complete::after { animation: metal-sheen .72s ease-out 1; }
.voice-button svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.voice-button .icon-stop { display: none; fill: currentColor; stroke: none; }
.voice-button.is-listening { border-color: var(--accent-deep); background: linear-gradient(135deg, #ead8d0, #d9b8ac, #e7cec5); color: #574944; animation: voice-breathe 2.1s ease-in-out infinite; }
.voice-button.is-complete { animation: complete-glint .85s ease-out 1; }
.voice-button.is-listening .icon-mic { display: none; }
.voice-button.is-listening .icon-stop { display: block; }
.primary-button, .secondary-button { width: 100%; min-height: 50px; border-radius: 14px; font-weight: 500; }
.primary-button { position: relative; overflow: hidden; border: 1px solid #cfb5aa; background: linear-gradient(180deg, #fff 0%, #fbf7f3 52%, #f4e9e3 100%); box-shadow: inset 0 1px rgba(255,255,255,.96), 0 4px 11px rgba(112,87,77,.06); color: var(--ink); }
.primary-button::before { position: absolute; top: 0; right: 22%; left: 22%; height: 1px; background: linear-gradient(90deg, transparent, rgba(216,191,180,.64), transparent); content: ""; }
.primary-button::after { position: absolute; top: -16px; bottom: -16px; left: -28%; width: 28px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), rgba(255,248,218,.54), rgba(255,255,255,.08), transparent); content: ""; opacity: 0; transform: skewX(-22deg); pointer-events: none; }
.primary-button:active::after { animation: button-sheen .58s ease-out 1; }
.secondary-button { border: 1px solid #d9c8bb; background: rgba(251,248,244,.96); color: var(--ink); box-shadow: inset 0 1px rgba(255,255,255,.9); }
.primary-button, .secondary-button { transition: transform .15s ease, box-shadow .18s ease, border-color .18s ease; }
.primary-button:active, .secondary-button:active { transform: translateY(2px); box-shadow: inset 0 2px 4px rgba(124,87,8,.12); }
.shopping-groups { display: grid; gap: 14px; }
.store-group { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card-bg); box-shadow: 0 3px 13px rgba(112,87,77,.035), inset 0 1px rgba(255,255,255,.92); transition: transform .18s ease, border-color .18s ease; }
.store-group:active { transform: translateY(-1px); border-color: var(--gold-light); }
.store-group.is-dragging, .item-row.is-dragging { opacity: .48; }
.store-heading { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 0 12px; background: #f1e6df; color: var(--ink); font-weight: 600; }
.drag-handle { flex: 0 0 auto; width: 28px; min-height: 44px; border: 0; background: transparent; color: #aaa08d; cursor: grab; touch-action: none; }
.item-list { min-height: 8px; }
.item-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 44px; align-items: center; min-height: 58px; border-top: 1px solid var(--line); }
.item-row:first-child { border-top: 0; }
.check-wrap { display: grid; place-items: center; min-height: 54px; }
.check-wrap input { width: 22px; height: 22px; accent-color: var(--gold-dark); }
.item-main { position: relative; min-width: 0; padding: 8px 6px 8px 0; cursor: pointer; }
.item-name { font-weight: 500; }
.item-note { margin-left: 8px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-badge { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 6px; background: #f0e5de; padding: 4px 7px; color: var(--muted); font-size: 11px; }
.item-row.is-checked .item-main { color: var(--checked); }
.item-row.is-checked .item-main::after { position: absolute; top: 50%; right: 5px; left: 0; height: 1px; background: currentColor; content: ""; transform: scaleX(0); transform-origin: left center; animation: strike-through .38s ease-out forwards; }
.item-row.is-checked .item-name, .item-row.is-checked .item-note { animation: checked-fade .5s ease-out forwards; }
.item-row.is-checked .item-note, .item-row.is-checked .store-badge { color: var(--checked); }
.menu-button { width: 44px; min-height: 48px; border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.list-actions { display: grid; gap: 10px; margin-top: 22px; }
.empty-state { margin: 72px 0; color: var(--muted); text-align: center; }
.regular-list { display: grid; gap: 10px; }
.regular-row, .store-row { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; min-height: 64px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-bg); box-shadow: 0 2px 9px rgba(112,87,77,.03), inset 0 1px rgba(255,255,255,.94); transition: transform .18s ease, border-color .18s ease; }
.regular-row::before, .store-row::before { position: absolute; top: 0; right: 20%; left: 20%; height: 1px; background: linear-gradient(90deg, transparent, rgba(216,191,180,.42), transparent); content: ""; }
.regular-row:active, .store-row:active { transform: translateY(-1px); border-color: var(--gold-light); }
.regular-main, .store-main { min-width: 0; padding: 11px 14px; cursor: pointer; }
.regular-name, .store-name { font-weight: 500; }
.regular-meta, .store-short { margin-top: 3px; color: var(--muted); font-size: 12px; }
.regular-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3, 1fr); max-width: 520px; margin: auto; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(251,248,244,.96); backdrop-filter: blur(12px); }
.bottom-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; border: 0; background: transparent; color: var(--muted); font-size: 10px; transition: color .22s ease, filter .22s ease; }
.bottom-nav button::after { position: absolute; top: -8px; left: 50%; width: 36px; height: 1px; border-radius: 999px; background: linear-gradient(90deg, transparent, var(--accent-deep) 30%, var(--accent-main) 50%, var(--accent-deep) 70%, transparent); box-shadow: none; content: ""; opacity: 0; transform: translateX(-50%) scaleX(.25); transition: opacity .22s ease, transform .28s ease; }
.bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.bottom-nav button.is-active { color: var(--accent-deep); filter: drop-shadow(0 1px 1px rgba(181,150,142,.14)); }
.bottom-nav button.is-active::after { opacity: 1; transform: translateX(-50%) scaleX(1); }
.bottom-nav .nav-voice svg { width: 28px; height: 28px; }
.form-dialog { width: min(calc(100% - 28px), 460px); max-height: calc(100dvh - 32px); border: 0; border-radius: 20px; padding: 0; box-shadow: var(--shadow); }
.form-dialog::backdrop { background: rgba(83,69,64,.32); backdrop-filter: blur(2px); }
.form-dialog form, .dialog-content { display: grid; gap: 17px; padding: 20px; overflow-y: auto; }
.form-dialog header { display: flex; align-items: center; justify-content: space-between; }
.close-button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 26px; }
.form-dialog label, .form-dialog fieldset { display: grid; gap: 7px; margin: 0; border: 0; padding: 0; font-size: 13px; font-weight: 500; }
.form-dialog input[type="text"], .form-dialog select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: #fdfaf7; padding: 0 12px; color: var(--ink); }
.form-dialog input:focus, .form-dialog select:focus { outline: 2px solid var(--gold-light); border-color: var(--gold); }
.radio-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; min-height: 38px; font-weight: 400 !important; }
.radio-label input { width: 20px; height: 20px; accent-color: var(--gold-dark); }
.select-label { color: var(--muted); font-size: 12px !important; font-weight: 400 !important; }
.message { margin: 8px 0 0; font-size: 13px; }
.message-error { color: var(--danger); }
.store-list { display: grid; gap: 9px; max-height: 55dvh; overflow-y: auto; }
.settings-section { display: grid; gap: 9px; }
.settings-section h3 { margin: 0; color: var(--muted); font-size: 13px; font-weight: 500; }
.settings-row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 64px; border: 1px solid var(--line); border-radius: 13px; background: #fdfaf7; padding: 11px 14px; text-align: left; }
.settings-row strong, .settings-row small { display: block; }
.settings-row strong { font-weight: 500; }
.settings-row small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.settings-row > span:last-child { color: var(--accent-deep); font-size: 24px; }
.font-size-setting { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(120px, 42%); align-items: center; gap: 14px !important; min-height: 64px; border: 1px solid var(--line) !important; border-radius: 13px; background: #fdfaf7; padding: 11px 14px !important; font-size: inherit !important; }
.font-size-setting > span { font-weight: 500; }
.font-size-setting select { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 34px 0 11px; color: var(--ink); }
body[data-font-size="small"] { font-size: 15px; }
body[data-font-size="standard"] { font-size: 19px; }
body[data-font-size="large"] { font-size: 22px; }
body[data-font-size] h1 { font-size: 1.6em; }
body[data-font-size] h2 { font-size: 1.2em; }
body[data-font-size] .voice-button { font-size: 1.2em; }
body[data-font-size] .text-button,
body[data-font-size] .empty-text,
body[data-font-size] .form-dialog label,
body[data-font-size] .form-dialog fieldset,
body[data-font-size] .message,
body[data-font-size] .settings-section h3 { font-size: .87em; }
body[data-font-size] .temporary-items li,
body[data-font-size] .chip-list li { font-size: .87em; }
body[data-font-size] .regular-meta,
body[data-font-size] .store-short,
body[data-font-size] .item-note,
body[data-font-size] .settings-row small { font-size: .8em; }
body[data-font-size] .bottom-nav button,
body[data-font-size] .eyebrow { font-size: .67em; }
body[data-font-size] .settings-button { font-size: max(12px, .75em); }
.voice-effect { position: fixed; z-index: 50; inset: 0; pointer-events: none; opacity: 0; }
.voice-effect i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #ead8d2; box-shadow: 0 0 6px #fff, 0 0 10px rgba(216,191,180,.34); }
.voice-effect i:nth-child(1) { left: 28%; top: 39%; }
.voice-effect i:nth-child(2) { left: 68%; top: 46%; width: 2px; height: 22px; border-radius: 4px; transform: rotate(35deg); }
.voice-effect i:nth-child(3) { left: 52%; top: 64%; width: 5px; height: 5px; }
.voice-effect.is-starting { animation: soft-glow .78s ease-out; }
.voice-effect.is-complete { animation: fine-sparkle .85s ease-out; }
@keyframes gold-ring { 0% { opacity: .42; transform: scale(.96); box-shadow: 0 0 7px rgba(216,191,180,.24); } 100% { opacity: 0; transform: scale(1.12); box-shadow: 0 0 16px rgba(216,191,180,0); } }
@keyframes metal-sheen { 0% { left: -25%; opacity: 0; } 20% { opacity: .55; } 72% { opacity: .4; } 100% { left: 112%; opacity: 0; } }
@keyframes button-sheen { 0% { left: -28%; opacity: 0; } 22% { opacity: .48; } 100% { left: 112%; opacity: 0; } }
@keyframes voice-breathe { 0%, 100% { transform: scale(1); box-shadow: inset 0 1px rgba(255,255,255,.72), 0 7px 18px rgba(156,116,103,.1), 0 0 7px rgba(230,210,205,.1); } 50% { transform: scale(1.012); box-shadow: inset 0 1px rgba(255,255,255,.78), 0 8px 20px rgba(156,116,103,.14), 0 0 14px rgba(230,210,205,.2); } }
@keyframes complete-glint { 0% { box-shadow: 0 6px 15px rgba(156,116,103,.08); } 38% { box-shadow: 0 0 10px rgba(255,255,255,.42), 0 0 18px rgba(230,210,205,.24); filter: brightness(1.02); } 100% { box-shadow: 0 7px 18px rgba(156,116,103,.1); filter: brightness(1); } }
@keyframes soft-glow { 0% { opacity: 0; background: radial-gradient(circle at 50% 70%, rgba(230,210,205,.2), transparent 8%); } 35% { opacity: 1; background: radial-gradient(circle at 50% 70%, rgba(216,191,180,.13), transparent 34%); } 100% { opacity: 0; background: radial-gradient(circle at 50% 70%, transparent, transparent 55%); } }
@keyframes fine-sparkle { 0% { opacity: 0; transform: translateY(5px) scale(.75); background: radial-gradient(circle at 50% 70%, rgba(255,255,255,.72), rgba(230,210,205,.15) 8%, transparent 28%); } 32% { opacity: 1; } 58% { opacity: .72; background: radial-gradient(circle at 50% 70%, rgba(255,255,255,.4), rgba(216,191,180,.11) 15%, transparent 36%); } 100% { opacity: 0; transform: translateY(-12px) scale(1.14); } }
@keyframes strike-through { to { transform: scaleX(1); } }
@keyframes checked-fade { 0%, 55% { opacity: 1; } 100% { opacity: .72; } }
@media (min-width: 521px) { body { min-height: 100vh; } .app-shell { max-width: 520px; box-shadow: 0 0 40px rgba(40,35,25,.08); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; } }
