:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: #2b1c16;
  background: #f6f1eb;
  --bg: #f6f1eb;
  --surface: #fffdfa;
  --surface-sub: #faf5ef;
  --surface-hover: #fdfaf6;
  --ink: #2b1c16;
  --muted: #766156;
  --wine: #7d2229;
  --wine-hover: #65191f;
  --wine-soft: #f9edf0;
  --wine-border: #dfb7bf;
  --line: #e4d6cc;
  --line-strong: #d5c1b4;
  --shadow-card: 0 1px 2px rgba(62, 34, 24, 0.05), 0 8px 24px rgba(62, 34, 24, 0.04);
  --shadow-cta: 0 2px 6px rgba(125, 34, 41, 0.24);
  --radius-panel: 16px;
  --radius-control: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

main {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 20px 56px;
}

/* Header */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
}

.masthead-brand { min-width: 0; }

.eyebrow {
  margin: 0 0 3px;
  color: var(--wine);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

h1 {
  font-size: clamp(1.38rem, 3.2vw, 1.75rem);
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  color: var(--ink);
}

h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.3;
  color: var(--ink);
}

p { margin: 0; line-height: 1.55; }

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.login-panel {
  max-width: 440px;
  margin: 24px auto 0;
}

.login-hint {
  margin: -4px 0 16px;
}

/* Controls */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.required-mark {
  color: var(--wine);
  font-weight: 700;
}

form {
  display: grid;
  gap: 10px;
}

input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: #a18d82;
}

input:hover {
  border-color: #bfa597;
}

input:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(125, 34, 41, 0.12);
}

button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--wine);
  border-radius: var(--radius-control);
  padding: 8px 15px;
  color: #fff;
  background: var(--wine);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

button:hover:not(:disabled), .button:hover {
  background: var(--wine-hover);
  border-color: var(--wine-hover);
}

button:active:not(:disabled), .button:active {
  transform: translateY(0.5px);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.quiet {
  background: #fff;
  color: var(--wine);
  border-color: var(--line-strong);
}

.quiet:hover:not(:disabled), a.quiet:hover {
  background: var(--wine-soft);
  border-color: var(--wine-border);
  color: var(--wine-hover);
}

.compact-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Primary CTA: 新增宾客 */
.primary-cta {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-cta);
  letter-spacing: 0.02em;
}

.primary-cta:hover:not(:disabled) {
  box-shadow: 0 3px 10px rgba(125, 34, 41, 0.3);
}

.cta-plus {
  font-size: 1.05em;
  line-height: 1;
  font-weight: 700;
}

.actions, .section-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.section-head {
  justify-content: space-between;
}

.section-head h2 { margin: 0; }

/* Ledger header & search */
.ledger-head {
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.ledger-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ledger-summary {
  font-size: 0.825rem;
  font-variant-numeric: tabular-nums;
}

.ledger-summary:empty { display: none; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 12px;
}

.search-bar input {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--surface-sub);
}

.search-bar input:focus {
  background: #fff;
}

.search-bar button {
  min-height: 40px;
  padding: 8px 14px;
  flex-shrink: 0;
}

.sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-sub);
  font-size: 0.84rem;
}

.sheet-bar-actions {
  gap: 6px;
}

/* Status & feedback banners */
.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.message {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #dfd0c4;
  border-left: 3.5px solid var(--wine);
  background: #faf4ee;
  color: #4f382e;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.5;
}

.message:empty {
  display: none;
}

.message.error {
  border-color: #e4b2af;
  border-left-color: #b82128;
  background: #fef0ef;
  color: #8f1a20;
  font-weight: 600;
}

.message.success {
  border-color: #b5d8c0;
  border-left-color: #257a46;
  background: #edf7f0;
  color: #1c5934;
}

.ledger-panel > .message {
  margin: 0 0 12px;
}

.service-status {
  margin: 0 0 14px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid #e2c593;
  background: #fff6e4;
  color: #5b3d0d;
  font-size: 0.88rem;
}

.service-status strong {
  display: block;
  font-size: 0.92rem;
}

.service-status p {
  margin: 2px 0 0;
}

.service-status[data-kind="error"] {
  background: #fef0ef;
  border-color: #e4b2af;
  color: #821d23;
}

.service-status[data-kind="ok"] {
  background: #edf7f0;
  border-color: #b0d6bc;
  color: #1f5534;
}

