:root {
  --paper: #ffffff; --case: #eef0f0; --back: #e1e5e5; --edge: #b9c1c1;
  --slit: #8d9999; --ink: #202626; --muted: #515e5e;
  --green: #1f6b4a; --green-pale: #e5eee7; --lcd: #b4d29e; --lcd-ink: #183a22; --red: #b52626;
  --glass: rgba(255,255,255,.22); --reflection: rgba(255,255,255,.75);
  --bottom-height: 184px; --tray-height: clamp(76px, calc((100svh - 452px) / 4), 116px);
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--ink); background: var(--case); }
body { font: 400 16px/1.5 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif; font-variant-numeric: tabular-nums; }
h1, h2, p { margin: 0; }
h1, h2, strong { font-weight: 600; }
h1 { font-size: 24px; line-height: 1.5; font-feature-settings: "palt" 1; overflow-wrap: anywhere; }
h2 { font-size: 20px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .tabs a { touch-action: manipulation; }
button { min-height: 44px; min-width: 44px; border: 1px solid var(--edge); border-radius: 4px; padding: 8px 12px; background: var(--paper); cursor: pointer; font-weight: 600; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.primary { color: var(--paper); background: var(--green); border-color: var(--green); }
.text-button { color: var(--green); background: transparent; border: 0; font-weight: 400; }
.app { width: min(100%, 440px); min-height: 100svh; margin: 0 auto; padding-bottom: var(--bottom-height); background: var(--paper); }
.list { --tray-height: clamp(72px, calc((100svh - 508px) / 4), 108px); }
.build:has(.over-budget) { --tray-height: clamp(72px, calc((100svh - 484px) / 4), 108px); }
.receive { --tray-height: clamp(64px, calc((100svh - 544px) / 4), 100px); }
.edit { --tray-height: clamp(64px, calc((100svh - 524px) / 4), 100px); }
.app:has(.free) { --tray-height: clamp(64px, calc((100svh - 588px) / 4), 100px); }
.build:has(.free) .target { display: none; }
.noodle-choice { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.noodle-choice select { flex: 1; min-width: 0; }
.top { padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 0; background: var(--paper); }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.heading h1 { flex: 1; min-width: 0; }
.heading > button { flex: none; padding-inline: 8px; }
.store-name { color: var(--muted); max-width: 40%; overflow-wrap: anywhere; }
.summary { overflow-wrap: anywhere; }
.edit-summary { display: block; width: 100%; min-height: 44px; padding: 4px 0; border: 0; text-align: left; font-weight: 400; }
.register { font-size: 18px; line-height: 1.4; }
.target { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.target span { color: var(--muted); }
.map { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; width: 100%; color: var(--muted); font-size: 14px; font-weight: 400; }
.map > span { flex: none; }
.map svg { flex: 1; min-width: 0; width: 100%; height: 24px; fill: none; stroke: var(--green); stroke-width: 2; }
.map circle { fill: var(--green); stroke: none; }
.map rect { fill: var(--green-pale); fill-opacity: .4; }
.bowl-tabs { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
.bowl-tabs button { flex: none; white-space: nowrap; padding: 4px 8px; border-color: transparent; background: transparent; font-weight: 400; }
.bowl-tabs [aria-selected="true"] { color: var(--green); border-color: var(--green); background: var(--green-pale); font-weight: 600; }
.cabinet { position: relative; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: thin; border: 1px solid var(--edge); background: var(--back); }
.case-track { position: relative; min-width: 100%; padding: 8px 12px 0; background-color: var(--back); background-image: linear-gradient(to bottom, var(--reflection), transparent 40px), radial-gradient(ellipse 8px 1px at 12px 24px, var(--slit) 95%, transparent 100%); background-size: 100% 100%, 28px 32px; }
.case-track::before, .case-track::after { content: ""; position: absolute; top: 0; bottom: 0; width: 8px; border: 1px solid var(--edge); background: var(--glass); pointer-events: none; z-index: 5; }
.case-track::before { left: 0; }
.case-track::after { right: 0; }
.shelf { position: relative; }
.shelf-title { position: relative; height: 24px; font-size: 14px; font-weight: 400; }
.shelf-title > span { position: sticky; left: 12px; display: inline-block; padding: 0 8px; line-height: 24px; color: var(--paper); background: var(--green); }
.shelf-row { position: relative; display: flex; align-items: end; min-height: var(--tray-height); background: linear-gradient(to bottom, transparent 0 calc(100% - 40px), var(--case) calc(100% - 40px) 100%); border-bottom: 1px solid var(--edge); }
.tray { position: relative; flex: none; height: var(--tray-height); min-width: 0; scroll-snap-align: start; }
.tray.long-name:not(.unneeded) { height: max(var(--tray-height), 100px); }
.build .tray:has(.subtract) { min-height: 88px; }
.build .tray.long-name { min-height: 108px; }
.tray-button { position: absolute; inset: 0; width: 100%; min-width: 0; height: 100%; border: 0; border-radius: 0; padding: 0; background: transparent; font-weight: 400; }
.food { position: absolute; z-index: 1; top: -4px; left: 4%; width: 92%; height: calc(100% - 24px); pointer-events: none; mix-blend-mode: multiply; }
.food img { position: absolute; inset: 0; width: 100%; height: 112%; object-fit: fill; mix-blend-mode: multiply; }
.food img:nth-child(1) { transform: translate(-6%, 0) rotate(-12deg); }
.food img:nth-child(2) { transform: translate(6%, -8%) rotate(12deg); }
.food img:nth-child(3) { transform: translate(0, -16%) rotate(-4deg); }
.pan-shell { position: absolute; z-index: 2; top: 4px; left: 4%; width: 92%; height: calc(100% - 32px); fill: var(--glass); stroke: var(--slit); stroke-width: 1; pointer-events: none; }
.pan-shell path { vector-effect: non-scaling-stroke; }
.pan-shell .shine { fill: none; stroke: var(--reflection); stroke-width: 2; }
.label { position: absolute; z-index: 3; bottom: 4px; left: 4px; right: 4px; min-height: 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 4px; border: 1px solid var(--edge); color: var(--ink); background: var(--paper); font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.grams { color: var(--muted); font-size: 14px; }
.list .label, .receive .label { font-size: 16px; }
.deep .pan-shell { top: 0; height: calc(100% - 8px); transform-origin: center bottom; transform: perspective(240px) rotateX(-16deg); }
.front .pan-shell { transform: perspective(240px) rotateX(-24deg); }
.deep .food { height: calc(100% - 16px); top: -8px; }
.front .food { top: 0; }
.tag { position: absolute; top: 0; right: 4px; z-index: 4; min-width: 32px; line-height: 26px; padding: 0 4px; color: var(--paper); background: var(--green); border: 1px solid var(--paper); font-weight: 600; font-size: 24px; }
.tag.done { color: var(--green); background: var(--paper); border-color: var(--green); }
.subtract { position: absolute; z-index: 5; top: -8px; right: 44px; width: 44px; height: 44px; padding: 8px 4px; border: 0; background: transparent; color: var(--green); }
.subtract svg { display: block; box-sizing: border-box; width: 36px; height: 28px; padding: 4px 8px; background: var(--paper); border: 1px solid var(--green); }
.unneeded .food, .unneeded .pan-shell, .finished .food, .finished .pan-shell { opacity: .3; }
.unneeded .food { filter: grayscale(1); overflow: hidden; }
.unneeded .tray-button { min-width: 0; }
.floating .food, .floating .pan-shell, .floating .label { transform: translateY(-8px); transition: transform 160ms; }
.floating .pan-shell { filter: drop-shadow(0 0 4px rgba(32,38,38,.22)); }
.floating .label { border-color: var(--green); }
.drop { position: relative; flex: 0 0 44px; width: 44px; height: calc(var(--tray-height) - 12px); padding: 0 4px; border: 2px dashed var(--green); background: var(--green-pale); border-radius: 0; color: var(--green); font-size: 14px; font-weight: 400; }
.outside-shelf { padding: 8px 16px; border-bottom: 1px solid var(--edge); background: var(--case); }
.list-tools { display: flex; justify-content: space-between; flex-wrap: wrap; padding: 0 8px; }
#bottom { position: fixed; z-index: 10; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 440px); background: var(--case); border-top: 1px solid var(--edge); padding-bottom: env(safe-area-inset-bottom, 0px); }
#dock { padding: 8px 12px 0; }
#dock:empty { padding: 0; }
.weighing { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; }
.bowl { position: relative; height: 84px; }
.contents { position: absolute; top: 0; left: 4px; right: 4px; height: 72px; overflow: hidden; border-radius: 4px 4px 48px 48px; mix-blend-mode: multiply; }
.contents img { position: absolute; width: 48px; height: 48px; object-fit: contain; mix-blend-mode: multiply; }
.contents img:nth-child(1) { left: 0; top: 0; transform: rotate(-20deg); }
.contents img:nth-child(2) { right: 0; top: 0; transform: rotate(20deg); }
.contents img:nth-child(3) { left: 24px; top: 0; }
.contents img:nth-child(4) { left: 8px; top: 24px; }
.contents img:nth-child(5) { right: 8px; top: 24px; }
.contents img:nth-child(6) { left: 24px; top: 32px; }
.bowl-shell { position: absolute; inset: 0; width: 100%; height: 84px; fill: var(--glass); stroke: var(--edge); stroke-width: 2; }
.bowl-shell .rim { fill: none; stroke: var(--reflection); }
.scale { min-width: 0; padding: 4px 8px; border: 1px solid var(--edge); border-radius: 4px; background: var(--paper); }
.lcd { display: flex; align-items: end; justify-content: space-between; gap: 8px; padding: 4px; color: var(--lcd-ink); background: var(--lcd); border: 1px solid var(--edge); }
.reading { display: flex; align-items: end; gap: 4px; line-height: 1.25; min-width: 0; }
.reading > span { flex: none; font-size: 14px; }
.digits { display: block; height: 28px; max-width: calc(100% - 20px); fill: currentColor; }
.scale-caption { display: flex; justify-content: space-between; gap: 4px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.free { margin-top: 4px; }
.over-budget { color: var(--red); }
.actions { display: flex; gap: 8px; padding-block: 8px; }
.actions > * { flex: 1; min-width: 0; }
.receive .actions { flex-direction: column; }
.tabs { display: flex; border-top: 1px solid var(--edge); color: var(--muted); background: var(--paper); }
.tabs a { flex: 1; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tabs [aria-current] { color: var(--green); background: var(--green-pale); font-weight: 600; }
.tabs svg { flex: none; }
.hidden-box { max-height: 128px; overflow-y: auto; border: 1px solid var(--edge); }
.hidden-destination { display: block; width: 100%; border: 0; border-radius: 0; color: var(--green); background: var(--green-pale); text-align: left; }
.can-drop { border: 2px dashed var(--green); }
.hidden-items { display: flex; flex-wrap: wrap; gap: 4px; }
.hidden-items:empty { display: none; }
.hidden-items button { font-size: 14px; font-weight: 400; }
.hidden-items [aria-pressed="true"] { border-color: var(--green); }
.empty { padding: 64px 16px; text-align: center; }
.empty button { margin-top: 16px; }
[hidden] { display: none !important; }
#notice { position: fixed; z-index: 30; bottom: calc(var(--bottom-height) + 8px); left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), 408px); padding: 12px 16px; color: var(--paper); background: var(--ink); }
dialog { position: fixed; inset: auto 0 0; width: min(100%, 440px); max-height: 85svh; margin: 0 auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); border: 1px solid var(--edge); border-radius: 8px 8px 0 0; background: var(--paper); }
dialog::backdrop { background: rgba(32,38,38,.4); }
.sheet-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 16px; }
.sheet-body { display: grid; gap: 16px; }
label { display: flex; flex-direction: column; gap: 4px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--edge); border-radius: 4px; background: var(--paper); font-size: 16px; }
textarea { min-height: 120px; }
input[type="checkbox"] { width: 44px; height: 44px; accent-color: var(--green); }
.toggle { flex-direction: row; align-items: center; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-columns > * { min-width: 0; }
fieldset { margin: 0; padding: 0; border: 0; }
.spice { display: flex; gap: 4px; }
.spice button { flex: 1; }
.spice [aria-pressed="true"] { color: var(--paper); background: var(--green); border-color: var(--green); }
.shelf-editor { padding-block: 12px; border-bottom: 1px solid var(--edge); }
.changed { animation: reading-change 160ms ease-out; }
@keyframes reading-change { from { opacity: .6; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .changed { animation: none; } .floating .food, .floating .pan-shell, .floating .label { transition: none; } }
@media (max-width: 374px) { .weighing { grid-template-columns: 80px minmax(0, 1fr); gap: 8px; } .heading h1 { font-size: 22px; } .scale { padding-inline: 4px; } .map { gap: 8px; } }
