:root {
  --ivory: #fbf8f0;
  --paper: #ffffff;
  --forest: #214c3b;
  --forest-2: #17392d;
  --sage: #91ad93;
  --sage-pale: #e8f0e6;
  --rose: #b97878;
  --rose-pale: #f7e8e6;
  --gold: #b28a49;
  --ink: #25302c;
  --muted: #65716c;
  --line: #dfe6df;
  --danger: #a63c3c;
  --warning: #9a641b;
  --success: #2e704f;
  --shadow: 0 12px 34px rgba(30, 63, 48, .10);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(145,173,147,.20), transparent 27rem),
    radial-gradient(circle at 92% 6%, rgba(185,120,120,.13), transparent 24rem),
    var(--ivory);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.68;
}

button, input, select, textarea {
  font: inherit;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--forest); }

.page-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 72px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(33,76,59,.12);
  background: rgba(251,248,240,.93);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(1180px, calc(100% - 28px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 45% 55%;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, var(--forest), var(--sage));
  box-shadow: 0 8px 20px rgba(33,76,59,.22);
  font-size: 1.35rem;
}

.brand-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--forest-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  color: var(--muted);
  font-size: .78rem;
}

.topnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topnav a {
  color: var(--forest);
  text-decoration: none;
  font-weight: 750;
  padding: 8px 11px;
  border-radius: 999px;
}

.topnav a:hover,
.topnav a.active {
  background: var(--sage-pale);
}

.hero {
  margin: 24px 0 20px;
  padding: clamp(24px, 5vw, 52px);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  color: white;
  background:
    linear-gradient(118deg, rgba(22,57,44,.96), rgba(55,100,75,.90)),
    radial-gradient(circle at 85% 16%, rgba(255,255,255,.2), transparent 16rem);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "✿";
  position: absolute;
  right: clamp(14px, 4vw, 52px);
  bottom: -34px;
  font-size: clamp(8rem, 24vw, 17rem);
  color: rgba(255,255,255,.075);
  line-height: 1;
}

.hero > * { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  font-size: .78rem;
  color: #dfeee2;
}

.hero h1 {
  margin: 0;
  max-width: 800px;
  font-size: clamp(1.75rem, 5vw, 3rem);
  line-height: 1.28;
}

.hero p {
  max-width: 760px;
  margin: 13px 0 0;
  color: rgba(255,255,255,.88);
}

.hero-actions, .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(38,68,54,.06);
  padding: 21px;
}

.card h2, .card h3 {
  color: var(--forest-2);
  line-height: 1.4;
}

.card h2 { font-size: 1.28rem; margin: 0 0 14px; }
.card h3 { font-size: 1.05rem; margin: 0 0 9px; }

.section-title {
  margin: 32px 0 14px;
  color: var(--forest-2);
  font-size: 1.45rem;
  line-height: 1.4;
}

.section-note {
  margin: -7px 0 16px;
  color: var(--muted);
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 13px;
  padding: 12px 17px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .52; cursor: not-allowed; transform: none; }

