:root {
  --ink: #0b3d5c;
  --body: #3d6478;
  --meta: #6e8ea0;
  --indigo: #0a7eaf;
  --sky: #10a0e0;
  --yellow: #f8e818;
  --green: #14864a;
  --rose: #c4233a;
  --emerald: #14864a;
  --amber: #d97706;
  --bg: #e5f4fb;
  --line: #cfe8f4;
  --card: #ffffff;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --font: "Satoshi", "Segoe UI", sans-serif;
  --top: 112px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
::selection { background: #b7e4f7; color: var(--ink); }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 8px;
  z-index: 40;
}
.skip:focus { top: 8px; }

.app {
  width: min(480px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: calc(var(--top) + 8px) 16px calc(96px + env(safe-area-inset-bottom));
}
.app:has(#dock.is-on) {
  padding-bottom: calc(176px + env(safe-area-inset-bottom));
}

.top {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100%);
  background: var(--indigo);
  backdrop-filter: blur(12px);
  padding: 12px 16px 10px;
}

.ident { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ident-title { display: flex; align-items: center; min-width: 0; }
.ident h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand-hit {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
}
.sub {
  display: block;
  margin-top: 2px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.key-link {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  color: #fff;
  text-decoration: none;
}
.key-link svg { width: 22px; height: 22px; }

.bell {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  flex: none;
  padding: 0;
}
.bell svg { width: 20px; height: 20px; margin: 10px; }
.bell:active { transform: scale(0.95); }
.dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin-top: 12px;
  padding: 0 12px;
  background: #fff;
  border-radius: 12px;
  color: var(--meta);
}
.search svg { width: 18px; height: 18px; flex: none; }
.search input {
  width: 100%;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}
.search input::placeholder { color: var(--meta); }
.search input:focus { outline: none; }

.cats {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cats button {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--indigo);
  font-size: 13px;
  font-weight: 700;
}
.cats button.is-on { background: var(--yellow); color: var(--ink); }
.cats button:active { transform: scale(0.95); }

.recall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.recall p { margin: 0; color: var(--ink); font-size: 13px; }
.recall button {
  border: 0;
  background: transparent;
  color: var(--indigo);
  font-weight: 700;
  padding: 0;
}

#menu { display: flex; flex-direction: column; gap: 12px; }
.card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.card.is-on { border-color: #8ecfed; }
.thumb {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  flex: none;
  overflow: hidden;
  background: var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card-top h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sku {
  display: block;
  margin-top: 2px;
  color: var(--meta);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.chip {
  align-self: flex-start;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.chip.ok { color: var(--green); background: #e5f6ec; }
.card-buy { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { color: var(--indigo); font-size: 15px; font-weight: 700; }

.step {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}
.step.has-qty { flex: 1 0 100%; justify-content: space-between; }
.step button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
}
.step button:active { transform: scale(0.95); }
.step .plus { background: var(--green); color: #fff; border-color: var(--green); }
.qty {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.none, .note, .fineprint, .hint, .slip-meta, .done-when, .done-who {
  color: var(--body);
  font-size: 13px;
  font-weight: 500;
}
.note { margin: 16px 0 20px; }
.none { margin: 8px 0 16px; }
.done-who { white-space: pre-line; overflow-wrap: anywhere; }

.slip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--top) + 8px);
  scroll-margin-bottom: 180px;
}
.slip-head, .slip-body, #order-form { padding: 14px; }
.slip-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 0;
}
#order-form { padding-top: 8px; }
.slip h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.slip-head p { margin: 2px 0 0; }
#clear {
  border: 0;
  background: transparent;
  color: var(--rose);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 0;
}
.slip-empty { margin: 4px 0 8px; color: var(--meta); }
.line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  color: var(--ink);
  font-size: 13px;
}
.line-qty { color: var(--meta); font-size: 12px; }
.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}
.total strong { font-size: 18px; color: var(--indigo); }
.hint, .slip-meta, .fineprint { margin: 6px 0 0; }
.who {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border-radius: 12px;
  background: #e5f6ec;
}
.who p {
  margin: 0;
  white-space: pre-line;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.who button, .note-toggle {
  border: 0;
  background: none;
  color: var(--indigo);
  font-weight: 700;
  padding: 0;
}
.note-toggle { margin: 0 0 10px; padding: 4px 0; }
.remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--indigo);
  font-size: 12px;
  font-weight: 700;
}
.remember button {
  border: 0;
  background: none;
  color: var(--rose);
  font-weight: 700;
  padding: 4px 0;
}
.slip-meta { color: var(--ink); font-weight: 700; }

fieldset { border: 0; margin: 12px 0 8px; padding: 0; min-inline-size: 0; }
legend { font-size: 11px; font-weight: 700; color: var(--meta); letter-spacing: 0.04em; margin-bottom: 6px; }
.choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice-2 { grid-template-columns: 1fr 1fr; }
.choice label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 6px 4px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.choice input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.choice span { font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.2; pointer-events: none; }
.choice small { display: block; margin-top: 2px; color: var(--meta); font-size: 10px; font-weight: 500; }
.choice label:has(input:checked) { background: #fff6b0; border-color: #e2cc00; }
.choice label:has(input:checked) span,
.choice label:has(input:checked) small { color: var(--ink); }
.choice label:has(input:disabled) { opacity: 0.4; }
.choice label:has(input:focus-visible) { outline: 3px solid var(--indigo); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; font-size: 11px; font-weight: 700; color: var(--meta); }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 58px; }
.field input::placeholder, .field textarea::placeholder { color: var(--meta); font-weight: 500; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--rose); background: #fff1f2; }
.form-error {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff1f2;
  color: var(--rose);
  font-size: 13px;
  font-weight: 700;
}
.send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.send:active { transform: scale(0.98); }
.done-code { margin: 2px 0 0; font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.03em; }
.done-pay { margin: 8px 0 12px; color: var(--emerald); font-weight: 700; }
.done-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; }
.done-actions button, .done-actions a { border: 0; background: none; color: var(--indigo); font-weight: 700; padding: 8px 0; text-decoration: none; }

.dock {
  display: none;
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(448px, calc(100% - 32px));
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 24px;
  background: rgba(10, 126, 175, 0.94);
  backdrop-filter: blur(12px);
  color: #fff;
  box-shadow: var(--shadow);
}
.dock.is-on { display: flex; }
.dock-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dock-icon { position: relative; width: 28px; height: 28px; flex: none; }
.dock-icon svg { width: 24px; height: 24px; }
.dock-icon i {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--yellow);
  color: var(--ink);
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}
.dock strong { display: block; font-size: 15px; font-weight: 700; }
.dock span { color: #e7f5fc; font-size: 12px; font-weight: 500; }
.go {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.go:active { transform: scale(0.95); }

.tabbar {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 64px;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--meta);
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 0;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-on { color: var(--indigo); }
.tab:active { transform: scale(0.95); }

.noscript {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

@media (max-width: 360px) {
  .choice { grid-template-columns: 1fr; }
  .choice-2 { grid-template-columns: 1fr 1fr; }
  .sub { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bell:active, .cats button:active, .step button:active, .go:active, .send:active, .tab:active { transform: none; }
}

@media print {
  .top, .tabbar, .dock, .recall, .note, #menu, .done-actions, #done-wa { display: none !important; }
  .app { padding: 0; width: auto; }
  .slip { box-shadow: none; }
}
