/* The look of qxsoftware.net for everything a client sees (pages under the "brand" layout). Light colours only.
   Everything is scoped to body.brand so the owner's and salesperson's screens are untouched. */
body.brand {
  --blue: #262262;
  --sky: #0776b4;
  --gold: #cf945f;
  --ink: #17143f;
  --cream: #f7f3ea;
  --brand-muted: #6b6874;
  --page: #fbfaf7;
  --border: #2622621f;
  --tick: #b9773f;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.brand a { color: var(--sky); }

body.brand .brand-header { background: var(--ink); }
body.brand .brand-header-inner { width: min(560px, 100% - 32px); margin: 0 auto; padding: 8px 0; }
body.brand .brand-logo-link { display: inline-block; line-height: 0; }
body.brand .brand-logo { display: block; height: 52px; width: auto; }

body.brand main.brand-main { flex: 1; width: min(560px, 100% - 32px); margin: 0 auto; padding: 28px 0 24px; }
body.brand h1 { font-size: clamp(1.9rem, 7vw, 2.5rem); line-height: 1.08; letter-spacing: -.04em; font-weight: 800; color: var(--blue); margin: 4px 0 12px; }
body.brand h2 { letter-spacing: -.03em; color: var(--blue); }
body.brand .eyebrow { margin: 0 0 6px; color: var(--tick); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
body.brand .lead { color: var(--brand-muted); font-size: 1.05rem; }
body.brand .muted, body.brand .small { color: var(--brand-muted); }
body.brand .center { text-align: center; }

/* Plan card, like the website's pricing cards */
body.brand .plan-card, body.brand .card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 24px 22px;
  margin: 18px 0;
  box-shadow: 0 18px 45px #2622621a;
}
body.brand .plan-card h2 { margin: 0; font-size: 1.7rem; line-height: 1.1; }
body.brand .plan-card .big-price { margin: 10px 0 14px; font-size: 2.3rem; line-height: 1.1; font-weight: 800; letter-spacing: -.04em; color: var(--blue); }
body.brand .plan-card .big-price small { font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--brand-muted); }
body.brand .plan-card .total { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--border); color: var(--blue); font-size: 1.05rem; }
body.brand .plan-card .also { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-weight: 700; color: var(--blue); }
body.brand .plan-card .plan-action { margin: 18px 0 0; }
body.brand .ticks { list-style: none; margin: 0; padding: 0; line-height: 1.5; }
body.brand .ticks li { position: relative; padding: 4px 0 4px 26px; }
body.brand .ticks li::before { content: "\2713"; position: absolute; left: 2px; top: 4px; color: var(--tick); font-weight: 800; }

/* Gold pill buttons with navy text */
body.brand a.button, body.brand input[type="submit"], body.brand button {
  display: inline-block;
  padding: 14px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 30px #cf945f55;
}
body.brand a.button.big, body.brand input[type="submit"].big { display: block; width: 100%; padding: 16px; font-size: 1.1rem; }
body.brand a.button:focus-visible, body.brand input:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
body.brand .text-link { color: var(--blue); font-weight: 700; }

