:root {
  --ink: #1c2622;
  --muted: #63706a;
  --line: #d8e0dc;
  --paper: #fbfcf9;
  --panel: #ffffff;
  --accent: #0d7f68;
  --accent-dark: #075946;
  --warn: #b56318;
  --danger: #a33933;
  --soft: #eef6f2;
  --amber: #fff4df;
  --blue: #edf5ff;
  --shadow: 0 18px 50px rgba(28, 38, 34, 0.11);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.role-hidden {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

body.public-mode .app-shell {
  display: block;
}

html.public-preload body:not(.public-view-ready) .app-shell {
  display: block;
}

body.public-mode .sidebar,
body.public-mode #dashboard,
body.public-mode #growth,
body.public-mode #customers,
body.public-mode #settings,
body.public-mode #adminLoginPanel,
html.public-preload body:not(.public-view-ready) .sidebar,
html.public-preload body:not(.public-view-ready) #dashboard,
html.public-preload body:not(.public-view-ready) #growth,
html.public-preload body:not(.public-view-ready) #customers,
html.public-preload body:not(.public-view-ready) #settings,
html.public-preload body:not(.public-view-ready) #adminLoginPanel {
  display: none !important;
}

body.public-mode main {
  padding: 0;
}

html.public-preload body:not(.public-view-ready) main {
  padding: 0;
}

body.reserve-mode #guest {
  display: block;
}

html.reserve-preload body:not(.public-view-ready) #guest {
  display: block;
}

body.reserve-mode:not(.public-view-ready) #guest .booking-page,
html.reserve-preload body:not(.public-view-ready) #guest .booking-page {
  visibility: hidden;
  min-height: 100vh;
}

.public-page-loading {
  display: none;
}

body.reserve-mode:not(.public-view-ready) #guest .public-page-loading,
html.reserve-preload body:not(.public-view-ready) #guest .public-page-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

body.reserve-mode #survey {
  display: none !important;
}

body.admin-mode #guest {
  display: none;
}

body.survey-mode #survey {
  display: block;
}

body.survey-mode #guest {
  display: none !important;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  color: #f7fffb;
  background: #17362e;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f3b95f;
  color: #17362e;
  font-weight: 800;
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.25;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: #bed3cc;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  border: 0;
  border-radius: 8px;
  padding: 12px 12px;
  color: #e8f5ef;
  background: transparent;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button[aria-selected="true"] {
  background: #255145;
  color: #ffffff;
}

.nav svg,
.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: #d3e3dd;
  font-size: 12px;
  line-height: 1.7;
}

.app-version {
  margin: 10px 2px 0;
  color: #9db8af;
  font-size: 11px;
  line-height: 1.4;
}

