/* UltraDialer team dashboard. Colours are tokens; text contrast is 4.5:1 or better in both themes. */
:root {
  --bg: #f4f8f6; --card: #ffffff; --raised: #f4f8f6; --text: #28403a; --muted: #5e756d; --line: #e6eeea;
  --chart: #1e8c72; --accent: #1a7f67; --accent-strong: #15695a; --accent-text: #ffffff; --accent-soft: #dff3ec;
  --brand: #2fa98c; --brand-dark: #1f4d42; --glow: rgba(47, 169, 140, .13);
  --call: #047857; --call-soft: #d9f5ea;
  --bad: #b91c1c; --bad-soft: #fde4e4; --warn: #92400e; --warn-soft: #fdf0d5;
  --ok: #047857; --ok-soft: #d9f5ea; --info: #1a6b58; --info-soft: #dff3ec;
  --shadow: 0 2px 12px rgba(47, 169, 140, .07);
  --r-sm: 9px; --r-md: 14px; --r-lg: 22px; --nav: 232px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --card: #131c2e; --raised: #182338; --text: #e5eaf3; --muted: #9fb0c8; --line: #2a3750;
    --chart: #4fd1ae; --accent: #4fd1ae; --accent-strong: #7be3c6; --accent-text: #06241c; --accent-soft: #17332b;
    --brand-dark: #2fa98c; --glow: rgba(0, 0, 0, 0);
    --call: #34d399; --call-soft: #12352b;
    --bad: #ff9a9a; --bad-soft: #3b1a1d; --warn: #f5c16c; --warn-soft: #3a2c12;
    --ok: #5fe0b0; --ok-soft: #12352b; --info: #9be8d0; --info-soft: #17332b;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15.5px/1.5 "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-underline-offset: 2px; }
.muted { color: var(--muted); }
.bad { color: var(--bad); }
.ok { color: var(--ok); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: var(--r-sm); z-index: 50; }
.skip:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons and fields ---------- */
button { font: inherit; font-weight: 600; min-height: 40px; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--r-sm);
  cursor: pointer; background: var(--accent); color: var(--accent-text); transition: background-color .15s, border-color .15s, opacity .15s; }
button:hover { background: var(--accent-strong); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.plain { background: var(--card); color: var(--text); border-color: var(--line); }
button.plain:hover { background: var(--raised); border-color: var(--muted); }
button.small { min-height: 32px; padding: 4px 12px; font-size: 13px; }
button.wide { width: 100%; min-height: 44px; }
button.danger { background: var(--card); color: var(--bad); border-color: var(--bad); }
button.danger:hover { background: var(--bad-soft); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; font-weight: 400; min-height: 40px; padding: 8px 12px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); width: 100%; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 160px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
.pw { display: flex; gap: 8px; }
.pw input { flex: 1; }

/* ---------- login ---------- */
#login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
#loginForm { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px 28px; box-shadow: var(--shadow); display: grid; gap: 16px; }
#loginForm h1 { font-size: 20px; }
#loginForm p { margin: -8px 0 0; }
.error { color: var(--bad); min-height: 1.5em; margin: 0; font-size: 14px; }

/* ---------- brand and top bar ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-large { font-size: 20px; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--call);
  display: inline-block; position: relative; flex: none; }
.mark::after { content: ""; position: absolute; inset: 7px 8px 7px 8px; border: 3px solid #fff; border-radius: 3px 10px 3px 10px; transform: rotate(-12deg); }
.tag { font-size: 12px; font-weight: 600; color: var(--info); background: var(--info-soft); padding: 2px 8px; border-radius: 999px; }
.top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; min-width: 0; }
.who #whoName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--info);
  display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }

/* ---------- layout and navigation: see the top-menu block at the end ---------- */
.layout { min-height: calc(100dvh - 68px); }
main { padding: 18px 20px 40px; max-width: 1480px; margin: 0 auto; width: 100%; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.toolbar label { width: auto; min-width: 150px; }
#notice { min-height: 24px; margin: 0 0 8px; font-size: 14px; }
#notice.bad { color: var(--bad); }
#notice.good { color: var(--ok); }
#notice:not(:empty) { padding: 10px 14px; border-radius: var(--r-sm); background: var(--raised); border: 1px solid var(--line); }
#notice.bad:not(:empty) { background: var(--bad-soft); border-color: var(--bad); }
#notice.good:not(:empty) { background: var(--ok-soft); border-color: var(--ok); }

/* ---------- cards, stats, tables ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; box-shadow: var(--shadow); }
.card + .card, .spaced { margin-top: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row label { flex: 1 1 180px; max-width: 340px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .value { display: block; font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--raised); white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover td { background: var(--raised); }
tr:last-child td { border-bottom: 0; }
td.empty { text-align: center; color: var(--muted); padding: 40px 14px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.person .avatar { width: 30px; height: 30px; font-size: 12px; }
.person small { display: block; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 2px 10px; border-radius: 999px;
  background: var(--raised); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.skeleton { height: 14px; border-radius: 6px; background: var(--line); animation: pulse 1.2s ease-in-out infinite; }
.skeleton-block { display: grid; gap: 14px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
@keyframes pulse { 50% { opacity: .45; } }
audio { width: 100%; margin-top: 16px; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  main { padding: 12px; }
  .top { padding: 10px 14px; }
  .who #whoName { display: none; }
  .toolbar { width: 100%; }
  .toolbar label { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

td select { width: auto; min-width: 120px; }

/* ---------- plans ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.plans .card + .card { margin-top: 0; }
.planhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.planhead h2 { margin: 0; font-size: 18px; }
.plan .row { margin-bottom: 12px; }
.plan label.block { margin-bottom: 12px; }
.features { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px 6px; margin: 0 0 14px; display: grid; gap: 2px; }
.features legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 6px; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; color: var(--text); min-height: 32px; font-size: 14px; }
label.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); flex: none; }
.plancell { display: grid; gap: 4px; min-width: 170px; }
.plancell select, .plancell input { min-height: 36px; padding: 4px 8px; }
.plancell button { justify-self: start; }
input.narrow { width: 96px; min-height: 36px; padding: 4px 8px; }

/* integrations */
.secret { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; padding: 10px 12px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); }
.secret code { overflow-wrap: anywhere; user-select: all; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; }
.check { display: flex; align-items: center; gap: 6px; font-weight: normal; }

/* live board */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 16px 0; }
.person-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow); border-left: 4px solid var(--line); }
.person-card.working { border-left-color: var(--ok); }
.person-card.not_in { border-left-color: var(--bad); }
.person-card.quiet { border-left-color: var(--bad); background: var(--bad-soft); }
.person-card header { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.person-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.person-card dt { color: var(--muted); }
.person-card dd { margin: 0; overflow-wrap: anywhere; }

/* status colours */
input[type="color"] { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); cursor: pointer; }