/* Semantic Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-sub);
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-pill[data-tone="sent"] {
  background: #eaf5ee;
  border-color: #b7dbc3;
  color: #1c5c36;
}
.status-pill[data-tone="sent"]::before { background: #2a854e; }

.status-pill[data-tone="sending"] {
  background: #ebf3fb;
  border-color: #b8d2ec;
  color: #1a4f82;
}
.status-pill[data-tone="sending"]::before { background: #266fb5; }

.status-pill[data-tone="unclaimed"] {
  background: #fdf3e2;
  border-color: #e8cba0;
  color: #854d0e;
}
.status-pill[data-tone="unclaimed"]::before { background: #c97b18; }

.status-pill[data-tone="running"],
.status-pill[data-tone="queued"] {
  background: #f9edf0;
  border-color: #e0bac2;
  color: #7d2229;
}
.status-pill[data-tone="running"]::before {
  background: #9e2b35;
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.status-pill[data-tone="queued"]::before { background: #9e2b35; }

.status-pill[data-tone="blocked"] {
  background: #fff0e5;
  border-color: #e6bc9c;
  color: #9a3e0c;
}
.status-pill[data-tone="blocked"]::before { background: #d4621a; }

.status-pill[data-tone="failed"] {
  background: #fdeceb;
  border-color: #e6b3b0;
  color: #991b22;
}
.status-pill[data-tone="failed"]::before { background: #cf2a33; }

.status-pill[data-tone="draft"] {
  background: #f9edf0;
  border-color: #dfb7bf;
  color: #7d2229;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Desktop Shared Table */
.guest-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
}

.guest-table .col-guest { width: 24%; }
.guest-table .col-staff { width: 22%; }
.guest-table .col-state { width: 28%; }
.guest-table .col-actions { width: 26%; text-align: right; }

.guest-table th {
  padding: 10px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-sub);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.guest-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.guest-table th:first-child,
.guest-table td:first-child { padding-left: 12px; }

.guest-table th:last-child,
.guest-table td:last-child { padding-right: 12px; }

#history > tr:not(.detail-row):hover {
  background: var(--surface-hover);
}

#history > tr.is-expanded {
  background: #fbf4ef;
}

#history > tr.is-expanded td {
  border-bottom-color: transparent;
}

.guest-name {
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.35;
}

.table-staff {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
}

.staff-name {
  display: block;
  color: #4f3d34;
  font-weight: 500;
}

.table-staff time {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.state-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.state-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.table-actions {
  text-align: right;
}

/* Row action button */
.row-action-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.84rem;
  border-radius: 8px;
}

.row-action-btn .chevron {
  display: inline-block;
  font-size: 0.92em;
  line-height: 1;
  transition: transform 0.18s ease;
  opacity: 0.85;
}

.row-action-btn[aria-expanded="true"] {
  background: var(--wine-soft);
  border-color: var(--wine);
  color: var(--wine);
}

.row-action-btn[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.row-action-btn.is-done {
  border-color: var(--wine-border);
  color: var(--wine);
  background: #fffaf9;
}

.row-action-btn.is-done:hover:not(:disabled) {
  background: var(--wine-soft);
  border-color: var(--wine);
}

/* Inline Draft Row */
.guest-table .draft-row {
  background: #fcf6f2;
}

.guest-table .draft-row td {
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--wine-border);
  vertical-align: bottom;
}

.guest-table .draft-row td:first-child {
  box-shadow: inset 3.5px 0 0 var(--wine);
}

.guest-table .draft-row label {
  margin-bottom: 5px;
  font-size: 0.8rem;
  color: #5e4439;
}

.guest-table .draft-row input {
  min-height: 40px;
  padding: 8px 10px;
}

.guest-table .draft-row .table-state {
  vertical-align: middle;
  padding-top: 28px;
}

.draft-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.draft-actions button {
  min-height: 40px;
  padding: 8px 14px;
}

/* Suspected Duplicate Warning Row */
.guest-table .full-row td {
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.similar-box {
  margin: 10px 0 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e6c690;
  border-left: 4px solid #c97b18;
  background: #fff9ee;
}

.similar-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.similar-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #c97b18;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
}

#similar-text {
  color: #6b4108;
  font-size: 0.9rem;
  font-weight: 600;
}

.similar-matches {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.similar-matches li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #ead8b8;
  border-radius: 10px;
  background: #fffdfa;
}

.similar-item-info {
  min-width: 0;
}

.record-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.record-heading strong {
  font-size: 0.95rem;
  color: var(--ink);
}

