/* 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: #5a6570;

  --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); }
.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: 12px; font-weight: 500; }
.chevron { color: var(--tm-hairline); flex: none; }
.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; 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: 12px; 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; }
.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; }
