/* Style follows DESIGN.md: blush paper, one coral voice, pill buttons, large soft radii. */
:root {
  --accent: #db404f;
  --bg: color-mix(in srgb, var(--accent) 15%, #fff);
  --soft: color-mix(in srgb, var(--accent) 8%, #fff);
  --line: color-mix(in srgb, var(--accent) 16%, #fff);
  --ink: color-mix(in srgb, var(--accent) 35%, #1c0b10);
  --muted: color-mix(in srgb, var(--accent) 30%, #7a6468);
  --card: #fff;
  --ok: #2fa56f;
  --r: 28px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 17px/1.45 Nunito, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
h1 { font-size: 34px; line-height: 1.08; letter-spacing: -0.02em; font-weight: 900; color: var(--accent); margin: 0 0 10px; }
h2 { font-size: 22px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 900; color: var(--accent); margin: 0 0 4px; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.top { display: flex; align-items: center; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 14px 18px 6px; }
.mark { width: 44px; height: 44px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 22px; flex: none; }
.top .who { flex: 1; min-width: 0; line-height: 1.15; }
.top .who b { display: block; font-size: 19px; font-weight: 900; color: var(--accent); }
.pill { border: 0; border-radius: 300px; background: var(--accent); color: #fff; font-weight: 800; padding: 11px 22px; text-decoration: none; display: inline-block; text-align: center; }
.pill.ghost { background: var(--card); color: var(--accent); }
.pill.wide { width: 100%; padding: 16px 22px; }
.pill.sm { padding: 8px 16px; font-size: 14px; }
.pill:disabled { opacity: 0.45; cursor: default; }
.banner { max-width: 1084px; margin: 8px auto 0; background: var(--card); border-radius: 18px; padding: 10px 16px; font-size: 14px; color: var(--muted); }
.banner-wrap { padding: 0 18px; }

.layout { max-width: 1120px; margin: 0 auto; }
.stage {
  position: sticky; top: 0; z-index: 4; height: 270px; padding: 6px 18px 0;
  background: var(--bg); border-radius: 0 0 32px 32px; transition: height 0.35s ease;
}
.stage .cake { height: calc(100% - 44px); display: grid; place-items: center; }
.stage svg { height: 100%; width: 100%; filter: drop-shadow(0 14px 18px color-mix(in srgb, var(--accent) 22%, transparent)); }
.stage .cap { text-align: center; font-weight: 800; font-size: 15px; color: var(--accent); height: 44px; padding-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.compact .stage { height: 216px; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 14%, transparent); }
.cake.pop svg { animation: pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes pop { 0% { transform: scale(0.94); } 100% { transform: scale(1); } }
.flame { animation: flick 0.9s ease-in-out infinite alternate; transform-origin: center bottom; transform-box: fill-box; }
@keyframes flick { to { transform: scaleY(0.82) scaleX(1.1); } }

.opts { padding: 8px 18px 0; }
.hero { padding: 8px 2px 4px; }
.sec { background: var(--card); border-radius: var(--r); padding: 22px 18px; margin-top: 16px; }
.sec .hint { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--accent); font-weight: 900; font-size: 15px; margin-right: 8px; vertical-align: 3px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 2px solid var(--line); background: var(--card); border-radius: 22px; padding: 10px 16px; text-align: center; line-height: 1.2; min-width: 86px; }
.chip b { display: block; font-weight: 900; font-size: 18px; }
.chip span { font-size: 12.5px; color: var(--muted); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on span { color: rgba(255, 255, 255, 0.85); }

.fills { display: grid; gap: 10px; }
.fill { display: flex; align-items: center; gap: 14px; text-align: left; border: 2px solid var(--line); background: var(--card); border-radius: 24px; padding: 12px 14px; width: 100%; }
.fill.on { border-color: var(--accent); background: var(--soft); }
.fill .grow { flex: 1; min-width: 0; }
.fill b { display: block; font-weight: 800; }
.fill small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.3; }
.fill em { display: block; font-style: normal; font-weight: 800; color: var(--accent); font-size: 15px; margin-top: 3px; }
.cut {
  width: 56px; height: 56px; border-radius: 18px; flex: none;
  background: repeating-linear-gradient(180deg, var(--a) 0 11px, var(--b) 11px 16px);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55), 0 4px 10px rgba(0, 0, 0, 0.08);
}

.coats { display: flex; gap: 12px; flex-wrap: wrap; }
.coat { border: 0; background: none; padding: 0; width: 68px; text-align: center; font-size: 13px; line-height: 1.2; color: var(--muted); }
.coat i { display: block; width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 6px; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line), inset 0 -8px 12px rgba(0, 0, 0, 0.08); }
.coat.on { color: var(--accent); font-weight: 800; }
.coat.on i { box-shadow: 0 0 0 3px var(--accent), inset 0 -8px 12px rgba(0, 0, 0, 0.08); }

.decs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dec { border: 2px solid var(--line); background: var(--card); border-radius: 22px; padding: 12px 14px; text-align: left; line-height: 1.25; position: relative; }
.dec b { display: block; font-weight: 800; padding-right: 26px; }
.dec em { font-style: normal; color: var(--muted); font-size: 14px; }
.dec .tick { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--soft); color: transparent; display: grid; place-items: center; font-size: 14px; font-weight: 900; }
.dec.on { border-color: var(--accent); background: var(--soft); }
.dec.on .tick { background: var(--accent); color: #fff; }

.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 18px 8px; margin: 0 -18px; scrollbar-width: none; scroll-snap-type: x proximity; }
.days::-webkit-scrollbar { display: none; }
.day { flex: none; width: 66px; border: 2px solid var(--line); background: var(--card); border-radius: 22px; padding: 9px 0; text-align: center; line-height: 1.15; scroll-snap-align: start; }
.day small { display: block; font-size: 12.5px; color: var(--muted); }
.day b { display: block; font-size: 22px; font-weight: 900; }
.day.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.day.on small { color: rgba(255, 255, 255, 0.85); }
.day:disabled { opacity: 0.45; cursor: default; background: var(--soft); }

.seg { display: flex; background: var(--soft); border-radius: 300px; padding: 5px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 300px; padding: 11px 6px; font-weight: 800; color: var(--muted); }
.seg button.on { background: var(--accent); color: #fff; }
.note { margin-top: 12px; background: var(--soft); border-radius: 18px; padding: 12px 14px; font-size: 15px; }

label.f { display: block; margin-top: 12px; }
label.f span { display: block; font-size: 14px; color: var(--muted); margin: 0 6px 5px; font-weight: 700; }
input, textarea, select {
  width: 100%; background: var(--soft); color: var(--ink); border: 2px solid transparent; border-radius: 18px;
  padding: 14px 16px; font: inherit; outline: none; -webkit-appearance: none; appearance: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); background: #fff; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 65%, #fff); }
textarea { min-height: 88px; resize: vertical; }
input[type='color'] { padding: 4px; height: 52px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.photos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.photos .ph, .photos .add { width: 84px; height: 84px; border-radius: 22px; background: var(--soft) center/cover no-repeat; position: relative; }
.photos .add { display: grid; place-items: center; color: var(--accent); font-size: 30px; border: 2px dashed var(--line); cursor: pointer; }
.photos .ph button { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; line-height: 1; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 40%);
}
.bar .in {
  max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: 300px; padding: 8px 8px 8px 24px;
  box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 26%, transparent);
}
.bar .sum { flex: 1; line-height: 1.1; }
.bar .sum span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.bar .sum b { display: block; font-size: 25px; font-weight: 900; letter-spacing: -0.02em; color: var(--accent); }
.bar .pill { padding: 16px 28px; font-size: 17px; }
.toast { position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 300px; font-size: 15px; font-weight: 700; z-index: 9; max-width: 90vw; text-align: center; }

.done { max-width: 560px; margin: 0 auto; padding: 18px; text-align: center; position: relative; }
.done .cake { height: 250px; }
.done .cake svg { height: 100%; filter: drop-shadow(0 14px 18px color-mix(in srgb, var(--accent) 22%, transparent)); }
.lines { text-align: left; }
.lines .l { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.lines .t { display: flex; justify-content: space-between; padding: 14px 0 0; font-weight: 900; font-size: 21px; color: var(--accent); }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 8; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 4px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
.foot { text-align: center; margin: 26px 0 0; font-size: 13px; color: var(--muted); }

@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: 1fr 520px; gap: 30px; align-items: start; padding: 0 18px; }
  .stage, body.compact .stage { top: 16px; height: calc(100vh - 170px); min-height: 380px; background: var(--card); border-radius: 44px; padding: 26px; }
  .opts { padding: 0; }
  .hero { padding-top: 0; }
  h1 { font-size: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Owner cabinet */
.wrap { max-width: 640px; margin: 0 auto; padding: 0 18px; }
.tabs { display: flex; gap: 4px; background: var(--card); border-radius: 300px; padding: 5px; margin: 14px 0; }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); font-weight: 800; padding: 11px 2px; border-radius: 300px; font-size: 15px; }
.tabs button.on { background: var(--accent); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stats div { background: var(--card); border-radius: 22px; padding: 12px 14px; line-height: 1.2; }
.stats b { display: block; font-size: 22px; font-weight: 900; color: var(--accent); }
.stats span { font-size: 13px; color: var(--muted); }
.order { background: var(--card); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.order .head { display: flex; gap: 12px; align-items: center; }
.order .mini { width: 84px; height: 84px; flex: none; background: var(--soft); border-radius: 22px; padding: 6px; }
.order .mini svg { width: 100%; height: 100%; }
.order .head .grow { flex: 1; min-width: 0; line-height: 1.25; }
.order .head b { font-size: 19px; font-weight: 900; }
.order .when { color: var(--accent); font-weight: 800; }
.chipst { font-size: 12.5px; font-weight: 800; padding: 4px 11px; border-radius: 300px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.chipst.new { background: var(--accent); color: #fff; }
.chipst.work { background: #fff0c2; color: #8a6200; }
.chipst.done { background: #d9f3e6; color: #1d7a4f; }
.order ul { margin: 12px 0; padding: 0; list-style: none; font-size: 15px; }
.order li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.order .info { font-size: 15px; line-height: 1.5; }
.order .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.order .pics { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.order .pics img { width: 100px; height: 100px; object-fit: cover; border-radius: 18px; }
.pill.soft { background: var(--soft); color: var(--ink); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .wd { text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 800; padding: 4px 0; }
.cal button { border: 2px solid transparent; background: var(--card); border-radius: 16px; padding: 8px 0; line-height: 1.15; min-height: 56px; }
.cal button b { display: block; font-weight: 900; }
.cal button span { font-size: 11.5px; color: var(--muted); }
.cal button.has { border-color: var(--accent); }
.cal button.full { background: var(--accent); color: #fff; }
.cal button.full span { color: #fff; }
.cal button.closed { background: var(--ink); color: #fff; }
.cal button.closed span { color: rgba(255, 255, 255, 0.8); }
.cal button.early { opacity: 0.5; }
.edit { background: var(--card); border-radius: 22px; padding: 12px; margin-bottom: 10px; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.edit .full { grid-column: 1 / -1; }
.edit input, .edit select { padding: 11px 13px; border-radius: 14px; }
.edit label { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.edit label input { margin-top: 3px; }
.sub { font-size: 16px; font-weight: 900; color: var(--accent); margin: 24px 4px 10px; }
.save { position: sticky; bottom: 14px; margin-top: 18px; }
.save .pill { box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 30%, transparent); }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 800; padding: 8px 4px; }
.err { color: #c0182f; font-size: 15px; margin: 10px 4px; min-height: 20px; font-weight: 700; }