.similar-item-meta {
  margin-top: 3px;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.similar-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e6cfa5;
  display: flex;
  justify-content: flex-end;
}

/* Inline Expanded Record Detail */
.detail-row td {
  padding: 0 0 12px !important;
  background: #fbf4ef;
  border-bottom: 1px solid var(--line-strong) !important;
}

.record-detail {
  margin: 0 10px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--wine-border);
  border-left: 4px solid var(--wine);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(125, 34, 41, 0.06);
}

.detail-head {
  gap: 10px;
  margin-bottom: 10px;
}

.detail-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

#result-title {
  font-size: 1.05rem;
  margin: 0;
}

.detail-status {
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
}

.detail-status.is-progress {
  padding: 9px 12px;
  border: 1px solid var(--wine-border);
  border-left: 3.5px solid var(--wine);
  background: var(--wine-soft);
  color: var(--wine);
  font-weight: 600;
}

.detail-status.error {
  padding: 10px 14px;
  border: 1px solid #e4b2af;
  border-left: 3.5px solid #b82128;
  background: #fef0ef;
  color: #8f1a20;
  font-weight: 600;
}

.detail-status.success {
  padding: 8px 12px;
  border: 1px solid #b5d8c0;
  border-left: 3.5px solid #257a46;
  background: #edf7f0;
  color: #1c5934;
  font-weight: 500;
}

.result-share {
  display: grid;
  gap: 12px;
}

.share-main {
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .result-share {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: start;
    gap: 16px;
  }

  .result-share.no-delivery {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }
}

/* Priority 1: Open Invite & Copy Link */
.share-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.share-open,
.share-copy {
  width: 100%;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 650;
}

.share-copy {
  background: #fff;
  color: var(--wine);
  border-color: var(--wine);
}

.share-copy:hover:not(:disabled) {
  background: var(--wine-soft);
}

/* Delivery Registration Strip */
.delivery-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-sub);
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.delivery-card.is-empty {
  display: none;
}

.claim-name {
  max-width: 24rem;
}

.claim-name label {
  margin-bottom: 5px;
}

.delivery-actions {
  gap: 8px;
}

#finish-delivery {
  background: #236e42;
  border-color: #236e42;
}

#finish-delivery:hover:not(:disabled) {
  background: #1b5934;
  border-color: #1b5934;
}

.forward-note {
  font-size: 0.84rem;
  color: #1a4f82;
  background: #ebf3fb;
  border: 1px solid #c5dbf0;
  border-radius: 8px;
  padding: 7px 11px;
}

/* Expandable QR Code */
.qr-disclosure {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.qr-disclosure summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--wine);
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 14px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.qr-disclosure summary::-webkit-details-marker {
  display: none;
}

.qr-disclosure summary::after {
  content: "展开 ▾";
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.qr-disclosure[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--surface-sub);
}

.qr-disclosure[open] summary::after {
  content: "收起 ▴";
}

.qr-body {
  padding: 14px;
  text-align: center;
}

.qr {
  display: block;
  width: min(100%, 212px);
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.qr-caption {
  margin-top: 8px;
  font-size: 0.8rem;
}

#retry-qr {
  margin-top: 10px;
}

/* Link Preview Input */
.link-preview input {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface-sub);
  border-color: var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Inline Delete Footer & Confirmation */
.detail-danger {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.danger-quiet {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #9b1c23;
  background: transparent;
  border-color: #e6b8b5;
}

.danger-quiet:hover:not(:disabled) {
  background: #fdeceb;
  border-color: #cf2a33;
  color: #82161c;
}

.delete-confirm {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid #e4b2af;
  border-left: 3.5px solid #b82128;
  background: #fef0ef;
  color: #7d1920;
  font-size: 0.86rem;
  display: grid;
  gap: 10px;
}

.delete-confirm p {
  margin: 0;
  font-weight: 600;
}

.delete-confirm-actions {
  justify-content: flex-end;
}

.danger-solid {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.85rem;
  background: #b82128;
  border-color: #b82128;
  color: #fff;
}

.danger-solid:hover:not(:disabled) {
  background: #96191f;
  border-color: #96191f;
}

/* Empty & Load more */
.empty-state {
  text-align: center;
  padding: 28px 16px;
  margin: 8px 0 0;
  border-radius: 10px;
  background: var(--surface-sub);
}

.load-more-wrap {
  display: flex;
  justify-content: center;
}

#more {
  margin-top: 14px;
  min-width: 160px;
}