.operator-status {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.operator-status span {
  color: #bed3cc;
  font-size: 11px;
}

.operator-status strong {
  font-size: 15px;
}

.operator-status .btn {
  margin-top: 4px;
  padding: 8px 10px;
}

main {
  min-width: 0;
  padding: 28px 32px 44px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.25;
}

.subcopy {
  margin: 8px 0 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.8;
}

.store-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(28, 38, 34, 0.06);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22a06b;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric.wide {
  grid-column: 1 / -1;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.1;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.metric[role="button"] {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.metric[role="button"]:hover {
  transform: translateY(-1px);
}

.metric[role="button"].is-disabled {
  cursor: default;
  opacity: 0.72;
}

.metric[role="button"].is-disabled:hover {
  transform: none;
}

.pending-metric.needs-action {
  border-color: #f0b5aa;
  background: #fff4f1;
  box-shadow: 0 10px 24px rgba(176, 62, 47, 0.12);
  animation: needsActionPulse 1.8s ease-in-out infinite;
}

.send-alert-metric.needs-action {
  border-color: #f0b5aa;
  background: #fff7f3;
  box-shadow: 0 10px 24px rgba(176, 62, 47, 0.12);
  animation: needsActionPulse 1.8s ease-in-out infinite;
}

.send-alert-metric.needs-action span,
.send-alert-metric.needs-action small {
  color: #9f2f25;
}

.send-alert-metric.needs-action strong {
  color: #b53a2d;
}

.pending-metric.needs-action span,
.pending-metric.needs-action small {
  color: #9f2f25;
}

.pending-metric.needs-action strong {
  color: #b53a2d;
}

.pending-metric[role="button"]:focus-visible {
  outline: 3px solid rgba(19, 141, 117, 0.28);
  outline-offset: 3px;
}

.today-summary-metric small span {
  white-space: nowrap;
}

.growth-actions {
  display: grid;
  gap: 8px;
  margin: -8px 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.growth-actions h2 {
  margin: 0;
  font-size: 16px;
}

.collapsible-ops-panel summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}

.collapsible-ops-panel summary::-webkit-details-marker {
  display: none;
}

.collapsible-ops-panel summary::after {
  content: "開く";
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.collapsible-ops-panel[open] summary::after {
  content: "閉じる";
}

.collapsible-ops-panel[open] .growth-action-list,
.collapsible-ops-panel[open] .special-date-panel {
  margin-top: 8px;
}

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

.reminder-queue-head .btn {
  flex: 0 0 auto;
}

.growth-action-list {
  display: grid;
  gap: 8px;
}

.growth-action-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.growth-action-item .toolbar {
  flex: 0 0 auto;
}

.growth-action-item strong {
  color: var(--ink);
}

.source-rate {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 800;
}

.source-url-item {
  align-items: flex-start;
}

.source-url-code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.source-url-panel {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.today-availability {
  margin-top: -8px;
}

.today-availability-item .source-rate {
  min-width: 96px;
  text-align: right;
}

.follow-history-body {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.follow-history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.follow-history-stat {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.follow-history-stat span,
.follow-history-stat small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.follow-history-stat strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 18px;
}

.follow-history-stat.sent {
  background: var(--soft);
}

.follow-history-stat.failed {
  background: #fff7f6;
  border-color: #f5c6c1;
}

.follow-history-stat.attention {
  background: #fff8ec;
  border-color: #f2d4a6;
}

.follow-history-card {
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.follow-history-card.sent {
  border-left-color: var(--accent);
}

.follow-history-card.failed {
  border-left-color: var(--danger);
  background: #fffafa;
}

.follow-history-card.attention {
  border-left-color: var(--warn);
  background: #fffaf0;
}

.follow-history-card.copied {
  border-left-color: #8aa39a;
}

.follow-history-card.resolved {
  border-left-color: #6f9ec6;
  background: #f7fbff;
}

.follow-history-card.draft {
  border-left-color: var(--warn);
}

.reservation-followup-log {
  margin-top: 8px;
}

.reservation-followup-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.reservation-followup-item {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.88rem;
}

.reservation-followup-item > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--ink);
}

.reservation-followup-item.sent {
  border-color: rgba(13, 142, 112, 0.22);
  background: rgba(231, 247, 241, 0.6);
}

.reservation-followup-item.failed {
  border-color: rgba(176, 49, 49, 0.28);
  background: rgba(255, 241, 239, 0.64);
}

.reservation-followup-item.attention {
  border-color: rgba(188, 108, 37, 0.28);
  background: rgba(255, 248, 236, 0.72);
}

.reservation-followup-item.copied {
  border-color: rgba(49, 112, 176, 0.22);
  background: rgba(235, 244, 255, 0.6);
}

.reservation-followup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.btn.tiny {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.84rem;
}

.follow-history-main {
  min-width: 0;
}

.follow-history-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.follow-history-subject {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.follow-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.follow-history-error {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #f5c6c1;
  border-radius: 8px;
  background: #fff1f0;
  color: var(--danger);
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.follow-history-toolbar {
  align-items: end;
  padding-top: 2px;
}

.follow-history-toolbar .field {
  min-width: 150px;
}

.follow-history-search {
  flex: 1 1 220px;
}

.integration-status {
  display: grid;
  gap: 8px;
  margin: -4px 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8ef;
}

.integration-status strong {
  color: var(--ink);
}

.integration-status.ready {
  background: #eef8f1;
  border-color: #b9ddc3;
}

.integration-status.missing {
  background: #fff4ee;
  border-color: #edc3af;
}

.share-link-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cfe1d9;
  border-radius: 8px;
  background: #f4fbf7;
}

.share-link-panel strong {
  display: block;
  font-size: 15px;
}

.share-link-panel input[readonly],
.share-link-panel textarea[readonly] {
  background: #ffffff;
}

.share-link-panel textarea[readonly] {
  min-height: 92px;
  resize: vertical;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.section {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.required-mark {
  color: var(--danger);
  font-weight: 900;
  margin-left: 3px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  outline-color: var(--accent);
}

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

.btn {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.btn.danger {
  border-color: #f1c6c3;
  color: var(--danger);
  background: #fff6f5;
}

.btn.warn {
  border-color: #f3d4aa;
  color: var(--warn);
  background: #fff9ed;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.busy {
  opacity: 0.72;
}

.btn.busy::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.refresh-status {
  align-self: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.offline-cache-status {
  color: #6f7f78;
}

.offline-ledger-banner {
  margin: 14px 18px 0;
  padding: 12px 14px;
  border: 1px solid #efcf8f;
  border-radius: 8px;
  background: #fff8e9;
  color: #7a4b0e;
  font-weight: 800;
  line-height: 1.6;
}

body.offline-ledger-mode .reservation-list {
  border-top: 1px solid #f0d8a8;
}

.reservation-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.calendar-wrap {
  display: none;
  padding: 18px;
  gap: 12px;
}

.calendar-wrap.active {
  display: grid;
}

.timeline-wrap {
  display: none;
  padding: 18px;
  gap: 14px;
}

.timeline-wrap.active {
  display: grid;
}

.reservation-list.hidden {
  display: none;
}

.timeline-board {
  display: grid;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.timeline-scale,
.timeline-row {
  display: grid;
  grid-template-columns: 108px minmax(720px, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 860px;
}

.timeline-scale {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timeline-hours,
.timeline-track {
  position: relative;
  min-height: 36px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(to right, rgba(216, 224, 220, 0.85) 0 1px, transparent 1px calc(100% / var(--timeline-hours))),
    #fbfcf9;
  border: 1px solid var(--line);
}

.timeline-hour {
  position: absolute;
  top: 9px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.timeline-row-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.timeline-row-label strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-row-label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timeline-bar {
  position: absolute;
  top: 6px;
  bottom: 6px;
  min-width: 32px;
  border-radius: 8px;
  border: 1px solid rgba(13, 127, 104, 0.28);
  background: linear-gradient(90deg, #dff3eb, #bfe6d8);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  box-shadow: 0 8px 18px rgba(14, 49, 39, 0.08);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  white-space: nowrap;
}

.timeline-bar.pending {
  border-color: rgba(181, 99, 24, 0.32);
  background: linear-gradient(90deg, #fff2d7, #f9d99d);
}

.timeline-bar.seated {
  border-color: rgba(99, 112, 106, 0.25);
  background: linear-gradient(90deg, #eef3f0, #dbe5e0);
}

.timeline-bar.declined,
.timeline-bar.cancelled {
  opacity: 0.48;
  background: #edf0ed;
}

.timeline-meta {
  color: var(--muted);
  font-weight: 700;
}

.customer-list {
  display: grid;
  gap: 0;
  padding: 18px;
  overflow-x: auto;
  max-height: 72vh;
  align-content: start;
}

.customer-row {
  display: grid;
  grid-template-columns: 160px 128px 190px 96px 112px 116px 96px 112px 126px 130px minmax(220px, 1fr);
  min-width: 1480px;
  gap: 0;
  align-items: center;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}

.customer-row:first-child {
  border-top: 1px solid var(--line);
}

.customer-header {
  position: sticky;
  top: 0;
  z-index: 3;
  border-top: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f7f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.customer-header + .customer-row {
  border-top: 0;
}

.customer-cell {
  min-width: 0;
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-cell:last-child {
  border-right: 0;
}

.customer-name {
  font-weight: 800;
}

.customer-note {
  color: var(--muted);
}

.customer-cancel {
  color: var(--danger);
  font-weight: 800;
}

.customer-risk {
  color: var(--danger);
  font-weight: 800;
}

.customer-muted {
  color: var(--muted);
  font-size: 12px;
}

.calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.calendar-title {
  font-weight: 800;
  font-size: 18px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.calendar-weekday,
.calendar-day {
  min-height: 92px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
}

.calendar-weekday {
  min-height: auto;
  background: #f2f7f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-weekday.sun,
.calendar-date.sun,
.calendar-date.holiday {
  color: #b83a34;
}

.calendar-weekday.sat,
.calendar-date.sat {
  color: #2568a8;
}

.calendar-day {
  display: grid;
  align-content: start;
  gap: 6px;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border-top: 0;
  border-left: 0;
  border-radius: 0;
  width: 100%;
  font: inherit;
}

.calendar-day:nth-child(7n),
.calendar-weekday:nth-child(7n) {
  border-right: 0;
}

.calendar-day.muted {
  background: #fafbf9;
  color: #a0aaa5;
}

.calendar-day.past {
  opacity: 0.7;
}

.calendar-day.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: #f2fbf7;
}

.calendar-day.has-bookings {
  cursor: pointer;
}

.calendar-date {
  font-weight: 800;
}

.calendar-summary {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.calendar-day.has-bookings .calendar-summary {
  color: var(--danger);
  font-weight: 700;
}

.calendar-special {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  background: #fff1f0;
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
}

.ops-note {
  margin-top: 8px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.guest-calendar-panel {
  display: grid;
  gap: 10px;
  background: #fff;
}

.guest-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.guest-calendar-weekday,
.guest-calendar-day {
  min-height: 52px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px;
  text-align: left;
}

.guest-calendar-weekday {
  min-height: auto;
  background: #f2f7f4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.guest-calendar-weekday:nth-child(7n),
.guest-calendar-day:nth-child(7n) {
  border-right: 0;
}

.guest-calendar-day {
  display: grid;
  gap: 2px;
  background: #fff;
  color: var(--ink);
  border-top: 0;
  border-left: 0;
  border-radius: 0;
  width: 100%;
  font: inherit;
  cursor: pointer;
}

.guest-calendar-day.muted {
  background: #fafbf9;
  color: #a0aaa5;
}

.guest-calendar-day.past,
.guest-calendar-day.full,
.guest-calendar-day.closed {
  opacity: 0.4;
  cursor: not-allowed;
}

.guest-calendar-day.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: #f2fbf7;
}

.guest-calendar-day.limited {
  background: #fff9ed;
}

.guest-calendar-day.full,
.guest-calendar-day.closed {
  background: #f8f1f1;
}

.guest-calendar-date {
  font-weight: 800;
}

.guest-calendar-date.sun,
.guest-calendar-date.holiday {
  color: #b83a34;
}

.guest-calendar-date.sat {
  color: #2568a8;
}

.guest-calendar-mark {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.guest-calendar-loading {
  grid-column: 1 / -1;
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  background: var(--soft);
}

.guest-calendar-day.available .guest-calendar-mark {
  color: var(--accent-strong);
}

.guest-calendar-day.limited .guest-calendar-mark {
  color: var(--warn);
}

.guest-calendar-day.full .guest-calendar-mark,
.guest-calendar-day.closed .guest-calendar-mark {
  color: var(--danger);
}

.reservation {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px 12px;
  align-items: start;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.reservation-main {
  min-width: 0;
}

.reservation-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  grid-column: 2;
  align-self: start;
  padding-top: 6px;
  border-top: 1px solid rgba(216, 224, 220, 0.8);
}

.reservation-actions .field {
  margin: 0;
}

.reservation-actions .toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0;
}

.reservation-actions .btn,
.reservation-actions .mini-select {
  min-height: 38px;
  padding-block: 8px;
}

.reservation-actions .action-grid,
.reservation-actions .toolbar,
.reservation-actions .payment-control {
  grid-column: 1 / -1;
}

.reservation.date-band-a,
.reservation.date-band-0 {
  background: #fff;
}

.reservation.date-band-b,
.reservation.date-band-1 {
  background: #fff2dc;
  border-color: #efc987;
}

.reservation.date-band-2 {
  background: #eef8f2;
  border-color: #b9ddc6;
}

.reservation.date-band-3 {
  background: #eef4ff;
  border-color: #bfd3f2;
}

.reservation.pre-confirmation {
  background: #fff;
  border-color: #d9e3de;
  box-shadow: 0 1px 0 rgba(18, 42, 35, 0.03);
}

.reservation.needs-action {
  border-color: #f0b5aa;
  background: linear-gradient(90deg, #fff4f1 0, #fffaf8 34%, #fff 100%);
  box-shadow: 0 12px 26px rgba(176, 62, 47, 0.12);
  animation: needsActionPulse 1.8s ease-in-out infinite;
}

.reservation.needs-action .pill.pending,
.reservation.needs-action .compact-status {
  background: #ffe0dc;
  color: #9f2f25;
}

.reservation.ops-block-card {
  grid-template-columns: 80px minmax(0, 1fr);
  border-color: #d68a50;
  background: #fff6ea;
}

.reservation.ops-block-card.date-band-b {
  background: #ffe8c5;
  border-color: #c9763c;
}

.reservation.ops-block-card.date-band-0 {
  background: #fff6ea;
  border-color: #d68a50;
}

.reservation.ops-block-card.date-band-1 {
  background: #ffe8c5;
  border-color: #c9763c;
}

.reservation.ops-block-card.date-band-2 {
  background: #edf8ef;
  border-color: #8cc49a;
}

.reservation.ops-block-card.date-band-3 {
  background: #edf4ff;
  border-color: #96b7e8;
}

.ops-block-card .time {
  color: #9b4c1f;
}

.reservation-date-band {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 8px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #f1c979;
  color: #5d3708;
  font-size: 12px;
  font-weight: 800;
}

.time {
  font-weight: 800;
  font-size: 20px;
  line-height: 1.15;
}

.reservation-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reservation h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.compact-status {
  flex: none;
}

.reservation p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.reservation-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.primary-meta {
  grid-template-columns: minmax(140px, 0.8fr) minmax(160px, 1fr) minmax(120px, 0.6fr);
}

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

.reservation-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(216, 224, 220, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reservation-details {
  margin-top: 6px;
}

.reservation-details summary {
  width: fit-content;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.reservation-details[open] {
  padding-top: 4px;
}

.reservation-note {
  display: -webkit-box;
  max-width: 72ch;
  overflow: hidden;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.queue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.change-request-notice {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #f0c46a;
  border-radius: 8px;
  background: #fff8e6;
  color: var(--text);
}

.change-request-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.change-request-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cancellation-record {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #f0c0bc;
  border-radius: 8px;
  background: #fff5f3;
}

.btn.small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  margin-top: 0;
}

.proposal-control {
  display: grid;
  gap: 6px;
}

.proposal-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-control {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 0.8fr);
  gap: 6px;
  align-items: end;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.payment-control .field {
  margin: 0;
}

.payment-control input {
  min-height: 36px;
  padding: 8px 10px;
}

.payment-control .capacity-note {
  grid-column: auto;
  align-self: center;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  background: var(--soft);
  color: var(--accent-dark);
}

.pill.pending {
  background: var(--amber);
  color: var(--warn);
}

.pill.seated {
  background: var(--blue);
  color: #255a8a;
}

.pill.declined {
  background: #fff1f0;
  color: var(--danger);
}

.pill.cancelled {
  background: #eeeeee;
  color: #6f7772;
}

.pill.sent {
  background: var(--soft);
  color: var(--accent-dark);
}

.pill.failed {
  background: #fff1f0;
  color: var(--danger);
}

.pill.attention {
  background: #fff3df;
  color: var(--warn);
}

.pill.copied {
  background: #eef3f1;
  color: #52655f;
}

.pill.resolved {
  background: #eaf4ff;
  color: #2f6393;
}

.pill.draft {
  background: var(--amber);
  color: var(--warn);
}

.pill.muted {
  background: #f4f6f5;
  color: var(--muted);
}

.visit-stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.star {
  font-size: 13px;
  line-height: 1;
  color: #8b9690;
  text-shadow: 0 0 0 #ffffff;
}

.star.gold {
  color: #c68a12;
}

.mini-select {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 13px;
}

.notice-template {
  margin: 0;
  padding: 14px;
  max-width: 100%;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.7;
  overflow-x: hidden;
}

.inline-notice {
  margin: 10px 0 0;
  padding: 10px;
  border: 1px solid #f3d4aa;
  border-radius: 8px;
  background: #fff9ed;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.form-grid {
  padding: 18px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.form-grid > * {
  min-width: 0;
}

.form-grid > .field > .btn {
  width: 100%;
  max-width: 100%;
  white-space: normal;
}

.manual-date-control {
  display: grid;
  gap: 10px;
}

.manual-date-control input {
  min-height: 56px;
  font-size: 18px;
  padding: 12px 14px;
}

.manual-date-control input[readonly] {
  background: #fff;
  cursor: pointer;
}

.manual-date-control > .btn {
  min-height: 48px;
  width: 100%;
}

.manual-calendar-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff;
}

.manual-calendar-panel[hidden] {
  display: none;
}

.manual-calendar-panel .guest-calendar-day {
  min-height: 58px;
}

.manual-calendar-day.phone {
  background: #eef7ff;
}

.manual-calendar-day.phone .guest-calendar-mark {
  color: #2568a8;
}

.manual-scratchpad {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaf6;
}

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

.manual-scratchpad-head strong {
  display: block;
  font-size: 16px;
}

.manual-scratch-canvas {
  width: 100%;
  height: 82px;
  max-height: 82px;
  border: 2px solid #c7d8d0;
  border-radius: 10px;
  background:
    linear-gradient(#ffffff 31px, #eef4f0 32px),
    #fff;
  background-size: 100% 32px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  touch-action: none;
}

.reply-workspace {
  padding-top: 10px;
}

.hidden-buffer {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: pre !important;
  border: 0 !important;
}

#guestForm.confirming > button[type="submit"],
#guestForm.completed > :not(#guestCompletionPanel) {
  display: none !important;
}

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

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rules {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.rule-row strong {
  display: block;
  margin-bottom: 3px;
}

.rule-row span,
.rule-row p {
  color: var(--muted);
  font-size: 12px;
}

.rule-row p {
  margin: 0;
  line-height: 1.6;
}

.settings-fold-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
}

.settings-fold-panel summary {
  cursor: pointer;
  font-weight: 900;
}

.settings-fold-panel[open] summary {
  margin-bottom: 4px;
}

.settings-subhead {
  display: grid;
  gap: 2px;
  padding-top: 4px;
}

.settings-subhead h3 {
  margin: 0;
  font-size: 15px;
}

.settings-subhead p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.capacity-rule-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.capacity-rule-row .field {
  margin: 0;
}

.switch-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-height: 44px;
  align-items: center;
}

.inline-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--ink);
}

.session-acceptance-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
}

.acceptance-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.acceptance-check input {
  width: 18px;
  height: 18px;
}

.acceptance-check span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.acceptance-check strong,
.acceptance-check small {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.acceptance-check small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.schedule-grid {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.special-date-list {
  display: grid;
  gap: 8px;
}

.special-date-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.special-date-item strong {
  display: block;
  font-size: 14px;
}

.special-date-item span {
  color: var(--muted);
  font-size: 12px;
}

.special-date-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.status-panel strong {
  color: var(--ink);
}

.confirm-panel {
  display: none;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
}

.confirm-panel .toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.confirm-panel .btn {
  min-width: 0;
  width: 100%;
  white-space: normal;
}

.reply-preview-box {
  margin: 0;
}

.reply-email-status {
  margin: 0;
}

.reply-email-status.warning {
  color: var(--warn);
  font-weight: 800;
}

#adminReplyPreview,
#reminderPreviewText {
  max-height: 42vh;
  min-height: 220px;
  overflow: auto;
  resize: vertical;
  width: 100%;
  font-family: inherit;
}

.confirm-panel.show {
  display: grid;
}

#adminReplyConfirmPanel.show,
#reminderConfirmPanel.show {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: 0 22px 60px rgba(18, 42, 35, 0.22);
}

.processing-note {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.processing-note.show {
  display: inline-flex;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #cfe4d9;
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes needsActionPulse {
  0%, 100% {
    box-shadow: 0 10px 22px rgba(176, 62, 47, 0.10);
  }
  50% {
    box-shadow: 0 16px 34px rgba(176, 62, 47, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pending-metric.needs-action,
  .reservation.needs-action {
    animation: none;
  }
}

.floor-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(22, 32, 27, 0.42);
}

.floor-modal.show {
  display: flex;
}

.operator-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 31, 26, 0.72);
}

.operator-modal.show {
  display: grid;
}

.operator-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.operator-panel h2 {
  margin: 0 0 6px;
}

.operator-panel .toolbar {
  justify-content: flex-end;
}

.floor-panel {
  width: min(920px, 100%);
  max-height: 92vh;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 18px 50px rgba(22, 32, 27, 0.22);
}

.floor-grid {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#edf4f0 1px, transparent 1px),
    linear-gradient(90deg, #edf4f0 1px, transparent 1px),
    #fbfdfb;
  background-size: 72px 72px;
  overflow: hidden;
}

.floor-zone {
  position: absolute;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf4f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.floor-table {
  position: absolute;
  width: 62px;
  height: 52px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.floor-table.busy {
  background: #fff1f0;
  border-color: #e08b84;
  color: var(--danger);
  cursor: not-allowed;
}

.floor-table.selected {
  background: #e6f4ed;
  border-color: var(--accent);
  color: var(--accent-dark);
}

.floor-table.warn {
  background: #fff9e8;
  border-color: #d99537;
}

.floor-table.short {
  opacity: 0.72;
  border-style: dashed;
}

.floor-table.fixed::after {
  content: "固定";
  position: absolute;
  right: 3px;
  bottom: 2px;
  font-size: 9px;
  color: #9b4c1f;
}

.floor-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: #fff9ed;
  border: 1px solid #efc987;
  font-size: 13px;
}

.manual-seat-picker {
  display: grid;
  gap: 10px;
}

.manual-seat-summary {
  background: #f7fbf8;
  border-color: var(--line);
}

.manual-customer-assist {
  display: none;
  gap: 8px;
  margin-top: 8px;
}

.manual-customer-assist.show {
  display: grid;
}

.manual-customer-assist-title,
.manual-customer-assist-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.manual-customer-candidate {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.manual-customer-candidate:hover,
.manual-customer-candidate:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(9, 135, 105, 0.12);
  outline: none;
}

.manual-customer-candidate small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.qr-box {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-box img,
.qr-box canvas {
  width: 220px;
  height: 220px;
}

.qr-url {
  word-break: break-all;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.confirm-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.confirm-list div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  font-size: 13px;
}

.confirm-list dt {
  color: var(--muted);
  font-weight: 700;
}

.confirm-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.weekday-row {
  display: grid;
  grid-template-columns: 74px 86px repeat(4, minmax(88px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.weekday-name {
  align-self: center;
  font-weight: 800;
}

.capacity-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.capacity-note.warning {
  color: var(--danger);
  font-weight: 700;
}

.policy-note {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
  white-space: pre-line;
}

.privacy-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9ed;
}

.privacy-short {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.privacy-box summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
}

.privacy-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.consent-row input {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  flex: 0 0 auto;
}

.weekday-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.admin-login {
  display: none;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9ed;
}

.admin-login.show {
  display: grid;
  gap: 12px;
}

body.admin-login-only,
body.oneawaits-home-mode {
  background: #f7faf8;
}

body.admin-login-only .app-shell,
body.oneawaits-home-mode .app-shell {
  display: block;
  min-height: 100vh;
}

body.admin-login-only .sidebar,
body.oneawaits-home-mode .sidebar {
  display: none;
}

body.admin-login-only main,
body.oneawaits-home-mode main {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px 16px;
}

body.admin-login-only .admin-login,
body.oneawaits-home-mode .store-required-panel {
  width: min(760px, 100%);
  margin: 0;
  padding: clamp(28px, 6vw, 56px);
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(28, 38, 34, 0.12);
}

body.admin-login-only .admin-login > div:first-child {
  text-align: center;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.login-brand .brand-mark {
  color: #123d32;
}

.login-brand strong {
  color: #264b4b;
  font-size: clamp(30px, 6vw, 48px);
  letter-spacing: 0;
}

body.admin-login-only .admin-login h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 42px);
}

body.admin-login-only .admin-login .toolbar {
  display: grid;
  gap: 14px;
}

body.admin-login-only .admin-login input {
  width: 100%;
}

body.supabase-login #adminPin {
  display: none;
}

body.admin-login-only .admin-login .btn.primary {
  justify-content: center;
  min-height: 52px;
  font-size: 17px;
}

.store-required-panel {
  display: none;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9ed;
}

.store-required-panel.show {
  display: grid;
  gap: 14px;
}

.home-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.home-brand .brand-mark {
  color: #123d32;
}

.home-brand h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.home-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.home-store-form {
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.capacity-note.warning {
  color: var(--danger);
  font-weight: 800;
}

.login-attempt-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-attempt-status.warning {
  color: var(--warn);
  font-weight: 700;
}

.login-attempt-status.locked {
  color: var(--danger);
  font-weight: 700;
}

.staff-operator-panel,
.audit-log-panel {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.staff-operator-panel > summary,
.audit-log-panel > summary {
  padding: 18px 0;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.staff-operator-content,
.audit-log-content {
  padding: 4px 0 10px;
}

.staff-operator-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 0.8fr) minmax(110px, 0.55fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.staff-operator-form .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.staff-operator-list {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.staff-operator-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}

.staff-operator-item strong {
  display: block;
}

.staff-operator-item span {
  color: var(--muted);
  font-size: 12px;
}

.staff-operator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.audit-log-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(130px, 0.8fr) minmax(135px, 0.8fr) minmax(135px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.audit-log-list {
  display: grid;
  max-height: 560px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.audit-log-item {
  display: grid;
  gap: 10px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

.audit-log-main {
  display: grid;
  gap: 6px;
}

.audit-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.audit-log-detail summary {
  width: fit-content;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.audit-log-detail pre {
  max-height: 300px;
  margin: 10px 0 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.audit-log-item > [data-audit-restore] {
  justify-self: start;
}

@media (max-width: 900px) {
  .capacity-rule-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-operator-form {
    grid-template-columns: 1fr 1fr;
  }

  .staff-operator-form .toolbar {
    grid-column: 1 / -1;
  }

  .audit-log-filters {
    grid-template-columns: 1fr 1fr;
  }

  .audit-log-filters > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .staff-operator-form,
  .audit-log-filters {
    grid-template-columns: 1fr;
  }

  .staff-operator-form .toolbar,
  .audit-log-filters > :first-child {
    grid-column: auto;
  }

  .staff-operator-item {
    grid-template-columns: 1fr;
  }

  .staff-operator-actions {
    justify-content: flex-start;
  }
}

.password-reset-panel {
  display: none;
  gap: 8px;
}

.password-reset-panel.show {
  display: grid;
}

.view.admin-locked .layout,
.view.admin-locked .metrics,
.view.admin-locked .growth-actions,
.view.admin-locked .rules,
.view.admin-locked .topbar,
.view.admin-locked .section {
  display: none;
}

.view.store-missing > * {
  display: none;
}

.admin-add-panel {
  border-top: 1px solid var(--line);
}

.admin-add-panel.top-add-panel {
  border-top: 0;
  border-bottom: 1px solid var(--line);
  background: #fffaf4;
}

.admin-add-panel summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 800;
}

.switch {
  position: relative;
  width: 50px;
  height: 28px;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd6d1;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  transition: 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.booking-page {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  min-height: calc(100vh - 56px);
  gap: 28px;
  align-items: stretch;
}

.survey-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 16px;
}

.guest-hero {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(13, 127, 104, 0.78), rgba(18, 42, 35, 0.88));
  background-color: #17362e;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px;
  color: white;
}

.guest-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #17362e;
}

.guest-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(18, 42, 35, 0.06), rgba(18, 42, 35, 0.2)),
    linear-gradient(180deg, rgba(18, 42, 35, 0) 45%, rgba(18, 42, 35, 0.72) 100%);
  pointer-events: none;
}

.guest-hero-content {
  position: relative;
  z-index: 1;
}

.guest-hero h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.08;
  text-shadow: 0 2px 14px rgba(18, 42, 35, 0.42);
}

.guest-hero p {
  max-width: 520px;
  margin: 14px 0 0;
  line-height: 1.9;
  color: #edf7f2;
  text-shadow: 0 2px 12px rgba(18, 42, 35, 0.46);
}

.guest-store-info {
  display: grid;
  gap: 8px;
  max-width: 560px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.34);
  color: #f4fbf7;
  font-size: 13px;
  line-height: 1.65;
}

.admin-access-label {
  margin: 8px 2px 0;
  color: #dbe9e4;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.settings-access-notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--warn);
  background: var(--amber);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.guest-store-info-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.guest-store-info-row strong {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.guest-store-info a {
  color: white;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.guest-public-footer {
  max-width: 560px;
  margin-top: 14px;
  padding-top: 12px;
}

.guest-public-footer[hidden] {
  display: none;
}

.guest-social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.guest-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  text-decoration: none;
  box-shadow: none;
}

.guest-social-link:hover,
.guest-social-link:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  outline: none;
  transform: translateY(-1px);
}

.guest-social-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.reservation-guidance {
  margin: 16px 18px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
  color: var(--ink);
  line-height: 1.75;
}

.reservation-guidance-inline {
  margin: 0;
  grid-column: 1 / -1;
}

.reservation-guidance strong,
.reservation-guidance summary {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.reservation-guidance summary {
  margin-bottom: 0;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  list-style-position: inside;
  touch-action: manipulation;
}

.reservation-guidance[open] summary {
  margin-bottom: 10px;
}

.reservation-guidance ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}

.reservation-qa-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.reservation-qa-list dt {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.reservation-qa-list dd {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.count-stepper {
  display: grid;
  grid-template-columns: 48px minmax(74px, 1fr) 48px minmax(128px, auto);
  align-items: center;
  gap: 8px;
  max-width: 360px;
  touch-action: manipulation;
}

.count-stepper button {
  width: 48px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f7faf8;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.count-stepper button:active {
  transform: translateY(1px);
}

.count-stepper input {
  height: 44px;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  padding: 0 8px;
}

.count-apply {
  min-width: 128px;
  padding: 0 12px;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.count-apply.needs-update {
  border-color: var(--warn);
  background: #fff9ed;
  color: var(--warn);
  font-weight: 900;
}

#guest .booking-page {
  --guest-soft: #fbf8f3;
  --guest-soft-green: #f2faf5;
  --guest-input-line: #cbded6;
  --guest-guide-line: #e3ebe7;
  --guest-focus: rgba(13, 127, 104, 0.16);
}

#guest .field {
  gap: 8px;
}

#guest .field label {
  color: #49665c;
  font-size: 13px;
  letter-spacing: 0;
}

#guest .required-mark {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff1f1;
  color: #a33b35;
  font-size: 10px;
  font-weight: 900;
  vertical-align: 1px;
}

#guest input,
#guest select,
#guest textarea {
  border-color: var(--guest-input-line);
  border-width: 1.5px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(18, 42, 35, 0.03);
}

#guest input,
#guest select {
  min-height: 46px;
}

#guest select#guestTime {
  box-sizing: border-box;
  height: 64px;
  min-height: 64px;
  padding: 0 50px 0 18px;
  line-height: normal;
  border-radius: 16px;
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5-5 5 5M7 14l5 5 5-5' stroke='%2318231f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px 20px;
}

#guest input:focus,
#guest select:focus,
#guest textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--guest-focus);
}

#guest .status-panel {
  border-color: var(--guest-guide-line);
  border-left: 4px solid #b8d8c8;
  border-radius: 10px;
  background: var(--guest-soft-green);
  color: #62736d;
  box-shadow: none;
}

#guest .guest-calendar-panel {
  border-left-width: 1px;
  background: #fffdf9;
}

#guest .capacity-note {
  color: #7a8983;
}

#guest .reservation-guidance {
  border-color: var(--guest-guide-line);
  border-left: 4px solid #d9c4a1;
  border-radius: 10px;
  background: var(--guest-soft);
  box-shadow: none;
}

#guest .count-stepper button,
#guest .count-apply {
  border-color: var(--guest-input-line);
  background: #fff;
}

#guest .count-stepper input {
  border-color: var(--guest-input-line);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 15px;
  border-radius: 8px;
  background: #17362e;
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .layout,
  .booking-page {
    grid-template-columns: 1fr;
  }

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

  .reservation {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .reservation-actions {
    grid-column: 2;
  }

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

  .primary-meta,
  .detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  main {
    padding: 20px 14px 32px;
  }

  .topbar,
  .section-head {
    display: grid;
  }

  .store-status {
    width: 100%;
    justify-content: center;
  }

  .metrics,
  .two-col,
  .three-col,
  .capacity-rule-row,
  .nav {
    grid-template-columns: 1fr;
  }

  .reservation {
    grid-template-columns: 1fr;
  }

  .reservation-actions {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .reservation-meta {
    display: flex;
    flex-wrap: wrap;
  }

  .reservation-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  #adminReplyConfirmPanel.show {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .reservation-note {
    -webkit-line-clamp: 2;
  }

  .payment-control {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .payment-control .capacity-note {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .reminder-queue-head,
  .growth-action-item {
    display: grid;
    align-items: stretch;
  }

  .growth-action-item .toolbar {
    width: 100%;
  }

  .follow-history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-list {
    max-height: none;
  }

  .action-grid,
  .weekday-row {
    grid-template-columns: 1fr;
  }

.guest-hero {
  min-height: 380px;
  padding: 24px;
}

}
