:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --paper: #fffdf8;
  --ink: #1d2b24;
  --muted: #5e6b63;
  --line: #ddd4c6;
  --green: #0f6b45;
  --green-dark: #0b5235;
  --leaf: #245c45;
  --coral: #d96567;
  --blush: #f8dedf;
  --petal: #f3b7bc;
  --mimosa: #f2c96d;
  --amber: #8a5a00;
  --amber-bg: #fff4d8;
  --red: #8d2f28;
  --red-bg: #fde8e4;
  --shadow: 0 10px 30px rgba(56, 42, 24, 0.08);
  --bp-phone: 360px;
  --bp-phone-lg: 430px;
  --bp-tablet: 960px;
  --gutter: 16px;
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.6;
}

a { color: var(--green-dark); }

button, input, textarea {
  font: inherit;
}

button, .choice {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid transparent;
}

button {
  background: var(--green);
  color: white;
  padding: 12px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }

button.secondary { background: white; color: var(--ink); border-color: var(--line); }
button.danger { background: var(--red); }

.screen {
  width: min(720px, calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
  padding: 20px 0 48px;
}
.screen.wide { width: min(980px, calc(100% - (var(--gutter) * 2))); }
.screen.narrow { width: min(460px, calc(100% - (var(--gutter) * 2))); }

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.icon-text, .icon-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-link { text-decoration: none; font-weight: 700; }

.page-header h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 8px; }
.eyebrow { margin: 0; color: var(--green); font-weight: 700; }

.board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.board-title h1 { margin: 0; }

.board-title form { margin: 0; }