.btn-primary {
  color: white;
  background: linear-gradient(145deg, var(--forest), #347056);
  box-shadow: 0 9px 20px rgba(33,76,59,.20);
}

.btn-secondary {
  color: var(--forest);
  background: var(--sage-pale);
  border: 1px solid #cfdccd;
}

.btn-rose {
  color: #733d3d;
  background: var(--rose-pale);
  border: 1px solid #edceca;
}

.btn-danger {
  color: white;
  background: var(--danger);
}

.btn-ghost {
  color: var(--forest);
  background: white;
  border: 1px solid var(--line);
}

.btn-small {
  min-height: 38px;
  padding: 7px 12px;
  font-size: .86rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full { grid-column: 1 / -1; }

label {
  font-weight: 800;
  color: var(--forest-2);
  font-size: .91rem;
}

.required::after {
  content: "必須";
  display: inline-block;
  margin-left: 7px;
  color: white;
  background: var(--rose);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: .66rem;
  vertical-align: 2px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #cfd9d1;
  border-radius: 12px;
  padding: 12px 13px;
  min-height: 48px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea { min-height: 112px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(145,173,147,.18);
}

.help {
  color: var(--muted);
  font-size: .79rem;
}

.notice, .alert {
  border-radius: 13px;
  padding: 13px 15px;
  margin: 13px 0;
  border: 1px solid;
}

.notice {
  color: #28543e;
  background: #edf7ef;
  border-color: #cee5d4;
}

.alert-error {
  color: #7e2d2d;
  background: #fff0ef;
  border-color: #efc7c4;
}

.alert-warning {
  color: #714b16;
  background: #fff7e8;
  border-color: #ead8b4;
}

.alert-info {
  color: #31596d;
  background: #eef7fb;
  border-color: #c9e0ea;
}

.hidden { display: none !important; }

.product-list {
  display: grid;
  gap: 13px;
}

.product-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  cursor: pointer;
}

.product-option:has(input:checked) {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(33,76,59,.10);
  background: #fbfefb;
}

.product-option input {
  width: 22px;
  height: 22px;
  min-height: auto;
  accent-color: var(--forest);
}

.product-name { font-weight: 850; color: var(--forest-2); }
.product-desc { color: var(--muted); font-size: .82rem; }
.price { white-space: nowrap; font-weight: 900; color: var(--forest); }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 9px;
}

.slot {
  min-height: 45px;
  border-radius: 11px;
  border: 1px solid #ced9d0;
  background: white;
  color: var(--forest);
  font-weight: 800;
  cursor: pointer;
}

.slot.selected {
  color: white;
  background: var(--forest);
  border-color: var(--forest);
}

.slot:disabled {
  color: #9da7a1;
  background: #f1f2f1;
  cursor: not-allowed;
}

.summary-list {
  display: grid;
  gap: 9px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 8px;
}

.summary-row:last-child { border-bottom: 0; }

.stat {
  display: grid;
  gap: 5px;
}

.stat-label { color: var(--muted); font-size: .82rem; }
.stat-value { color: var(--forest-2); font-size: 1.65rem; font-weight: 900; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th, td {
  padding: 13px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--forest-2);
  background: #f3f7f2;
  font-size: .83rem;
  white-space: nowrap;
}

td { font-size: .89rem; }

tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 800;
  font-size: .72rem;
  background: var(--sage-pale);
  color: var(--forest);
  white-space: nowrap;
}