/* manager limits */
input.narrow { min-width: 0; width: 120px; }

.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.kcol { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; min-height: 120px; }
.kcard { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; margin-top: 8px; cursor: grab; display: grid; gap: 6px; }
.tplrow { display: grid; grid-template-columns: 2fr 80px 100px 110px 1fr auto; gap: 6px; margin-top: 6px; }
@media (max-width: 720px) { .tplrow { grid-template-columns: 1fr 1fr; } }
a.button { display: inline-block; min-height: 40px; padding: 8px 16px; border-radius: var(--r-md); background: var(--accent); color: var(--accent-text); text-decoration: none; margin: 8px 0; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.calday { border: 1px solid var(--line); border-radius: var(--r-sm); min-height: 64px; padding: 4px; display: grid; gap: 2px; align-content: start; font-size: 12px; }

.qrbox{margin:8px 0}
.qrbox canvas{display:block;width:240px;height:240px;max-width:100%;background:#fff;border:1px solid #ccd;border-radius:8px}

/* Reports */
.stat-sub { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.chart-grid .card + .card { margin-top: 0; }
.chart-card h3 { margin: 0 0 4px; }
.vtop { font-size: 12px; margin-top: 6px; }
.vplot { position: relative; padding-top: 30px; }
.vbars { display: flex; align-items: stretch; height: 170px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.vcol { position: relative; flex: 1 1 0; min-width: 0; display: flex; justify-content: center; cursor: default; }
.vcol:hover { background: var(--raised); }
.vtrack { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 100%; padding: 0 1px; }
.vbar { display: block; width: 100%; max-width: 22px; background: var(--chart); border-radius: 4px 4px 0 0; }
.vlabel { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-tip { position: absolute; top: 0; z-index: 2; padding: 3px 8px; font-size: 12px; white-space: nowrap; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.chart-data { margin-top: 6px; font-size: 13px; }
.chart-data summary { cursor: pointer; color: var(--muted); }
.hrow { display: grid; grid-template-columns: minmax(0, 120px) 1fr auto; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.hname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htrack { display: block; flex: 1 1 60px; min-width: 60px; height: 8px; }
.hbar { display: block; height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; }
.hval, .lb-cell { font-variant-numeric: tabular-nums; }
.lb-cell { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.report-range { align-items: center; margin-bottom: 12px; }
.codes { padding: 12px; background: var(--raised); border-radius: var(--r-sm); font-size: 15px; line-height: 1.6; }
.insight-row { padding: 12px 0; border-top: 1px solid var(--line); }
.insight-row p { margin: 6px 0; }
.insight h4 { margin: 8px 0 2px; }
.insight .codes { white-space: pre-wrap; overflow-wrap: anywhere; }
/* WhatsApp inbox */
.wa-grid { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; }
.wa-list { max-height: 620px; overflow-y: auto; border-right: 1px solid var(--line); }
.wa-item { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 12px; text-align: left; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.wa-item span.muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-item:hover, .wa-item.on { background: var(--raised); }
.wa-top, .wa-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wa-thread { display: flex; flex-direction: column; min-width: 0; padding: 12px; }
.wa-log { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 280px; max-height: 440px; margin: 10px 0; overflow-y: auto; }
.wa-msg { max-width: 78%; padding: 8px 10px; overflow-wrap: anywhere; white-space: pre-wrap; background: var(--raised); border-radius: var(--r-md); }
.wa-msg.out { align-self: flex-end; background: var(--accent-soft); }
.wa-msg.failed { outline: 1px solid var(--bad); }
.wa-msg small { display: block; margin-top: 3px; color: var(--muted); }
.wa-compose { display: flex; gap: 8px; align-items: flex-end; }
.wa-compose textarea { flex: 1; }
.wa-template input { margin-bottom: 6px; }
@media (max-width: 760px) { .wa-grid { grid-template-columns: 1fr; } .wa-list { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--line); } }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.selfie-view img { display: block; max-width: 240px; max-height: 320px; margin-bottom: 12px; border-radius: var(--r-md); }
/* Sign-up and invoices */
.signup { max-width: 460px; margin: 0 auto; padding: 32px 16px 48px; }
.signup form, .signup section { display: block; }
.signup label { display: block; margin-top: 12px; }
.signup input:not([type=checkbox]) { width: 100%; box-sizing: border-box; }
.signup .wide { width: 100%; margin-top: 16px; }
.signup .trap { position: absolute; left: -9999px; }
.plans-list { display: grid; gap: 12px; }
.plans-list .card { margin-top: 0; }
.invite-code { font: 700 30px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; user-select: all; }
.invite-text { white-space: pre-line; overflow-wrap: anywhere; }
/* Billing, account deletion and legal pages */
.signup section + section, .signup section[id] { margin-top: 20px; }
.signup h1 { margin: 16px 0 8px; }
.signup ul, .legal ul { padding-left: 20px; margin: 0 0 12px; }
.signup label.check { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; }
.billing .total { font-weight: 700; }
.billing #choose { margin-bottom: 16px; }
.billing .invoice table { margin-bottom: 12px; }
.billing > .note { margin: 16px 0; }
.note { padding: 10px 14px; border-radius: var(--r-sm); background: var(--ok-soft); border: 1px solid var(--ok); }
main.legal { max-width: 720px; padding: 32px 16px 48px; overflow-wrap: anywhere; }
.legal h1 { margin: 20px 0 8px; }
.legal h2 { margin-top: 24px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.legal-links a { display: inline-block; padding: 6px 0; }
.invoice { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); }
.invoice-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 10px 0; }
@media print { body * { visibility: hidden; } .invoice, .invoice * { visibility: visible; } .invoice { position: absolute; left: 0; top: 0; width: 100%; border: 0; } .no-print { display: none; } }
/* Pipeline */
.pipe-board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.pipe-col { flex: 0 0 260px; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); }
.pipe-col.over { outline: 2px solid var(--accent); }
.pipe-col header { display: flex; flex-direction: column; gap: 2px; }
.pipe-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: grab; }
.pipe-card ul { margin: 4px 0; padding-left: 18px; font-size: 13px; }
.pipe-card summary { font-size: 13px; color: var(--muted); cursor: pointer; }
/* Quotations */
.quote-page { max-width: 820px; margin: 0 auto; padding: 24px 16px 48px; }
.quote-sums { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin: 12px 0; }
.quote-terms p { white-space: pre-wrap; }
.quote-page form { margin-top: 12px; }
.quote-row { display: grid; grid-template-columns: minmax(120px, 2fr) minmax(70px, 1fr) 70px 100px 70px auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.quote-head { font-size: 12px; margin-bottom: 2px; }
@media (max-width: 760px) { .quote-row { grid-template-columns: 1fr 1fr; } .quote-head { display: none; } }

/* Language picker (i18n.js) */
.langpick select { font: inherit; font-size: 13px; padding: 4px 6px; max-width: 150px; }
.mark.logo { background-color: transparent; background-size: contain; background-repeat: no-repeat; background-position: center; }
.mark.logo::after { display: none; }
.brand-preview { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
#loginForm .langpick { display: block; margin-top: 14px; text-align: center; }
.top { flex-wrap: wrap; row-gap: 6px; }
.top .langpick { margin-left: auto; }

.stops { margin: 6px 0 10px; padding-left: 22px; }
.stops li { margin: 4px 0; }
.daypick { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.daypick label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.daypick input { width: 18px; height: 18px; margin: 0; }

/* lead workspace form */
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin-bottom: 12px; }
.grid2 label { display: block; }

/* simple bar charts (reports) */
.bars { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 140px; gap: 8px; align-items: center; }
.bar-track { background: rgba(127,127,127,.15); border-radius: 4px; height: 12px; overflow: hidden; }
.bar { display: block; height: 100%; background: currentColor; opacity: .55; }
.bar-value { font-variant-numeric: tabular-nums; }

/* attendance route and API tester */
.routemap { width: 100%; max-width: 520px; height: auto; border: 1px solid rgba(127,127,127,.3); border-radius: 8px; }
.route-line { fill: none; stroke: currentColor; stroke-width: 2; opacity: .6; }
.route-in { fill: #2e7d32; }
.route-out { fill: #c62828; }
.route-office { fill: none; stroke: #1565c0; stroke-width: 2; }
.apiout { max-height: 320px; overflow: auto; white-space: pre-wrap; font-size: 12px; }

/* sign-in with a code, hub tiles */
.otpbox { margin-top: 12px; display: grid; gap: 8px; }
.tile { text-align: left; cursor: pointer; color: var(--text); font-weight: 400; }
.tile:hover { background: var(--raised); }
.preview { white-space: pre-wrap; border-left: 3px solid rgba(127,127,127,.4); padding-left: 8px; }

/* task board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; }
.board-col { min-height: 120px; padding: 8px; border-radius: 8px; background: rgba(127,127,127,.08); }
.board-card { cursor: grab; margin: 6px 0; }
.board-card.overdue { border-left: 4px solid #c62828; }
.narrow { width: 5em; }

/* ---- appearance (set per person; body data-* attributes) ---- */
body[data-theme="dark"] { --bg: #0b1220; --card: #131c2e; --raised: #182338; --text: #e5eaf3; --muted: #9fb0c8; --line: #2a3750; --accent: #6ea8ff; --accent-strong: #93bfff; --accent-text: #08142b; --accent-soft: #1c2d52; }
body[data-theme="ocean"] { --bg: #eef7fb; --accent: #0369a1; --accent-strong: #075985; --accent-soft: #dbeefa; --chart: #0369a1; }
body[data-theme="forest"] { --bg: #f1f7f2; --accent: #15803d; --accent-strong: #166534; --accent-soft: #dcf2e2; --chart: #15803d; }
body[data-theme="sunset"] { --bg: #fdf4ee; --accent: #c2410c; --accent-strong: #9a3412; --accent-soft: #fde3d3; --chart: #c2410c; }
body[data-theme="rose"] { --bg: #fdf2f5; --accent: #be185d; --accent-strong: #9d174d; --accent-soft: #fbdce8; --chart: #be185d; }
body[data-theme="slate"] { --bg: #f1f3f6; --accent: #334155; --accent-strong: #1e293b; --accent-soft: #e2e8f0; --chart: #334155; }
body[data-theme="sand"] { --bg: #f8f5ee; --accent: #92400e; --accent-strong: #78350f; --accent-soft: #f5e9d3; --chart: #92400e; }
body[data-theme="violet"] { --bg: #f5f3fd; --accent: #6d28d9; --accent-strong: #5b21b6; --accent-soft: #e9e2fc; --chart: #6d28d9; }
body[data-theme="contrast"] { --bg: #ffffff; --card: #ffffff; --text: #000000; --muted: #222222; --line: #000000; --accent: #0000cc; --accent-strong: #000099; --accent-soft: #e6e6ff; }
body[data-theme="mint"] { --bg: #effaf6; --accent: #0f766e; --accent-strong: #115e59; --accent-soft: #d5f3ec; --chart: #0f766e; }
body[data-font="inter"] { font-family: Inter, "Segoe UI", system-ui, sans-serif; }
body[data-font="serif"] { font-family: Georgia, "Times New Roman", serif; }
body[data-font="rounded"] { font-family: "Nunito", "Varela Round", "Segoe UI", system-ui, sans-serif; }
body[data-font="mono"] { font-family: ui-monospace, Consolas, monospace; }
body[data-size="small"] { font-size: 13px; } body[data-size="large"] { font-size: 17px; } body[data-size="xlarge"] { font-size: 19px; }
body[data-density="compact"] .card { padding: 8px 10px; } body[data-density="spacious"] .card { padding: 22px 24px; }
body[data-corners="square"] { --r-sm: 0; --r-md: 2px; --r-lg: 4px; } body[data-corners="round"] { --r-sm: 14px; --r-md: 20px; --r-lg: 26px; }
body[data-surface="flat"] { --shadow: none; } body[data-surface="floating"] { --shadow: 0 6px 24px rgba(15, 23, 42, .12); }
body[data-background="tint"] { background: linear-gradient(180deg, var(--accent-soft), var(--bg) 320px); }
body[data-background="grid"] { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 32px 32px; }
body[data-background="dots"] { background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px; }
body[data-sidebar="icons"] { --nav: 72px; } body[data-sidebar="hidden"] { --nav: 0px; }

/* ---- bell, pill, tiles, tour, chat, mobile bar ---- */
.topbar-extra { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 4px 8px; }
.bell.has { color: var(--warn); font-weight: 600; }
.pill { cursor: pointer; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile .big { font-size: 1.6em; color: var(--text); font-weight: 700; }
.tour { position: fixed; right: 16px; bottom: 72px; max-width: 340px; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.chat { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; margin-bottom: 8px; }
.chat-msg { padding: 8px 10px; border-radius: var(--r-md); background: var(--raised); }
.chat-msg.user { background: var(--accent-soft); justify-self: end; max-width: 80%; }
.news-img { max-width: 100%; border-radius: var(--r-md); }
.suggestion { text-align: left; margin: 4px 0; }
.offer { font-weight: 600; color: var(--ok); }
.standee { text-align: center; }
.mobile-bar { display: none; }
@media (max-width: 720px) {
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: 6px 0; z-index: 40; }
  body { padding-bottom: 72px; } /* room for the bar when a label takes two lines */
  .mobile-bar button { flex: 1 1 0; min-width: 0; padding: 8px 2px; font-size: 13px; overflow-wrap: anywhere; } /* five share the width */
  body:has(> #login:not([hidden])) > .mobile-bar { display: none; } /* nothing to jump to before signing in */
  body:has(> .mobile-bar[hidden]), body:has(> #login:not([hidden])) { padding-bottom: 0; }
  .tour { left: 8px; right: 8px; bottom: 76px; max-width: none; }
}
@media (max-width: 360px) { .mobile-bar button { font-size: 11px; padding-left: 0; padding-right: 0; } }
@media print { .mobile-bar, .topbar-extra, button { display: none !important; } }


/* ---------- top menu, page card, tabs inside a page (the same arrangement as mimg.in, in our own colours) ---------- */
#navbtn, #navmode, #navedge { display: none !important; }
.top { gap: 18px; padding: 10px 22px; box-shadow: 0 6px 24px var(--glow); }
.top .brand { flex: none; }
#tabs { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; padding: 0; border: 0; background: none; position: static; height: auto; overflow: visible; }
.navgroup { position: relative; }
.navtrigger, #tabs > button { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px 6px 8px; border-radius: 16px;
  background: transparent; color: var(--muted); font-weight: 600; font-size: 15px; white-space: nowrap; position: relative; }
.navtrigger:hover, #tabs > button:hover { background: var(--raised); color: var(--text); }
.navtrigger[aria-current="true"], #tabs > button[aria-current="true"] { background: var(--accent-soft); color: var(--info); }
.navtrigger[aria-current="true"]::after, #tabs > button[aria-current="true"]::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -10px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.navtrigger .tile, #tabs > button .tile { width: 32px; height: 32px; border-radius: 11px; display: inline-grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--info); }
.navtrigger .tile svg, #tabs > button .tile svg { width: 18px; height: 18px; }
.navgroup:nth-child(2) .tile { background: #ece7fb; color: #5b45b0; }
.navgroup:nth-child(3) .tile, #tabs > button .tile { background: #dff3ec; color: #1a7f67; }
.navgroup:nth-child(4) .tile { background: #eef0f2; color: #4d5d59; }
.caret { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; opacity: .7; }
.navmenu { position: absolute; top: calc(100% + 10px); left: 0; z-index: 60; min-width: 250px; max-height: 70dvh; overflow-y: auto; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 40px rgba(31, 77, 66, .16); display: grid; gap: 2px; }
.navmenu button { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: flex-start; text-align: left; min-height: 40px; padding: 6px 12px;
  background: transparent; color: var(--text); font-weight: 600; font-size: 14.5px; border-radius: 12px; }
.navmenu button:hover { background: var(--raised); }
.navmenu button[aria-current="true"] { background: var(--accent-soft); color: var(--info); }
.navmenu button svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.navmenu .navhead { padding: 8px 12px 2px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.who { flex: none; gap: 8px; }
.iconbtn { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; position: relative; display: inline-grid; place-items: center; }
.iconbtn::before { content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/><path d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/><path d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/></svg>") center / contain no-repeat; }
.dot { position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); border: 2px solid var(--card); }
.acct { position: relative; }
.acctbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 12px 4px 6px; border-radius: 16px; font-size: 14.5px; max-width: 260px; }
.acctmenu { left: auto; right: 0; min-width: 210px; }
.avatar { background: var(--accent-soft); color: var(--info); }

.pagecard { background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 8px 24px var(--glow); overflow: hidden; }
.pagecard-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px 14px; }
.ph-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ph-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-dark); color: #fff; display: inline-grid; place-items: center; flex: none; }
.ph-icon svg { width: 22px; height: 22px; }
.pagecard-head h1 { font-size: 25px; font-weight: 600; letter-spacing: -.01em; }
.ph-actions { display: flex; gap: 8px; }
.ph-actions button { border-radius: 10px; }
#subtabs { display: flex; gap: 2px; padding: 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
#subtabs button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600;
  border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
#subtabs button:hover { color: var(--text); background: transparent; }
#subtabs button[aria-current="true"] { color: var(--text); border-bottom-color: var(--brand); }
#subtabs svg { width: 15px; height: 15px; }
.pagebody { padding: 16px 22px 28px; }
.pagebody .toolbar { margin-bottom: 14px; }
input, select, textarea { border-radius: 12px; background: var(--raised); }
button.plain { border-radius: 10px; }
/* number cards: label, big number, round icon tile; the ones that filter are buttons */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; text-align: left; font: inherit; color: inherit; min-height: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat .label { order: 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.stat .value { order: 1; font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat-ico { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--bg); color: var(--muted); }
.stat-ico svg { width: 17px; height: 17px; }
.stat-btn { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.stat-btn:hover { border-color: var(--brand); }
.stat-btn.active { background: var(--accent-soft); border-color: var(--brand); box-shadow: 0 0 0 3px var(--glow); }
.stat-btn.active .stat-ico { background: var(--brand); color: #fff; }
.stat-btn.active .label { color: var(--accent-strong); }
.stat-hint { align-self: flex-start; margin-top: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--bg); color: var(--muted); }
.stat-hint.ok { background: var(--accent-soft); color: var(--accent-strong); }
.stat-hint.bad { background: #fde8e6; color: #b42318; }
.infodot { position: relative; display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 9px; font-weight: 700; line-height: 14px; text-align: center; text-transform: none; letter-spacing: 0; cursor: pointer; }
.emptybox { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 12px; text-align: center; }
.emptybox p { margin: 0; max-width: 380px; }
.empty-ico { width: 54px; height: 54px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bg); color: var(--muted); margin-bottom: 8px; }
.empty-ico svg { width: 24px; height: 24px; }
.empty-title { font-weight: 700; font-size: 16px; color: var(--text); }
td.empty { padding: 8px 14px; }
.card { border-radius: 18px; }
th { background: transparent; }
.support { position: fixed; right: 22px; bottom: 22px; z-index: 30; display: inline-flex; align-items: center; gap: 10px; padding: 5px 18px 5px 5px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 24px var(--glow); color: var(--text); font-weight: 600; text-decoration: none; }
@media (max-width: 1100px) {
  .navtrigger, #tabs > button { padding-right: 10px; }
  .navtrigger .label, #tabs > button .label { display: none; }
}
@media (max-width: 760px) {
  .top { flex-wrap: wrap; }
  #tabs { order: 3; flex: 1 1 100%; overflow-x: auto; }
  .navtrigger .label, #tabs > button .label { display: inline; }
  .navmenu { position: fixed; left: 12px; right: 12px; top: 120px; }
  .acctmenu { top: 64px; }
}
#subtabs { overflow-y: hidden; }
@media (min-width: 761px) { #subtabs { flex-wrap: wrap; } }
.ph-actions { flex-wrap: wrap; }
.iconbtn svg { width: 17px; height: 17px; display: block; }
.linkbar { margin-bottom: 12px; }
.tipbanner { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; background: var(--accent-soft); font-weight: 600; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.pagehead p { margin: 0; }
.eventrow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.eventrow > div:first-child { flex: 1 1 260px; }
.eventrow > .secret { flex: 1 1 100%; margin: 0; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 12px; padding: 0; }
.steps li { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600; }
.steps li[aria-current="step"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.top select { width: auto; min-height: 36px; padding: 4px 8px; }
#tabs { gap: 2px; }
/* a mid-size window: the menus move to a second line instead of sliding under the account and bell */
@media (min-width: 761px) { #tabs { flex-wrap: wrap; } }
.navtrigger, #tabs > button { padding: 6px 10px 6px 6px; font-size: 14.5px; gap: 8px; }
.acctbtn { max-width: 210px; }
.acctbtn #whoName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
@media (max-width: 1280px) { .top .tag { display: none; } }
.top .tag { display: none; }
.top { gap: 10px; }
/* a bare label followed by its field (the date range bar, filter rows) sits on the same line */
.row > label:has(+ input), .row > label:has(+ select) { flex: 0 0 auto; align-self: center; }
.row > input, .row > select { width: auto; flex: 1 1 150px; max-width: 260px; }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; height: 18px; padding: 0; accent-color: var(--accent); }

/* the home landing page */
.pagecard.landing { background: none; border: 0; box-shadow: none; overflow: visible; }
.pagecard.landing .ph-icon, .pagecard.landing .ph-actions, .pagecard.landing #subtabs { display: none; }
.pagecard.landing .pagecard-head { padding: 8px 4px 0; }
.pagecard.landing .pagebody { padding: 8px 0 28px; }
.eyebrow { display: block; font-size: 12px; letter-spacing: .08em; font-weight: 700; color: var(--brand); }
.pagecard.landing h1 { font-size: 30px; }
.ph-sub { margin: 4px 0 0; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin-bottom: 26px; }
.bigtile { display: grid; gap: 10px; text-align: left; padding: 24px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 8px 24px var(--glow); min-height: 190px; align-content: start; color: var(--text); }
.bigtile:hover { background: var(--card); border-color: var(--brand); }
.bigtile strong { font-size: 19px; font-weight: 600; }
.bigtile .desc { color: var(--muted); font-weight: 400; font-size: 15px; line-height: 1.55; }
.bigtile .foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.bigtile .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 12px; font-weight: 600; background: var(--raised); color: var(--text); border-radius: 999px; padding: 2px 10px; }
.bigtile .go { font-weight: 600; font-size: 14px; }

/* plan pill and bell in the top bar */
.top .pill { background: var(--accent-soft); color: var(--accent-strong); border: 0; font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.top .pill.warn { background: #fff1d6; color: #8a5a00; }
.bell { position: relative; width: 38px; height: 38px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.bell svg { width: 18px; height: 18px; }
.bell-count { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #d92d20; color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; }
.stats { margin-top: 12px; }

body[data-theme="amber"] { --bg: #fdf8ec; --accent: #b45309; --accent-strong: #92400e; --accent-soft: #fdeccb; --chart: #b45309; --brand: #f59e0b; }
body[data-theme="emerald"] { --bg: #effaf3; --accent: #047857; --accent-strong: #065f46; --accent-soft: #d3f4e3; --chart: #047857; --brand: #10b981; }
body[data-theme="indigo"] { --bg: #f1f2fd; --accent: #4338ca; --accent-strong: #3730a3; --accent-soft: #e0e2fb; --chart: #4338ca; --brand: #6366f1; }
body[data-theme="plum"] { --bg: #f9f2f8; --accent: #86198f; --accent-strong: #701a75; --accent-soft: #f4dcf3; --chart: #86198f; --brand: #c026d3; }
body[data-background="soft"] { background-image: radial-gradient(900px 400px at 85% -10%, var(--accent-soft), transparent 70%); }
body[data-background="noise"] { background-image: repeating-linear-gradient(45deg, transparent 0 2px, rgba(0,0,0,.018) 2px 3px); }
.optgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 18px; }
.opt { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.opt[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--glow); background: var(--accent-soft); }
.opt .sw { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 1px solid rgba(0,0,0,.12); }
.opt small { display: block; color: var(--muted); font-weight: 400; }
.phone-frame { width: min(300px, 100%); min-height: 220px; margin: 10px 0; padding: 34px 12px 20px; border: 8px solid #22302d; border-radius: 30px; background: #e9e1d6; display: flex; flex-direction: column; justify-content: flex-end; }
.phone-bubble { align-self: flex-end; max-width: 94%; padding: 8px 10px; border-radius: 12px 12px 2px 12px; background: #dcf8c6; color: #14201d; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; display: grid; gap: 6px; }
.phone-file { padding: 8px; border-radius: 8px; background: rgba(0,0,0,.07); font-weight: 600; }
.phone-link { color: #0a58a8; }
/* a tick box sits beside its name, not above it */
.chips > label:has(> input[type="checkbox"]:first-child), .row > label:has(> input[type="checkbox"]:first-child) { flex-direction: row; align-items: center; flex: 0 0 auto; gap: 6px; margin-right: 14px; min-height: 32px; }
.chips > label > input[type="checkbox"]:first-child, .row > label > input[type="checkbox"]:first-child { width: 18px; height: 18px; min-height: 0; flex: none; }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; margin: 8px 0 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 6px 0 16px; }
.seg button { border: 0; border-radius: 0; background: var(--card); color: var(--text); padding: 8px 16px; font: inherit; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.apsec { display: grid; gap: 2px; } .apsec h3 { margin: 14px 0 0; } .apsec p.muted { margin: 0 0 4px; }

.chips input[type="date"], .chips input[type="search"] { width: auto; }
.chips input[type="search"] { flex: 1 1 240px; max-width: 360px; }
.daylabel { align-self: center; margin: 0 6px; }
.rangebar input[type="date"] { max-width: 170px; }

.info-tip::after { content: attr(data-info-tip); position: absolute; left: -6px; top: calc(100% + 9px); width: max-content; max-width: 250px; padding: 9px 12px; border-radius: 10px; background: var(--brand-dark); color: #fff;
  font-size: 12px; font-weight: 500; line-height: 1.45; text-align: left; white-space: normal; box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; visibility: hidden; pointer-events: none; z-index: 70; transition: opacity .12s; }
.info-tip:hover::after, .info-tip:focus-visible::after, .info-tip.open::after { opacity: 1; visibility: visible; }
.info-tip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.listhead { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 14px 4px 8px; }
.phonerow select { flex: 0 0 210px; max-width: 210px; } .phonerow input { flex: 1 1 200px; max-width: none; }
.chips .infodot { align-self: center; }

/* pop-up windows */
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--card); color: var(--text); box-shadow: 0 24px 70px rgba(0,0,0,.28); overflow: hidden; }
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(20, 40, 34, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-x { width: 34px; height: 34px; padding: 0; font-size: 20px; line-height: 1; border-radius: 50%; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--bg); }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.formgrid .fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.formgrid .fld label { margin: 0; }
.formgrid .fld input:not([type="checkbox"]), .formgrid .fld select { width: 100%; max-width: none; } /* a tick box keeps its own size */
.formgrid .phonerow { display: grid; grid-template-columns: 150px 1fr; gap: 8px; }
.formgrid .phonerow select { flex: none; max-width: none; }
.formerr { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: #fde8e6; color: #b42318; font-weight: 600; }
@media (max-width: 640px) { .formgrid { grid-template-columns: 1fr; } }

/* white-label settings */
.wl-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.wl-side { position: sticky; top: 12px; }
.wl-side ul { margin: 0; padding-left: 18px; } .wl-side li { margin: 6px 0; }
.wl-preview { display: flex; flex-direction: column; gap: 8px; overflow-wrap: anywhere; }
.wl-logo { max-width: 160px; max-height: 80px; object-fit: contain; align-self: flex-start; }
.wl-thumb { width: 28px; height: 28px; object-fit: contain; }
.wl-note h2 { margin-bottom: 4px; }
@media (max-width: 900px) { .wl-wrap { grid-template-columns: 1fr; } .wl-side { position: static; } }

.avatar { overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- team chat (web/chat.js): the list on the left, the conversation on the right ---------- */
/* ends above the round Help button, which would otherwise cover Send */
.tc { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); padding: 0; overflow: hidden; height: calc(100dvh - 280px); min-height: 400px; }
.card.tc, body[data-density] .card.tc { padding: 0; margin-top: 0; } /* the two panes reach the edges at every density */
.tc-side, .tc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tc-side { border-right: 1px solid var(--line); }
.tc-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 12px 0; }
.tc-filters { gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tc-note { margin: 0; padding: 8px 12px; font-size: 13px; background: var(--warn-soft); color: var(--warn); }
.tc-list { flex: 1; min-height: 0; overflow-y: auto; }
.tc-item { display: flex; flex: none; align-items: center; gap: 10px; width: 100%; min-height: 62px; padding: 8px 12px; text-align: left; font-weight: 400;
  color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.tc-item:hover { background: var(--raised); }
.tc-item.on { background: var(--accent-soft); }
.tc-item:focus-visible { outline-offset: -3px; }
.tc-item-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.tc-item-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.tc-item-line .tc-clip.muted, .tc-item-line .tc-wrap { flex: 1; font-size: 13px; }
.tc-clip { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-time { font-size: 12px; white-space: nowrap; }
.tc-marks { display: flex; flex: none; align-items: center; gap: 5px; color: var(--muted); }
.tc-count { display: inline-block; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: var(--accent-text);
  font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; }
.tc-count.quiet { background: var(--muted); color: var(--card); }
.tc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.avatar.group { border-radius: 10px; }
.tc-ico { width: 15px; height: 15px; flex: none; vertical-align: -3px; }
span.tc-ico { display: inline-flex; } span.tc-ico svg { width: 100%; height: 100%; }
.tc-ico.tick { margin-right: 3px; }
.tc-ico.read { color: #1673c7; }
body[data-theme="dark"] .tc-ico.read { color: #6cc0ff; }
@media (prefers-color-scheme: dark) { body:not([data-theme]) .tc-ico.read { color: #6cc0ff; } }

.tc-none { margin: auto; }
.tc-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tc-title { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.tc-title h2 { margin: 0; }
.tc-iconbtn { display: inline-grid; flex: none; place-items: center; width: 36px; min-height: 36px; padding: 0; border-radius: 50%; }
.tc-iconbtn svg { width: 18px; height: 18px; }
.tc-back { display: none; }
.tc-log { display: flex; flex: 1; flex-direction: column; gap: 6px; min-height: 0; padding: 12px 16px; overflow-y: auto; background: var(--bg); }
.tc-log > * { flex: none; }
.tc-log:focus-visible { outline-offset: -3px; }
.tc-day { align-self: center; margin: 6px 0; padding: 1px 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.tc-earlier { align-self: center; }
.tc-pad { margin: 0; padding: 16px 12px; text-align: center; }
.tc-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px; }
.tc-row.out { flex-direction: row-reverse; }
.tc-msg { display: flex; flex-direction: column; gap: 2px; max-width: min(78%, 620px); padding: 7px 10px; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.tc-row.out .tc-msg { background: var(--accent-soft); border-color: transparent; }
.tc-row.out .tc-msg.failed { border-color: var(--bad); }
.tc-from { font-size: 13px; color: var(--accent-strong); }
.tc-text { white-space: pre-wrap; }
.tc-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: 11px; color: var(--muted); }
.tc-more { width: 30px; min-height: 30px; background: transparent; border-color: transparent; color: var(--muted); }
@media (hover: hover) {
  .tc-more { opacity: 0; }
  .tc-row:hover .tc-more, .tc-more:focus-visible, .tc-more[aria-expanded="true"] { opacity: 1; }
}
.tc-menu { display: flex; flex-basis: 100%; flex-wrap: wrap; gap: 6px; }
.tc-row.out .tc-menu { justify-content: flex-end; }
.tc-quote { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 0; padding: 4px 8px; text-align: left; font-size: 12.5px; font-weight: 400;
  color: var(--muted); background: var(--raised); border: 0; border-left: 3px solid var(--accent); border-radius: 6px; }
button.tc-quote:hover { background: var(--raised); }
.tc-quote .tc-clip { max-width: 100%; }
.tc-reply { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); }
.tc-reply-text { display: flex; flex: 1; flex-direction: column; min-width: 0; padding-left: 8px; border-left: 3px solid var(--accent); font-size: 13px; }
.tc-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.tc-compose textarea { flex: 1; min-height: 40px; max-height: 140px; resize: none; }
.tc-closed { margin: 0; padding: 12px 14px; text-align: center; border-top: 1px solid var(--line); }

/* the chat pop-ups: staff lists, group info, message info */
.tc-people { display: flex; flex-direction: column; max-height: 42vh; margin-top: 8px; overflow-y: auto; }
.tc-person { display: flex; flex: none; align-items: center; gap: 10px; min-height: 44px; padding: 6px 4px; }
button.tc-person { width: 100%; justify-content: flex-start; font-weight: 400; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.tc-person-text { display: flex; flex: 1; flex-direction: column; min-width: 0; text-align: left; overflow-wrap: anywhere; }
.tc-who h3 { margin: 14px 0 6px; font-size: 14px; }
.tc-field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.tc-inline { display: flex; gap: 8px; }
.tc-inline input { flex: 1; }
.tc-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tc-privacy { margin-top: 14px; font-size: 13px; }

/* photos, documents and lead cards in chat */
.tc-attach { width: 40px; min-height: 40px; }
.tc-photo { display: grid; place-items: center; width: 240px; max-width: 100%; aspect-ratio: 1; min-height: 0; padding: 0; overflow: hidden; font-weight: 400; color: var(--muted); background: var(--raised); border: 0; border-radius: 10px; }
.tc-photo img { width: 100%; height: 100%; object-fit: cover; }
button.tc-photo:hover, button.tc-doc:hover { color: var(--text); background: var(--raised); }
.tc-doc, .tc-lead { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; text-align: left; font-weight: 400; color: var(--text); background: var(--raised); border: 0; border-radius: 10px; }
.tc-doc { min-height: 44px; }
.tc-lead button { margin-top: 4px; }
.tc-full { display: block; max-width: 100%; max-height: 60vh; margin: 0 auto; }
.tc-choices { display: flex; flex-direction: column; gap: 8px; }
.tc-storage progress { width: 100%; }

/* one column on a narrow screen: the list, or the open chat with a way back */
@media (max-width: 760px) {
  /* fits between the top bar and the phone bottom bar once it is scrolled into place (chat.js does that) */
  .tc { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 270px); min-height: 320px; scroll-margin-top: 178px; }
  .tc-side { border-right: 0; }
  .tc .tc-main { display: none; }
  .tc.open .tc-side { display: none; }
  .tc.open .tc-main { display: flex; }
  .tc-back { display: inline-grid; }
  .tc-msg { max-width: 82%; }
}

/* the platform owner's search */
.ownerfind { position: relative; flex: 1 1 220px; max-width: 360px; margin-left: auto; }
.ownerfind[hidden], .findlist[hidden] { display: none; }
.ownerfind input { width: 100%; min-height: 36px; padding: 6px 12px; }
.findlist { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: min(440px, calc(100vw - 28px)); max-height: 70vh;
  overflow-y: auto; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.2); }
.findlist h3 { margin: 8px 6px 4px; font-size: 13px; color: var(--muted); }
.findlist p { margin: 8px 6px; }
.findlist .findrow { display: grid; gap: 2px; justify-items: start; width: 100%; margin-bottom: 4px; text-align: left; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .ownerfind { order: 2; flex: 1 1 100%; max-width: none; }
  .findlist { left: 0; width: auto; }
}
