/* ---------- Montserrat (self-hosted, works offline) ---------- */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/montserrat-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/montserrat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/montserrat-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/montserrat-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/montserrat-latin-800-normal.woff2') format('woff2'); }

:root {
  color-scheme: light;

  /* ============================================================
     THE PALETTE — these eight hex codes, exactly as supplied.
     Every colored surface in this app resolves to one of them.
     Legibility is handled by the TEXT color, never by altering
     the hex: dark ink clears 4.5:1 on seven of them, and brick
     takes white at 5.0:1.
     ============================================================ */
  --p-coral:   #e7807d;   --on-coral:   #2e2a28;   /* 5.26:1 */
  --p-orchid:  #c977b5;   --on-orchid:  #2e2a28;   /* 4.59:1 */
  --p-blue:    #699fb0;   --on-blue:    #2e2a28;   /* 4.86:1 */
  --p-apricot: #f3ad5a;   --on-apricot: #2e2a28;   /* 7.40:1 */
  --p-sage:    #9cc2b5;   --on-sage:    #2e2a28;   /* 7.31:1 */
  --p-yellow:  #fcd86f;   --on-yellow:  #2e2a28;   /* 10.28:1 */
  --p-grey:    #c0c0c0;   --on-grey:    #2e2a28;   /* 7.81:1 */
  --p-brick:   #c63f3d;   --on-brick:   #ffffff;   /* 5.02:1 */

  /* Soft grounds: the same hexes at reduced alpha over white */
  --wash-coral:   rgba(231, 128, 125, .22);
  --wash-orchid:  rgba(201, 119, 181, .22);
  --wash-blue:    rgba(105, 159, 176, .22);
  --wash-apricot: rgba(243, 173,  90, .24);
  --wash-sage:    rgba(156, 194, 181, .28);
  --wash-yellow:  rgba(252, 216, 111, .32);
  --wash-grey:    rgba(192, 192, 192, .28);
  --wash-brick:   rgba(198,  63,  61, .14);

  /* ===== Roles (each points at a palette hex) ===== */
  --brand: var(--p-blue);           /* primary actions, links, active state */
  --on-brand: var(--on-blue);       /* ink, not white: 4.86:1 on this blue */
  --brand-wash: var(--wash-blue);
  --page: var(--p-sage);            /* the backdrop the app sits on */
  --surface-1: #ffffff;
  --surface-2: #FAF9F7;             /* near-white grounds: hovers, board columns */
  --surface-3: #F5F3F1;

  /* Warm neutral ink & chrome, keyed to the palette's grey */
  --ink: #2e2a28;
  --ink-2: #5f5955;
  --muted: #918a85;
  --grid: #ECE9E6;
  --baseline: var(--p-grey);
  --border: #E7E3DF;
  --shadow: 0 1px 2px rgba(46, 42, 40, .04), 0 6px 20px rgba(46, 42, 40, .06);

  /* Categorical data series — the six chromatic palette hexes, verbatim */
  --series-1: var(--p-blue);
  --series-2: var(--p-coral);
  --series-3: var(--p-apricot);
  --series-4: var(--p-sage);
  --series-5: var(--p-orchid);
  --series-6: var(--p-yellow);

  /* Status */
  --good: var(--p-sage);
  --warning: var(--p-apricot);
  --serious: var(--p-apricot);
  --critical: var(--p-brick);

  /* Booking channels */
  --pf-airbnb:  var(--p-orchid);
  --pf-vrbo:    var(--p-blue);
  --pf-booking: var(--p-sage);
  --pf-direct:  var(--p-apricot);
  --pf-other:   var(--p-grey);

  --accent: var(--brand);
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 16px;
  font-family: 'Montserrat', system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page); color: var(--ink); font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.app { display: flex; background: var(--surface-1); border-radius: 26px; min-height: calc(100vh - 32px); box-shadow: 0 8px 40px rgba(46, 42, 40, .16); }