/* Admin lists & shared records */
.records {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

#failures li {
  border-top: 1px solid var(--line);
  padding: 12px 0 6px;
}

#failures p {
  margin: 4px 0 8px;
}

.records a:not(.button) {
  color: var(--wine);
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* Mobile-First Responsive Layout (verified at 360px & 390px) */
@media (max-width: 680px) {
  main {
    padding: 12px 10px 44px;
  }

  .masthead {
    align-items: center;
    margin-bottom: 12px;
    padding: 0 2px;
  }

  .panel {
    padding: 16px 14px;
    border-radius: 14px;
  }

  .ledger-panel {
    padding: 14px 12px 16px;
  }

  .ledger-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 12px;
  }

  .primary-cta {
    width: 100%;
    min-height: 46px;
    font-size: 1rem;
  }

  .search-bar {
    gap: 6px;
    margin: 12px 0 10px;
  }

  .search-bar input {
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .search-bar button {
    padding: 8px 11px;
    font-size: 0.85rem;
  }

  /* Transform table into clean, scannable mobile rows with zero horizontal overflow */
  .guest-table,
  .guest-table tbody {
    display: block;
    width: 100%;
  }

  .guest-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
  }

  .guest-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
  }

  #history > tr:first-child {
    border-top: 1px solid var(--line);
  }

  #history > tr.is-expanded {
    margin: 0 -4px;
    padding: 12px 8px 10px;
    border-radius: 10px 10px 0 0;
    border-bottom: 0;
  }

  .guest-table td,
  .guest-table th {
    padding: 0 !important;
    border: 0 !important;
  }

  .guest-table .table-guest {
    grid-area: 1 / 1;
    min-width: 0;
  }

  .guest-table .table-state {
    grid-area: 1 / 2;
    justify-self: end;
    text-align: right;
  }

  .state-wrap {
    align-items: flex-end;
  }

  .state-meta {
    display: none;
  }

  .guest-table .table-staff {
    grid-area: 2 / 1;
    min-width: 0;
    font-size: 0.79rem;
  }

  .staff-name {
    display: inline;
    color: var(--muted);
    font-weight: 400;
  }

  .table-staff time {
    display: inline;
    margin-top: 0;
  }

  .table-staff .mobile-delivery-note {
    display: block;
    margin-top: 2px;
    font-size: 0.77rem;
    color: #5c4940;
  }

  .guest-table .table-actions {
    grid-area: 2 / 2;
    justify-self: end;
  }

  .row-action-btn {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  .guest-name {
    font-size: 1rem;
  }

  /* Mobile Inline Draft Card */
  .guest-table .draft-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin: 2px 0 10px;
    padding: 14px 12px;
    border: 1px solid var(--wine-border);
    border-left: 4px solid var(--wine);
    border-radius: 12px;
    background: #fcf6f2;
  }

  .guest-table .draft-row td:first-child {
    box-shadow: none;
  }

  .guest-table .draft-row .table-guest,
  .guest-table .draft-row .table-staff,
  .guest-table .draft-row .table-actions {
    grid-area: auto;
    justify-self: stretch;
  }

  .guest-table .draft-row .table-state {
    display: none;
  }

  .draft-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 8px;
    margin-top: 2px;
  }

  .draft-actions button {
    width: 100%;
    min-height: 44px;
  }

  /* Mobile Full Rows (Similar & Expanded Detail) */
  .guest-table .full-row {
    display: block;
    padding: 0;
    border-bottom: 0;
  }

  .guest-table .full-row td {
    display: block;
    width: 100%;
  }

  .similar-box {
    margin: 4px 0 10px;
    padding: 12px;
  }

  .similar-matches li {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .similar-matches li button {
    width: 100%;
  }

  .similar-foot button {
    width: 100%;
  }

  .detail-row {
    margin: 0 -4px 4px;
    padding: 0 4px 10px !important;
    background: #fbf4ef;
    border-radius: 0 0 10px 10px;
    border-bottom: 1px solid var(--line-strong) !important;
  }

  .detail-row td {
    background: transparent !important;
    padding: 0 !important;
    border-bottom: 0 !important;
  }

  .record-detail {
    margin: 0;
    padding: 13px 12px;
    border-radius: 10px;
  }

  .share-primary-actions {
    gap: 8px;
  }

  .delivery-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
  }

  .delivery-actions button {
    width: 100%;
  }
}

@media (min-width: 681px) {
  .table-staff .mobile-delivery-note {
    display: none;
  }
  .table-staff .staff-sep {
    display: none;
  }
}
