/* Tiny Hub. Tiny Mammoth brand, paper mode. Tokens copied from ~/.claude/standards/tm-brand.css. */
@font-face { font-family: Aspekta; font-weight: 400; font-display: swap; src: url(/static/fonts/Aspekta-400.woff2) format("woff2"); }
@font-face { font-family: Aspekta; font-weight: 500; font-display: swap; src: url(/static/fonts/Aspekta-500.woff2) format("woff2"); }
@font-face { font-family: Aspekta; font-weight: 600; font-display: swap; src: url(/static/fonts/Aspekta-600.woff2) format("woff2"); }

:root {
  --tm-font: Aspekta, ui-sans-serif, system-ui, -apple-system, sans-serif;

  --tm-dark: #050507;
  --tm-dark-soft: #0d0d10;
  --tm-ink-on-dark: #e8e8ea;
  --tm-muted-on-dark: #a8a8a8;

  --tm-paper: #ffffff;
  --tm-hairline: #dce4ec;
  --tm-ink: #2a3135;
  --tm-ink-secondary: #4a545e;

  --tm-blue: #0077c1;
  --tm-gold: #ffbc00;
  --tm-gold-tint: #fff6db;
  --tm-gold-ink: #8a6400;

  --accent: var(--tm-blue);
  --surface: #f5f8fb;
  --tabs-h: 64px;
}

* { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--tm-paper);
  color: var(--tm-ink);
  font-family: var(--tm-font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
}
h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
a { color: var(--tm-blue); }
p { margin: 0 0 12px; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Shell */
.app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom)); }
.app.plain { padding-bottom: 32px; }
.narrow { max-width: 440px; margin: 0 auto; padding: 48px 20px 32px; }
.narrow h1 { margin-bottom: 8px; }
.lede { color: var(--tm-ink-secondary); margin-bottom: 24px; }

.hdr { position: sticky; top: 0; z-index: 20; background: var(--tm-paper); border-bottom: 1px solid var(--tm-hairline); }
.hdr-in { max-width: 720px; margin: 0 auto; padding: 0 16px; min-height: 56px; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; flex: none; display: block; object-fit: cover; }
.hdr-name { flex: 1; min-width: 0; }
.hdr-name > .loc-name, .switcher > summary { display: flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; font-size: 17px; color: var(--tm-ink); text-decoration: none; }
.loc-name span, .switcher > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher > summary { list-style: none; cursor: pointer; }
.switcher > summary::-webkit-details-marker { display: none; }
.switcher > summary svg { flex: none; transition: transform .15s; }
.switcher[open] > summary svg { transform: rotate(180deg); }
.switcher[open] > summary::before { content: ""; position: fixed; inset: 0; background: rgba(5, 5, 7, .45); z-index: 30; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--tm-paper); border-radius: 16px 16px 0 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 70vh; overflow-y: auto; box-shadow: 0 -8px 32px rgba(5, 5, 7, .18); }
.sheet-inner { max-width: 720px; margin: 0 auto; }
.sheet h2 { font-size: 13px; color: var(--tm-ink-secondary); font-weight: 500; padding: 8px 4px; }
.sheet a, .sheet button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--tm-hairline); background: none; color: var(--tm-ink); text-decoration: none; text-align: left; cursor: pointer; }
.sheet a:last-child, .sheet form:last-child button { border-bottom: 0; }
.sheet .on { font-weight: 600; }
.sheet svg { color: var(--accent); }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--tm-ink-secondary); }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary::before { content: ""; position: fixed; inset: 0; background: rgba(5, 5, 7, .45); z-index: 30; }