.sidebar {
  width: 232px; background: var(--surface-1); color: var(--ink);
  border-right: 1px solid var(--border); padding: 24px 0 16px;
  position: sticky; top: 16px; height: calc(100vh - 32px); flex-shrink: 0;
  display: flex; flex-direction: column; border-radius: 26px 0 0 26px;
}
.logo {
  padding: 0 20px 24px;
  display: flex; align-items: center; gap: 10px;
}
/* Brand lockup: the boxed R tile beside the "rentals" wordmark. */
.logo .mark { width: 34px; height: 34px; flex-shrink: 0; display: block; }
.logo .wordmark { height: 23px; width: auto; display: block; margin-top: 3px; }
.nav { flex: 0 0 auto; padding: 0 12px; }
/* Nav: 1pt blue outline on white. Active = blue label, contrasting icon. */
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 6px; color: var(--ink-2); font-weight: 500; font-size: 12.5px;
  border: 1px solid var(--p-blue); background: var(--surface-1);
  border-radius: 10px; text-decoration: none;
}
.nav a svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--muted); }
.nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--p-blue); font-weight: 700; background: var(--surface-1); }
.nav a.active svg { color: var(--p-coral); }
.sidebar .foot { margin-top: auto; padding: 14px 20px 0; font-size: 11px; color: var(--muted); line-height: 1.6; border-top: 1px solid var(--border); margin-left: 12px; margin-right: 12px; }
.main { flex: 1; padding: 28px 32px; min-width: 0; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.5px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 12.5px; font-weight: 500; }
h2 { font-size: 14px; font-weight: 700; margin: 26px 0 10px; letter-spacing: -.2px; }

/* ---------- Cards & stat tiles ---------- */
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 18px;
  padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 14px; margin-bottom: 18px; }
/* White ground, 1pt outline in the tile's palette hex. */
.stat {
  border-radius: 18px; padding: 16px 18px; box-shadow: none;
  background: var(--surface-1); border: 1px solid var(--tile, var(--baseline));
}
.stat.t-blue   { --tile: var(--p-blue); }
.stat.t-yellow { --tile: var(--p-yellow); }
.stat.t-green  { --tile: var(--p-sage); }
.stat.t-purple { --tile: var(--p-orchid); }
.stat.t-pink   { --tile: var(--p-coral); }
.stat .top { display: flex; align-items: center; gap: 7px; }
.stat .icon { width: 15px; height: 15px; color: var(--tile); }
.stat .label { color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.stat .value { font-size: 27px; font-weight: 700; letter-spacing: -1px; margin-top: 6px; }
.stat .hint { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; font-weight: 500; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--grid); }
td { padding: 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: var(--surface-2); }

/* ---------- Controls ---------- */
button, .btn {
  background: var(--brand); border: none; color: var(--on-brand); font: inherit; font-weight: 600; font-size: 12.5px;
  padding: 8px 15px; border-radius: 10px; cursor: pointer; transition: filter .12s;
}
button:hover, .btn:hover { filter: brightness(.9); text-decoration: none; }
button.green { background: var(--p-sage); color: var(--on-sage); }
button.ghost, .btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--baseline); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-3); filter: none; }
button.small { padding: 4px 11px; font-size: 11.5px; border-radius: 8px; }
button.danger { background: var(--p-brick); color: var(--on-brick); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  font: inherit; font-size: 12.5px; padding: 8px 11px; border: 1.5px solid var(--baseline); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--p-blue); box-shadow: 0 0 0 3px var(--wash-blue); }
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin: 12px 0 5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.toolbar select, .toolbar input { width: auto; }

