/* PayCaptain design tokens (from the PayCaptain App design summary) */
@font-face { font-family: Figtree; src: url(/fonts/figtree.woff2) format('woff2'); font-weight: 300 900; font-display: swap; }
:root {
  --teal: #1F7A76; --teal-dark: #145753; --page: #F2F6F6; --surface: #FFFFFF; --text: #1F2A37; --muted: #57605F;
  --tint: #E9F5F5; --hover: #D3E9E7; --mist: #E4EEED; --border: #DDE5E4; --input: #C9D0DA; --coral: #F47C6C; --error: #C23934;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 15px/1.5 Figtree, system-ui, -apple-system, 'Segoe UI', sans-serif; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul { margin: 0; }
h1 { font-size: 30px; font-weight: 600; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; line-height: 1.25; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid #7CC4C0; outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 12px 16px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.centre { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 32px; }
.stack-s { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }

.bar { background: var(--surface); border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top); }
.bar-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { height: 30px; width: auto; display: block; }
.brand-name { padding-left: 12px; border-left: 1px solid var(--border); font-size: 17px; font-weight: 600; line-height: 1.2; }

.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--input); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.pill:hover { background: var(--hover); color: var(--text); }
.pill.solid { border-color: transparent; }
.btn { flex: 1 1 180px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; max-width: 550px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--teal); background: var(--teal); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn.secondary { background: var(--surface); border-color: var(--input); color: var(--text); }
.btn.secondary:hover { background: var(--hover); color: var(--text); }
.link { background: none; border: 0; padding: 0; min-height: 44px; color: var(--text); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

.main { display: flex; flex-direction: column; gap: 32px; padding-top: 24px; padding-bottom: 48px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.pad { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.note { background: var(--tint); border: 1px solid #B9DAD7; border-radius: 12px; padding: 16px 20px; }

.urgent { background: var(--coral); border-radius: 12px; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.urgent-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.urgent-row p { flex: 1 1 320px; }
.urgent-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.urgent-more { list-style: none; padding: 12px 0 0; border-top: 1px solid rgba(31, 42, 55, .25); display: flex; flex-direction: column; gap: 8px; }
.urgent-more a { color: var(--text); font-weight: 600; }
.urgent-foot { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.urgent-show { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 20px; border: 0; border-radius: 12px; background: var(--coral); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.urgent-show strong { font-weight: 600; }
.urgent-show:hover { filter: brightness(0.96); }
.urgent.flash { outline: 3px solid var(--text); outline-offset: 3px; }

.hero { background: var(--mist); border-radius: 14px; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; }
.hero.left { align-items: flex-start; gap: 12px; padding: 28px 24px; }
.hero-in { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 16px; }
.hero-in h1, .hero-in .lead { text-align: center; }
.lead { font-size: 17px; }
.ask { padding: 16px; display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.ask label { font-size: 14px; font-weight: 600; }
textarea { width: 100%; border: 1px solid var(--input); border-radius: 8px; padding: 12px; font: inherit; font-size: 16px; color: var(--text); resize: vertical; }
textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31, 122, 118, .25); }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chips li { background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--teal-dark); }

.topic { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 14px 16px; text-decoration: none; color: var(--text); }
.topic:hover { background: var(--tint); border-color: #B9DAD7; color: var(--text); }
.topic-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 999px; background: var(--tint); color: var(--teal); display: flex; align-items: center; justify-content: center; }
.topic-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topic-text small { font-size: 13px; color: var(--muted); line-height: 1.35; }

.back { font-weight: 600; align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; }
.org { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.org-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--tint); color: var(--teal-dark); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.org .btn { font-variant-numeric: tabular-nums; }
.feedback .btn { flex: 0 1 140px; }
.rating .btn { flex: 0 0 52px; padding: 0; }

.foot { padding: 0 0 calc(32px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--muted); }
.foot .line { display: block; }
.foot .wrap { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 768px) {
  h1 { font-size: 26px; }
  .card, .urgent, .hero { border-radius: 10px; }
  .btn { flex-basis: 100%; }
  .feedback .btn { flex: 1 1 120px; }
  .rating .btn { flex: 1 0 44px; }
  .pill#quick-exit { padding: 0 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .pill, .topic { transition: background-color .15s, border-color .15s; }
  html { scroll-behavior: smooth; }
}

/* Admin */
.admin main { gap: 20px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 16px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--teal); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid #EEF1F6; vertical-align: top; }
th { font-size: 13px; font-weight: 400; color: #5B6675; background: var(--tint); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.stat { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select { min-height: 44px; border: 1px solid var(--input); border-radius: 8px; padding: 0 12px; font: inherit; color: var(--text); background: var(--surface); width: 100%; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.form .wide { grid-column: 1 / -1; }
.warn { background: #FFF6E5; border: 1px solid #F0D49A; border-radius: 12px; padding: 12px 16px; }
.warn ul { padding-left: 20px; }
.err { color: var(--error); font-weight: 600; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; background: #FFF6E5; color: #7A4B00; }
.badge.ok { background: var(--tint); color: var(--teal-dark); }
.list-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--teal); text-decoration: underline; cursor: pointer; text-align: left; }
.bar-cell { background: var(--teal); height: 10px; border-radius: 999px; min-width: 2px; }
.admin .btn { flex: 0 0 auto; }
details.card > summary { padding: 14px 16px; font-weight: 600; cursor: pointer; }
details.card > .pad { border-top: 1px solid var(--border); }
.ask .btn { max-width: none; }

/* Conversation */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat { padding: 16px; display: flex; flex-direction: column; gap: 12px; max-width: 760px; width: 100%; align-self: center; }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.agent { background: var(--mist); align-self: flex-start; }
.msg.user { background: var(--teal); color: #fff; align-self: flex-end; }
.chat-log .org { align-self: stretch; }
.chat input[type=text] { flex: 999 1 220px; min-height: 44px; border: 1px solid var(--input); border-radius: 8px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--text); }
.chat input[type=text]:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31, 122, 118, .25); }
.chat form .btn { flex: 1 1 100px; }

/* Choose how to get help */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.option { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 14px 16px; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.option strong { font-size: 17px; font-weight: 600; line-height: 1.25; }
.option:hover { background: var(--tint); border-color: #B9DAD7; }
.option[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.option[aria-pressed="true"] small { color: #fff; }
.option[aria-pressed="true"] .topic-icon { background: #fff; }
.panel:focus { outline: none; }
.how > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer; }
.how > summary::before { content: '+'; font-weight: 600; width: 12px; }
.how[open] > summary::before { content: '\2212'; }
.how > summary::-webkit-details-marker { display: none; }
.how > summary { list-style: none; }
.how ul { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.how strong { color: var(--text); font-weight: 600; }
.hero { padding: 32px 20px; }
#panel-chat .ask, #panel-chat .chat { max-width: 760px; width: 100%; align-self: center; margin-top: 0; }
#panel-call .row { justify-content: center; }
#panel-call .btn { flex: 0 1 360px; }
@media (max-width: 768px) { .options { grid-template-columns: 1fr 1fr; } .option { flex-direction: column; align-items: flex-start; } }

/* Keep headline and intro lines even, with no single words left on their own line */
.hero .line { display: block; }
.hero h1, .hero .lead, .panel > p, .foot p { text-wrap: balance; }
.hero-in { max-width: 720px; }