.banner { background: var(--tm-gold-tint); color: var(--tm-gold-ink); border-radius: 10px; padding: 12px 14px; margin: 16px 0 0; font-weight: 500; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--tm-paper); border-top: 1px solid var(--tm-hairline); padding-bottom: env(safe-area-inset-bottom); }
.tabs-in { max-width: 720px; margin: 0 auto; display: flex; }
.tabs a { flex: 1; min-height: var(--tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--tm-ink-secondary); font-size: 12px; font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* Page heads */
.page-head { padding: 20px 0 12px; }
.sub { color: var(--tm-ink-secondary); font-size: 14px; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.block { display: flex; width: 100%; }
.btn.secondary { background: #fff; color: var(--tm-ink); border: 1px solid var(--tm-hairline); }
.btn.apple { background: #000; color: #fff; border: 1px solid #000; }
.link-btn { background: none; border: 0; padding: 0; min-height: 44px; color: var(--tm-blue); text-decoration: underline; cursor: pointer; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.field input, .field select { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--tm-hairline); border-radius: 10px; background: #fff; }
.field input:focus { border-color: var(--accent); }
.stack > * + * { margin-top: 12px; }
.alt { margin-top: 20px; text-align: center; }
.icon-big { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--tm-blue); margin-bottom: 20px; }

/* Cards, states */
.card { background: #fff; border: 1px solid var(--tm-hairline); border-radius: 12px; padding: 16px; }
.empty { text-align: center; padding: 40px 16px; color: var(--tm-ink-secondary); }
.empty strong { display: block; color: var(--tm-ink); font-weight: 600; margin-bottom: 4px; }
.errbox { text-align: center; padding: 40px 16px; }
.errbox p { color: var(--tm-ink-secondary); }

/* Leads */
.search { display: flex; gap: 8px; margin: 4px 0 0; }
.search input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px; border: 1px solid var(--tm-hairline); border-radius: 24px; background: var(--surface); }
.search button { min-height: 48px; }
.count { color: var(--tm-ink-secondary); font-size: 14px; padding: 14px 0 4px; }
#leads > li, #team > li { border-bottom: 1px solid var(--tm-hairline); }
.row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 0; text-decoration: none; color: var(--tm-ink); }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--tm-blue); font-weight: 600; font-size: 17px; }
.avatar.big { width: 72px; height: 72px; font-size: 28px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--tm-ink-secondary); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { background: var(--surface); color: var(--tm-ink-secondary); border-radius: 999px; padding: 1px 10px; font-size: 13px; font-weight: 500; }
.chevron { color: var(--tm-hairline); flex: none; display: flex; align-items: center; }
.page-head.tight { padding: 0; }
.page-head.tight ~ .hero { padding-top: 8px; }
.more { display: block; text-align: center; padding: 16px 0; }

/* Lead detail */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 0 8px; gap: 8px; }
.actions { display: flex; justify-content: center; gap: 20px; padding: 12px 0 20px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 64px; min-height: 44px; text-decoration: none; color: var(--tm-ink); font-size: 13px; font-weight: 500; }
.act i { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.section { margin-top: 24px; }
.section > h2 { margin-bottom: 8px; }
.info li { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--tm-hairline); }
.info svg { color: var(--tm-ink-secondary); flex: none; }
.info small { display: block; color: var(--tm-ink-secondary); font-size: 13px; }
.info .val { min-width: 0; overflow-wrap: anywhere; }
.timeline { position: relative; }
.timeline li { position: relative; padding: 0 0 18px 28px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: -8px; width: 2px; background: var(--tm-hairline); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--tm-blue); }
.timeline .when { color: var(--tm-ink-secondary); font-size: 13px; }

