.reference-guest main {
  background: var(--surface);
}
.reference-guest .page-heading {
  margin-bottom: 22px;
}
.guest-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
}
.guest-tools .reference-search {
  display: flex;
  flex-direction: row;
  width: min(100%, 620px);
  min-width: 0;
}
.guest-tools .reference-search input {
  width: 100%;
  font-weight: 400;
}
.reference-guest #guest-month-slot:empty {display:none;}
.guest-tools .reference-search svg, .guest-source svg { flex: none; }
.guest-source {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.guest-source svg,
.guest-header-date svg {
  width: 16px;
  height: 16px;
}
.guest-tabs {
  display: flex;
  gap: 4px;
  padding: 2px 0 8px;
}
.guest-tools .guest-tabs { grid-column: 1 / -1; }
.guest-tabs button {
  border: 0;
  padding: 7px 15px;
  min-height: 32px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: transparent;
}
.guest-tabs button[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--green-dark);
}
.reference-guest .guest-ledger th {
  background: var(--surface);
  text-align: left;
  height: 46px;
  padding: 11px 9px;
  white-space: nowrap;
}
.reference-guest .guest-ledger td {
  padding: 15px 9px;
  font-variant-numeric: tabular-nums;
}
.guest-ledger tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface) 97%, var(--ink));
}
.guest-ledger tbody tr:is(.selected, :hover) {
  background: var(--green-soft);
}
.reference-guest .guest-ledger .past-row td,
.reference-guest .guest-ledger .past-row td:first-child {color:var(--muted);font-weight:400;}
.reference-guest .guest-ledger .past-row .finance-status {background:var(--line);color:var(--muted);}
.guest-ledger .column-sort {display:inline-flex; align-items:center; gap:4px;}
.guest-ledger .name-sort-menu summary svg {width:14px;height:14px;}
.guest-ledger .name-sort-menu > summary {width:auto;gap:5px;font:inherit;color:inherit;}
.guest-ledger .name-sort-options {top:100%;}
.guest-ledger .name-sort-menu.is-filtered summary,.guest-ledger .name-sort-options [aria-pressed="true"] {background:var(--green-soft);}
.guest-ledger th:has(.name-sort-menu[open]) {z-index:4;}
.arrival-outstanding {padding:0 calc(1px + var(--card-pad) + var(--chevron) + var(--icon-gap)) 0 calc(1px + var(--card-pad) + var(--icon) + var(--icon-gap));font-weight:650;}
.arrival-outstanding.paid {color:var(--green-dark);}
.arrival-outstanding.due {color:var(--amber);}
.guest-ledger .guest-no-results {
  color: var(--muted);
  text-align: center;
}
.guest-split.has-selection .guest-ledger tbody {
  filter: blur(2.5px);
}
.guest-register:has(.name-sort-menu[open]) {min-height:min(240px,60dvh);}
.guest-header-date {
  display: inline-flex;
  position: relative;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.guest-header-date input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  padding: 0;
  min-height: 0;
}
.guest-header-date:is(.is-filtered, :focus-within) {
  box-shadow: 0 2px var(--green);
}
.guest-header-date svg {
  color: var(--green-dark);
}
.reference-guest .guest-detail.booking-card {
  --card-pad: 16px;
  --icon: 17px;
  --icon-gap: 8px;
  --chevron: 12px;
  width: min(598px, 100vw);
  padding: 18px;
  background: var(--surface);
  color: var(--ink);
}
.booking-mast {
  position: sticky;
  top: -18px;
  z-index: 2;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 14px;
  padding-block: 8px;
  margin: -8px 0 8px;
}
.booking-brand {
  display: grid;
  justify-items: start;
  gap: 4px;
  color: var(--ink);
}
.booking-brand img { width: 142px; height: 32px; object-fit: cover; }
.night-mode .booking-brand img { filter: invert(1); }
.booking-brand span { font-size: 9px; letter-spacing: .21em; }
.booking-demo {
  margin-left: auto;
  font-size: 10px;
  border-radius: 20px;
  padding: 5px 10px;
  background: var(--green-soft);
  color: var(--green-dark);
}
.booking-mast .guest-close {
  margin-left: auto;
  flex: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 23px;
  padding: 0;
}
.booking-mast .booking-demo + .guest-close {
  margin-left: 0;
}
.booking-paper {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.reference-guest .guest-detail .booking-paper h2 {
  font:
    700 clamp(27px, 3vw, 36px) / 1.15 Georgia,
    serif;
  color: var(--green-dark);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.booking-meta {
  display: flex;
  gap: 8px 15px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 12px;
}
.booking-meta span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.booking-meta svg,
.booking-footer svg {
  color: var(--green-dark);
  width: var(--icon);
  height: var(--icon);
}
.guest-scope {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 15px;
  font-size: 12px;
  font-weight: 500;
  max-width: 100%;
}
.guest-scope select {
  width: auto;
  min-height: 33px;
  font-size: 12px;
  min-width: 0;
  padding: 4px 32px 4px 9px;
}
.booking-section {
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 0 0 8px;
}
.booking-section.major {
  background: color-mix(in srgb, var(--green-soft) 22%, var(--surface));
}
.booking-section.major.paid {
  background: color-mix(in srgb, var(--green-soft) 62%, var(--surface));
}
.booking-section.major.due {
  background: color-mix(in srgb, #fff0e2 88%, var(--surface));
  border-color: #f1decf;
}
.booking-section summary {
  display: grid;
  align-items: center;
  grid-template-columns: var(--icon) minmax(0, 1fr) auto var(--chevron);
  gap: var(--icon-gap);
  padding: 10px var(--card-pad);
  cursor: pointer;
  list-style: none;
  min-height: 39px;
}
.booking-section summary::-webkit-details-marker {
  display: none;
}
.booking-section summary svg {
  width: var(--icon);
  height: var(--icon);
  color: var(--green-dark);
}
.booking-chevron {
  border-bottom: 1.4px solid var(--green-dark);
  border-right: 1.4px solid var(--green-dark);
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  justify-self: center;
}
.booking-section[open] .booking-chevron {
  transform: rotate(225deg);
}
.booking-heading,
.booking-amount {
  line-height: 1.3;
  font-family: inherit;
  font-weight: 400;
  font-size: 13px;
}
.booking-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.booking-section.major summary {
  padding-top: 13px;
  padding-bottom: 13px;
  color: var(--green-dark);
}
.booking-section.major .booking-heading > span {
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 700;
}
.booking-section.major .booking-amount {
  font-size: 18px;
  font-weight: 700;
}
.booking-heading small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  margin-top: 3px;
  color: var(--muted);
}
.booking-section.major.paid summary {
  color: #176939;
}
.booking-section.major.due summary {
  color: #b44b0e;
}
.booking-section.refund .booking-amount,
.refund-amount {
  color: var(--red);
}
.booking-breakdown-content {
  padding: 5px calc(var(--card-pad) + var(--chevron) + var(--icon-gap)) 10px
    calc(var(--card-pad) + var(--icon) + var(--icon-gap));
}
.booking-line,
.booking-note,
.booking-mini-table {
  font-size: 12px;
}
.booking-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}
.booking-line > span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.booking-paper h2, .booking-heading, .booking-line {overflow-wrap:anywhere;}
.booking-refund-detail .booking-line {
  display: grid;
  grid-template-columns: 40% 1fr;
}
.booking-refund-detail .booking-line > span:last-child {
  text-align: left;
}
.booking-note {
  color: var(--muted);
  margin: 6px 0;
  line-height: 1.5;
}
.booking-mini-table {
  min-width: 0;
  width: 100%;
  table-layout: auto;
  margin: 2px 0;
}
.booking-mini-table th,
.booking-mini-table td {
  padding: 6px 2px;
  font-size: 12px;
  font-weight: 400;
  white-space: normal;
  text-align: left;
  color: var(--ink);
}
.booking-mini-table th {
  position: static;
  text-transform: none;
  font-weight: 600;
  background: color-mix(in srgb, var(--surface) 96%, var(--ink));
  letter-spacing: 0;
}
.booking-mini-table tbody tr:hover {background:transparent;}
.booking-mini-table td:last-child,
.booking-mini-table th:last-child {
  padding-right: 0;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.booking-mini-table button {
  padding: 0;
  min-height: 22px;
  border: none;
  background: transparent;
  color: var(--green-dark);
  text-decoration: underline;
}
.booking-divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 14px 0;
}
.booking-footer {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 17px;
  padding-top: 12px;
}
.booking-footer a,
.booking-footer button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  text-decoration: none;
  min-height: 32px;
}
.booking-footer button.send-invoices {
  padding: 6px 11px;
  color: #fff;
  background: #18543b;
  border-radius: 6px;
}
.booking-section:last-of-type {
  background: color-mix(in srgb, var(--surface) 96%, var(--ink));
}
.night-mode .booking-section.major.due {
  background: #352a20;
  border-color: #59442f;
}
.night-mode .booking-section.major.due summary {
  color: #efbb6b;
}
.night-mode .booking-section.major.paid summary {
  color: #8bd5aa;
}
@media (max-width: 580px) {
  .reference-guest .guest-detail.booking-card {
    padding: 10px 6px max(12px, env(safe-area-inset-bottom));
    --card-pad: 8px;
    --icon: 15px;
    --icon-gap: 6px;
  }
  .booking-paper {
    padding: 10px 8px;
  }
  .booking-mast {top:-10px;padding-inline:4px;}
  .guest-scope label {max-width:100%;}
  .booking-section summary, .guest-tabs button, .guest-scope select {min-height:44px;}
  .guest-tools {gap:4px 8px;}
  .guest-tools .reference-search {grid-column:1 / -1;width:100%;height:44px;}
  .guest-tools .reference-search input, .guest-name-editor input, .guest-scope select {font-size:16px;}
  .guest-tools .guest-source {grid-column:2;grid-row:2;justify-self:end;gap:4px;max-width:45vw;font-size:11px;}
  .guest-tools .guest-tabs {grid-column:1;grid-row:2;padding-block:4px;}
  .reference-guest .guest-ledger tr {background-color:var(--surface);}
  .reference-guest .guest-ledger tbody tr:nth-child(even) {background-color:color-mix(in srgb,var(--surface) 97%,var(--ink));}
  .reference-guest .guest-ledger tbody tr.selected {background-color:var(--green-soft);}
  .reference-guest .guest-ledger tr > :first-child:not([colspan]) {position:sticky;left:0;z-index:1;box-shadow:1px 0 var(--line);}
  .reference-guest .guest-ledger td:first-child {background-color:inherit;}
  .reference-guest .guest-ledger thead th:first-child {z-index:2;}
  .reference-guest .guest-ledger th {padding-block:3px;}
  .guest-ledger .name-sort-menu > summary, .guest-header-date {min-height:42px;}
  .booking-footer {display:grid;grid-template-columns:1fr auto;gap:4px 12px;}
  .booking-footer :is(a,button) {min-height:44px;justify-content:center;}
  .booking-footer a {justify-content:start;}
  .booking-section.major .booking-heading > span {
    font-size: 12px;
  }
  .booking-section.major .booking-amount {
    font-size: 15px;
  }
  .booking-mini-table td,
  .booking-mini-table th {
    font-size: 12px;
  }
  .booking-meta {
    font-size: 11px;
  }
}
@media (max-width: 360px) {
  #app.reference-guest .page-heading h1 {font-size:28px;}
  .reference-guest #page-actions button {padding-inline:8px;gap:5px;}
}

