/* ThruArt brand (thruart.com.au): warm paper, ink, mosaic-glass jewel colours, Bricolage Grotesque
   with a Fraunces italic accent. Light only, and kept plain: this is an analysis tool.
   Layout: full-bleed map, list card on the left, lead card on the right, one reset button top right. */
:root {
  --paper: #f5f0e8;
  --paper-2: #ebe3d6;
  --surface: #fffbf4;
  --ink: #1c1727;
  --ink-2: #4f4859;
  --ink-3: #6f6879;          /* site's #8b8495 darkened to 5.0:1 on surface for small text */
  --line: rgba(28, 23, 39, 0.11);
  --line-strong: rgba(28, 23, 39, 0.22);
  --cobalt: #2a46d6;
  --turq: #0fa59b;
  --emerald: #149157;
  --amber: #f6a623;
  --ruby: #e23b52;
  --glow: #ffcf7a;
  --ember-soft: #fbe3bd;
  --display: 'Bricolage Grotesque', -apple-system, 'Helvetica Neue', sans-serif;
  --accent-serif: 'Fraunces', Georgia, serif;
  --shadow: 0 18px 50px rgba(28, 23, 39, 0.16), 0 2px 6px rgba(28, 23, 39, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.45 var(--display); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

#map { position: fixed; inset: 0; }
.maplibregl-ctrl-group { border-radius: 12px !important; box-shadow: var(--shadow) !important; }
body.detail-open .maplibregl-ctrl-bottom-right { right: 400px; }
.maplibregl-ctrl-attrib { font-size: 10px; background: rgba(255, 251, 244, 0.85) !important; }

/* ---------- list card (left) ---------- */
.sidebar {
  position: fixed; z-index: 2; top: 14px; left: 14px; bottom: 14px; width: 352px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  overflow: hidden; display: flex;
}
.view { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.side-head { padding: 16px 18px 12px; display: grid; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { height: 24px; width: auto; display: block; }
.atlas { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); padding-left: 10px; border-left: 1px solid var(--line-strong); }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--paper);
  border-radius: 14px; padding: 10px 4px; text-align: center;
}
.stats:hover { border-color: var(--line-strong); }
.stats span { display: grid; gap: 2px; font-size: 12px; color: var(--ink-2); }
.stats span + span { border-left: 1px solid var(--line); }
.stats b { font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

.btn-primary {
  border: 0; border-radius: 14px; background: var(--ink); color: var(--surface);
  font-weight: 700; font-size: 15px; padding: 12px 16px; min-height: 44px;
}
.btn-primary:hover { background: #2c2540; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-secondary { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); padding: 11px 16px; min-height: 44px; font-weight: 600; }
.btn-secondary:hover { background: var(--paper); }
.btn-plain { border: 0; background: none; color: var(--ink); font-weight: 700; padding: 6px 4px; text-decoration: underline; text-underline-offset: 3px; }

.toolbar { padding: 0 18px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; border-bottom: 1px solid var(--line); }
input[type='search'] {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 9px 12px 9px 34px; min-height: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%236f6879' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center;
}
input[type='search']::placeholder { color: var(--ink-3); }
.row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
select { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 8px 10px; min-height: 36px; width: 100%; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--paper-2); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: none; border-radius: 9px; padding: 6px 8px; min-height: 30px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.segmented button[aria-checked='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(28, 23, 39, 0.14); }

.list-head { display: flex; justify-content: space-between; padding: 10px 20px 2px; font-size: 12px; color: var(--ink-3); }
.list-head span:first-child { color: var(--ink); font-weight: 700; }
.list { list-style: none; margin: 0; padding: 6px 10px; overflow: auto; flex: 1 1 0; min-height: 120px; }
.list li { display: grid; grid-template-columns: 14px 1fr auto; gap: 1px 12px; align-items: center; padding: 10px 10px; border-radius: 12px; min-height: 52px; }
.list li[data-id] { cursor: pointer; }
.list li[data-id]:hover { background: var(--paper); }
.list li.sel { background: var(--ember-soft); }
.list .dot { grid-row: 1 / span 2; justify-self: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.list .name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.list .place { grid-column: 2; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .trail { grid-column: 3; grid-row: 1 / span 2; display: grid; justify-items: end; gap: 3px; }
.sc { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 7px; border-radius: 7px; background: var(--paper-2); color: var(--ink-2); }
.sc { font-weight: 700; }
.sc.A { background: var(--ink); color: var(--surface); }
.sc.C { background: transparent; color: var(--ink-3); }
.pill { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.pill.contacted, .pill.interested { background: color-mix(in srgb, var(--turq) 16%, var(--surface)); color: #0a6d66; }
.pill.customer { background: color-mix(in srgb, var(--emerald) 16%, var(--surface)); color: #0d6a3f; }
.list .more { display: flex; justify-content: center; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.list .empty { display: block; color: var(--ink-3); text-align: center; padding: 28px 12px; }

.key { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 12px 18px 14px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.key span { display: inline-flex; align-items: center; gap: 8px; }
.key .dot { width: 8px; height: 8px; }

/* ---------- lead card (right) ---------- */
.detail {
  position: fixed; z-index: 6; top: 14px; right: 14px; bottom: 14px; width: 380px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  overflow: auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 18px;
  animation: card-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes card-in { from { opacity: 0; transform: translateX(24px); } }
.detail-top { display: flex; justify-content: space-between; align-items: center; }
.close { border: 0; background: var(--paper); width: 32px; height: 32px; border-radius: 50%; font-size: 18px; line-height: 1; color: var(--ink-2); }
.close:hover { background: var(--paper-2); color: var(--ink); }
.title { font-size: 28px; line-height: 1.05; font-weight: 800; margin: 0; letter-spacing: -0.03em; text-wrap: balance; }
.subtitle { margin: 6px 0 0; color: var(--ink-2); }
.hot-tag { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 99px; background: var(--ember-soft); }

.score { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.score .num { grid-row: 1 / span 2; font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.score .num small { font-size: 14px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.score .lbl { font-weight: 700; }
.score .meter { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.score .meter span { display: block; height: 100%; border-radius: 3px; background: var(--ink); }

.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.stages span { height: 5px; border-radius: 3px; background: var(--paper-2); }
.stages span.on { background: var(--turq); }
.stages span.won { background: var(--emerald); }
.stage-label { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.stage-label b { color: var(--ink); }
.actions { display: flex; gap: 8px; }
.actions .btn-primary { flex: 1; }

.group { border: 1px solid var(--line); border-radius: 16px; margin: 0; padding: 0 14px; background: var(--surface); }
.cell { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cell:last-child { border-bottom: 0; }
.cell dt { color: var(--ink-3); font-size: 13px; }
.cell dd { margin: 0; min-width: 0; overflow-wrap: anywhere; user-select: text; }
.cell a { color: var(--cobalt); text-decoration: none; font-weight: 600; }
.cell a:hover { text-decoration: underline; }
.sec h3 { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); }
.tag.mosaic { background: var(--ember-soft); border-color: rgba(246, 166, 35, 0.4); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.facts div { background: var(--paper); border-radius: 12px; padding: 9px 11px; }
.facts b { display: block; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.facts span { font-size: 12px; color: var(--ink-3); }
.source { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.source a { color: var(--cobalt); font-weight: 600; text-decoration: none; }
textarea { width: 100%; min-height: 84px; resize: vertical; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: 11px 13px; }
.note-row { display: flex; justify-content: flex-end; margin-top: 6px; }
details.near summary { cursor: pointer; color: var(--ink-2); font-weight: 600; padding: 4px 0; }
details.near ul { list-style: none; margin: 6px 0 0; padding: 0; }
details.near li { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
details.near li:hover .n { text-decoration: underline; }
details.near .d { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- map chrome ---------- */
.map-tools { position: fixed; z-index: 2; top: 14px; right: 14px; display: flex; gap: 8px; }
body.detail-open .map-tools { right: 408px; }
.tool {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
  padding: 10px 16px; font-weight: 600; min-height: 40px;
}
.tool:hover { background: var(--paper); }
.tool[aria-pressed='true'] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
body.area-mode #map canvas { cursor: crosshair !important; }
.lasso { position: fixed; z-index: 4; border: 2px solid var(--cobalt); background: rgba(42, 70, 214, 0.08); border-radius: 4px; pointer-events: none; }
.link { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--cobalt); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* cluster popup */
.cluster-pop { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 10px; display: grid; gap: 6px; min-width: 190px; font: 13px/1.3 var(--display); color: var(--ink); }
.cluster-pop b { font-size: 14px; }
.cluster-pop button { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); padding: 8px 10px; font-weight: 600; text-align: left; }
.cluster-pop button.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* lead card: logo, cover, what they sell */
.biz { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.biz-logo { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--line); background: #fff; object-fit: contain; padding: 6px; }
.biz-initial { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--paper-2); font-size: 22px; font-weight: 800; color: var(--ink-2); }
.cover { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); }
.about { margin: 0; color: var(--ink-2); line-height: 1.5; }
.offers { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.offers li { padding: 8px 12px; border-radius: 10px; background: var(--paper); font-weight: 600; font-size: 13px; }

/* selection panel */
.sel-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sel-sum div { background: var(--paper); border-radius: 12px; padding: 9px 11px; }
.sel-sum b { display: block; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sel-sum span { font-size: 12px; color: var(--ink-3); }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.field input { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 9px 12px; min-height: 40px; }
.batches { display: grid; gap: 8px; }
.batches .btn-primary, .batches .btn-secondary { width: 100%; text-align: left; display: flex; justify-content: space-between; }
.legal { font-size: 12px; color: var(--ink-3); margin: 0; }
.picked { list-style: none; margin: 0; padding: 0; }
.picked li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.picked li .m { color: var(--ink-3); font-size: 12px; }
.picked li button { border: 0; background: none; color: var(--ink-3); font-size: 16px; line-height: 1; padding: 2px 4px; }
.picked li button:hover { color: var(--ink); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions > * { flex: 1; }

.toast {
  position: fixed; z-index: 9; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--surface); border-radius: 99px; padding: 11px 18px; font-weight: 600;
  box-shadow: var(--shadow); animation: toast-in 0.25s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

.sheet { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.sheet::backdrop { background: rgba(28, 23, 39, 0.3); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.sheet-head form { margin: 0; }
#sheet-body { padding: 18px 20px 22px; }
.states { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.states li { display: grid; grid-template-columns: 48px 1fr 90px; gap: 12px; align-items: center; }
.states b { font-weight: 800; }
.states .bar { height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.states .bar div { height: 100%; background: var(--turq); border-radius: 4px; }
.states .n { text-align: right; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.sheet .note { margin: 14px 0 0; color: var(--ink-3); font-size: 12.5px; }

/* map hover label */
.maplibregl-popup-content { padding: 0; background: none; box-shadow: none; }
.maplibregl-popup-tip { display: none; }
.tip { background: var(--ink); color: var(--surface); border-radius: 10px; padding: 7px 11px; font: 600 12.5px/1.35 var(--display); box-shadow: var(--shadow); }
.tip b { font-weight: 800; }
.tip span { font-weight: 400; opacity: 0.75; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* compact width: the cards become bottom sheets */
@media (max-width: 720px) {
  .sidebar { top: auto; left: max(8px, env(safe-area-inset-left, 0px)); right: max(8px, env(safe-area-inset-right, 0px)); bottom: max(8px, env(safe-area-inset-bottom, 0px)); width: auto; height: 56vh; }
  .toast { bottom: calc(56vh + 20px); }
  .detail { top: auto; left: max(8px, env(safe-area-inset-left, 0px)); right: max(8px, env(safe-area-inset-right, 0px)); bottom: max(8px, env(safe-area-inset-bottom, 0px)); width: auto; height: 70vh; z-index: 3; }
  body.detail-open .map-tools { right: 14px; }
}

/* ---------- plain-language helpers ---------- */
.help { margin: 0 18px 10px; padding: 9px 14px; border-radius: 12px; background: var(--ember-soft); font-size: 13.5px; }
.help summary { cursor: pointer; font-weight: 700; }
.help[open] summary { margin-bottom: 4px; }
.help ol { margin: 6px 0 8px; padding-left: 20px; display: grid; gap: 4px; }
.why { margin: -6px 0 0; font-size: 15px; font-weight: 600; color: var(--ink); background: var(--paper); border-radius: 12px; padding: 10px 12px; }
.contact-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.btn-contact {
  display: grid; gap: 2px; text-decoration: none; color: var(--surface); background: var(--cobalt); border-radius: 14px;
  padding: 10px 12px; font-weight: 700; font-size: 15px; min-height: 52px;
}
.btn-contact small { font-weight: 400; font-size: 11.5px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-contact:hover { background: #2238b0; }
.steps { margin: 0; padding: 12px 14px 12px 34px; border-radius: 14px; background: var(--paper); display: grid; gap: 6px; font-size: 14px; }
.key-pulse { width: 100%; }
.pulse-dot { background: var(--amber); animation: key-pulse 1.8s ease-out infinite; }
@keyframes key-pulse { 0% { box-shadow: 0 0 0 0 rgba(246, 166, 35, 0.6); } 100% { box-shadow: 0 0 0 8px rgba(246, 166, 35, 0); } }

/* ---------- header bits ---------- */
.brand-row { display: flex; align-items: center; justify-content: space-between; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--paper); color: var(--ink); }
.icon-btn.spin svg, .btn-secondary.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper-2); border-radius: 12px; padding: 3px; gap: 2px; }
.switch button { border: 0; background: none; border-radius: 9px; padding: 8px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.switch button[aria-selected='true'] { background: var(--ink); color: var(--surface); }
.stats { padding: 8px 4px; }
.stats b { font-size: 20px; }

/* ---------- full-screen list ---------- */
body.table-mode .sidebar, body.table-mode .map-tools, body.table-mode .maplibregl-ctrl-bottom-right { display: none; }
.table-view {
  position: fixed; inset: 0; z-index: 4; background: var(--paper); display: flex; flex-direction: column;
  padding: 18px max(20px, env(safe-area-inset-right, 0px)) 14px max(20px, env(safe-area-inset-left, 0px));
  gap: 14px; animation: tv-in 0.28s ease both;
}
@keyframes tv-in { from { opacity: 0; transform: translateY(8px); } }
body.detail-open .table-view { padding-right: 410px; }
.tv-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tv-head .switch { width: 300px; }
.tv-stats { display: flex; gap: 8px; }
.tv-stats span { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; font-size: 13px; color: var(--ink-2); }
.tv-stats b { font-size: 16px; color: var(--ink); margin-right: 4px; font-variant-numeric: tabular-nums; }
.tv-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tv-right .btn-secondary { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; }
.updated { font-size: 12.5px; color: var(--ink-3); }
.tv-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tv-filters input[type='search'] { flex: 1 1 260px; width: auto; }
.tv-filters select { width: auto; min-width: 170px; min-height: 40px; }
.tv-filters .segmented { min-width: 340px; }
.tv-filters .btn-primary { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.tv-wrap { flex: 1; min-height: 0; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.tv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tv-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 12px; border-bottom: 1px solid var(--line); }
.tv-table thead th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.tv-table thead th button.on { color: var(--ink); }
.tv-table thead th button.on::after { content: ' ↓'; }
.tv-table thead th button.on.asc::after { content: ' ↑'; }
.tv-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tv-table tbody tr { cursor: pointer; }
.tv-table tbody tr:hover { background: var(--paper); }
.tv-table tbody tr.sel { background: var(--ember-soft); }
.tv-table tbody tr.checked { background: color-mix(in srgb, var(--cobalt) 7%, var(--surface)); }
.c-check { width: 40px; }
.c-check input, .tv-table td input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--cobalt); cursor: pointer; }
.firm { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; }
.firm img, .firm .ini { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; object-fit: contain; padding: 3px; }
.firm .ini { display: grid; place-items: center; background: var(--paper-2); font-weight: 800; color: var(--ink-2); padding: 0; }
.firm b { display: block; font-weight: 700; }
.firm small { color: var(--ink-3); font-size: 12.5px; }
.fit { display: grid; gap: 4px; min-width: 110px; }
.fit .bar { height: 5px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.fit .bar span { display: block; height: 100%; background: var(--ink); }
.contact { display: grid; gap: 2px; font-size: 13px; }
.contact a { color: var(--cobalt); text-decoration: none; font-weight: 600; }
.contact a:hover { text-decoration: underline; }
.contact .none { color: var(--ink-3); }
.status-select { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); padding: 7px 8px; min-height: 36px; font-weight: 600; width: auto; }
.status-select.contacted, .status-select.interested { background: color-mix(in srgb, var(--turq) 12%, var(--surface)); }
.status-select.customer { background: color-mix(in srgb, var(--emerald) 14%, var(--surface)); }
.status-select.rejected { color: var(--ink-3); }
.open { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 7px 12px; font-weight: 700; white-space: nowrap; }
body.detail-open .tv-table th:nth-child(5), body.detail-open .tv-table td:nth-child(5) { display: none; }
.open:hover { background: var(--paper); }
.tv-foot { display: flex; align-items: center; gap: 16px; font-size: 13.5px; color: var(--ink-2); }
.pager { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pager .btn-secondary { min-height: 36px; padding: 6px 12px; }
.pager .btn-secondary:disabled { opacity: 0.4; cursor: default; }
@media (max-width: 900px) {
  .tv-table th:nth-child(5), .tv-table td:nth-child(5) { display: none; }
  .tv-filters .segmented { min-width: 0; flex: 1 1 100%; }
}
.tv-table small.muted { color: var(--ink-3); font-size: 12.5px; }

/* ---------- left panel: fixed top, one scroll, pinned filters (HIG: no nested scroll views) ---------- */
.sidebar { flex-direction: column; }
.side-top { padding: 16px 18px 12px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.side-intro { padding: 12px 18px 4px; display: grid; gap: 10px; }
.side-intro .help { margin: 0; }
.side-filters {
  position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 10px 18px 8px; display: grid; gap: 8px;
  transition: box-shadow 0.15s ease;
}
.side-filters.scrolled { box-shadow: 0 8px 12px -10px rgba(28, 23, 39, 0.35); border-bottom: 1px solid var(--line); }
.side-filters .list-head { padding: 4px 2px 0; }
.side-filters .list-head b { font-weight: 800; }
.side-scroll .list { overflow: visible; flex: none; min-height: 0; padding: 4px 10px 16px; }
/* a soft fade at the bottom says "there is more below" */
.sidebar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 28px; border-radius: 0 0 22px 22px; pointer-events: none;
  background: linear-gradient(rgba(255, 251, 244, 0), var(--surface)); }
.list li[data-id] { grid-template-columns: 14px 1fr auto 12px; border: 1px solid transparent; }
.list li[data-id]::after { content: '›'; grid-column: 4; grid-row: 1 / span 2; color: var(--ink-3); font-size: 20px; line-height: 1; }
.list li[data-id]:hover { border-color: var(--line); }
.list .more { margin-top: 6px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; text-decoration: none; }

/* legend floats on the map, beside the panel */
.legend {
  position: fixed; z-index: 2; left: 380px; bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 9px 14px;
  font-size: 12.5px; color: var(--ink-2); max-width: calc(100vw - 460px); border-top: 1px solid var(--line);
}
.legend.key { border-top: 1px solid var(--line); }
.legend .key-pulse { width: auto; }
body.table-mode .legend { display: none; }
@media (max-width: 720px) { .legend { display: none; } }

/* open the full list / back to the map: labelled buttons, not icons alone */
.expand-btn, .back-map {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; font-weight: 700; font-size: 14px;
  padding: 9px 14px; min-height: 40px; background: var(--ink); color: var(--surface);
}
.expand-btn:hover, .back-map:hover { background: #2c2540; }
.back-map { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.back-map:hover { background: var(--paper); }
.expand-btn, .back-map { white-space: nowrap; }
.side-top .atlas { display: none; }   /* room for the "Listeyi büyüt" label; the full list header still shows it */

/* ---------- assistant ---------- */
.maplibregl-ctrl-bottom-right { bottom: 76px !important; }
.ask-launch {
  position: fixed; z-index: 7; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 0; border-radius: 99px; padding: 8px 18px 8px 8px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow);
}
.ask-launch:hover { background: #2c2540; }
.ask-launch b { display: block; font-size: 14px; }
.ask-launch small { display: block; font-size: 11.5px; opacity: 0.75; }
.ask-dot { width: 38px; height: 38px; border-radius: 50%; background: var(--amber); color: var(--ink); display: grid; place-items: center; }
body.detail-open .ask-launch { right: 408px; }
body.ask-open .ask-launch { display: none; }
.ask {
  position: fixed; z-index: 8; right: 14px; bottom: 14px; width: min(420px, calc(100vw - 28px)); height: min(620px, calc(100vh - 28px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 60px rgba(28, 23, 39, 0.28);
  display: flex; flex-direction: column; overflow: hidden; animation: card-in 0.25s ease both;
}
body.detail-open .ask { right: 408px; }
.ask-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 14px 16px; background: var(--ink); color: var(--surface); }
.ask-head b { font-size: 16px; }
.ask-head small { display: block; font-size: 12px; opacity: 0.75; margin-top: 2px; }
.ask-head-actions { display: flex; align-items: center; gap: 10px; }
.ask-head .link { color: var(--glow); }
.ask-head .close { background: rgba(255, 255, 255, 0.12); color: var(--surface); }
.ask-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; line-height: 1.45; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--surface); border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.bot.error { border-color: rgba(226, 59, 82, 0.4); background: #fdf0f1; }
.msg.note { align-self: center; background: none; color: var(--ink-3); font-size: 12.5px; padding: 0; text-align: center; }
.msg .act { display: inline-block; margin-top: 8px; border: 0; border-radius: 10px; background: var(--cobalt); color: #fff; padding: 7px 12px; font-weight: 700; font-size: 13px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: typing 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ask-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 0; background: var(--surface); }
.ask-suggest button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px; padding: 6px 11px; font-size: 12.5px; font-weight: 600; }
.ask-suggest button:hover { background: var(--paper); }
.ask-form { display: flex; gap: 8px; padding: 12px 14px 14px; background: var(--surface); align-items: flex-end; }
.ask-form textarea { flex: 1; min-height: 76px; max-height: 200px; line-height: 1.45; resize: none; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); padding: 11px 13px; }
.ask-form .btn-primary { min-height: 44px; padding: 10px 16px; font-size: 14px; }
.ask-setup { background: var(--ember-soft); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; }
.ask-setup code { background: rgba(28, 23, 39, 0.08); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
@media (max-width: 720px) { .ask, body.detail-open .ask { right: 8px; left: 8px; width: auto; bottom: 8px; } .ask-launch, body.detail-open .ask-launch { right: 14px; bottom: calc(56vh + 20px); } }
.msg a { color: var(--cobalt); font-weight: 600; }
.msg.me a { color: var(--glow); }
.ask-head .link { white-space: nowrap; }

/* guide face (ThruArt's Workshop Guide character from thruart.com.au) */
.guide-face { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #fff; flex: none; box-shadow: 0 0 0 2px var(--surface); }
.ask-launch { padding: 6px 18px 6px 6px; }
.ask-launch .guide-face { width: 44px; height: 44px; }
.ask-head { align-items: center; }
.ask-head .guide-face { width: 44px; height: 44px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.ask-titles { flex: 1; min-width: 0; }
.row-bot { display: flex; gap: 8px; align-items: flex-end; align-self: flex-start; max-width: 92%; }
.row-bot .guide-face { width: 30px; height: 30px; }
.row-bot .msg { max-width: none; }
.cats { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.cats h4 { margin: 0; font-size: 13px; }
.cat { display: grid; gap: 6px; }
.cat b { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.cat .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat .chips button { border: 1px solid var(--line-strong); background: var(--paper); border-radius: 99px; padding: 6px 11px; font-size: 12.5px; font-weight: 600; text-align: left; }
.cat .chips button:hover { background: var(--ember-soft); }

/* existing-supplier flag */
.sup-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: #efe4d2; color: #7a6342; vertical-align: 1px; }
.supplier-warn { display: grid; gap: 4px; background: #f4ebdd; border: 1px solid #e2d2b6; border-left: 4px solid #b39a73; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: var(--ink-2); }
.supplier-warn b { color: #6b5333; }

/* ---------- sign-in page ---------- */
body.login-page { overflow: auto; min-height: 100%; background:
  radial-gradient(circle at 20% 15%, rgba(246, 166, 35, 0.14), transparent 40%),
  radial-gradient(circle at 85% 80%, rgba(42, 70, 214, 0.10), transparent 45%), var(--paper); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 28px; display: grid; gap: 20px; }
.login-card .logo { height: 28px; }
.login-hello { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.login-hello .guide-face { width: 64px; height: 64px; }
.login-hello h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.login-hello p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
#login-form { display: grid; gap: 8px; }
#login-form label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-top: 6px; }
#login-form input { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); padding: 12px 14px; min-height: 48px; font-size: 16px; }
#login-form input:focus { outline: 2px solid var(--cobalt); outline-offset: 1px; background: #fff; }
.pw { position: relative; }
.pw input { padding-right: 84px !important; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: var(--paper-2); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; font-weight: 700; }
.login-error { margin: 4px 0 0; color: #b42335; background: #fdf0f1; border-radius: 10px; padding: 9px 12px; font-size: 13.5px; font-weight: 600; }
#login-form .btn-primary { margin-top: 10px; min-height: 50px; font-size: 16px; }
.login-foot { margin: 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }

/* ---------- signed-in user ---------- */
.user-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.user-row .who { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row .who b { color: var(--ink); }
.user-row .link { font-size: 13px; }
.users-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.users-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.users-list li.off { opacity: 0.55; }
.users-list small { color: var(--ink-3); font-size: 12px; }
.users-list .acts { display: flex; gap: 10px; }
.user-form { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.user-form h3 { margin: 0 0 4px; font-size: 15px; }
.user-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.user-form input, .user-form select { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); padding: 9px 11px; min-height: 40px; }
.user-form .temp { font-size: 12.5px; color: var(--ink-3); }
.user-form .temp code { background: var(--paper-2); padding: 2px 6px; border-radius: 6px; user-select: all; }

/* ---------- phones: behave like an app ----------
   Touch: no double-tap zoom delay, no grey tap flash. Panels fill the visible area above the keyboard
   (--app-h / --vv-top / --kb come from app.js); body.typing = a text field has focus, so the keyboard is up. */
body { -webkit-tap-highlight-color: transparent; }
button, a, input, select, textarea, label, summary { touch-action: manipulation; }
body.area-mode .maplibregl-canvas-container { touch-action: none; }   /* a finger draws the box instead of moving the map */

@media (max-width: 720px) {
  input, select, textarea { font-size: 16px !important; }   /* below 16px iOS zooms the page on focus */

  /* sign-in: one full screen, content at the top so the keyboard never covers the fields */
  body.login-page { background: var(--surface); }
  .login-wrap { min-height: 100dvh; padding: 0; place-items: start stretch; }
  .login-card {
    width: 100%; min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; align-content: start; gap: 22px;
    padding: calc(28px + env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(22px, env(safe-area-inset-left, 0px));
  }
  .login-hello .guide-face { width: 56px; height: 56px; }
  .login-hello h1 { font-size: 24px; }
  #login-form input { min-height: 52px; }
  #login-form .btn-primary { min-height: 54px; }

  /* list: bottom sheet with a grab handle; full height while typing in the search */
  .sidebar {
    left: 0; right: 0; bottom: 0; height: 56vh; border-radius: 22px 22px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sidebar::before { content: ''; position: absolute; top: 6px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line-strong); }
  .sidebar::after { display: none; }
  .side-top { padding: 16px 16px 10px; }
  .expand-btn { min-height: 38px; padding: 8px 12px; font-size: 13.5px; }
  .user-row .link { padding: 6px 2px; }
  body.typing .sidebar { top: calc(var(--vv-top, 0px) + env(safe-area-inset-top, 0px) + 8px); bottom: var(--kb, 0px); height: auto; border-radius: 22px; }

  /* map buttons: small, top right, out of the sheet's way */
  .map-tools { top: calc(8px + env(safe-area-inset-top, 0px)); right: 8px; left: 8px; justify-content: flex-end; }
  body.detail-open .map-tools { right: 8px; }
  .tool { padding: 8px 12px; min-height: 38px; font-size: 13.5px; }
  .maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-right { display: none; }   /* pinch to zoom instead */

  /* lead card and selection: a taller sheet from the bottom; full screen while typing a note */
  .detail {
    left: 0; right: 0; bottom: 0; height: 78vh; border-radius: 22px 22px 0 0; border-bottom: 0; z-index: 6;
    padding: 14px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  body.typing .detail { top: var(--vv-top, 0px); bottom: auto; height: var(--app-h, 100dvh); border-radius: 0; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .title { font-size: 24px; }

  /* list in the sheet: one card per firm */
  .side-scroll { background: var(--paper); }
  .side-filters { background: var(--paper); }
  .side-scroll .list { padding: 6px 12px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; }
  .list li[data-id] {
    min-height: 64px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    box-shadow: 0 2px 8px rgba(28, 23, 39, 0.05);
  }
  .list li[data-id]:hover { background: var(--surface); }
  .list li.sel { border-color: var(--amber); box-shadow: 0 0 0 2px var(--ember-soft); }

  /* assistant: a full-screen chat, like a messaging app; the box stays just above the keyboard */
  .ask, body.detail-open .ask {
    top: var(--vv-top, 0px); left: 0; right: 0; bottom: auto; width: auto; height: var(--app-h, 100dvh);
    border: 0; border-radius: 0; z-index: 8;
  }
  .ask-head { padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; }
  .ask-head small { display: none; }
  .ask-head .close { width: 40px; height: 40px; font-size: 22px; }
  .ask-suggest { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .ask-suggest button { flex: none; }
  .ask-form { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  body.typing .ask-form { padding-bottom: 10px; }
  .ask-form textarea { min-height: 48px; max-height: 140px; }
  .ask-form .btn-primary { min-height: 48px; }
  .msg { max-width: 92%; }

  /* assistant button: a round button above the list sheet */
  .ask-launch, body.detail-open .ask-launch { right: 12px; bottom: calc(56vh + 12px); padding: 5px; }
  .ask-launch > span { display: none; }
  body.detail-open .ask-launch, body.table-mode .ask-launch { display: none; }

  /* pop-up sheets (password, users, states): from the bottom, lifted above the keyboard */
  .sheet {
    width: 100%; max-width: none; margin: auto 0 var(--kb, 0px); border-radius: 22px 22px 0 0; border-bottom: 0;
    max-height: calc(var(--app-h, 100dvh) - 24px); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .user-form .two { grid-template-columns: 1fr; }
  .users-list li { grid-template-columns: 1fr; }

  /* full-screen list: fewer columns, everything reachable with a thumb */
  .table-view { padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(10px + env(safe-area-inset-bottom, 0px)); gap: 10px; }
  .tv-head { gap: 10px; }
  .tv-head .brand { display: none; }
  .tv-stats, .updated { display: none; }
  .tv-filters { gap: 8px; }
  .tv-filters input[type='search'] { flex: 1 1 100%; }
  .tv-filters select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .tv-filters .btn-primary { flex: 1 1 100%; }

  /* each firm is a card: tick, logo + name, place and fit, call / email buttons, status. Tapping the card opens it. */
  .table-view { overflow-y: auto; overscroll-behavior: contain; display: block; }   /* filters scroll away with the cards */
  .table-view > * + * { margin-top: 10px; }
  .tv-head { position: sticky; top: calc(-12px - env(safe-area-inset-top, 0px)); z-index: 2; background: var(--paper); padding: 4px 0 8px; }
  .tv-filters .btn-primary:disabled { display: none; }   /* shows up once a firm is ticked */
  .tv-wrap { overflow: visible; background: none; border: 0; box-shadow: none; border-radius: 0; }
  .tv-table, .tv-table tbody { display: block; }
  .tv-table thead { display: block; padding-bottom: 8px; }
  .tv-table thead tr { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .tv-table thead th { position: static; display: block; padding: 0; border: 0; background: none; flex: none; }
  .tv-table thead th:empty, .tv-table thead th:nth-child(5) { display: none !important; }
  .tv-table thead th.c-check { width: auto; padding: 0 4px; }
  .tv-table thead th button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 12px; }
  .tv-table thead th button.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
  .tv-table tbody tr {
    display: grid; grid-template-columns: 26px 1fr auto; grid-template-areas: 'chk firm firm' '. place fit' '. contact contact' '. status status';
    gap: 8px 10px; align-items: center; margin-bottom: 10px; padding: 14px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 2px 10px rgba(28, 23, 39, 0.06);
  }
  .tv-table tbody tr:hover { background: var(--surface); }
  .tv-table tbody tr.sel { background: var(--surface); border-color: var(--amber); box-shadow: 0 0 0 2px var(--ember-soft); }
  .tv-table tbody tr.checked { background: color-mix(in srgb, var(--cobalt) 6%, var(--surface)); border-color: color-mix(in srgb, var(--cobalt) 40%, transparent); }
  .tv-table td { display: block !important; padding: 0; border: 0; min-width: 0; }
  .tv-table td[colspan] { grid-column: 1 / -1; }
  .tv-table td:nth-child(1) { grid-area: chk; }
  .tv-table td:nth-child(2) { grid-area: firm; }
  .tv-table td:nth-child(3) { grid-area: place; font-size: 13.5px; color: var(--ink-2); }
  .tv-table td:nth-child(3) br { display: none; }
  .tv-table td:nth-child(3) small.muted::before { content: ' · '; }
  .tv-table td:nth-child(4) { grid-area: fit; }
  .tv-table td:nth-child(5) { grid-area: contact; }
  .tv-table td:nth-child(6) { grid-area: status; }
  .tv-table td:nth-child(7) { display: none !important; }
  .tv-table td input[type='checkbox'] { width: 22px; height: 22px; }
  .firm { grid-template-columns: 44px 1fr; }
  .firm img, .firm .ini { width: 44px; height: 44px; }
  .firm b { font-size: 16px; line-height: 1.25; }
  .fit { min-width: 0; width: 96px; font-size: 12.5px; text-align: right; }
  .tv-table .contact { display: flex; flex-wrap: wrap; gap: 6px; }
  .tv-table .contact a { display: inline-flex; align-items: center; min-height: 36px; max-width: 100%; padding: 6px 12px; border-radius: 12px;
    background: color-mix(in srgb, var(--cobalt) 9%, var(--surface)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tv-table .contact .none { font-size: 12.5px; }
  .tv-table .status-select { width: 100%; min-height: 42px; }
  .tv-foot { flex-wrap: wrap; gap: 8px 12px; }
  .pager { margin-left: 0; width: 100%; justify-content: space-between; }

  .toast { bottom: calc(56vh + 16px); max-width: calc(100vw - 32px); text-align: center; border-radius: 16px; }
}