/* ---------- Avatars & chips ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; font-size: 11px; font-weight: 700;
  flex-shrink: 0; letter-spacing: .2px; color: var(--ink);
}
.chip { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.chip.money { background: var(--wash-sage); color: var(--ink); }
.chip.plain { background: #fff; color: var(--ink-2); border-color: var(--baseline); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 700; letter-spacing: .2px; color: var(--ink); }
.badge.airbnb { background: var(--wash-orchid); }
.badge.vrbo { background: var(--wash-blue); }
.badge.booking { background: var(--wash-sage); }
.badge.direct { background: var(--wash-apricot); }
.badge.other { background: var(--wash-grey); }
.badge.st-confirmed { background: var(--wash-sage); }
.badge.st-pending { background: var(--wash-yellow); }
.badge.st-cancelled { background: var(--wash-grey); color: var(--muted); }
.badge.st-blocked { background: var(--wash-grey); }
.badge.st-ready { background: var(--wash-blue); }
.badge.st-queued { background: var(--wash-yellow); }
.badge.st-sent { background: var(--wash-sage); }
.badge.st-draft { background: var(--wash-grey); }
.badge.st-failed { background: var(--wash-brick); }
.badge.st-done { background: var(--wash-sage); }
.badge.st-in_progress { background: var(--wash-blue); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: baseline; }

/* ---------- Alerts ---------- */
.alert {
  border: 1px solid var(--border); border-left: 4px solid var(--p-apricot);
  background: var(--surface-1); border-radius: 12px; padding: 11px 15px; margin-bottom: 8px;
  display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); font-size: 12.5px;
}
.alert.critical { border-left-color: var(--p-brick); }
.alert.info { border-left-color: var(--p-blue); }
.alert .msg { flex: 1; }

/* ---------- Calendar ---------- */
.cal-wrap { overflow-x: auto; padding: 2px 0; }
.cal { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.cal thead th { border: none; }
.cal th.month-band {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--ink);
  text-transform: none; letter-spacing: 0; padding: 2px 8px 7px;
  border-bottom: 1px solid var(--grid);
}
.cal th.dow { font-size: 9px; padding: 6px 0 2px; text-align: center; min-width: 40px; color: var(--muted); font-weight: 600; }
.cal th.dnum { font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 0 0 6px; text-align: center; }
.cal th.today-col { color: var(--ink); }
.cal td { padding: 0; border-bottom: 1px solid var(--grid); border-right: 1px solid var(--grid); height: 52px; min-width: 40px; position: relative; }
.cal td.prop-name {
  position: sticky; left: 0; background: var(--surface-1); z-index: 10; min-width: 196px;
  padding: 6px 12px; font-weight: 600; border-right: 2px solid var(--baseline); white-space: nowrap; font-size: 12.5px;
}
.cal td.prop-name .meta { font-size: 10px; color: var(--muted); font-weight: 500; }
.cal td.day { background: #fff; cursor: pointer; }
.cal td.day.wknd { background: var(--surface-2); }
.cal td.day:not(.occupied):hover { background: var(--wash-blue); }
.cal td.day.occupied { cursor: default; }
.cal td.day.today-col { box-shadow: inset 0 2.5px 0 var(--ink); }
.cal .cell-rate {
  position: absolute; bottom: 5px; left: 6px;
  font-size: 9.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; pointer-events: none;
}
.cal .cell-min { position: absolute; top: 5px; left: 6px; font-size: 9px; color: var(--muted); font-weight: 600; pointer-events: none; }
/* ONE continuous bar per stay: it lives in the first covered cell and overflows
   across the rest, so no gridline cuts through it. Width comes from --cw, the
   measured day-cell width. */
.cal .res-bar {
  position: absolute; top: 50%; transform: translateY(-50%); height: 27px;
  border-radius: 7px; z-index: 5;
  font-size: 11px; font-weight: 650; overflow: hidden; white-space: nowrap;
  padding: 0 8px 0 5px; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.cal .res-bar.open-left { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal .res-bar.open-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal .res-bar .pf {
  width: 17px; height: 17px; border-radius: 5px; background: rgba(255,255,255,.92);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 800; flex-shrink: 0;
}
.cal .res-bar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal .res-bar.blocked { background: repeating-linear-gradient(45deg, var(--p-grey), var(--p-grey) 5px, rgba(255,255,255,.55) 5px, rgba(255,255,255,.55) 10px) !important; }
.cal-legend { display: flex; gap: 16px; align-items: center; font-size: 11.5px; color: var(--ink-2); margin-top: 12px; flex-wrap: wrap; font-weight: 500; }
.cal-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .sw { width: 16px; height: 10px; border-radius: 3px; }

/* ================= INTERNAL NOTES ================= */
.pulse { position: relative; display: inline-flex; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(.24,.6,.35,1) infinite;
}
.pulse.p-urgent { background: var(--p-brick); }
.pulse.p-urgent::after { color: rgba(198,63,61,.6); animation-duration: 1.4s; }
.pulse.p-high { background: var(--p-apricot); }
.pulse.p-high::after { color: rgba(243,173,90,.75); animation-duration: 2.2s; }
.pulse.p-normal { background: var(--p-blue); }
.pulse.p-normal::after { animation: none; }
.pulse.p-low { background: var(--p-grey); }
.pulse.p-low::after { animation: none; }
.pulse.done { background: var(--p-sage); }
.pulse.done::after { animation: none; }
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: .7; }
  70%  { box-shadow: 0 0 0 9px transparent; opacity: 0; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .pulse::after { animation: none !important; } }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 12px; min-height: 140px; }
.board-col > h3 {
  margin: 2px 4px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); display: flex; align-items: center; gap: 7px;
}
.board-col > h3 .count {
  background: var(--surface-1); border: 1px solid var(--baseline); color: var(--ink-2);
  border-radius: 20px; padding: 1px 8px; font-size: 10.5px; letter-spacing: 0;
}
.board-empty { color: var(--muted); font-size: 11.5px; padding: 10px 6px 14px; text-align: center; }