.badge.rose { background: var(--rose-pale); color: #7a4141; }
.badge.gold { background: #fbf1dc; color: #785419; }
.badge.gray { background: #edf0ee; color: #5d6762; }

.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .field { min-width: 180px; flex: 1; }
.toolbar .btn { flex: 0 0 auto; }

.admin-lock {
  display: grid;
  gap: 14px;
  max-width: 520px;
  margin: 50px auto;
}

.code-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.order-card {
  display: grid;
  gap: 12px;
}

.order-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.order-number {
  color: var(--forest-2);
  font-size: 1.08rem;
  font-weight: 900;
}

.order-meta {
  color: var(--muted);
  font-size: .82rem;
}

.timeline {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0 4px;
}

.timeline-step {
  min-width: 95px;
  text-align: center;
  color: #87918c;
  font-size: .72rem;
  position: relative;
  padding-top: 24px;
}

.timeline-step::before {
  content: "";
  position: absolute;
  top: 7px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd3ce;
  z-index: 2;
}

.timeline-step::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #d9dfdb;
}

.timeline-step:last-child::after { display: none; }

.timeline-step.done,
.timeline-step.active {
  color: var(--forest);
  font-weight: 800;
}

.timeline-step.done::before,
.timeline-step.active::before {
  background: var(--forest);
}

.timeline-step.done::after { background: var(--forest); }

.loading {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--muted);
}

.footer {
  margin-top: 34px;
  text-align: center;
  color: var(--muted);
  font-size: .77rem;
}

.check-list {
  display: grid;
  gap: 9px;
}

.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.check-ok { color: var(--success); font-weight: 900; }
.check-ng { color: var(--danger); font-weight: 900; }
.check-wait { color: var(--muted); font-weight: 800; }

.mobile-bottom-nav { display: none; }

@media (max-width: 860px) {
  html { font-size: 16px; }

  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topnav { display: none; }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 70;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255,255,255,.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .mobile-bottom-nav a {
    padding: 9px 4px 8px;
    color: var(--muted);
    text-decoration: none;
    text-align: center;
    font-size: .67rem;
    font-weight: 750;
  }

  .mobile-bottom-nav span {
    display: block;
    font-size: 1.15rem;
    line-height: 1.1;
  }

  .page-shell { padding-bottom: 90px; }
}

@media (max-width: 640px) {
  .page-shell,
  .topbar-inner {
    width: min(100% - 20px, 1180px);
  }

  .hero {
    margin-top: 13px;
    padding: 25px 20px 29px;
    border-radius: 20px;
  }

  .hero h1 { font-size: 1.72rem; }
  .brand-subtitle { display: none; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .card { padding: 17px; border-radius: 15px; }
  .product-option { grid-template-columns: auto 1fr; }
  .product-option .price { grid-column: 2; }
  .code-row { grid-template-columns: 1fr auto; }
  .code-row .btn-danger { grid-column: 1 / -1; }
  .toolbar { align-items: stretch; }
  .toolbar .field, .toolbar .btn { flex: 1 1 100%; }
  .order-head { display: grid; }
}


/* ==========================================================
   STEP FLOWER-15: 完成写真・電話/店頭注文
   ========================================================== */

.photo-uploader {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.photo-uploader-title {
  margin: 0 0 10px;
  color: var(--forest-2);
  font-weight: 850;
}

.photo-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.photo-visibility {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0 0;
  font-weight: 750;
  color: var(--forest-2);
}

.photo-visibility input {
  width: 21px;
  height: 21px;
  min-height: auto;
  accent-color: var(--forest);
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.photo-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sage-pale);
}

.photo-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #edf2ed;
}

.photo-preview figcaption {
  padding: 8px 10px;
  color: var(--muted);
  font-size: .76rem;
}

.completion-photos {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px dashed var(--line);
}

.completion-photos h4 {
  margin: 0 0 10px;
  color: var(--forest-2);
  font-size: .96rem;
}

.counter-layout {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.5fr);
  gap: 18px;
  align-items: start;
}

.counter-sidebar {
  position: sticky;
  top: 88px;
}

.customer-search-results {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: 480px;
  overflow: auto;
}

.customer-choice {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  color: var(--ink);
  background: white;
  cursor: pointer;
}

.customer-choice:hover,
.customer-choice.selected {
  border-color: var(--forest);
  background: #f8fcf8;
  box-shadow: 0 0 0 3px rgba(33,76,59,.09);
}

.customer-choice strong {
  display: block;
  color: var(--forest-2);
}

.customer-choice span {
  display: block;
  color: var(--muted);
  font-size: .8rem;
}

.selected-customer {
  margin-top: 13px;
}

.order-item-list {
  display: grid;
  gap: 13px;
}

.order-item-row {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 15px;
  background: #fff;
}

.order-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.order-item-title {
  color: var(--forest-2);
  font-weight: 850;
}

.order-item-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) .55fr .7fr;
  gap: 12px;
}

.order-item-grid .wide {
  grid-column: 1 / -1;
}

.inline-result {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.success-panel {
  border: 1px solid #bee0c7;
  background: #eef9f1;
}

@media (max-width: 900px) {
  .counter-layout {
    grid-template-columns: 1fr;
  }

  .counter-sidebar {
    position: static;
  }
}

@media (max-width: 680px) {
  .photo-upload-row,
  .order-item-grid {
    grid-template-columns: 1fr;
  }
}