button.emergency-pill {
  min-height: 44px;
  margin: 0;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

button.emergency-pill.status-confirmed {
  background: #e7f5ee;
  color: var(--green-dark);
}

button.emergency-pill.status-rejected {
  background: var(--red);
  color: white;
}

.stop-note {
  margin: 10px 0 0;
  color: var(--red);
  font-weight: 700;
}

.banner {
  background: #e7f5ee;
  border-radius: 14px;
  padding: 14px 16px;
}

.toast {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  width: min(480px, calc(100% - (var(--gutter) * 2)));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 8px 12px 16px;
  background: #e7f5ee;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.toast p { margin: 0; }

.toast-alert { background: var(--red-bg); color: var(--red); }

button.toast-close {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
}

.banner-stop { background: var(--red-bg); color: var(--red); }

.choices { display: grid; grid-template-columns: 1fr; gap: 10px; }

.choice {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.choice[aria-pressed="true"] {
  border-color: var(--green);
  background: #e7f5ee;
  outline: 3px solid rgba(15, 107, 69, 0.18);
}

.choice[aria-pressed="true"]::after {
  content: "✓";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
}

.choice small, .optional, .muted { color: var(--muted); }

section { margin-top: 28px; }
h2 { font-size: 1.25rem; margin-bottom: 12px; }
h3 { font-size: 1.05rem; }

textarea, input[type="text"], input[type="password"], input[type="date"], input[type="time"], input[type="number"], input:not([type]) {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: white;
}

textarea { min-height: 120px; }

.summary, .panel, .order-card {
  background: var(--paper);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

dl { margin: 0; }
dl div { display: grid; grid-template-columns: 7rem 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); }

#submit-order, .stack button { width: 100%; margin-top: 12px; }

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 700;
}

.status-pending_store { background: var(--amber-bg); color: var(--amber); }
.status-confirmed { background: #e7f5ee; color: var(--green-dark); }
.status-rejected, .fail { background: var(--red-bg); color: var(--red); }
.status-completed, .status-cancelled, .pass { background: #eef2f0; color: #31443b; }

.admin { padding-bottom: 112px; }

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--paper);
  border-top: 1px solid var(--line);
  z-index: 3;
}

.tab-bar a {
  flex: 1;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
}

.tab-bar .icon { font-size: 1.25rem; }

.tab-bar a[aria-current="page"] { color: var(--green-dark); background: #e7f5ee; }

.date-nav, .setting-row, .order-card-top, .inline-form {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.setting-row, .inline-form { align-items: stretch; }
.inline-form, .setting-row form { width: 100%; }

.date-nav form, .inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.date-nav input, .inline-form input { width: auto; }

.order-card { margin: 12px 0; }
.order-card h3 { margin: 8px 0; }
.order-card p { margin: 4px 0; }
.slip-code { font-size: 1.7rem; letter-spacing: 0.03em; line-height: 1.2; }
.slip-time { font-size: 1.35rem; font-weight: 700; margin: 0 0 8px; }
.slip-note, .slip-card { border-radius: 12px; padding: 12px 14px; }
.slip-wish { margin: 4px 0; font-size: 1.35rem; font-weight: 700; color: var(--green-dark); }
.slip-note { background: var(--amber-bg); }
.slip-card { background: #e7f5ee; font-size: 1.25rem; }
.slot-board { margin-top: 18px; }
.slot-board-head, .weekday-picks { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.weekday-picks { border: 0; padding: 0; }
.weekday-picks label { min-height: 48px; }
dialog {
  border: 0;
  border-radius: 18px;
  padding: 20px;
  width: min(420px, calc(100% - (var(--gutter) * 2)));
  background: var(--paper);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(29, 43, 36, 0.45); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.confirm-actions button { width: 100%; }
.count { color: var(--amber); }

.slot-form, .stack { display: grid; gap: 12px; }
.product-card, .slot-card { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.product-card:first-of-type, .slot-card:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.product-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.product-actions form { width: auto; }
.fold { margin-top: 16px; }
.product-card .fold, .slot-card .fold { margin-top: 4px; }
.fold summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 48px;
  display: flex;
  align-items: center;
}
.slot-day + .slot-day { margin-top: 28px; }
.slot-day h3 { margin: 0 0 8px; color: var(--green); font-weight: 700; }
.slot-time { margin: 0; font-weight: 700; }
.slot-card .setting-row { align-items: flex-start; flex-wrap: nowrap; }
.slot-card .slot-accept, .slot-card .status { width: auto; margin: 0; }
.slot-card .fold summary {
  width: fit-content;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  list-style: none;
}
.slot-card .fold summary::-webkit-details-marker { display: none; }
.checks, .timeline { padding-left: 1.2rem; }
.checks li, .timeline li { margin: 8px 0; }
.capacity { font-size: 1.4rem; font-weight: 700; margin: 4px 0; }
.dev-auth { margin-top: 28px; }
.retry-row button { width: 100%; background: white; color: var(--ink); border: 1px solid var(--line); }

/* 顧客画面は、管理画面よりも柔らかな色と花束を想起させる形を使う。 */
.customer-page {
  background:
    radial-gradient(circle at 8% 12%, rgba(248, 222, 223, 0.8), transparent 28rem),
    radial-gradient(circle at 100% 38%, rgba(242, 201, 109, 0.16), transparent 24rem),
    #fff9f4;
}

.customer-page .screen {
  padding-top: 12px;
}

.customer-hero {
  position: relative;
  min-height: 158px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 18px var(--gutter) 20px;
  overflow: hidden;
  border-radius: 0 0 26px 26px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.94), rgba(248, 222, 223, 0.76)),
    var(--paper);
  box-shadow: 0 18px 45px rgba(111, 69, 57, 0.1);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 430px;
}

.customer-hero h1 {
  margin: 2px 0 7px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(1.48rem, 7vw, 1.9rem);
  line-height: 1.14;
  letter-spacing: 0.01em;
  color: #173e31;
  white-space: nowrap;
}

.hero-lead {
  margin: 0;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(0.92rem, 4.2vw, 1.05rem);
  font-weight: 700;
  color: #7e3f47;
}

.hero-note {
  display: none;
  max-width: 25em;
  margin: 4px 0 0;
  color: #4d5f56;
  font-size: 0.8rem;
}

.bouquet-mark {
  position: absolute;
  right: -22px;
  bottom: -45px;
  width: 104px;
  height: 118px;
  color: var(--coral);
  transform: rotate(-8deg);
  opacity: 0.42;
}

.bouquet-flower { position: absolute; filter: drop-shadow(0 8px 10px rgba(84, 59, 41, 0.08)); }
.bouquet-flower-main { width: 105px; height: 105px; right: 16px; top: 4px; }
.bouquet-flower-left { width: 72px; height: 72px; left: 2px; top: 48px; color: #b47c9a; }
.bouquet-flower-right { width: 62px; height: 62px; right: 0; top: 77px; color: #d7a72e; }

.order-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 16px 0 8px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.order-progress li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.order-progress li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 12px;
  left: calc(50% + 15px);
  width: calc(100% - 26px);
  height: 1px;
  background: #dbcbc2;
}

.order-progress span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--blush);
  color: #7e3f47;
}

.customer-page .order-step {
  margin-top: 18px;
  padding: 20px 16px;
  border: 1px solid rgba(221, 212, 198, 0.72);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.78);
}

.customer-page .compact-step { padding-block: 17px; }

.step-kicker {
  margin: 0 0 2px;
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: #173e31;
}

.section-title > .icon { color: var(--coral); font-size: 1.15em; }
.section-title .optional { margin-left: auto; font-size: 0.75rem; font-weight: 500; }
.sub-question { margin-top: 26px; }

.customer-page .choice {
  min-height: 58px;
  border-color: #e4d7cc;
  border-radius: 17px;
  box-shadow: 0 8px 22px rgba(77, 53, 37, 0.06);
}

.customer-page .choice:hover:not(:disabled) { border-color: #c48a8f; }
.customer-page .choice:focus-visible { outline: 3px solid rgba(217, 101, 103, 0.3); outline-offset: 2px; }
.customer-page .choice[aria-pressed="true"] { border-color: var(--coral); background: #fff4f3; outline-color: rgba(217, 101, 103, 0.15); }
.customer-page .choice[aria-pressed="true"]::after { background: var(--coral); }

.product-choice-main {
  display: flex;
  align-items: center;
  gap: 11px;
}

.choice-art {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: var(--blush);
  color: var(--coral);
  font-size: 1.25rem;
}

.product-choices .choice { align-items: center; }
.product-choices .choice strong { color: #7e3f47; white-space: nowrap; }

.purpose-choices .choice,
.color-choices .choice {
  justify-content: flex-start;
}

.purpose-choices .choice > .icon { color: #b47c9a; }

.color-swatch {
  width: 28px;
  height: 28px;
  flex: none;
  border: 3px solid white;
  border-radius: 50%;
  background: conic-gradient(#e98585, #f2c96d, #8eb8aa, #b47c9a, #e98585);
  box-shadow: 0 0 0 1px #ddcfc5;
}

.color-choices .choice:nth-child(2) .color-swatch { background: linear-gradient(135deg, #dc6769, #f1a45e); }
.color-choices .choice:nth-child(3) .color-swatch { background: linear-gradient(135deg, #668fc2, #8eb8aa); }
.color-choices .choice:nth-child(4) .color-swatch { background: linear-gradient(135deg, #f8dfe5, #dcd4ef); }
.color-choices .choice:nth-child(5) .color-swatch { background: linear-gradient(135deg, #ec3970, #ef982f); }

.date-heading {
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eadfd6;
  color: #7e3f47;
}

.slot-choices .icon { color: var(--coral); }

.customer-page textarea {
  margin-top: 7px;
  border-color: #e4d7cc;
  background: rgba(255, 255, 255, 0.86);
}

.customer-page .summary {
  background: linear-gradient(145deg, #fffdf8, #fff5ef);
  box-shadow: 0 14px 32px rgba(86, 53, 35, 0.1);
}

.primary-cta {
  min-height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #d96567, #bd505b);
  box-shadow: 0 10px 24px rgba(189, 80, 91, 0.24);
  font-weight: 800;
}

.primary-cta:hover:not(:disabled) { transform: translateY(-1px); }

.admin button .icon,
.admin .emergency-pill .icon { font-size: 1.05rem; }
.order-meta .icon { color: var(--green); }
.slip-note.icon-text, .slip-card.icon-text { display: flex; align-items: flex-start; }

/* 360px は基準。430px は大型スマホ、960px 以上はタブレットとPC。 */
@media (min-width: 430px) {
  :root { --gutter: 24px; }
  .purpose-choices, .color-choices, .slot-choices { grid-template-columns: 1fr 1fr; }
  .customer-hero { min-height: 178px; padding: 22px 28px; }
  .customer-hero h1 { font-size: 2rem; }
  .hero-note { display: block; }
  .bouquet-mark { right: 4px; bottom: -34px; width: 130px; transform: rotate(-8deg); opacity: 0.55; }
}

@media (min-width: 960px) {
  .choices { grid-template-columns: 1fr 1fr; }
  .setting-row, .inline-form { align-items: center; }
  .inline-form, .setting-row form { width: auto; }
}
