/* Shared layout, controls, and state colours for the browser pages. */
:root {
  --ink: #20252b;
  --muted: #667085;
  --paper: #f4f5f6;
  --surface: #ffffff;
  --line: #d9dde2;
  --soft: #eef0f2;
  --sent: #2563eb;
  --paid: #16a34a;
  --held: #d97706;
  --late: #dc2626;
  --released: #9ca3af;
  --booked: #64748b;
  --white: #ffffff;
  --border-strong: #cbd0d6;
  --hover: #f4f5f6;
  --replay-bg: #f1f2f3;
  --card-muted: #f5f6f7;
  --heading-bg: #f7f8f9;
  --tag-bg: #eff1f3;
  --success-bg: #dcfce7;
  --success-ink: #166534;
  --neutral-tag: #eceff1;
  --red-bg: #fee2e2;
  --red-ink: #991b1b;
  --amber-bg: #fef3c7;
  --amber-ink: #92400e;
  --held-bg: #fff7ed;
  --held-ink: #7c4a03;
  --released-ink: #39404a;
  --flash-bg: #f1f5e9;
  --focus: #64748b;
  --sheet-bg: #ffffff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
}
button, a, textarea {
  font: inherit;
}
button {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: normal;
}
button:hover {
  background: var(--hover);
}
a {
  color: inherit;
}
.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 390px) minmax(320px, 620px);
  gap: 32px;
  justify-content: center;
  align-items: center;
  padding: 18px;
}
.phone {
  width: 390px;
  max-width: 100%;
  height: min(844px, calc(100vh - 36px));
  min-height: 600px;
  border: 1px solid var(--border-strong);
  border-radius: 34px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.top {
  min-height: 55px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}
.panel-toggle {
  display: none;
}
.tabs {
  display: flex;
  gap: 12px;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  flex: 1;
  min-width: 0;
  padding: 8px;
  font-size: 13px;
}
.tabs button.active {
  background: var(--ink);
  color: var(--white);
}
.phone-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.screen {
  overflow: auto;
  flex: 1;
  padding: 16px 16px 20px;
  min-height: 0;
}
/* The calendar keeps its own container across redraws, so a live calendar is never thrown away. */
.calendar-host {
  flex: none;
  height: 640px;
  overflow: auto;
  padding: 0 8px 8px;
}
.phone.calendar-tab .phone-content {
  display: block;
}
.phone.calendar-tab .screen {
  overflow: visible;
}
.talk {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.talk-button {
  width: 116px;
  min-width: 100px;
  min-height: 76px;
  border-radius: 40px;
  background: var(--ink);
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 650;
}
.talk-button.recording {
  background: var(--late);
}
.talk-button small {
  font-size: 12px;
}
.entry {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.entry textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.entry button {
  flex: none;
  font-size: 20px;
}
.side-panel {
  width: 100%;
  max-height: 844px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
}
.side-panel h2 {
  font-size: 18px;
  margin: 0 0 16px;
}
.replay {
  font-size: 11px;
  padding: 7px 14px;
  background: var(--replay-bg);
  border-bottom: 1px solid var(--line);
}
.card, .notice, .quiet, .offer, .owed-row, .citation, .owed-summary {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px;
  margin-bottom: 12px;
}
.card, .offer, .job-block {
  overflow-wrap: anywhere;
}
.notice {
  padding: 9px 11px;
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 44px;
  display: block;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quiet {
  background: var(--card-muted);
  color: var(--muted);
}
.reason {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 10px;
}
.try-saying h2 {
  font-size: 13px;
  margin: 0 0 8px;
}
.try-saying-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.try-saying-lines button {
  min-height: 44px;
  padding: 8px;
  font-size: 12px;
  text-align: left;
  overflow-wrap: anywhere;
}
h1, h2, h3, p {
  margin-top: 0;
}
h2 {
  font-size: 18px;
  margin-bottom: 8px;
}
h3 {
  font-size: 16px;
  margin: 0 0 6px;
}
.subtle, .source, .meta {
  font-size: 12px;
  color: var(--muted);
}
/* The main action stays in view above the talk bar while a long draft scrolls. */
.card .primary {
  position: sticky;
  bottom: 12px;
  box-shadow: 0 -10px 0 0 var(--surface), 0 -24px 14px -8px var(--surface), 0 12px 0 0 var(--surface);
}
.primary {
  width: 100%;
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
  font-weight: 650;
  margin-top: 12px;
}
.money {
  font-size: 28px;
  font-weight: 750;
}
.line-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.line-table td {
  padding: 8px 3px;
  border-bottom: 1px solid var(--soft);
  vertical-align: top;
}
.line-table td:last-child {
  text-align: right;
  white-space: nowrap;
}
.source {
  display: block;
}
.totals {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 14px;
}
.pay-options {
  border-top: 1px solid var(--soft);
  margin-top: 8px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pay-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 15px;
}
.pay-choice input {
  width: 20px;
  height: 20px;
  margin: 0;
}
.customer-form label {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  font-size: 14px;
}
.customer-form input {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.customer-form [role="alert"] {
  color: var(--red-ink);
}
.total {
  font-size: 23px;
  font-weight: 750;
  padding-top: 9px;
}
.tone, .pill {
  display: inline-block;
  border-radius: 99px;
  padding: 3px 8px;
  font-size: 11px;
  background: var(--neutral-tag);
}
.card-status, .card .tone {
  display: block;
  width: fit-content;
  margin-bottom: 8px;
}
.remind-text {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 12px;
  min-height: 96px;
  padding: 8px;
  font: inherit;
}
.remind-label {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.remind-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.remind-actions button {
  flex: 1 1 160px;
  width: auto;
  min-width: 0;
  padding: 8px;
}
.remind-actions .primary {
  position: static;
  box-shadow: none;
}
.late-text {
  color: var(--late);
}
.owed-row, .citation {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 12px;
}
.row-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.row-amount {
  font-weight: 650;
  white-space: nowrap;
}
.row-main strong {
  display: inline;
  overflow-wrap: anywhere;
  min-width: 0;
}
.sheet {
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: 24px 16px;
  overflow: auto;
  background: var(--sheet-bg);
}
.sheet {
  text-align: center;
}
.sheet-close {
  display: block;
  margin-left: auto;
  margin-bottom: 12px;
}
.pay-link {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}
.qr {
  display: block;
  width: min(300px, 100%);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto 12px;
  image-rendering: pixelated;
}
.qr[hidden] { display: none }
.pay-status {
  display: block;
  width: fit-content;
  margin: 8px auto 0;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--neutral-tag);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.paid-status {
  background: none;
  padding: 0;
  font-size: 32px;
  font-weight: 750;
  color: var(--paid);
}
.shared-invoice, .centered {
  text-align: center;
}
.sheet .shared-invoice {
  background: none;
  border: 0;
  padding: 0;
  margin: 12px 0 0;
  font-size: 13px;
}
.qr-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px;
  margin: 12px 0;
}
.qr-card p {
  margin: 0;
}
.mobile-panel {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: var(--surface);
  overflow: auto;
  padding: 18px;
}
.close-panel {
  margin-bottom: 12px;
}
.side-panel a {
  display: inline-block;
  margin-top: 14px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  margin: 12px 0;
}
.legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--state);
  margin-right: 4px;
}
.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.settings-row button {
  flex: 1 1 150px;
}
.settings-row button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}
.calendar-shell {
  min-width: 0;
}
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.cal-grid {
  display: grid;
  grid-template-columns: 38px repeat(5, minmax(0, 1fr));
  font-size: 10px;
  position: relative;
}
.cal-day, .cal-hour {
  padding: 5px 2px;
  text-align: center;
  border: 1px solid var(--line);
  min-width: 0;
}
.cal-day {
  font-weight: 650;
  background: var(--heading-bg);
  min-height: 28px;
}
.cal-time-column {
  display: grid;
  grid-template-rows: 28px repeat(9, 48px);
}
.cal-hour {
  padding-top: 4px;
}
.cal-column {
  position: relative;
  display: grid;
  grid-template-rows: 28px repeat(9, 48px);
  border-right: 1px solid var(--line);
}
.cal-grid.mobile {
  grid-template-columns: 44px minmax(0, 1fr);
}
.cal-grid.mobile .cal-column.hidden-day {
  display: none;
}
.cal-track {
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.job-block {
  position: absolute;
  left: 2px;
  right: 2px;
  z-index: 1;
  border-radius: 7px;
  padding: 4px;
  background: var(--state);
  color: var(--white);
  overflow: hidden;
  font-size: 10px;
  line-height: 1.2;
  cursor: grab;
  transition: top .3s, left .3s, background-color .3s, height .3s;
  touch-action: none;
}
.job-block[data-state="held"] {
  background: var(--held-bg);
  color: var(--held-ink);
  border: 1px dashed var(--held);
}
.job-block[data-state="offered"] {
  background: var(--white);
  color: var(--held-ink);
  border: 1px solid var(--held);
}
.job-block[data-state="released"] {
  color: var(--released-ink);
}
.job-block small {
  display: block;
}
.day-pick {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.day-pick button {
  flex: 1;
  padding: 8px;
  font-size: 12px;
}
.panel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.panel-entry {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
  transition: background-color .8s;
}
.panel-entry.flash {
  background: var(--flash-bg);
}
.panel-head {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.panel-path {
  font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  margin: 6px 0;
}
.kind-tag {
  font-size: 10px;
  padding: 3px 7px;
  background: var(--tag-bg);
  border-radius: 99px;
}
.status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  background: var(--soft);
  color: var(--muted);
}
.status-pill.green {
  background: var(--success-bg);
  color: var(--success-ink);
}
.status-pill.red {
  background: var(--red-bg);
  color: var(--red-ink);
}
.status-pill.amber {
  background: var(--amber-bg);
  color: var(--amber-ink);
}
.panel-extra {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.customer-view, .about-page {
  max-width: 520px;
  margin: 40px auto;
  padding: 16px;
}
.customer-view .card, .about-page .card {
  padding: 24px;
}
@media (max-width: 899px) {
  body {
    background: var(--white);
  }
  .layout {
    display: block;
    padding: 0;
    min-height: 100dvh;
  }
  .phone {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }
  .panel-toggle {
    display: block;
    font-size: 12px;
  }
  .side-panel {
    display: none;
  }
}
@media (max-width: 380px) {
  .talk-button {
    width: 104px;
    min-width: 96px;
  }
  .card {
    padding: 12px;
  }
  .tabs {
    gap: 8px;
    padding: 0 12px 10px;
  }
  .tabs button {
    padding: 8px;
    font-size: 12px;
  }
}

/* Video mode (?video=1): the phone and the panel fill a 1920 x 1080 frame. The capture opens a 1536 x 864 page at
   1.25 pixel density for that size; a CSS zoom here would stop Bryntum's drag (tests/e2e/calendar-drag.spec.js). */
.video .layout {
  justify-content: center;
  align-items: center;
  min-height: 0;
  padding: 8px 0 0;
}
.video .phone {
  height: 820px;
}
.video .side-panel {
  height: 820px;
  overflow: hidden;
}
/* The film names only PayPal and its listed sponsor tools, so model names stay out of frame. */
.video .panel-entry[data-kind="model"] .panel-path {
  display: none;
}

.panel-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 5px;
}

.owed-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  align-items: center;
  margin: 0 0 12px;
}
.owed-summary .money {
  grid-column: 2;
  grid-row: 1 / span 2;
  text-align: right;
}
.owed-summary .meta { grid-column: 1 }
.owed-group {
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
  margin: 4px 0 0;
}
.owed-where {
  margin: 8px 0 0;
}
.owed-summary + .owed-action {
  margin-top: 0;
}
.owed-action {
  min-height: 44px;
  padding: 8px;
}
.owed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.owed-row {
  min-height: 44px;
  padding: 8px;
  margin-bottom: 0;
}
.owed-details {
  display: block;
  margin-top: 3px;
}
.owed-shared {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}
.owed-due {
  display: block;
  font-size: 13px;
}
.owed-late {
  display: inline-block;
  border-radius: 99px;
  padding: 2px 7px;
  background: var(--red-bg);
  color: var(--red-ink);
  font-size: 10px;
  font-weight: 650;
}

.job-block:focus-visible, .job-block.keyboard-preview {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  z-index: 2;
}
.pay-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.pay-links .pay-link {
  margin-top: 0;
  border: 0;
  text-decoration: underline;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mobile-about {
  display: none;
}
@media (max-width: 899px) {
  .mobile-about {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 12px;
  }
}
.stop-reminders {
  display: block;
  margin: 12px auto 0;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  min-height: 44px;
}

/* A new rate said on a card: one tap changes the rate card. */
.rate-change {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 8px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.rate-change p {
  margin: 0;
}

.rate-change .rate-update {
  min-height: 44px;
  padding: 8px 12px;
}
.calendar-host[hidden] + .job-details { display: none; }
.job-details { padding: 12px; background: #fff; border: 1px solid #ddd; border-radius: 8px; }
.job-details button { float: right; }
.waiting-list { margin-top: 16px; }
.waiting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.waiting-row span { min-width: 0; overflow-wrap: anywhere; }
.waiting-row button, .waiting-form button { min-height: 44px; padding: 8px 12px; }
.waiting-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.waiting-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.waiting-form input, .waiting-form select { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; }
.waiting-list [role="alert"] { color: var(--red-ink); }

.job-block[data-state="part"] { background: var(--sent); }
.job-block[data-state="completed"] { background: var(--booked); }
.job-block[data-state="refunded"], .job-block[data-state="cancelled"] { background: var(--released); color: var(--released-ink); }
.visit-form { display: grid; gap: .75rem; margin: 1rem 0; }
.visit-form label { display: grid; gap: .25rem; }
.visit-form input, .visit-form select { max-width: 100%; min-width: 0; padding: .5rem; }
.recovery {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.recovery summary {
  font-weight: 700;
  cursor: pointer;
  min-height: 24px;
}
.recovery p {
  margin: 8px 0;
}
.recovery ol {
  margin: 8px 0;
  padding-left: 20px;
}
.recovery li {
  margin: 4px 0;
}
.recovery li[data-result="chosen"] {
  color: var(--paid);
}
.recovery-stage {
  font-weight: 700;
}
.step {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 12px;
}
.step h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.visit-summary, .visit-confirmed {
  margin: 0;
  font-size: 14px;
}
.new-visit[hidden], .visit-summary[hidden] {
  display: none;
}
.send-why {
  margin: 8px 0;
  font-size: 13px;
  color: var(--muted);
}
.edit-note-row {
  margin-top: 12px;
  display: flex;
}
.edit-note {
  padding: 8px 12px;
  font-size: 14px;
}