/* Pipeline */
.picker { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.picker a { flex: none; min-height: 44px; display: flex; align-items: center; padding: 0 16px; border-radius: 22px; border: 1px solid var(--tm-hairline); text-decoration: none; color: var(--tm-ink); font-weight: 500; }
.picker a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.wl { color: var(--tm-ink-secondary); font-size: 14px; padding: 4px 0 12px; }
.pipe-cols { display: flex; flex-direction: column; gap: 20px; }
.col { min-width: 0; }
.col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 2px solid var(--tm-hairline); margin-bottom: 10px; }
.col-head h2 { font-size: 15px; }
.col-meta { color: var(--tm-ink-secondary); font-size: 14px; white-space: nowrap; }
.col-total { background: var(--tm-gold); color: var(--tm-ink); border-radius: 6px; padding: 0 8px; font-weight: 600; }
.opp { display: block; text-decoration: none; color: var(--tm-ink); background: #fff; border: 1px solid var(--tm-hairline); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; min-height: 44px; }
.opp-title { font-weight: 600; }
.opp-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--tm-ink-secondary); font-size: 14px; margin-top: 2px; }
.opp-val { color: var(--tm-ink); font-weight: 600; }
.col-empty { color: var(--tm-ink-secondary); font-size: 14px; padding: 8px 0 16px; }
.col-more { color: var(--tm-ink-secondary); font-size: 14px; padding: 4px 0 16px; }
.dots, .pipe-skel { display: none; }
.js .pipe.ready .pipe-cols { flex-direction: row; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.js .pipe.ready .pipe-cols::-webkit-scrollbar { display: none; }
.js .pipe.ready .col { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.js .pipe.ready .dots { display: flex; justify-content: center; gap: 0; padding-top: 4px; }
.dots button { width: 32px; height: 44px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dots button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tm-hairline); }
.dots button[aria-current="true"]::before { background: var(--accent); width: 10px; height: 10px; }
.js .pipe:not(.ready) .pipe-cols { display: none; }
.js .pipe:not(.ready) .pipe-skel { display: block; }
.skel { background: linear-gradient(90deg, var(--surface) 25%, #e9eff5 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 12px; }
.skel.h { height: 22px; width: 55%; margin: 12px 0; }
.skel.c { height: 72px; margin-bottom: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } .switcher > summary svg { transition: none; } }

/* Appointments */
.day { margin-top: 20px; }
.day > h2 { font-size: 14px; color: var(--tm-ink-secondary); font-weight: 500; padding-bottom: 6px; border-bottom: 1px solid var(--tm-hairline); }
.appt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--tm-hairline); text-decoration: none; color: var(--tm-ink); }
.time { flex: none; min-width: 78px; width: auto; white-space: nowrap; text-align: center; background: var(--surface); border-radius: 999px; padding: 4px 10px; font-weight: 600; font-size: 14px; }
.appt-main { flex: 1; min-width: 0; }
.appt-title { font-weight: 600; }
.appt.cancelled .appt-title, .appt.cancelled .time { text-decoration: line-through; color: var(--tm-ink-secondary); }
.badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 13px; font-weight: 600; background: var(--surface); color: var(--tm-ink-secondary); margin-top: 4px; }
.badge.cancelled { background: #fdecea; color: #a12b1f; }
.badge.ok { background: #e6f4ea; color: #1b6b32; }

/* Admin and team (plain) */
.admin h2 { margin-top: 28px; margin-bottom: 8px; }
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin th, .admin td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--tm-hairline); vertical-align: top; }
.admin .scroll { overflow-x: auto; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline .field { margin-bottom: 0; flex: 1 1 160px; }
.notice { background: var(--surface); border-radius: 10px; padding: 10px 14px; margin: 16px 0 0; }

@media (min-width: 720px) {
  .app { padding-left: 24px; padding-right: 24px; }
  .hdr-in { padding: 0 24px; }
}

.row-title, .row-sub, .row-main .chips { display: block; }
.row-main .chips { display: flex; }
.inl { display: inline; }
.loading-note { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; color: var(--muted, #5b6b7b); }
.skel-rows .skel.c { height: 64px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); border-radius: 10px; padding: 12px 14px; margin: 8px 0 16px; word-break: break-all; user-select: all; }
.codes { list-style: none; }

/* Inbox */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.filters a { flex: none; min-height: 44px; display: flex; align-items: center; padding: 0 14px; border-radius: 18px; border: 1px solid var(--tm-hairline); text-decoration: none; color: var(--tm-ink); font-size: 14px; font-weight: 500; }
.filters a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
#inbox > li { border-bottom: 1px solid var(--tm-hairline); }
.convo .row-title { display: flex; justify-content: space-between; gap: 8px; }
.convo .row-title time { flex: none; color: var(--tm-ink-secondary); font-size: 13px; font-weight: 400; }
.convo.unread .row-title, .convo.unread .row-sub { color: var(--tm-ink); font-weight: 600; }
.convo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.ch { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 6px; background: var(--surface); color: var(--tm-ink-secondary); font-size: 13px; font-weight: 600; line-height: 20px; vertical-align: 1px; }
.ch.email { background: var(--tm-gold-tint); color: var(--tm-gold-ink); }
.foot-note { text-align: center; color: var(--tm-ink-secondary); font-size: 13px; padding: 16px 0 8px; }
.tab-icon { position: relative; display: inline-flex; }
.badge-count { position: absolute; top: -4px; left: 13px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tm-gold); color: var(--tm-ink); font-size: 12px; font-weight: 600; line-height: 18px; text-align: center; }

/* Conversation */
.thead { position: sticky; top: 56px; z-index: 10; display: flex; align-items: center; gap: 10px; min-height: 56px; background: var(--tm-paper); border-bottom: 1px solid var(--tm-hairline); margin: 0 -16px; padding: 0 12px; }
.thead .back, .icon-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--tm-ink); text-decoration: none; flex: none; }
.avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { color: var(--tm-ink-secondary); font-size: 13px; }
.acts { display: flex; align-items: center; }
.thread { display: flex; flex-direction: column; gap: 4px; padding: 12px 0 8px; }
.thread[aria-busy="true"] { opacity: .7; }
.day-sep { align-self: center; margin: 12px 0 4px; padding: 2px 12px; border-radius: 999px; background: var(--surface); color: var(--tm-ink-secondary); font-size: 13px; font-weight: 500; }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.in { align-self: flex-start; align-items: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.bub { padding: 8px 12px; border-radius: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.in .bub { background: var(--surface); border-bottom-left-radius: 4px; }
.msg.out .bub { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.out .bub a { color: #fff; }
.bub-tag { margin-bottom: 4px; }
.subj { display: block; margin-bottom: 2px; }
.attach { display: block; margin-top: 4px; }
.dim { opacity: .7; }
.meta { color: var(--tm-ink-secondary); font-size: 13px; padding: 2px 4px 6px; }
.meta.bad { color: #a12b1f; }
.earlier { align-self: center; margin-bottom: 8px; }
.thread .notice { text-align: center; }
.composer-ph { margin: 8px 0 0; padding: 12px 16px; border: 1px solid var(--tm-hairline); border-radius: 24px; background: var(--surface); color: var(--tm-ink-secondary); }

/* Admin v2 (a- prefix: nothing here touches the client screens) */
.a-top { background: var(--tm-dark); color: var(--tm-ink-on-dark); }
.a-top-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; min-height: 58px; display: flex; align-items: center; gap: 22px; }
.a-logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--tm-ink-on-dark); text-decoration: none; white-space: nowrap; }
.a-logo i { width: 28px; height: 28px; border-radius: 8px; background: var(--tm-gold); display: grid; place-items: center; color: var(--tm-dark); font-style: normal; }
.a-logo span { color: var(--tm-muted-on-dark); font-weight: 400; }
.a-tabs { display: flex; gap: 2px; min-width: 0; }
.a-tabs a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--tm-muted-on-dark); font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap; }
.a-tabs a[aria-current="page"] { background: #121216; color: #fff; box-shadow: inset 0 -2px 0 var(--tm-gold); }
.a-me { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--tm-muted-on-dark); min-width: 0; }
.a-2fa { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: rgba(22, 163, 74, .15); color: #6ee7a0; font-weight: 500; }
.a-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-av { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--tm-blue); color: #fff; display: grid; place-items: center; font-weight: 600; }
.a-ic { flex: none; display: block; }

body:has(.a-top) { background: var(--surface); }
.a-wrap { max-width: 1240px; margin: 0 auto; padding: 24px 24px 40px; }
.a-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 18px; }
.a-head h1 { font-size: 28px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.a-head p { margin: 2px 0 0; color: var(--tm-ink-secondary); }
.a-head-acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.a-narrow { max-width: 620px; }
.a-back { margin-top: 18px; }

.a-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--tm-hairline); background: var(--tm-paper); color: var(--tm-ink); font-weight: 500; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.a-btn.pri { background: var(--tm-dark); border-color: var(--tm-dark); color: #fff; }
.a-btn.blue { background: var(--tm-blue); border-color: var(--tm-blue); color: #fff; }
.a-btn.block { display: flex; width: 100%; }
.a-link { background: none; border: 0; padding: 0 4px; min-height: 40px; color: var(--tm-blue); text-decoration: underline; cursor: pointer; }

.a-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.a-kpi { background: var(--tm-paper); border: 1px solid var(--tm-hairline); border-radius: 14px; padding: 16px; min-width: 0; }
.a-k { font-size: 13px; color: var(--tm-ink-secondary); display: flex; align-items: center; gap: 8px; }
.a-k i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #e6f2fa; color: var(--tm-blue); }
.a-v { font-size: 30px; font-weight: 600; margin-top: 6px; letter-spacing: -.02em; line-height: 1.2; }
.a-v.bad { color: #dc2626; }
.a-s { font-size: 13px; color: var(--tm-ink-secondary); overflow-wrap: anywhere; }
.a-s b { color: #16a34a; font-weight: 500; }
.a-s b.bad { color: #dc2626; }

.a-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.a-stack { display: grid; gap: 18px; min-width: 0; }
.a-card { background: var(--tm-paper); border: 1px solid var(--tm-hairline); border-radius: 14px; scroll-margin-top: 16px; }
.a-card > header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 14px 18px; border-bottom: 1px solid var(--tm-hairline); }
.a-card > header h2 { font-size: 16px; }
.a-count { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef2f6; color: var(--tm-ink-secondary); }
.a-r { margin-left: auto; }
.a-body { padding: 16px 18px; }
.a-body.flush { padding: 0; }
.a-body h3 { font-size: 14px; margin: 12px 0 4px; }
.a-pad { padding: 16px 18px; margin: 0; }
.a-muted { color: var(--tm-ink-secondary); }
.a-hint { font-size: 12.5px; color: var(--tm-ink-secondary); margin: 6px 0 14px; }
.a-notice { background: #fff6db; color: var(--tm-gold-ink); border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; }
.a-card .a-notice { background: var(--surface); color: var(--tm-ink); }
.a-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--tm-hairline); }
.a-fld { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.a-list small { color: var(--tm-ink-secondary); }
.a-mono { display: block; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--tm-ink-secondary); overflow-wrap: anywhere; }

.a-search { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 10px; border: 1px solid var(--tm-hairline); border-radius: 9px; color: var(--tm-ink-secondary); width: 220px; max-width: 100%; }
.a-search[hidden] { display: none; }
.a-search input { flex: 1; min-width: 0; align-self: stretch; border: 0; outline: 0; background: none; font-size: 14px; color: var(--tm-ink); }
.a-search:focus-within { border-color: var(--tm-blue); }
.a-none { padding: 16px 18px; margin: 0; color: var(--tm-ink-secondary); }

.a-table { width: 100%; border-collapse: collapse; }
.a-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--tm-ink-secondary); text-transform: uppercase; letter-spacing: .06em; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--tm-hairline); }
.a-table td { padding: 14px 18px; border-bottom: 1px solid var(--tm-hairline); vertical-align: middle; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table tr[hidden] { display: none; }
.a-table small { display: block; color: var(--tm-ink-secondary); font-size: 12px; }
.a-when { font-size: 13.5px; }
.a-loc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.a-loc b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.a-loc b a { color: var(--tm-ink); text-decoration: none; }
.a-lav, .a-sw { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: #fff; }
.a-av-0 { background: #0ea5e9; } .a-av-1 { background: #111827; } .a-av-2 { background: #7c3aed; } .a-av-3 { background: #0f766e; }
.a-av-4 { background: #b45309; } .a-av-5 { background: #be185d; } .a-av-6 { background: #0E1730; } .a-av-7 { background: #4d7c0f; }
.a-tag { display: inline-block; font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: #e6f2fa; color: var(--tm-blue); font-weight: 500; margin-left: 6px; vertical-align: 1px; }
.a-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; }
.a-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.a-pill.ok { background: #e7f6ec; color: #16a34a; }
.a-pill.new { background: var(--tm-gold-tint); color: var(--tm-gold-ink); }
.a-pill.off { background: #eef2f6; color: var(--tm-ink-secondary); }
.a-pill.bad { background: #fdecec; color: #dc2626; }
.a-acts { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.a-acts form { margin: 0; }
.a-ib { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--tm-hairline); display: grid; place-items: center; color: var(--tm-ink-secondary); background: var(--tm-paper); cursor: pointer; padding: 0; list-style: none; }
.a-ib::-webkit-details-marker { display: none; }
.a-more { position: relative; }
.a-menu { position: absolute; right: 0; top: 44px; z-index: 10; min-width: 190px; background: var(--tm-paper); border: 1px solid var(--tm-hairline); border-radius: 10px; box-shadow: 0 8px 24px rgba(5, 5, 7, .14); padding: 4px; }
.a-menu a, .a-menu button { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--tm-ink); font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.a-menu form { margin: 0; }

.a-site { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--tm-hairline); border-radius: 12px; }
.a-site + .a-site { margin-top: 10px; }
.a-sw { width: 40px; height: 40px; border-bottom: 4px solid var(--tm-gold); }
.a-site-main { min-width: 0; flex: 1 1 200px; }
.a-site-main b { display: block; overflow-wrap: anywhere; }
.a-site-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.a-foot { font-size: 12.5px; color: var(--tm-ink-secondary); margin: 10px 0 0; }

.a-field { display: block; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.a-field > span, .a-field > legend { display: block; font-size: 13px; font-weight: 500; margin: 0 0 6px; padding: 0; }
.a-field input:not([type="radio"]):not([type="checkbox"]), .a-field select, .a-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--tm-hairline); border-radius: 10px; background: var(--tm-paper); color: var(--tm-ink); font: inherit; font-size: 14px; }
.a-field textarea { min-height: 96px; resize: vertical; }
.a-field input:focus, .a-field select:focus, .a-field textarea:focus { border-color: var(--tm-blue); }

.a-seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; background: var(--surface); border: 1px solid var(--tm-hairline); border-radius: 10px; position: relative; }
.a-seg label { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--tm-ink-secondary); cursor: pointer; }
.a-seg input:checked + label { background: var(--tm-paper); color: var(--tm-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.a-seg input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 1px; }
.a-chips { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.a-chip { position: relative; }
.a-chip label { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; border: 1px solid var(--tm-hairline); border-radius: 999px; font-size: 13px; background: var(--tm-paper); cursor: pointer; }
.a-chip i { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid #b9c4cf; display: grid; place-items: center; }
.a-chip input:checked + label { border-color: var(--tm-blue); background: #e6f2fa; color: var(--tm-blue); }
.a-chip input:checked + label i { background: var(--tm-blue); border-color: var(--tm-blue); }
.a-chip input:checked + label i::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.a-chip input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (max-width: 1000px) {
  .a-grid { grid-template-columns: minmax(0, 1fr); }
  .a-kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .a-top-in { flex-wrap: wrap; padding: 8px 16px 0; gap: 4px 12px; min-height: 0; }
  .a-tabs { order: 3; flex: 0 0 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
  .a-tabs::-webkit-scrollbar { display: none; }
  .a-email { display: none; }
  .a-wrap { padding: 16px 16px 32px; }
  .a-head h1 { font-size: 24px; }
  .a-head-acts { margin-left: 0; width: 100%; }
  .a-head-acts .a-btn { flex: 1 1 auto; }
  .a-v { font-size: 24px; }
  .a-kpi { padding: 12px; }
  .a-r, .a-search { width: 100%; margin-left: 0; }
  .a-card > header .a-r { flex: 1 1 100%; }
  .a-table thead { display: none; }
  .a-table, .a-table tbody { display: block; }
  .a-table tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 12px; padding: 12px 16px; border-bottom: 1px solid var(--tm-hairline); }
  .a-table tr:last-child { border-bottom: 0; }
  .a-table tr[hidden] { display: none; }
  .a-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .a-table td:first-child, .a-table td.a-actcell, .a-table td.a-full { grid-column: 1 / -1; }
  .a-table td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--tm-ink-secondary); }
  .a-acts { justify-content: flex-start; }
  .a-menu { left: 0; right: auto; }
  .a-site-acts { width: 100%; }
  .a-site-acts .a-btn { flex: 1 1 auto; }
}

/* Build 1: show what we already have */
.back-link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding-right: 12px; text-decoration: none; font-weight: 500; }
.lead-row, .appt { position: relative; }
.lead-row { display: flex; align-items: center; gap: 4px; }
.lead-row > .row { flex: 1; min-width: 0; }
.call-btn { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface); color: var(--accent); text-decoration: none; }
.appt { align-items: center; gap: 4px; }
.appt-link { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; min-height: 44px; }
.appt.past .appt-link { opacity: .7; }
.wait { display: block; color: var(--tm-gold-ink); font-size: 13px; font-weight: 600; }
.updated { color: var(--tm-ink-secondary); font-size: 13px; margin: 4px 0 0; }
.added { color: var(--tm-ink-secondary); font-size: 14px; margin: 0; }
.note { background: var(--tm-gold-tint); color: var(--tm-gold-ink); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-size: 14px; font-weight: 500; text-align: center; }
.sheet .note { margin: 8px 4px 4px; }
.center { text-align: center; }
.thread-link { border: 1px solid var(--tm-hairline); border-radius: 12px; padding: 10px 14px; }
.thread-link.unread .row-title { font-weight: 700; }

/* Google Business Profile picker (site admin, Connect Google): one card per profile, whole card is the label. */
.gbp-picker { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.gbp-picker legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.gbp-row { display: flex; align-items: flex-start; gap: 12px; min-height: 64px; padding: 12px 14px; margin: 0 0 8px; border: 1px solid var(--tm-hairline); border-radius: 12px; background: #fff; cursor: pointer; }
.gbp-row:has(input:checked) { border-color: var(--accent); background: var(--surface); }
.gbp-row:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.gbp-row input[type="radio"] { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.gbp-row .row-title, .gbp-row .row-sub { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
