/* WEBSITEMO: client dashboard, admin area and sign-in pages.
   Uses the colors and parts (buttons, fields, pills, tiles) from style.css. */

/* Your own message bubbles: a slightly deeper blue in the dark theme so white text stays easy to read */
:root { --mine: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --mine: #3454e0; } }
:root[data-theme="dark"] { --mine: #3454e0; }

body.app { background: var(--bg-soft); }
.app .icon { width: 18px; height: 18px; }

/* ---------- Shell: sidebar + main ---------- */
.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px;
  background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
}
.side-logo { padding: 4px 10px 18px; }
.side-logo .logo-mark { width: 30px; height: 30px; }
.side-logo .logo-word { font-size: 1.15rem; }
.side-admin { margin-left: 2px; height: 22px; font-size: .7rem; }
.side-nav { display: grid; gap: 2px; }
.side-group { margin: 16px 12px 6px; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.side-link {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 0; background: none;
  color: var(--muted); font-size: .93rem; font-weight: 600; text-align: left; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.side-link:hover { color: var(--text); background: var(--bg-soft); }
.side-link.is-active { color: var(--accent-text); background: var(--accent-soft); }
.side-link span { flex: 1; }
.side-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; min-width: 0; }
.side-user-text { display: grid; min-width: 0; }
.side-user-text b { font-size: .9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: .82rem; font-weight: 800; }
.side-overlay { display: none; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: 72px;
  padding: 12px max(32px, calc((100% - 1400px) / 2 + 32px));   /* lines up with the centered content on wide screens */
  background: color-mix(in srgb, var(--bg-soft) 86%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-title { min-width: 0; flex: 1; }
.app-title h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.app-title p { font-size: .88rem; color: var(--muted); }
.app-actions { display: flex; align-items: center; gap: 10px; }
.app-actions .btn .icon { width: 16px; height: 16px; }
.app-menu { display: none; }
.app-content { width: 100%; max-width: 1400px; margin-inline: auto; padding: 28px 32px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-content: start; }

/* ---------- Flash notes ---------- */
.flashes { display: grid; gap: 8px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: .93rem; font-weight: 500; }
.flash .icon { width: 18px; height: 18px; flex: none; }
.flash > span { min-width: 0; overflow-wrap: anywhere; }
.flash-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: color-mix(in srgb, var(--ok) 55%, var(--text)); }
.flash-error { background: color-mix(in srgb, var(--error) 11%, transparent); color: var(--error); }
.flash-info { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Panels, rows, tiles ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.panel { border-radius: 18px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; container: panel / inline-size; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.panel-head p { font-size: .85rem; color: var(--muted); }
.panel-head .btn .icon { width: 16px; height: 16px; }
.panel-body { padding: 20px 22px; }
.panel-body > * + * { margin-top: 14px; }
.panel-note { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .88rem; color: var(--muted); }

.app .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.app .tile { padding: 18px 20px; border-radius: 16px; }
.app .tile-value { font-size: 1.6rem; margin: 8px 0 4px; }
.app .tile-note { font-size: .85rem; }
.tile-link { display: block; transition: border-color .2s, transform .4s var(--ease); }
.tile-link:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); transform: translateY(-2px); }

/* List rows: each list sets its columns with --cols, so every row lines up. */
.rows { display: grid; }
.row { display: grid; grid-template-columns: var(--cols, 1fr auto); gap: 16px; align-items: center; padding: 14px 22px; }
.row + .row { border-top: 1px solid var(--line); }
.row:nth-child(even) { background: var(--surface-2); }
.row-head { padding-top: 10px; padding-bottom: 10px; background: var(--surface-2); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.rows .row-head + .row { border-top: 1px solid var(--line); }
.row-main { min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-title a:hover { color: var(--accent-text); }
.row-sub { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
.row-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.row-actions form { display: contents; }
.row-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); overflow: hidden; }
.row-icon img { width: 100%; height: 100%; object-fit: cover; }
a.row:hover { background: var(--accent-soft); }

.empty { padding: 32px 22px; text-align: center; color: var(--muted); }
.empty .icon { width: 28px; height: 28px; margin: 0 auto 10px; color: var(--faint); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }

.pill-ok { color: color-mix(in srgb, var(--ok) 60%, var(--text)); background: color-mix(in srgb, var(--ok) 13%, transparent); border-color: transparent; }
.pill-warn { color: color-mix(in srgb, var(--gold) 45%, var(--text)); background: color-mix(in srgb, var(--gold) 16%, transparent); border-color: transparent; }
.pill-bad { color: var(--error); background: color-mix(in srgb, var(--error) 11%, transparent); border-color: transparent; }

.btn-xs { height: 32px; padding: 0 12px; font-size: .82rem; gap: 6px; }
.btn-xs .icon { width: 15px !important; height: 15px !important; }
.btn-danger { color: var(--error); }
.btn-danger:hover { border-color: var(--error); }
.link { color: var(--accent-text); font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* ---------- Forms in the app ---------- */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.check-line { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; color: var(--muted); cursor: pointer; }
.check-line input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.field-hint { font-size: .84rem; color: var(--faint); }
.field-error { font-size: .84rem; color: var(--error); }
.app .field input, .app .field select, .app .field textarea { padding: 11px 14px; }

/* ---------- Progress tracker ---------- */
.track { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.track-step { position: relative; display: grid; justify-items: center; text-align: center; gap: 8px; }
.track-step:not(:last-child)::after { content: ""; position: absolute; top: 19px; left: calc(50% + 26px); right: calc(-50% + 26px); height: 2px; border-radius: 2px; background: var(--line-strong); }
.track-step.is-done:not(:last-child)::after { background: var(--accent); }
.track-dot { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); color: var(--faint); font-weight: 800; }
.track-dot .icon { width: 18px; height: 18px; stroke-width: 3; }
.is-done .track-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.is-current .track-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.track-text { display: grid; }
.track-text b { font-size: .9rem; font-weight: 700; }
.track-text small { font-size: .78rem; color: var(--muted); }
.is-current .track-text small { color: var(--accent-text); font-weight: 700; }
.live-banner { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 14px; background: color-mix(in srgb, var(--ok) 11%, transparent); }
.live-banner .icon { width: 26px; height: 26px; color: var(--ok); flex: none; }

/* To-do list on the overview */
.todo { display: grid; }
.todo-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 13px 22px; }
.todo-item + .todo-item { border-top: 1px solid var(--line); }
.todo-check { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); }
.todo-item.is-done .todo-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.todo-check .icon { width: 14px; height: 14px; stroke-width: 3.5; }
.todo-item.is-done .todo-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

/* ---------- Messages ---------- */
.thread { display: flex; flex-direction: column; gap: 14px; padding: 22px; max-height: min(60vh, 620px); overflow-y: auto; }
.bubble { max-width: min(78%, 560px); align-self: flex-start; }
.bubble-body { padding: 12px 16px; border-radius: 16px 16px 16px 6px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-meta { margin: 5px 6px 0; font-size: .76rem; color: var(--faint); }
.bubble.mine { align-self: flex-end; }
.bubble.mine .bubble-body { background: var(--mine); border-color: var(--mine); color: #fff; border-radius: 16px 16px 6px 16px; }
.bubble.mine .bubble-meta { text-align: right; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.composer textarea { width: 100%; min-height: 52px; max-height: 220px; resize: vertical; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 1rem; line-height: 1.4; outline: none; }
.composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- Files ---------- */
.drop {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 28px 20px; border-radius: 14px;
  border: 2px dashed var(--line-strong); background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .2s, background-color .2s;
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop .icon { width: 28px; height: 28px; color: var(--accent); }
.drop b { font-size: 1rem; }
.drop small { color: var(--muted); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-list { font-size: .88rem; color: var(--text); font-weight: 600; }

/* ---------- Website check ---------- */
/* .check-form is in style.css (shared with the public check page) */
.result-head { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.result-head h3 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.result-head p { color: var(--muted); }
.ring {
  --tone: var(--accent); position: relative; display: grid; place-content: center; text-align: center; width: 112px; height: 112px; border-radius: 50%;
  background: conic-gradient(var(--tone) calc(var(--p) * 1%), var(--line) 0);
}
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.ring b, .ring small { position: relative; }
.ring b { font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ring small { font-size: .74rem; color: var(--muted); }
.ring-ok { --tone: var(--ok); } .ring-warn { --tone: var(--gold); } .ring-bad { --tone: var(--error); }
.ring-sm { width: 46px; height: 46px; }
.ring-sm::before { inset: 5px; }
.ring-sm b { font-size: .92rem; }
.ring-sm small { display: none; }
.chk { display: grid; place-items: center; }
.chk .icon { width: 22px; height: 22px; }
.chk-pass { color: var(--ok); } .chk-warn { color: var(--gold); } .chk-fail { color: var(--error); }
.checks .row { --cols: 28px minmax(0, 1fr) minmax(0, .9fr); align-items: start; }
.checks .chk { margin-top: 1px; }
.check-found { font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.is-loading .btn-label { opacity: .6; }
.spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
.is-loading .spin { display: block; }

/* ---------- Business check ---------- */
.q-section { display: grid; gap: 18px; }
.q-section + .q-section { margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--line); }
.q-section h3 { display: flex; align-items: center; gap: 12px; font-size: 1.02rem; font-weight: 700; }
.q-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: .85rem; font-weight: 800; }
.q { display: grid; gap: 8px; }
.q-label { font-weight: 600; font-size: .95rem; }
.q-label i { color: var(--error); font-style: normal; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: .9rem; font-weight: 500; cursor: pointer; transition: border-color .2s, background-color .2s, color .2s;
}
.choice span:hover { border-color: var(--accent); }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.reco { display: grid; gap: 16px; }
.reco-plan { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.reco ul { display: grid; gap: 8px; }
.reco li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.reco li .icon { width: 20px; height: 20px; margin-top: 2px; }
.reco .ok { color: var(--ok); } .reco .todo-mark { color: var(--gold); } .reco .plus { color: var(--accent); }
.dl { display: grid; }
.dl > div { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: 16px; padding: 12px 22px; }
.dl > div + div { border-top: 1px solid var(--line); }
.dl > div:nth-child(even) { background: var(--surface-2); }
.dl dt { font-size: .88rem; color: var(--muted); font-weight: 600; }
.dl dd { font-size: .93rem; overflow-wrap: anywhere; white-space: pre-wrap; }

/* ---------- Payments ---------- */
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pay-method { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.pay-method b { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.pay-method span { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-method small { color: var(--muted); }
details.report summary { list-style: none; cursor: pointer; }
details.report summary::-webkit-details-marker { display: none; }
details.report[open] summary { display: none; }
.pay-paypal span { font-weight: 600 !important; }
.pay-paypal em { font-style: normal; color: var(--accent-text); }
.pay-paypal { margin-bottom: 4px; }
.plan-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.plan-choice { position: relative; display: block; cursor: pointer; }
.plan-choice input { position: absolute; opacity: 0; pointer-events: none; }
.plan-choice > span { display: grid; gap: 2px; align-content: start; height: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); transition: border-color .2s, background-color .2s; }
.plan-choice > span b { font-size: .98rem; }
.plan-choice > span .num { font-weight: 700; }
.plan-choice > span small { font-size: .84rem; color: var(--muted); }
.plan-choice:hover > span { border-color: var(--accent); }
.plan-choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.todo-item.is-included .todo-check { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.steps-list { display: grid; gap: 10px; padding-left: 22px; list-style: decimal; }
.steps-list li { padding-left: 4px; }
.steps-list li::marker { color: var(--accent-text); font-weight: 700; }
.code-line { display: block; margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font: .84rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
@container panel (max-width: 760px) {
  .row.setup-row { grid-template-columns: minmax(0, 1fr) auto; }
  .row.setup-row > .row-sub, .row.setup-row > .row-actions { grid-column: 1 / -1; }
  .row.setup-row .row-actions { justify-content: flex-start; }
}
.pay-hidden { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 0; border-bottom: 1px solid var(--line); color: var(--text); }
.pay-hidden b { font-weight: 700; }
.report-form { display: grid; gap: 12px; padding: 16px; margin-top: 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }

/* ---------- Admin ---------- */
/* Admin → client: name and actions on top, then the facts in equal columns */
.client-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: -10px; font-size: .88rem; font-weight: 600; color: var(--muted); justify-self: start; }
.client-back:hover { color: var(--accent-text); }
.client-back .icon { width: 16px; height: 16px; }
.client-top { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px 22px; }
.client-avatar { width: 52px; height: 52px; font-size: 1.05rem; }
.client-name { min-width: 0; }
.client-name h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.client-name p { margin-top: 2px; font-size: .9rem; color: var(--muted); }
.client-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.client-facts { display: grid; grid-template-columns: minmax(0, auto) repeat(4, minmax(max-content, 1fr)); margin: 0; border-top: 1px solid var(--line); background: var(--surface-2); }
.client-facts > div { min-width: 0; padding: 14px 22px; }
.client-facts > div + div { border-left: 1px solid var(--line); }
.client-facts dt { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.client-facts dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 6px 0 0; font-weight: 600; font-size: .92rem; color: var(--text); }
/* The whole email always shows on one line. If it is too long for the space, its text gets smaller (assets/js/app.js) */
.client-facts dd.client-email { display: block; white-space: nowrap; overflow: hidden; }
.client-facts dd { white-space: nowrap; }
.client-name h2 .pill { font-size: .74rem; letter-spacing: 0; }
@container panel (max-width: 900px) {
  .client-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-facts > div:first-child { grid-column: 1 / -1; }
  .client-facts > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .client-facts > div:nth-child(odd):not(:first-child) { border-left: 1px solid var(--line); }
}
@container panel (max-width: 640px) {
  .client-top { grid-template-columns: 48px minmax(0, 1fr); padding: 16px; }
  .client-avatar { width: 48px; height: 48px; }
  .client-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .client-facts > div { padding: 12px 16px; }
}
.client-info { flex: 1 1 200px; min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.tab { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; font-size: .9rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--text); background: var(--bg-soft); }
.tab.is-active { background: var(--accent-soft); color: var(--accent-text); }
.tab .side-badge { height: 20px; min-width: 20px; font-size: .7rem; }
.search { display: flex; gap: 10px; }
.search input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); font-size: .95rem; outline: none; }
.search input:focus { border-color: var(--accent); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input, .inline-form select { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); font-size: .9rem; min-width: 0; }
.inline-form input:focus, .inline-form select:focus { outline: none; border-color: var(--accent); }
.mail-body { margin-top: 10px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font: .84rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
details.mail > summary { cursor: pointer; list-style: none; }
details.mail > summary::-webkit-details-marker { display: none; }
details.mail > summary::after { content: ""; position: absolute; right: 22px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border: solid var(--faint); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
details.mail[open] > summary::after { margin-top: -2px; transform: rotate(-135deg); }
details.mail > summary.row { position: relative; padding-right: 50px; }
details.mail > summary:hover { background: var(--accent-soft); }
.rows > details.mail + details.mail, .panel > details.mail + details.mail { border-top: 1px solid var(--line); }
.rows > details.mail:nth-child(even) > summary { background: var(--surface-2); }
.rows > details.mail:nth-child(even) > summary:hover { background: var(--accent-soft); }
details.mail[open] > summary { border-bottom: 1px solid var(--line); }

/* ---------- Sign-in pages ---------- */
body.auth-page { background: var(--bg); }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-aside {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; color: #fff; isolation: isolate; overflow: hidden;
  background: linear-gradient(160deg, rgba(10, 14, 32, .55), rgba(10, 14, 32, .92)), var(--auth-photo, none) 62% center / cover, #0b1022;
}
.auth-aside .logo-word { color: #fff; }
.auth-aside .logo-word b { color: #8ea6ff; }
.auth-pitch { max-width: 460px; }
.auth-pitch .eyebrow { color: #a9bcff; }
.auth-pitch h2 { color: #fff; margin: 12px 0 24px; }
.auth-points { display: grid; gap: 14px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: rgba(255, 255, 255, .9); }
.auth-points .icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; flex: none; }
.auth-foot { font-weight: 600; color: rgba(255, 255, 255, .7); }
.auth-main { display: flex; flex-direction: column; align-items: center; padding: 28px 24px 48px; }
.auth-top { width: 100%; max-width: 440px; display: flex; justify-content: flex-end; align-items: center; margin-bottom: auto; }
.auth-logo-small { display: none; }
.auth-card { width: 100%; max-width: 440px; margin: 32px 0; }
.auth-card h1 { font-size: clamp(1.7rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.auth-lead { color: var(--muted); margin: 8px 0 26px; }
.auth-card .form { gap: 16px; }
.auth-card .flashes { margin-bottom: 18px; }
.auth-switch { margin-top: auto; color: var(--muted); font-size: .94rem; text-align: center; }
.auth-switch a { color: var(--accent-text); font-weight: 700; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { color: var(--text); }
.pw-toggle .icon { width: 18px; height: 18px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.label-row a { font-size: .86rem; color: var(--accent-text); font-weight: 600; }

/* ---------- Tablets and phones ---------- */
@media (max-width: 1100px) {
  .app .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(300px, 86vw); height: 100%;
    transform: translateX(-102%); visibility: hidden; box-shadow: var(--shadow-lg);
    transition: transform .4s var(--ease), visibility 0s linear .4s;
  }
  .nav-open .side { transform: none; visibility: visible; transition: transform .4s var(--ease), visibility 0s; }
  .side-overlay { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(5, 8, 20, .5); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .nav-open .side-overlay { opacity: 1; pointer-events: auto; }
  .app-menu { display: inline-grid; }
  .app-top { padding: 10px 16px; min-height: 64px; gap: 10px; }
  .app-title h1 { font-size: 1.15rem; }
  .app-title p { display: none; }
  .app-site-link { display: none; }
  .app-content { padding: 18px 16px 48px; gap: 16px; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-top { justify-content: space-between; max-width: 440px; }
  .auth-logo-small { display: inline-flex; }
  .auth-logo-small .logo-mark { width: 30px; height: 30px; }
  .auth-logo-small .logo-word { font-size: 1.15rem; }
}
@media (max-width: 640px) {
  .app .tiles { gap: 10px; }
  .app .tile { padding: 14px; }
  .app .tile-value { font-size: 1.3rem; }
  .panel-head { padding: 14px 16px; flex-wrap: wrap; }
  .panel-body { padding: 16px; }
  .panel-note { padding: 12px 16px; }
  .todo-item { padding: 12px 16px; }
  .thread { padding: 16px; max-height: 58vh; }
  .bubble { max-width: 88%; }
  .composer { padding: 12px 16px; grid-template-columns: 1fr; }
  .composer .btn { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .check-form { grid-template-columns: 1fr; }
  .result-head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .result-head h3 { justify-content: center; }
  .track { grid-template-columns: 1fr; gap: 0; }
  .track-step { grid-template-columns: 40px 1fr; justify-items: start; text-align: left; gap: 14px; padding-bottom: 18px; }
  .track-step:not(:last-child)::after { top: 44px; bottom: 2px; left: 19px; right: auto; width: 2px; height: auto; }
  .auth-card { margin: 24px 0; }
}

/* Helpers */
.stack { display: grid; gap: 22px; align-content: start; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 640px) { .stack { gap: 16px; } }
.pill .icon { width: 14px !important; height: 14px !important; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.pay-form { background: var(--surface-2); }
.pay-form[hidden] { display: none; }
.small-note { font-size: .86rem; line-height: 1.5; }
@media (max-width: 640px) {
  .tiles-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .tiles-3 .tile:last-child { grid-column: 1 / -1; }
  .panel-head .search { max-width: none !important; width: 100%; }
  .panel-head .tabs { width: 100%; }
}

/* Lists inside a box: columns follow the width of the box, so tablets and phones stay tidy */
.row-pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-badges { gap: 6px; justify-content: flex-end; }
.row .track-step:not(:last-child)::after { display: none; }
@container panel (max-width: 900px) {
  .row.clients-row { grid-template-columns: 44px minmax(0, 1fr) 150px 130px 96px; }
  .col-opt { display: none; }
}
/* Medium boxes (tablets): name on top, then the other columns lined up on a second line */
@container panel (max-width: 700px) {
  .rows:has(> .has-pic) > .row-head { display: none; }
  .row.has-pic { grid-template-columns: 40px 150px 140px minmax(0, 1fr); column-gap: 14px; row-gap: 8px; }
  .row.has-pic > :first-child { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
  .row.has-pic > .row-main { grid-column: 2 / -1; }
  .row.has-pic > :nth-child(n+3) { grid-row: 2; }
  .row.has-pic .avatar { width: 40px; height: 40px; }
  .row.has-pic .row-actions, .row.has-pic .row-badges { justify-content: flex-start; }
}
/* Small boxes (phones): picture on the left, everything else under each other */
@container panel (max-width: 520px) {
  .row.has-pic { grid-template-columns: 40px minmax(0, 1fr); row-gap: 0; align-items: start; }
  .row.has-pic > * { grid-column: 2; }
  .row.has-pic > :first-child { grid-column: 1; grid-row: 1 / span 6; }
  .row.has-pic > :nth-child(n+3) { grid-row: auto; margin-top: 6px; }
  .row.has-pic .row-badges:empty { display: none; }
}
/* The payments list has four columns, so it stacks a little sooner */
@container panel (max-width: 760px) {
  .row.pay-row { grid-template-columns: 1fr; gap: 6px; }
  .row-head.pay-row { display: none; }
  .row.pay-row .row-actions { justify-content: flex-start; }
}
@container panel (max-width: 480px) {
  .row { grid-template-columns: 1fr; gap: 6px; }
  .row-head { display: none; }
  .row.keep { grid-template-columns: var(--cols); gap: 12px; }
  .row-actions { justify-content: flex-start; }
  .checks .row { grid-template-columns: 26px minmax(0, 1fr); }
  .checks .check-found { grid-column: 2; }
  .row.keep .row-sub.num { font-size: .78rem; }
  .dl > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 640px) {
  .row { padding: 14px 16px; }
  .dl > div { padding: 12px 16px; }
  details.mail > summary.row { padding-right: 44px; }
  details.mail > summary::after { right: 18px; }
}

/* Keys: client Keys page and the admin Keys tab */
.key-chip { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.key-chip .icon { width: 20px; height: 20px; }
.key-row { --cols: 40px minmax(0, 1fr) 130px 64px; }
.key-row.is-admin { --cols: 40px minmax(0, 1fr) 120px 200px; }
.key-fact { --cols: 40px minmax(0, 1fr); }
.key-log { --cols: 190px minmax(0, 1fr) 280px; }
.key-actions { align-items: center; gap: 16px; }
.key-inline { display: none; }
.key-actions p { margin: 0; }
textarea.mono, .key-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; }
.key-tip { border-top: 1px solid var(--line); padding: 14px 22px 16px; }
.key-tip > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .92rem; list-style: none; }
.key-tip > summary::-webkit-details-marker { display: none; }
.key-tip > summary .icon { width: 18px; height: 18px; color: var(--accent); }
.key-tip p, .key-tip ul { margin: 10px 0 0; }
.key-tip ul { padding-left: 18px; display: grid; gap: 4px; }
.key-reveal { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 22px 16px 74px; border-top: 1px dashed var(--line-strong); background: var(--accent-soft); }
.key-value { display: block; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.key-reveal .small { grid-column: 1 / -1; margin: 0; }
@container panel (max-width: 640px) {
  .key-row, .key-row.is-admin { --cols: 40px minmax(0, 1fr) auto; }
  .key-row > :nth-child(3) { display: none; }
  .key-inline { display: inline; }
  .key-log { --cols: minmax(0, 1fr); gap: 2px; }
  .key-reveal { padding-left: 22px; grid-template-columns: minmax(0, 1fr); }
}

/* Live chat: Admin → Chats (the bubbles, "is typing" and dots are in style.css) */
.side-badge[hidden] { display: none; }
.avatar-lg { width: 44px; height: 44px; font-size: .9rem; }
.cs-star { color: var(--gold); margin-right: 6px; }
.cs-note { border: 1px solid var(--line); border-radius: 14px; }
.cs-wrap { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px; align-items: start; }
.cs-list .rows { max-height: 640px; overflow-y: auto; }
.cs-row { --cols: 36px minmax(0, 1fr) 84px; gap: 12px; padding: 13px 18px; transition: background .2s; }
.cs-row:hover { background: var(--accent-soft); }
.cs-row.is-current { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.cs-row .row-title, .cs-row .row-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-row.is-unread .row-title { font-weight: 800; }
.cs-row.is-unread .row-sub { color: var(--text); }
.cs-when { display: grid; gap: 5px; justify-items: start; align-self: stretch; align-content: center; padding-left: 12px; border-left: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.cs-when .side-badge { height: 20px; min-width: 20px; font-size: .7rem; background: var(--error); }
.cs-stars { color: var(--gold); letter-spacing: 1px; font-size: .78rem; }
.cs-conv { display: flex; flex-direction: column; min-height: 520px; }
.cs-pick { flex: 1; display: grid; align-content: center; }
.cs-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.cs-back { display: none; align-items: center; gap: 6px; grid-column: 1 / -1; font-size: .88rem; }
.cs-back .icon { width: 16px; height: 16px; }
.cs-who { min-width: 0; display: grid; gap: 3px; }
.cs-who .row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.02rem; }
.cs-here { color: color-mix(in srgb, var(--ok) 70%, var(--text)); font-weight: 600; }
.cs-here i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--ok); vertical-align: 1px; }
.cs-here[hidden] { display: none; }
.cs-acts form { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cs-strip { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 11px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: .86rem; color: var(--muted); }
.cs-strip .cs-stars { font-size: .9rem; }
.cs-msgs { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 280px; max-height: 520px; padding: 20px 22px; overflow-y: auto; background: var(--bg-soft); }
.cs-msgs .cm { max-width: 75%; }
.cs-typing { padding: 0 22px 10px; }
.cs-reply { display: grid; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.cs-reply textarea { width: 100%; min-height: 76px; max-height: 260px; resize: vertical; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; }
.cs-reply textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cs-send { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cs-send p { margin: 0; }
.cs-name { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.cs-name > * + * { margin-top: 0; }
.cs-name input { width: 100%; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; }
.cs-name input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
@media (max-width: 1100px) {
  .cs-wrap { grid-template-columns: minmax(0, 1fr); }
  .cs-wrap.has-thread .cs-list { display: none; }
  .cs-wrap:not(.has-thread) .cs-conv { display: none; }
  .cs-back { display: inline-flex; }
}
@media (max-width: 640px) {
  .cs-head { grid-template-columns: 44px minmax(0, 1fr); padding: 14px 16px; }
  .cs-acts { grid-column: 1 / -1; }
  .cs-acts form { justify-content: flex-start; }
  .cs-msgs { padding: 16px; }
  .cs-msgs .cm { max-width: 88%; }
  .cs-reply, .cs-strip { padding-left: 16px; padding-right: 16px; }
  .cs-send { flex-direction: column; align-items: stretch; }
  .cs-name { grid-template-columns: minmax(0, 1fr); }
}

/* Live chat alerts on every admin page (assets/js/admin-chat.js) */
.al-alerts { position: relative; }
.al-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 85; width: 270px; display: grid; gap: 8px; padding: 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: chat-up .2s var(--ease); }
.al-menu[hidden] { display: none; }
.al-menu b { font-size: .9rem; }
.al-opt { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .86rem; font-weight: 600; text-align: left; cursor: pointer; }
.al-opt:hover:not(:disabled) { background: var(--bg-soft); }
.al-opt:disabled { color: var(--muted); cursor: default; }
.al-opt[hidden] { display: none; }
.al-note { margin: 0; font-size: .8rem; line-height: 1.45; color: var(--muted); }
.al-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 10px; width: min(360px, calc(100vw - 24px)); }
.admin-live:has(.al-chat) .al-toasts { right: 400px; }
.al-toast { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); animation: al-in .35s var(--ease); }
.al-main { min-width: 0; display: grid; gap: 4px; }
.al-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.al-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.al-top small { flex: none; font-size: .76rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.al-toast p { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: .88rem; line-height: 1.45; color: var(--muted); }
.al-acts { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.al-x { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--faint); cursor: pointer; }
.al-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.al-x:hover { background: var(--bg-soft); color: var(--text); }
.al-chat { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; width: min(370px, calc(100vw - 24px)); height: min(520px, calc(100vh - 100px));
  border-radius: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; animation: chat-up .3s var(--ease); }
.al-head { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); }
.al-who { min-width: 0; display: grid; }
.al-who b, .al-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-who b { font-size: .92rem; }
.al-who small { font-size: .76rem; color: var(--muted); }
.al-full { font-size: .8rem; font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.al-full:hover { text-decoration: underline; }
.al-msgs { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px; overflow-y: auto; background: var(--bg-soft); }
.al-typing { padding: 2px 14px 8px; }
.al-typing[hidden], .al-err[hidden] { display: none; }
.al-err { margin: 0; padding: 6px 14px; font-size: .84rem; color: var(--error); background: color-mix(in srgb, var(--error) 10%, var(--surface)); }
.al-send { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 10px; border-top: 1px solid var(--line); }
.al-send textarea { min-height: 40px; max-height: 120px; resize: none; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: inherit; font-size: .9rem; line-height: 1.4; }
.al-send textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
@keyframes al-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .admin-live:has(.al-chat) .al-toasts { right: 12px; bottom: auto; top: 76px; }
  .al-toasts, .al-chat { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { .al-toast, .al-chat, .al-menu { animation: none; } }

/* Business check: steps on the left, one card per section, progress bar at the bottom */
.brief { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.brief-steps { position: sticky; top: 96px; display: grid; gap: 4px; }
.brief-steps-title { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.brief-steps-note { margin-bottom: 14px; font-size: .84rem; color: var(--muted); }
.brief-steps ol { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.brief-steps a { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; color: var(--text); transition: background .2s; }
.brief-steps a:hover { background: var(--surface); }
.brief-steps a.is-current { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.brief-step-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: .82rem; font-weight: 800; }
.brief-step-num .icon { display: none; width: 15px; height: 15px; }
.brief-steps a.is-current .brief-step-num { border-color: var(--accent); color: var(--accent-text); }
.brief-steps a.is-done .brief-step-num { border-color: transparent; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.brief-steps a.is-done .brief-step-num > span { display: none; }
.brief-steps a.is-done .brief-step-num .icon { display: block; }
.brief-step-text { display: grid; min-width: 0; }
.brief-step-text b { font-size: .9rem; font-weight: 600; }
.brief-step-text small { font-size: .78rem; color: var(--faint); }
.brief-form { display: grid; gap: 18px; min-width: 0; }
.brief-card { scroll-margin-top: 92px; }
.brief-card-head { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.brief-card-head .q-num { width: 32px; height: 32px; }
.brief-card-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.brief-card-head p { font-size: .86rem; color: var(--muted); }
.brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 22px 20px; padding: 22px 24px 24px; }
.brief-grid .q { grid-column: 1 / -1; align-content: start; }
.brief-grid .q-half { grid-column: auto; }
.brief-grid .field textarea { min-height: 96px; }
.q-other { margin-top: 4px; padding: 14px; border-radius: 12px; border: 1px dashed var(--line-strong); background: var(--surface-2); }
.q-other[hidden] { display: none; }
.q-other label i { color: var(--error); font-style: normal; }
.choice-tick { display: none; width: 15px !important; height: 15px !important; margin-right: 2px; }
.choice input:checked + span .choice-tick { display: inline-block; }
.choice span { display: inline-flex; align-items: center; gap: 6px; }
.brief-bar { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 22px; border-radius: 16px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.brief-bar-progress { flex: 1; display: grid; gap: 8px; min-width: 0; }
.brief-bar-progress p { font-size: .88rem; color: var(--muted); }
.brief-bar-progress b { color: var(--text); font-variant-numeric: tabular-nums; }
.brief-meter { display: block; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; max-width: 320px; }
.brief-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #8b5cf6); transition: width .4s var(--ease); }
@media (max-width: 1100px) {
  .brief { grid-template-columns: minmax(0, 1fr); }
  .brief-steps { display: none; }
}
@media (max-width: 640px) {
  .brief-grid { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 20px; gap: 20px; }
  .brief-grid .q-half { grid-column: 1 / -1; }
  .brief-card-head { padding: 16px; }
  .brief-bar { bottom: 10px; padding: 12px; flex-wrap: wrap; }
  .brief-bar-progress { flex-basis: 100%; }
  .brief-bar .btn { flex: 1; justify-content: center; }
}
/* Business check results: each section on its own row, its name on the left and the answers lined up on the right */
.answers { display: grid; }
.answers-group { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-width: 0; }
.answers-group + .answers-group { border-top: 1px solid var(--line); }
.answers-group h3 { display: flex; align-items: flex-start; gap: 10px; padding: 14px 22px; font-size: .92rem; font-weight: 700; border-right: 1px solid var(--line); }
.answers-group h3 .q-num { flex: none; width: 24px; height: 24px; font-size: .75rem; margin-top: -2px; }
.answers-group .dl > div { grid-template-columns: minmax(0, 46%) minmax(0, 1fr); }
@container panel (max-width: 760px) {
  .answers-group { grid-template-columns: minmax(0, 1fr); }
  .answers-group h3 { border-right: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); }
  .answers-group .dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Business check: "What to prepare", three step cards with their own upload area */
.reco-wide { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.prep-head { flex-wrap: wrap; }
.prep-progress { display: flex; align-items: center; gap: 12px; }
.prep-progress b { font-size: .84rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.prep-segs { display: flex; gap: 4px; }
.prep-segs i { width: 34px; height: 6px; border-radius: 999px; background: var(--line); }
.prep-segs i.on { background: var(--ok); }
.prep-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 20px 22px 22px; }
.prep-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.prep-card.is-done { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.prep-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.prep-step { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.prep-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap;
  color: color-mix(in srgb, var(--gold) 50%, var(--text)); background: color-mix(in srgb, var(--gold) 15%, transparent); }
.prep-chip .icon { width: 12px !important; height: 12px !important; }
.is-done .prep-chip { color: color-mix(in srgb, var(--ok) 65%, var(--text)); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.is-us .prep-chip { color: var(--muted); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.prep-card h3 { margin: 0; font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.prep-note { font-size: .86rem; line-height: 1.5; color: var(--muted); }
.prep-action { display: grid; gap: 10px; margin-top: auto; padding-top: 12px; }
.prep-got { display: flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.prep-got .icon { width: 16px; height: 16px; }
.prep-upload { display: grid; gap: 10px; }
.prep-drop { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1.5px dashed var(--line-strong); background: var(--surface); cursor: pointer; transition: border-color .2s, background .2s; }
.prep-drop:hover, .prep-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.prep-drop > .icon { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.prep-drop span { display: grid; min-width: 0; }
.prep-drop b { font-size: .88rem; font-weight: 700; }
.prep-drop small { font-size: .78rem; color: var(--faint); }
.prep-picked { display: flex; flex-wrap: wrap; gap: 6px; }
.prep-picked[hidden], .prep-upload [hidden] { display: none; }
.prep-file { max-width: 100%; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .78rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-block { width: 100%; justify-content: center; }
.prep-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.prep-foot p { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: var(--muted); }
.prep-foot p .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.prep-foot b { color: var(--text); }
@container panel (max-width: 860px) {
  .prep-grid { grid-template-columns: minmax(0, 1fr); }
  .reco-wide { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@container panel (max-width: 480px) {
  .prep-grid { padding: 16px; gap: 12px; }
  .prep-head, .prep-foot { padding: 14px 16px; }
  .prep-foot .btn { width: 100%; justify-content: center; }
}

/* Client dashboard: room for the Chat button, and the Business check bar sits above it */
body:has(.chat-client) .app-content { padding-bottom: 110px; }
body:has(.chat-client) .brief-bar { bottom: 88px; }

/* ---------- Live updates and notifications (assets/js/live.js) ---------- */
.al-top b { min-width: 0; }
.lv-toast .al-top { align-items: flex-start; }
.lv-toast .al-top b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; line-height: 1.35; }
.lv-toast .al-top small { padding-top: 2px; }
.lv-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.lv-icon svg, .push-icon svg { width: 18px; height: 18px; }
body:has(.chat-client) .al-toasts { bottom: 96px; }
.push-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 20px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.push-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.push-icon svg { width: 20px; height: 20px; }
.push-text { min-width: 0; display: grid; gap: 2px; }
.push-text b { font-size: .95rem; }
.push-text p { margin: 0; font-size: .87rem; line-height: 1.5; color: var(--muted); }
.push-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.push-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.push-row p, .push-row > * + * { margin: 0; }
.push-row .btn { flex: none; }
.push-row .btn[hidden] { display: none; }
@media (max-width: 640px) {
  .push-card { grid-template-columns: 40px minmax(0, 1fr); padding: 16px; }
  .push-icon { width: 40px; height: 40px; }
  .push-acts { grid-column: 1 / -1; justify-content: stretch; }
  .push-acts .btn { flex: 1; }
  .push-row { flex-direction: column; align-items: stretch; }
  body:has(.chat-client) .al-toasts { bottom: 84px; }
}

/* ---------- Admin → Security ---------- */
.sec-steps { list-style: none; margin: 0; padding: 22px 22px 6px; }
.sec-steps li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; padding-bottom: 22px; }
.sec-steps li:not(:last-child)::before { content: ""; position: absolute; left: 15.5px; top: 36px; bottom: 4px; width: 1px; background: var(--line-strong); }
.sec-steps .app-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--bg-soft); font-weight: 700; font-size: .88rem; }
.sec-steps b { display: block; padding-top: 5px; font-weight: 600; }
.sec-steps p { margin-top: 3px; font-size: .9rem; color: var(--muted); line-height: 1.55; }
.sec-key { padding: 2px 6px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--line); font-size: .86rem; letter-spacing: .04em; color: var(--text); overflow-wrap: anywhere; }
.sec-qr { width: 200px; height: 200px; margin-top: 14px; padding: 6px; border-radius: 14px; background: #fff; }
.sec-qr svg { display: block; width: 100%; height: 100%; }
.sec-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.sec-inline input { width: 170px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.sec-inline input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sec-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.sec-actions .sec-inline { margin-top: 0; }
.backup-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; padding: 0; list-style: none; }
.backup-grid li { padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft); text-align: center; font-weight: 700; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.sec-list { list-style: none; margin: 0; padding: 0; }
.sec-list li { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 22px; }
.sec-list li + li { border-top: 1px solid var(--line); }
.sec-list li:nth-child(even) { background: var(--surface-2); }
.sec-when { color: var(--muted); font-size: .9rem; }
.sec-device { display: grid; min-width: 0; }
.sec-device small { color: var(--muted); font-size: .84rem; }
.sec-checks { list-style: none; margin: 0; padding: 8px 22px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
.sec-checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 12px 0; }
.sec-checks .icon { width: 20px; height: 20px; color: var(--ok); margin-top: 1px; }
.sec-checks span { display: grid; gap: 2px; font-size: .88rem; color: var(--muted); line-height: 1.5; }
.sec-checks b { color: var(--text); font-size: .94rem; }
.code-input { font-size: 1.3rem !important; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 760px) {
  .backup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sec-list li { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; }
  .sec-when { grid-column: 1 / -1; }
  .sec-checks { grid-template-columns: 1fr; }
}

/* ---------- Admin → Account settings (like FareFinders: sections with a menu on the left) ---------- */
.acct { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.acct-nav { position: sticky; top: 24px; display: grid; gap: 2px; padding: 8px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.acct-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.acct-nav a:hover { background: var(--bg-soft); color: var(--text); }
.acct-nav .icon { width: 17px; height: 17px; }
.acct-main { display: grid; gap: 20px; min-width: 0; }
.acct-sec { scroll-margin-top: 24px; }
.acct-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-items: start; }
.acct-fields > * + * { margin-top: 0; }
.acct-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acct-actions .btn { margin-left: auto; }
.acct-pending { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 22px 0; padding: 12px 14px; border-radius: 12px;
  background: var(--accent-soft); color: var(--text); font-size: .88rem; line-height: 1.5; }
.acct-pending .icon { width: 18px; height: 18px; color: var(--accent-text); flex: none; }
.acct-pending span { flex: 1; min-width: 200px; }
.side-user-link { border-radius: 12px; padding: 6px; margin: -6px -6px 6px; transition: background-color .2s; }
.side-user-link:hover { background: var(--bg-soft); }
@media (max-width: 980px) {
  .acct { grid-template-columns: 1fr; }
  .acct-nav { display: none; }
}
@media (max-width: 640px) {
  .acct-fields { grid-template-columns: 1fr; }
  .acct-actions .btn { width: 100%; }
}

/* ---------- Admin → Facebook ---------- */
.fb-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; padding: 18px 22px; }
.fb-day { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-align: center; transition: border-color .2s, background-color .2s; }
.fb-day small { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.fb-day b { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.fb-day span { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.fb-day.has-post span { color: var(--text); font-weight: 600; }
.fb-day.has-post span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--ok); vertical-align: 1px; }
.fb-day.is-open { border-style: dashed; border-color: var(--line-strong); background: transparent; }
.fb-day.is-open span { color: var(--faint); }
.fb-day.is-today small { color: var(--accent-text); }
.fb-day.is-picked { border: 1px solid var(--accent); background: var(--accent-soft); }
.fb-day:hover { border-color: var(--accent); }
.fb-photo { display: grid; gap: 10px; justify-items: start; }
.fb-photo img { max-width: 100%; max-height: 180px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; }
.fb-photo input[type=file] { width: 100%; padding: 8px; border-radius: 12px; border: 1px dashed var(--line-strong); background: var(--surface-2); font-size: .9rem; color: var(--muted); cursor: pointer; }
.fb-photo input[type=file]::file-selector-button { margin-right: 12px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.fb-photo input[type=file]:hover::file-selector-button { border-color: var(--accent); }
.fb-actions .small { margin-left: auto; }
.fb-row { --cols: 56px minmax(0, 1fr) 112px 120px 264px; }
.fb-thumb { width: 56px; height: 56px; border-radius: 12px; }
.fb-thumb .icon { width: 22px; height: 22px; }
.fb-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fb-error { color: var(--error); }
.fb-when { display: grid; gap: 2px; font-size: .9rem; }
.fb-when b { font-weight: 600; }
.fb-when small { color: var(--muted); font-size: .84rem; }
.fb-row .row-actions { flex-wrap: wrap; gap: 6px; }
.fb-page { --cols: 40px minmax(0, 1fr) auto; }
@media (max-width: 1100px) {
  .fb-row { --cols: 56px minmax(0, 1fr) 110px 140px; }
  .fb-row .row-actions { grid-column: 2 / -1; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .fb-days { gap: 6px; padding: 14px 16px; }
  .fb-day { padding: 8px 2px; border-radius: 10px; }
  .fb-day b { font-size: 1.05rem; }
  .fb-day span { font-size: 0; }
  .fb-day span::before, .fb-day.has-post span::before { font-size: .7rem; }
  .fb-day.is-open span::before { content: "Open"; color: var(--faint); }
  .fb-day.has-post span::before { margin: 0; }
  .fb-row { grid-template-columns: 48px minmax(0, 1fr); grid-template-areas: "thumb main" "thumb when" ". actions"; gap: 6px 14px; padding: 14px 16px; align-items: start; }
  .fb-row .fb-thumb { grid-area: thumb; width: 48px; height: 48px; }
  .fb-row .row-main { grid-area: main; }
  .fb-row .fb-when { grid-area: when; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .fb-row .fb-when small::before { content: "· "; }
  .fb-row .fb-status { grid-area: when; justify-self: end; }
  .fb-row .row-actions { grid-area: actions; }
  .fb-page { grid-template-columns: 40px minmax(0, 1fr); }
  .fb-page .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .fb-actions .small { margin-left: 0; width: 100%; }
}

/* Client overview: a payment you asked for stands out (soft glow, a light sweep, a nudging arrow) */
.todo-item.is-urgent { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.todo-item.is-urgent .todo-text { font-weight: 600; }
.todo-item.is-urgent .todo-check { border-color: var(--accent); animation: pay-ring 2s ease-out infinite; }
.btn-pay { position: relative; overflow: hidden; isolation: isolate; animation: pay-glow 2.4s ease-in-out infinite; }
.btn-pay::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%); transform: translateX(-130%); animation: pay-shine 2.4s ease-in-out infinite; }
.btn-pay .icon-arrow { animation: pay-nudge 1.2s ease-in-out infinite; }
@keyframes pay-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes pay-glow { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); } }
@keyframes pay-shine { 0%, 55% { transform: translateX(-130%); } 85%, 100% { transform: translateX(130%); } }
@keyframes pay-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .todo-item.is-urgent .todo-check, .btn-pay, .btn-pay::after, .btn-pay .icon-arrow { animation: none; } }

/* Client → Payments: the payment that is due, in its own box */
.pay-due { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.pay-due-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 24px; align-items: center; padding: 20px 22px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.pay-due-amount { margin: 6px 0 4px; font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.pay-due-actions { display: grid; justify-items: end; gap: 8px; text-align: right; }
.pay-due-actions form { display: contents; }
.pay-due-actions small { font-size: .82rem; color: var(--muted); }
@media (max-width: 640px) {
  .pay-due-main { grid-template-columns: 1fr; padding: 16px; }
  .pay-due-actions { justify-items: stretch; text-align: left; }
  .pay-due-actions .btn { width: 100%; justify-content: center; }
  .pay-due-amount { font-size: 1.7rem; }
}
.pay-due-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.pay-due-buttons form { display: contents; }
@media (max-width: 640px) { .pay-due-buttons { flex-direction: column; } .pay-due-buttons .btn { width: 100%; justify-content: center; } }

/* ---------- Admin → Email ---------- */
.mail-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.mail-bar-actions { display: flex; gap: 8px; margin-left: auto; }
.mail-bar-actions form { display: contents; }
.mail-bar .tab .side-badge { margin-left: 6px; }
.mail-row { --cols: 40px minmax(0, 1fr) 110px; }
.mail-row .avatar { width: 40px; height: 40px; font-size: .85rem; }
.mail-row .row-title { font-weight: 500; }
.mail-row .row-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-row.is-unread .row-title { font-weight: 700; }
.mail-row.is-unread .row-title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 2px; }
.mail-row.is-unread .row-sub { color: var(--text); }
.mail-meta { display: grid; justify-items: start; gap: 4px; font-size: .85rem; color: var(--muted); }
.mail-row.is-unread .mail-meta .num { color: var(--text); font-weight: 600; }
.mail-icons { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.mail-icons .icon { width: 15px; height: 15px; }
.mail-icons .pill { font-size: .7rem; padding: 1px 8px; }
.mail-box-row { --cols: 40px minmax(0, 1fr) auto; }
.mail-err { color: var(--error); }
.mail-view .panel-head .link { display: inline-flex; align-items: center; gap: 6px; }
.mail-view .panel-head .link .icon { width: 16px; height: 16px; }
.mail-view .row-actions form { display: flex; gap: 8px; }
.mail-head { padding: 18px 22px 0; }
.mail-head h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 14px; overflow-wrap: anywhere; }
.mail-from { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.mail-from .avatar { width: 40px; height: 40px; font-size: .85rem; }
.mail-from .pill { margin-left: 6px; font-size: .72rem; }
.mail-text { padding: 20px 22px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: .95rem; }
.mail-text a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.mail-quote { color: var(--muted); }
.mail-atts { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 22px 20px; }
.mail-att { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.mail-att:hover { border-color: var(--accent); }
.mail-att .icon { flex: none; width: 18px; height: 18px; color: var(--accent); }
.mail-att span { display: grid; min-width: 0; }
.mail-att b { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-att small { font-size: .78rem; color: var(--muted); }
@media (max-width: 640px) {
  .mail-bar-actions { margin-left: 0; width: 100%; }
  .mail-bar-actions .btn-primary { flex: 1; justify-content: center; }
  .mail-bar .tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .row.mail-row { grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; padding: 12px 16px; gap: 4px 12px; }
  .row.mail-box-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .mail-row .avatar { width: 36px; height: 36px; }
  .mail-meta { justify-items: end; }
  .mail-head { padding: 16px 16px 0; }
  .mail-from { grid-template-columns: 36px minmax(0, 1fr); }
  .mail-from > .row-sub { grid-column: 2; }
  .mail-text { padding: 16px; }
  .mail-atts { padding: 0 16px 16px; }
  .mail-view .panel-head { flex-wrap: wrap; }
}

/* ---------- Dashboard forms: clean, organized (uppercase labels, underlined fields, wide columns) ---------- */
@font-face {
  font-family: "Oswald"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/oswald-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Oswald"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/oswald-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
.app { --label-font: "Oswald", "Plus Jakarta Sans", system-ui, sans-serif; }
.app .panel-head h2 { font-family: var(--label-font); font-size: 1.05rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.app .form { gap: 26px; }
.app .form-row { gap: 26px 40px; }
.app .acct-fields { gap: 26px 40px; }
.app .field { gap: 10px; }
.app .field label { font-family: var(--label-font); font-size: 1.02rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text); }
.app .field label span { font-family: "Plus Jakarta Sans", system-ui, sans-serif; font-size: .8rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--faint); margin-left: 4px; }
.app .field input, .app .field select, .app .field textarea {
  padding: 8px 0 10px; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; background: transparent;
  font-size: .95rem; box-shadow: none; transition: border-color .2s, box-shadow .2s;
}
.app .field input:hover, .app .field select:hover, .app .field textarea:hover { border-bottom-color: var(--faint); }
.app .field input:focus, .app .field select:focus, .app .field textarea:focus { border-bottom-color: var(--accent); background: transparent; box-shadow: 0 1px 0 0 var(--accent); }
.app .field input:disabled { color: var(--muted); }
.app .field [aria-invalid="true"] { border-bottom-color: var(--error); }
.app .field textarea { min-height: 110px; padding-top: 10px; }
.app .field select { padding-right: 28px; }
.app .select::after { right: 6px; }
.app .field-hint { font-size: .82rem; }
.app .field-error { font-size: .8rem; }
.app .code-input { padding: 10px 0 !important; }
.app .inline-form input, .app .inline-form select { padding: 8px 0; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; background: transparent; }
.app .inline-form input:focus, .app .inline-form select:focus { border-bottom-color: var(--accent); box-shadow: 0 1px 0 0 var(--accent); }
.app .fb-photo input[type=file] { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 8px; }
.app .check-line { font-size: .9rem; }
.app .panel-note.form-actions, .app .panel-note.acct-actions { padding-top: 16px; padding-bottom: 16px; }
@media (max-width: 640px) {
  .app .form { gap: 22px; }
  .app .form-row, .app .acct-fields { gap: 22px; }
}

/* ---------- Big uploads: progress ---------- */
.up-list { display: grid; gap: 12px; }
.up-item { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.up-head { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.up-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.up-pct { flex: none; color: var(--muted); }
.up-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.up-fill { height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .25s; }
.up-note { font-size: .8rem; color: var(--faint); }
.up-item.is-done .up-fill { background: var(--ok); }
.up-item.is-done .up-pct { color: color-mix(in srgb, var(--ok) 60%, var(--text)); font-weight: 600; }
.up-item.is-failed .up-fill { background: var(--error); }
.up-item.is-failed .up-pct, .up-item.is-failed .up-note { color: var(--error); }
.up-tail { font-size: .88rem; color: var(--muted); }

/* Website agreement (client/agreement.php, Admin → client → Agreement, the printable copy) */
.ag-callout { margin-bottom: 0; }
.ag-tile-text { font-size: 1.05rem !important; line-height: 1.3; }
.ag-wrap { padding: 0; }
.ag-doc { max-width: 820px; margin: 0 auto; padding: 30px 32px 34px; color: var(--text); font-size: .95rem; line-height: 1.6; }
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 3px solid var(--accent); }
.ag-brand { display: flex; align-items: center; gap: 10px; }
.ag-brand .logo-mark { width: 36px; height: 36px; }
.ag-brand b { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.ag-brand b span { color: var(--accent-text); }
.ag-brand small { display: block; font-size: .74rem; color: var(--muted); font-weight: 600; }
.ag-head-r { font-size: .8rem; color: var(--muted); text-align: right; line-height: 1.5; }
.ag-head-r b { color: var(--text); }
.ag-doc h1 { font-size: 1.45rem; letter-spacing: -.02em; margin: 20px 0 4px; }
.ag-ref { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: .86rem; color: var(--muted); }
.ag-ref b { color: var(--text); }
.ag-lead { margin: 12px 0 6px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); border-left: 3px solid var(--accent); }
.ag-doc h2 { font-size: 1rem; font-weight: 700; margin: 22px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-family: inherit; letter-spacing: 0; text-transform: none; }
.ag-doc p { margin: 6px 0; }
.ag-doc ul { margin: 6px 0; padding-left: 20px; list-style: disc; }
.ag-doc li { margin: 4px 0; }
.ag-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 8px 0; font-size: .9rem; }
.ag-table th, .ag-table td { text-align: left; vertical-align: top; padding: 8px 10px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.ag-table thead th { background: var(--surface-2); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.ag-table tbody th { width: 18%; color: var(--muted); font-weight: 700; background: var(--surface-2); }
.ag-blank { color: var(--faint); font-style: italic; }
.ag-signature { display: block; font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 1.6rem; line-height: 1.2; color: var(--accent-text); margin-bottom: 2px; }
.ag-proof { margin-top: 12px !important; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .8rem; color: var(--muted); }
.ag-proof code { overflow-wrap: anywhere; font-size: .74rem; }
.ag-sign-input { font-size: 1.15rem !important; }
.ag-done { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ag-done > .icon { width: 34px; height: 34px; color: var(--ok); flex: none; }
.ag-done > div { flex: 1; min-width: 220px; }
.ag-done p { color: var(--muted); }
body.ag-print { background: #e9edf5; padding: 24px 12px; }
body.ag-print .ag-doc { background: #fff; color: #1a2235; border-radius: 12px; box-shadow: 0 10px 30px rgba(14, 21, 38, .12); }
.ag-toolbar { max-width: 820px; margin: 0 auto 14px; display: flex; justify-content: flex-end; }
@media (max-width: 640px) {
  .ag-doc { padding: 20px 16px 24px; }
  .ag-head-r { text-align: left; }
  .ag-table, .ag-table tbody, .ag-table tr, .ag-table th, .ag-table td { display: block; width: auto !important; }
  .ag-table thead { display: none; }
  .ag-table tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
  .ag-table th, .ag-table td { border: 0; }
  .ag-table td + td { border-top: 1px solid var(--line); }
  .ag-table td::before { content: attr(data-label); display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
}
@media print {
  @page { size: A4; margin: 16mm; }
  body.ag-print { background: #fff; padding: 0; }
  body.ag-print .ag-doc { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  .ag-toolbar { display: none; }
  .ag-doc h2 { break-after: avoid; }
  .ag-sign { break-inside: avoid; }
}

/* Agreement page, modern layout */
.ag-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.ag-steps li { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .9rem; }
.ag-steps li span { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-strong); font-weight: 800; font-size: .82rem; }
.ag-steps li span .icon { width: 15px; height: 15px; }
.ag-steps li b { font-weight: 700; }
.ag-steps li.is-current { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--accent-soft); color: var(--text); }
.ag-steps li.is-current span { background: var(--accent); border-color: var(--accent); color: #fff; }
.ag-steps li.is-done { color: var(--text); }
.ag-steps li.is-done span { background: var(--ok); border-color: var(--ok); color: #fff; }

.ag-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 24px 26px; border-radius: var(--radius-lg, 20px);
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line)); background: linear-gradient(120deg, color-mix(in srgb, var(--ok) 12%, var(--surface)), var(--surface) 65%); }
.ag-hero-ic { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.ag-hero-ic .icon { width: 30px; height: 30px; }
.ag-hero h2 { font-size: 1.3rem; letter-spacing: -.02em; margin: 4px 0 6px; }
.ag-hero p { color: var(--muted); }
.ag-hero-cta { display: grid; gap: 8px; }

.ag-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.ag-paper { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(0, 0, 0, .45); overflow: hidden; }
.ag-paper .ag-doc { padding: 40px 44px 44px; max-width: none; }
.ag-side { position: sticky; top: 88px; display: grid; gap: 12px; }
.ag-summary dl { margin: 0; padding: 6px 22px 4px; }
.ag-summary dl > div { padding: 11px 0; }
.ag-summary dl > div + div { border-top: 1px solid var(--line); }
.ag-summary dt { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.ag-summary dd { margin: 3px 0 0; font-weight: 600; line-height: 1.4; }
.ag-price { font-size: 1.6rem; font-weight: 800 !important; letter-spacing: -.02em; }
.ag-summary-cta { display: grid; gap: 8px; padding: 14px 22px 20px; border-top: 1px solid var(--line); }
.ag-side-note { display: flex; gap: 10px; align-items: flex-start; padding: 0 6px; font-size: .86rem; color: var(--muted); line-height: 1.45; }
.ag-side-note .icon { width: 18px; height: 18px; flex: none; color: var(--accent-text); margin-top: 1px; }

.ag-signform { scroll-margin-top: 90px; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.ag-sign-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.ag-sub { display: flex; align-items: center; gap: 10px; font-weight: 800; margin-bottom: 4px; }
.ag-sub span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: .8rem; }
.ag-sigpad { position: relative; padding: 22px 20px 14px; border-radius: 14px; border: 1.5px dashed var(--line-strong); background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.ag-sigpad-name { display: block; min-height: 52px; font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", cursive; font-size: 2.3rem; line-height: 1.3; color: var(--accent-text); overflow-wrap: anywhere; }
.ag-sigpad-name:empty::before { content: attr(data-empty); font-family: inherit; font-size: 1rem; color: var(--faint); }
.ag-sigpad-line { display: block; height: 1.5px; background: var(--line-strong); margin: 4px 0 8px; }
.ag-sigpad small { color: var(--faint); font-size: .78rem; }
.ag-agree { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: .9rem; line-height: 1.45; }
.ag-agree input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.ag-agree:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); }
.ag-sign-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ag-sign-foot > span { display: flex; align-items: center; gap: 8px; }
.ag-sign-foot .icon { width: 16px; height: 16px; flex: none; }

@media (max-width: 1100px) {
  .ag-layout { grid-template-columns: 1fr; }
  .ag-side { position: static; grid-row: 1; }
}
@media (max-width: 640px) {
  .ag-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .ag-steps li { flex-direction: column; text-align: center; gap: 6px; padding: 10px 4px; font-size: .72rem; }
  .ag-steps li b { font-weight: 600; line-height: 1.2; }
  .ag-hero { grid-template-columns: 1fr; padding: 20px 18px; }
  .ag-paper .ag-doc { padding: 22px 16px 26px; }
  .ag-sign-grid { grid-template-columns: 1fr; gap: 22px; }
  .ag-sign-foot .btn { width: 100%; justify-content: center; }
  .ag-sigpad-name { font-size: 1.9rem; }
}
.ag-how { list-style: none; margin: 0; padding: 8px 22px 18px; counter-reset: how; }
.ag-how li { position: relative; padding: 12px 0 12px 40px; counter-increment: how; }
.ag-how li + li { border-top: 1px solid var(--line); }
.ag-how li::before { content: counter(how); position: absolute; left: 0; top: 12px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-size: .8rem; }
.ag-how b { display: block; }
.ag-how span { font-size: .86rem; color: var(--muted); }
#ag-send { scroll-margin-top: 90px; }

/* Remembered devices (two-step sign-in) */
.trust-line { margin: 4px 0 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); line-height: 1.45; }
.trust-line b { color: var(--text); }
.trust-head { display: grid; gap: 2px; padding: 14px 22px 6px; border-top: 1px solid var(--line); }
.trust-head .muted { font-size: .86rem; }
.trust-empty { padding: 0 22px 16px; font-size: .9rem; }
.trust-act { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.trust-all { padding: 0 22px 14px; text-align: right; font-size: .88rem; }

/* Admin → Messenger (admin/messenger.php): conversations reuse the chat layout (.cs-*) */
.fbm-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; border: 1px solid var(--line); border-radius: 14px; }
.fbm-banner span { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fbm-banner .icon { width: 18px; height: 18px; color: var(--accent); }
.fbm-facts { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.fbm-facts div { display: grid; gap: 1px; min-width: 0; }
.fbm-facts dt { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.fbm-facts dd { margin: 0; font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.cs-msgs .cm-bot p { background: var(--surface); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-bottom-right-radius: 5px; }
.fbm-switch .row-icon, .fbm-block .row-icon { background: var(--accent-soft); color: var(--accent); }
.row.fbm-block { --cols: 40px minmax(0, 1fr) 150px 120px auto; transition: background .2s; }
.row.fbm-block:hover, .row.fbm-block.is-current { background: var(--accent-soft); }
.row.fbm-block.is-current { box-shadow: inset 3px 0 0 var(--accent); }
.fbm-block .row-title, .fbm-block .row-sub { display: block; }
.fbm-leads { font-variant-numeric: tabular-nums; }
.fbm-edit { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.fbm-buttons { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.fbm-buttons legend { padding: 0; margin-bottom: 6px; font-family: var(--label-font); font-size: 1.02rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text); }
.fbm-buttons legend span { font-family: "Plus Jakarta Sans", system-ui, sans-serif; font-size: .8rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--faint); margin-left: 4px; }
.fbm-btn { display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); gap: 8px; align-items: center; }
.fbm-btn.is-answer { grid-template-columns: minmax(0, 1fr); }
.fbm-btn input, .fbm-btn select, .fbm-add input, .fbm-add select { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; }
.fbm-btn input:focus, .fbm-btn select:focus, .fbm-add input:focus, .fbm-add select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fbm-arrow { display: grid; place-items: center; color: var(--faint); }
.fbm-arrow .icon { width: 16px; height: 16px; }
.fbm-preview { position: sticky; top: 20px; display: grid; gap: 10px; }
.fbm-phone { display: grid; gap: 10px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--bg-soft); }
.fbm-phone .cm { max-width: 100%; }
.fbm-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.fbm-chips:empty { display: none; }
.fbm-chips span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent-text); font-size: .8rem; font-weight: 600; background: var(--surface); }
.fbm-chips .icon { width: 14px; height: 14px; }
.fbm-add { display: grid; grid-template-columns: minmax(0, 1fr) 230px auto; gap: 10px; align-items: center; }
.row.fbm-kw { --cols: minmax(0, 1fr) 22px 190px auto; }
.fbm-words { display: flex; flex-wrap: wrap; gap: 6px; }
.fbm-words .pill { font-weight: 500; }
.fbm-reset { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-top: 0; }
.fbm-err { color: var(--error); }
.fbm-manual > summary { cursor: pointer; list-style: none; }
.fbm-manual > summary::-webkit-details-marker { display: none; }
.fbm-manual:not([open]) > summary { border-bottom: 0; }
.fbm-manual .panel-body { display: grid; gap: 10px; }
@media (max-width: 1100px) {
  .app-content:has(.cs-wrap.has-thread) .fbm-tiles { display: none; }   /* phones and tablets: the open chat comes first */
}
@media (max-width: 1000px) {
  .fbm-edit { grid-template-columns: minmax(0, 1fr); }
  .fbm-preview { position: static; }
}
@media (max-width: 640px) {
  .fbm-add { grid-template-columns: minmax(0, 1fr); }
  .fbm-facts { padding: 12px 16px; gap: 8px 18px; }
  .fbm-btn { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .fbm-btn .fbm-arrow { display: none; }
  .fbm-btn:not(.is-answer) { padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
}
@container panel (max-width: 480px) {
  .row.fbm-kw .fbm-arrow { display: none; }
}

/* Unread rows (Inquiries, Leads): bold title and an accent line until you have seen them */
.row.is-unread { box-shadow: inset 3px 0 0 var(--accent); }
.row.is-unread .row-title { font-weight: 800; }
/* New chat messages slide in */
.cm-new { animation: cm-in .28s ease-out both; }
@keyframes cm-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cm-new { animation: none; } }
.fbm-err-line { border-radius: 10px; }
.fbm-err-line[hidden], .cs-reply .al-err[hidden] { display: none; }
.cs-reply .al-err { border-radius: 10px; }
/* Messenger in the pop-ups: Messenger's blue-to-purple avatar, so you see at a glance where it came from */
.avatar.al-fb { background: linear-gradient(135deg, #0a7cff, #a033ff); color: #fff; }
.al-chat-fb .al-head { box-shadow: inset 0 -2px 0 color-mix(in srgb, #0a7cff 45%, transparent); }

/* Admin → Leads */
.leads-head { flex-wrap: wrap; gap: 12px; }
.lead-chips { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.lead-chip { padding: 6px 12px; border-radius: 9px; font-size: .84rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.lead-chip:hover { color: var(--text); }
.lead-chip.is-on { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.leads-search { flex: 1; min-width: 220px; position: relative; align-items: center; }
.leads-search .icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.leads-search input { padding-left: 36px; }
.row.lead-row { --cols: 40px minmax(0, 1.5fr) minmax(0, 1.2fr) 130px 110px 70px; }
a.row.lead-row { transition: background .2s; }
a.row.lead-row:hover, .row.lead-row.is-current { background: var(--accent-soft); }
.lead-row .row-title, .lead-row .row-sub { display: block; }
.lead-row .row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lead-contact { display: grid; gap: 2px; min-width: 0; font-size: .9rem; }
.lead-contact span, .lead-contact small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-contact small { color: var(--muted); font-size: .8rem; }
.lead-tag { font-size: .7rem; padding: 1px 8px; margin-left: 2px; }
.lead-card { scroll-margin-top: 90px; }
.lead-top { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.lead-who { min-width: 0; display: grid; gap: 3px; }
.lead-who .row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.05rem; }
.lead-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.lead-acts form { display: contents; }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.lead-form { padding: 22px; }
.lead-consent { display: grid; gap: 8px; align-content: start; padding: 22px; border-left: 1px solid var(--line); background: var(--surface-2); }
.lead-consent-v { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; font-weight: 700; }
.lead-consent-v.is-yes { color: var(--ok); }
.lead-consent-v .icon { width: 20px; height: 20px; }
.lead-quote { margin: 0; padding: 10px 12px; border-left: 3px solid var(--line-strong); border-radius: 6px; background: var(--surface); font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.lead-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.lead-rule-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.lead-rule-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 14px 22px; font-size: .88rem; color: var(--muted); line-height: 1.5; }
.lead-rule-list li + li { border-top: 1px solid var(--line); }
.lead-rule-list b { display: block; color: var(--text); }
.lead-rule-list .icon { width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.row.camp-row { --cols: minmax(0, 1fr) 120px 170px 90px 80px; }
.row-head.camp-row, .row-head.lead-row { padding-top: 10px; padding-bottom: 10px; }
.camp-bar { display: grid; gap: 5px; font-size: .8rem; color: var(--muted); }
.camp-track { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.camp-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s; }
.fb-who { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 1100px) {
  .lead-split, .lead-grid { grid-template-columns: minmax(0, 1fr); }
  .lead-consent { border-left: 0; border-top: 1px solid var(--line); }
}
@container panel (max-width: 760px) {
  .row.camp-row { grid-template-columns: 1fr; gap: 6px; }
  .row-head.camp-row { display: none; }
}
@media (max-width: 640px) {
  .lead-top { grid-template-columns: 44px minmax(0, 1fr); padding: 16px; }
  .lead-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .lead-form, .lead-consent { padding: 16px; }
  .lead-chips { width: 100%; }
  .lead-chip { flex: 1; text-align: center; }
  .leads-search { min-width: 0; width: 100%; flex-basis: 100%; }
  .lead-rule-list li { padding: 12px 16px; }
}

/* Payments: ways to pay (PayMongo) */
.pay-ways { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pay-way { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.pay-way b { display: block; font-weight: 600; }
.pay-way small { display: block; font-size: .82rem; color: var(--muted); }
.pay-way-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.pay-way-ic .icon { width: 20px; height: 20px; }
.pay-ways + .panel-note { border-top: 0; }
.pay-ways + .panel-note .icon, .pay-due-actions small .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
@media (max-width: 640px) { .pay-way { padding: 12px 16px; } }
.row.pm-method { cursor: pointer; }
.row.pm-method input { width: 18px; height: 18px; accent-color: var(--accent); }
.row.pm-pay { --cols: minmax(0, 1fr) 120px 150px 120px; }
a.row.pm-pay:hover { background: var(--accent-soft); }
.pm-method .row-title, .pm-method .row-sub, .pm-pay .row-title, .pm-pay .row-sub { display: block; }
.care-how { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.care-how b { color: var(--text); }
.care-how .icon { width: 20px; height: 20px; color: var(--accent); }
.pay-due-actions small, .pay-ways + .panel-note { display: flex; gap: 6px; align-items: flex-start; }
.pay-due-actions small .icon, .pay-ways + .panel-note .icon { flex: none; margin: 2px 0 0; }
@container panel (max-width: 480px) {
  .row.pm-method { grid-template-columns: 24px minmax(0, 1fr); gap: 4px 12px; align-items: start; }
  .row.pm-method > :last-child { grid-column: 2; }
  .row.pm-method:has(> :last-child:empty) > :last-child { display: none; }
}