/* Checkout-style form */
body.brand label { display: block; margin: 14px 0 6px; font-size: .9rem; font-weight: 700; color: var(--blue); }
body.brand input[type="email"], body.brand input[type="text"], body.brand input[type="tel"], body.brand textarea {
  width: 100%;
  padding: 14px 16px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
body.brand input:focus { outline: 3px solid #0776b433; border-color: var(--sky); }
body.brand .terms { display: flex; gap: 10px; align-items: flex-start; margin: 20px 0; font-size: .9rem; color: var(--brand-muted); }
body.brand .terms input { margin-top: 5px; accent-color: var(--blue); }
body.brand .terms label { display: inline; margin: 0; font-weight: 400; color: inherit; }
body.brand .after { margin-top: 18px; font-size: .9rem; }
body.brand .flash { padding: 12px 16px; border-radius: 16px; margin: 12px 0; }
body.brand .flash.alert { background: #fbeaea; color: #a12626; }
body.brand .flash.notice { background: var(--cream); color: var(--blue); }
body.brand .signup-steps { display: flex; gap: 8px; list-style: none; margin: 0 0 18px; padding: 0; font-size: .85rem; font-weight: 700; }
body.brand .signup-steps li { padding: 6px 12px; border-radius: 999px; background: var(--cream); color: var(--brand-muted); }
body.brand .signup-steps li[aria-current="step"] { background: var(--blue); color: #fff; }
body.brand .summary-line { padding: 14px 18px; border-radius: 18px; background: var(--cream); color: var(--blue); }

/* Invoice */
body.brand .invoice-status { display: inline-block; margin: 0 0 14px; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: .9rem; }
body.brand .invoice-status.paid { background: #e7f4ec; color: #1d6b3f; }
body.brand .invoice-status.owed { background: #fbeee0; color: #8a4f1a; }
body.brand .invoice-status.cancelled { background: var(--cream); color: var(--brand-muted); }
body.brand .invoice-meta { color: var(--brand-muted); font-size: .92rem; }
body.brand .invoice-meta strong { color: var(--ink); }
body.brand table.prices { width: 100%; border-collapse: collapse; margin: 14px 0 0; background: transparent; font-size: .95rem; }
body.brand table.prices th { text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-muted); font-weight: 700; padding: 6px 4px; border-bottom: 1px solid var(--border); }
body.brand table.prices td { padding: 10px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
body.brand table.prices th:nth-child(n+2), body.brand table.prices td:nth-child(n+2) { text-align: right; white-space: nowrap; }
body.brand table.prices tfoot td { border-bottom: 0; }
body.brand table.prices tfoot tr:last-child td { padding-top: 14px; font-size: 1.25rem; color: var(--blue); border-top: 2px solid var(--gold); }
body.brand .amount-due { margin: 18px 0 4px; color: var(--brand-muted); }
body.brand .amount-due strong { display: block; font-size: 2.2rem; line-height: 1.1; letter-spacing: -.04em; color: var(--blue); }
body.brand .pay-desktop { display: none; text-align: center; }
@media (min-width: 800px) {
  body.brand .pay-phone { display: none; }
  body.brand .pay-desktop { display: block; }
}

body.brand .brand-footer { padding: 24px 16px 32px; text-align: center; font-size: .85rem; color: var(--brand-muted); border-top: 1px solid var(--border); }
body.brand .brand-footer p { margin: 2px 0; }
body.brand .brand-footer a { color: var(--blue); }

body.brand .progress-list { list-style: none; margin: 0 0 18px; padding: 0; line-height: 1.5; }
body.brand .progress-list li { padding: 4px 0; }
body.brand .progress-mark { display: inline-block; width: 1.5em; color: var(--tick); font-weight: 800; }
body.brand .section-title { margin: 28px 0 10px; }
body.brand .progress-list li { display: flex; gap: 4px; align-items: baseline; }
body.brand .progress-mark { flex: none; }
body.brand .state-label { margin-left: auto; padding-left: 12px; font-size: .85rem; white-space: nowrap; }
body.brand .state-done { color: var(--brand-muted); }
body.brand .state-done .state-label { color: #1d6b3f; }
body.brand .state-yours { color: var(--blue); font-weight: 700; }
body.brand .state-yours .state-label { padding: 2px 12px; border-radius: 999px; background: var(--gold); color: var(--ink); }
body.brand .state-ours .state-label { color: var(--sky); }
body.brand .state-later { color: var(--brand-muted); }
body.brand textarea { display: block; width: 100%; box-sizing: border-box; font: inherit; color: var(--ink); background: #fff; }
body.brand form p { margin: 0 0 6px; }

/* "Add photos": the real input is hidden but still reachable by keyboard */
body.brand .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.brand .field-label { display: block; margin: 14px 0 6px; font-size: .9rem; font-weight: 700; color: var(--blue); }
body.brand label.file-button { display: inline-block; margin: 0; padding: 12px 22px; border: 2px solid var(--gold); border-radius: 999px; color: var(--blue); font-size: 1rem; cursor: pointer; }
body.brand input:focus-visible + label.file-button { outline: 3px solid var(--sky); outline-offset: 2px; }
body.brand .files-list { list-style: none; margin: 8px 0 14px; padding: 0; font-size: .92rem; }
body.brand .preview-box { background: var(--cream); }

/* "Your QX page" and the website chat panel: the chat fills the screen, composer at the bottom. */
body.chat-public { background: #f4efe4; }
body.chat-public .chat-public-main { flex: 1; width: min(760px, 100%); margin: 0 auto; padding: 0 0 24px; box-sizing: border-box; }
body.chat-public .chat-public-alert { margin: 12px 16px 0; }
body.chat-public .chat-public-note { padding: 32px 16px; }
.client-page-head { padding: 16px 16px 8px; }
.client-page-head h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 6vw, 2.2rem); }
.client-page-links { display: flex; gap: 8px; flex-wrap: wrap; }
.client-page-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-weight: 600; text-decoration: none; }
body.chat-public .chat-thread-frame { display: block; }
body.chat-public .chat-thread { display: flex; flex-direction: column; height: calc(100dvh - 200px); min-height: 420px; background: transparent; }
body.chat-public .chat-reply-note { margin: 0; padding: 0 16px 4px; font-size: 14px; color: var(--brand-muted); }
body.chat-public .chat-messages { flex: 1; overflow-y: auto; padding: 8px 16px; min-height: 0; }
body.chat-public .chat-composer { position: sticky; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: #fff; }
body.chat-public .chat-composer textarea { width: 100%; box-sizing: border-box; min-height: 56px; font: inherit; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); resize: none; }
body.chat-public .msg-meta { align-items: center; color: var(--brand-muted); }
body.chat-public .msg-bubble { background: #fff; color: var(--ink); box-shadow: 0 1px 2px #17143f14; }
.client-view .msg[data-side="team"], .chat-panel .msg[data-side="team"] { align-items: flex-start; }
.client-view .msg[data-side="team"] .msg-bubble, .chat-panel .msg[data-side="team"] .msg-bubble { background: #fff; color: var(--ink); }
.client-view .msg[data-side="team"] .msg-bubble a, .chat-panel .msg[data-side="team"] .msg-bubble a { color: var(--sky); }
.client-view .msg[data-side="client"], .chat-panel .msg[data-side="visitor"] { align-items: flex-end; }
.client-view .msg[data-side="client"] .msg-bubble, .chat-panel .msg[data-side="visitor"] .msg-bubble { background: #262262; color: #fff; }
.client-view .msg[data-side="client"] .msg-bubble a, .chat-panel .msg[data-side="visitor"] .msg-bubble a { color: #fff; }
.chat-not-open { padding: 24px 16px; height: auto !important; min-height: 0 !important; }
.chat-not-open p:first-child { font-size: 1.1rem; font-weight: 600; }
.client-page-invoices { margin: 16px; padding: 16px; background: #fff; border-radius: 16px; }
.client-page-invoices h2 { margin: 0 0 8px; font-size: 1.2rem; }
.client-page-invoices ul { margin: 0; padding: 0; list-style: none; }
.client-page-invoices li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.client-page-invoices li a { min-height: 24px; font-weight: 600; }
body.chat-public .chat-attach { padding: 0 16px; }
body.chat-public .brand-header-inner { width: min(728px, 100% - 32px); }

/* The website chat panel (inside an iframe on qxsoftware.net). Colours come from Settings. */
body.chat-panel { background: var(--chat-background, #fff); min-height: 0; height: 100dvh; }
body.chat-panel .chat-public-main { padding: 0; width: 100%; height: 100dvh; display: flex; flex-direction: column; }
.chat-panel .panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
body.chat-panel .chat-thread-frame { display: flex; flex: 1; min-height: 0; }
body.chat-panel .chat-thread { height: auto; min-height: 0; flex: 1; }
.chat-panel .panel-head { padding: 14px 16px 8px; background: var(--chat-accent, #262262); color: #fff; }
.chat-panel .panel-head h1 { margin: 0 0 4px; font-size: 1.05rem; line-height: 1.3; letter-spacing: 0; color: #fff; }
.chat-panel .panel-head p { margin: 0; font-size: 13px; opacity: .85; }
.chat-panel .panel-start { flex: 1; border-top: 0; display: flex; flex-direction: column; justify-content: flex-end; background: transparent; }
.chat-panel .msg[data-side="visitor"] .msg-bubble { background: var(--chat-accent, #262262); }
.chat-panel .pill.primary { background: var(--chat-accent, #262262); color: #fff; }
.chat-panel .panel-contact { padding: 8px 16px; border-top: 1px solid var(--border); font-size: 14px; }
.chat-panel .panel-contact p { margin: 0 0 6px; }
.chat-panel .panel-contact-fields { display: flex; gap: 6px; }
.chat-panel .panel-contact-fields .pill { min-height: 44px; padding: 0 14px; }
.chat-panel .panel-contact-fields input[type=email], .chat-panel .panel-contact-fields input[type=tel] { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; font: inherit; }
.chat-panel .panel-closed { padding: 24px 16px; justify-content: center; text-align: center; }
.chat-panel .panel-closed h1 { font-size: 1.3rem; letter-spacing: 0; }
.chat-panel .trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.chat-panel .alert { margin: 8px 16px; }
.chat-panel .chat-public-alert { margin: 8px 16px; }
body.chat-panel .chat-composer:not(.panel-start) { display: flex; align-items: flex-end; gap: 8px; }
body.chat-panel .chat-composer:not(.panel-start) textarea { flex: 1; min-height: 44px; }
body.chat-panel .chat-composer:not(.panel-start) .chat-compose-actions { margin: 0; }