.note-card {
  background: var(--surface-1); border: 1px solid var(--border); border-left: 4px solid var(--nc, var(--baseline));
  border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(46,42,40,.05); transition: box-shadow .14s, transform .14s;
}
.note-card:hover { box-shadow: 0 4px 16px rgba(46,42,40,.10); transform: translateY(-1px); }
.note-card:last-child { margin-bottom: 0; }
.note-card.is-urgent { border-color: rgba(198,63,61,.35); }
.note-card.is-resolved { opacity: .72; }
.note-card .nc-top { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.note-card .nc-unit {
  font-size: 10.5px; font-weight: 700; color: var(--ink); letter-spacing: .2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.note-card .nc-unit .sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.note-card .nc-title { font-weight: 650; font-size: 13px; line-height: 1.35; margin-bottom: 4px; }
.note-card.is-resolved .nc-title { text-decoration: line-through; text-decoration-color: var(--muted); }
.note-card .nc-body {
  font-size: 11.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 9px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.note-card .nc-foot { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted); }
.note-card .nc-foot .spacer { flex: 1; }
.note-card .nc-actions { display: flex; gap: 5px; margin-top: 10px; }
.note-card .nc-actions button { flex: 1; }

.assignee {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 650; color: var(--ink-2);
  background: var(--surface-3); border: 1px solid var(--grid); border-radius: 20px; padding: 2px 8px 2px 2px;
}
.assignee .av { width: 17px; height: 17px; border-radius: 5px; font-size: 8.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.assignee.unassigned { color: var(--ink); background: var(--wash-apricot); border-color: rgba(243,173,90,.35); padding-left: 8px; }

.prio-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.prio-tag.urgent { color: var(--p-brick); }
.prio-tag.high { color: #a3701f; }
.prio-tag.normal, .prio-tag.low { color: var(--muted); }
.overdue-tag { color: var(--p-brick); font-weight: 700; }

.attention {
  background: var(--surface-1); border: 1px solid var(--border); border-left: 4px solid var(--p-apricot);
  border-radius: 14px; padding: 14px 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.attention .att-top { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.attention .att-title { font-weight: 700; font-size: 14px; }
.attention .att-list { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.attention .att-row {
  display: flex; align-items: center; gap: 9px; font-size: 12.5px; cursor: pointer;
  padding: 7px 10px; border-radius: 10px; border: 1px solid var(--grid);
}
.attention .att-row:hover { background: var(--surface-2); }
.attention .att-row .u { font-weight: 700; font-size: 10.5px; }
.attention .att-row .u .sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.attention .att-row .spacer { flex: 1; }

.nav a .nav-badge {
  margin-left: auto; background: var(--p-apricot); color: var(--on-apricot); border-radius: 20px;
  font-size: 10px; font-weight: 700; padding: 1px 7px; min-width: 19px; text-align: center;
}
.nav a .nav-badge.calm { background: var(--p-grey); color: var(--on-grey); }

.whoami { display: flex; align-items: center; gap: 9px; padding: 10px 12px; margin: 0 12px 8px;
  border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface-1); }
.whoami:hover { background: var(--surface-3); }
.whoami .label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
.whoami .name { font-size: 12.5px; font-weight: 650; }

.thread { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.thread .msg { display: flex; gap: 10px; }
.thread .msg .bubble { background: var(--surface-3); border: 1px solid var(--grid); border-radius: 12px; padding: 9px 12px; font-size: 12.5px; line-height: 1.55; flex: 1; }
.thread .msg .who { font-weight: 700; font-size: 11.5px; margin-bottom: 2px; }
.thread .msg .when { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.thread .sys { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; padding-left: 4px; }
.thread .sys::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--baseline); flex-shrink: 0; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: transparent; color: var(--ink-2); padding: 5px 12px; border-radius: 8px; font-size: 11.5px; font-weight: 650; }
.seg button:hover { background: rgba(255,255,255,.8); color: var(--ink); filter: none; }
.seg button.on { background: var(--surface-1); color: var(--p-blue); box-shadow: 0 1px 3px rgba(46,42,40,.15); }

/* ---------- Charts ---------- */
.chart-box { position: relative; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; flex-wrap: wrap; font-weight: 500; }
.chart-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .swatch { width: 12px; height: 12px; border-radius: 3px; }
.donut-row { display: flex; align-items: center; gap: 18px; }
.donut-legend { font-size: 12px; color: var(--ink-2); line-height: 2; min-width: 0; font-weight: 500; }
.donut-legend .key { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.donut-legend .swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.donut-legend .v { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; padding-left: 14px; }
.tooltip {
  position: fixed; pointer-events: none; background: var(--ink); color: #fff; padding: 7px 11px;
  border-radius: 9px; font-size: 11.5px; z-index: 50; display: none; max-width: 260px; line-height: 1.5; font-weight: 500;
  box-shadow: 0 4px 16px rgba(46,42,40,.32);
}

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(46, 42, 40, .42); z-index: 20; display: flex; align-items: flex-start; justify-content: center; padding: 44px 16px; overflow: auto; backdrop-filter: blur(2px); }
.modal { background: var(--surface-1); border-radius: 20px; padding: 22px 24px; width: 620px; max-width: 100%; box-shadow: 0 12px 44px rgba(46,42,40,.26); }
.modal h3 { margin: 0 0 6px; font-size: 16px; letter-spacing: -.2px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.copybox { background: var(--surface-3); border: 1px solid var(--grid); border-radius: 8px; padding: 7px 10px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; word-break: break-all; }
.msg-body { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--grid); border-radius: 12px; padding: 12px 14px; margin-top: 8px; line-height: 1.6; font-size: 12.5px; }
.pill-tabs { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 3px; gap: 2px; }
.pill-tabs button { background: transparent; color: var(--ink-2); padding: 6px 14px; border-radius: 9px; font-size: 12px; font-weight: 600; }
.pill-tabs button:hover { background: rgba(255,255,255,.8); color: var(--ink); filter: none; }
.pill-tabs button.active { background: var(--surface-1); color: var(--p-blue); box-shadow: 0 1px 3px rgba(46,42,40,.14); }

/* ---------- Upcoming-dates list ----------
   Hairline rows on white (see BRAND.md). Color enters only as a 3px left rule.
   A booking you haven't acknowledged is marked with a 1px outline, never a fill. */
.date-group {
  font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted); padding: 18px 0 7px;
}
.date-group:first-child { padding-top: 4px; }
.date-list { }
.date-row {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 12px; border-bottom: 1px solid var(--grid);
  cursor: pointer; background: none;
}
.date-row:hover { background: var(--surface-2); }
.date-row .rule { width: 3px; align-self: stretch; min-height: 30px; border-radius: 2px; background: var(--rowc, var(--p-grey)); flex-shrink: 0; }
.date-row .dl-main { min-width: 0; }
.date-row .dl-dates { font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; }
.date-row .dl-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.date-row .dl-right { margin-left: auto; text-align: right; flex-shrink: 0; }
.date-row .dl-meta { font-size: 11.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.date-row .dl-meta .pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--rowc); }
.date-row .dl-action { font-size: 11px; color: var(--muted); margin-top: 3px; opacity: 0; transition: opacity .12s; }
.date-row:hover .dl-action { opacity: 1; }
/* Yellow = "you haven't seen this yet". Brick is reserved for emergencies. */
.date-row.is-new {
  border-bottom-color: transparent; border-radius: 9px;
  box-shadow: inset 0 0 0 1.5px var(--p-yellow);
}
.date-row.is-new .dl-action { opacity: 1; color: #8a6a12; font-weight: 600; }
.new-flag {
  border: 1px solid var(--p-yellow); background: var(--wash-yellow); color: #7d5f0f;
  font-size: 9px; font-weight: 700; letter-spacing: .6px; padding: 1px 6px; border-radius: 4px;
}

/* Signed-in identity + sign out */
.whoami { cursor: default; }
.whoami .acct { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.whoami .out { font-size: 10.5px; color: var(--muted); font-weight: 600; cursor: pointer; }
.whoami .out:hover { color: var(--p-blue); }
.whoami .out[data-act=out]:hover { color: var(--p-brick); }

/* Single-column form layout inside a modal */
.form-grid.one { grid-template-columns: 1fr; }

/* Inline form feedback — amber for "needs attention", sage for done. Red stays for emergencies. */
.formmsg { font-size: 12px; font-weight: 600; margin-top: 12px; padding: 0; }
.formmsg:empty { display: none; }
.formmsg.err { color: var(--ink); background: rgba(243,173,90,.18); border-left: 3px solid var(--p-apricot); padding: 8px 11px; border-radius: 0 8px 8px 0; }
.formmsg.ok  { color: var(--ink); background: rgba(156,194,181,.22); border-left: 3px solid var(--p-sage); padding: 8px 11px; border-radius: 0 8px 8px 0; }
.date-list.is-sample { opacity: .55; pointer-events: none; }

/* ---------- Notes button: pulses for 30s after each load, then rests ---------- */
@keyframes nav-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(243, 173, 90, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(243, 173, 90, .30); }
}
.nav a.pulsing { animation: nav-pulse 1.6s ease-in-out infinite; border-color: var(--p-apricot); }
@media (prefers-reduced-motion: reduce) { .nav a.pulsing { animation: none; } }

/* ---------- Sync health: a thin bar, quiet unless something is wrong ---------- */
.syncbar {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  padding: 7px 14px; margin-bottom: 16px; font-size: 12px; cursor: pointer;
}
.syncbar:hover { background: var(--surface-2); }
.syncbar .sb-label { font-weight: 650; }
.syncbar .sb-status { font-size: 11.5px; }
.syncbar .sb-caret { color: var(--muted); font-size: 10px; }
.syncbar .warn-tri { width: 15px; height: 15px; display: block; }
.syncbar.has-trouble { border-color: var(--p-brick); }

/* ---------- Collapsible cards ---------- */
.collapser { padding-bottom: 20px; }
.collapser-head { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.collapser-head .collapser-caret { color: var(--muted); font-size: 11px; transition: transform .15s; }
.collapser-body { margin-top: 14px; }
.collapser.is-closed { padding-bottom: 16px; }
.collapser.is-closed .collapser-body { display: none; }
.collapser.is-closed .collapser-caret { transform: rotate(-90deg); }

/* PriceSense rate move */
.ps-move { font-size: 12px; font-weight: 500; margin-left: 6px; font-variant-numeric: tabular-nums; }
.ps-move.up { color: var(--tint-sage-ink, #2e7a5e); }
.ps-move.down { color: #8a5510; }
.ps-move b { font-weight: 700; }

/* Revoked accounts and spent invitations: present, but visibly out of play. */
.date-row.is-off { opacity: .55; }
.date-row.is-off b { text-decoration: line-through; text-decoration-color: var(--muted); }
button.small.danger { background: var(--p-brick); color: var(--on-brick); }