.booking-mini-table.booking-shared-axis {
  table-layout: fixed;
}
.booking-shared-axis th:first-child {
  width: 30%;
}
.booking-shared-axis th:last-child {
  width: 28%;
}
.booking-refund-detail .booking-line {
  grid-template-columns: 30% 1fr;
  gap: 2px;
}
.booking-shared-axis td {
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .booking-mini-table.booking-shared-axis {table-layout:auto;}
  .booking-shared-axis th:first-child, .booking-shared-axis th:last-child {width:auto;}
  /* Stack the date and method below each payment, keeping its amount on the card's numeric axis. */
  .booking-payments, .booking-payments tbody {display:block;}
  .booking-payments thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
  .booking-payments tbody tr {
    display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;
    gap:3px 8px;padding-block:8px;border-top:1px solid var(--line);
  }
  .booking-payments tbody td {padding:0;border:0;}
  .booking-payments tbody td:first-child {grid-area:2 / 1;color:var(--muted);}
  .booking-payments tbody td:nth-child(2) {grid-area:1 / 1;}
  .booking-payments tbody td:nth-child(3) {grid-area:2 / 2;color:var(--muted);text-align:right;}
  .booking-payments tbody td:last-child {grid-area:1 / 2;}
}
@media (min-width: 1220px) {
  #app.reference-guest:has(.guest-split.has-selection) main {
    margin-right: min(38vw, 598px);
    padding-right: 16px;
    padding-left: 20px;
  }
  .reference-guest .guest-detail.booking-card {
    width: min(38vw, 598px);
  }
}

.guest-base-caption {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.booking-line:has(.guest-base-caption) > span:last-child {
  flex: none;
  white-space: nowrap;
}

.invoice-preview input[type=checkbox] {width:17px;height:17px;min-height:0;accent-color:var(--green);cursor:pointer;}

.reference-guest .guest-ledger th .guest-header-date {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}

.guest-scope label, .guest-name-editor { display: inline-flex; align-items: center; gap: .5rem; }
.guest-scope { flex-wrap: wrap; }
.guest-scope button[aria-label="Edit guest name"] { display: inline-grid; place-items: center; padding: .4rem; }
.guest-scope .ui-icon { width: 16px; height: 16px; }
.guest-name-editor { flex-wrap: wrap; }
.guest-name-editor input { min-width: 0; max-width: 100%; }
