/* Layout: map left, site grid top-right, comment feed bottom-right; phones get one pane plus a tab bar. */
:root {
  --bg: #e9edf1; --panel: #ffffff; --panel-2: #f5f7f9; --ink: #18212b; --muted: #5d6877; --line: #d4dbe3;
  --accent: #f2a900; --accent-ink: #1d1600; --accent-soft: #fff1c9; --select: #dbe9f8; --select-ink: #10335a;
  --head: #f2a900; --head-ink: #1d1600; --danger: #c43d2f; --ok: #2f7d4f; --shadow: 0 10px 30px rgba(16, 24, 34, .18);
  --map-bg: #cfd6dd;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --n-landlord: #2f8f4e; --n-tenant: #2a6fd6; --n-jll: #b86e00; --n-legal: #7a4fc2; --n-hold: #6b7a8c;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f141a; --panel: #171e26; --panel-2: #1d2630; --ink: #e5eaf0; --muted: #96a3b3; --line: #2a3542;
  --accent: #f5b82e; --accent-ink: #1d1600; --accent-soft: #3a2f12; --select: #1e3550; --select-ink: #d7e8ff;
  --head: #2a2414; --head-ink: #f5c75a; --danger: #ef7466; --ok: #6fcf93; --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  --map-bg: #26303b;
  --n-landlord: #6fcf93; --n-tenant: #6aa5ff; --n-jll: #f5b82e; --n-legal: #a888e6; --n-hold: #8d9bad;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0f141a; --panel: #171e26; --panel-2: #1d2630; --ink: #e5eaf0; --muted: #96a3b3; --line: #2a3542;
  --accent: #f5b82e; --accent-ink: #1d1600; --accent-soft: #3a2f12; --select: #1e3550; --select-ink: #d7e8ff;
  --head: #2a2414; --head-ink: #f5c75a; --danger: #ef7466; --ok: #6fcf93; --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  --map-bg: #26303b;
  --n-landlord: #6fcf93; --n-tenant: #6aa5ff; --n-jll: #f5b82e; --n-legal: #a888e6; --n-hold: #8d9bad;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font-body); font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
h3 { font: 700 13px/1.2 var(--font-display); letter-spacing: .04em; text-transform: uppercase; margin: 0; color: var(--muted); }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 14px; font-weight: 600; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); border-color: var(--accent); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-map { background: var(--panel); box-shadow: 0 2px 8px rgba(0,0,0,.2); border-color: transparent; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; }
.icon-btn { border: 0; background: none; padding: 4px; border-radius: 6px; color: var(--muted); line-height: 0; }
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* login */
.login { min-height: 100%; 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(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 8px; box-shadow: var(--shadow); }
.login-card label { font-weight: 600; font-size: 13px; margin-top: 6px; }
.login-card .btn { margin-top: 12px; padding: 10px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=url], select, textarea {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; }
.form-error { color: var(--danger); margin: 4px 0 0; font-size: 13px; }

.brand { display: flex; align-items: center; gap: 10px; font: 800 17px/1 var(--font-display); letter-spacing: -.01em; white-space: nowrap; }
.brand-lg { font-size: 22px; margin-bottom: 4px; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 13px; letter-spacing: .02em; }
.client-chip { font: 600 12px/1 var(--font-body); padding: 5px 9px; border-radius: 20px; background: var(--accent-soft); color: var(--ink); }
.client-chip:empty { display: none; }

/* app frame */
.app { height: 100%; display: flex; flex-direction: column; }
.demo-banner { background: var(--accent-soft); text-align: center; font-size: 12px; padding: 5px 16px; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: var(--panel); border-bottom: 1px solid var(--line); }
.views { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.view { border: 0; background: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.view.on { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.view .count { font-weight: 500; color: var(--muted); margin-left: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: var(--panel); font: 700 13px/1 var(--font-display); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 42px; z-index: 1200; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 210px; padding: 6px; display: grid; }
.menu button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; }
.menu button:hover { background: var(--panel-2); }
.menu-head { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; }

.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--map-w, minmax(320px, 38%)) minmax(0, 1fr); grid-template-rows: var(--grid-h, minmax(0, 58fr)) minmax(0, 42fr); gap: 1px; background: var(--line); }
.pane { background: var(--panel); min-width: 0; min-height: 0; position: relative; }
.map-pane { grid-row: 1 / span 2; }
.grid-pane { display: flex; flex-direction: column; }
.comments-pane { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w, minmax(200px, 30%)); gap: 1px; background: var(--line); }
.tabbar { display: none; }
.feed { position: relative; }
/* drag handles between panels */
.resizer { position: absolute; z-index: 1100; touch-action: none; }
.resizer::after { content: ""; position: absolute; background: var(--accent); opacity: 0; transition: opacity .15s; border-radius: 2px; }
.resizer:hover::after, .resizer:focus-visible::after, .resizing .resizer::after { opacity: .9; }
.resizer-col { top: 0; bottom: 0; width: 10px; cursor: col-resize; }
.resizer-col::after { top: 0; bottom: 0; left: 4px; width: 3px; }
.resizer-row { left: 0; right: 0; height: 10px; cursor: row-resize; }
.resizer-row::after { left: 0; right: 0; top: 4px; height: 3px; }
#rz-map { right: -6px; }
#rz-grid { bottom: -6px; }
.side-resizer { right: -6px; }
.resizing { user-select: none; }
.resizing.resizing-col, .resizing.resizing-col * { cursor: col-resize !important; }
.resizing.resizing-row, .resizing.resizing-row * { cursor: row-resize !important; }
.resizing .map { pointer-events: none; }
/* live updates */
.remote-bar { flex-basis: 100%; background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
@keyframes rowflash { from { box-shadow: inset 4px 0 0 var(--accent); } to { box-shadow: inset 4px 0 0 transparent; } }
.sites tr.flash td:first-child { animation: rowflash 2.5s ease-out; }

/* map */
.map { position: absolute; inset: 0; background: var(--map-bg); }
.map-search { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 900; display: flex; gap: 8px; }
.search-box { position: relative; flex: 1; min-width: 0; }
.search-box input { border-radius: 22px; padding: 9px 16px; border-color: transparent; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); max-height: 320px; overflow: auto; padding: 6px; }
.search-results .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px 2px; }
.search-results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 6px; }
.search-results button:hover, .search-results button.hi { background: var(--panel-2); }
.search-results .msg { padding: 8px; color: var(--muted); font-size: 13px; }
.map-tools { position: absolute; top: 60px; right: 12px; z-index: 900; display: grid; gap: 6px; }
.map-note { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 400; background: var(--panel); color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 12px; pointer-events: none; text-align: center; max-width: 80%; }
.legend { position: absolute; left: 12px; top: 60px; z-index: 900; background: var(--panel); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.25); max-width: calc(100% - 140px); font-size: 12px; }
.legend-head { display: flex; justify-content: space-between; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 10px; font: 700 12px/1.2 var(--font-display); }
.legend-list { padding: 0 10px 8px; display: grid; gap: 2px; }
.legend-row { display: grid; grid-template-columns: 14px 18px 1fr auto; align-items: center; gap: 6px; cursor: pointer; padding: 1px 0; }
.legend-row input { margin: 0; width: 13px; height: 13px; accent-color: var(--ink); }
.legend-icon { display: grid; place-items: center; }
.legend-n { color: var(--muted); padding-left: 8px; }
.legend-note { margin: 4px 0 0; color: var(--muted); max-width: 190px; }
.map-caption { position: absolute; left: 12px; right: 12px; bottom: 22px; z-index: 900; background: var(--panel); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); text-align: center; font: 700 15px/1.3 var(--font-display); }
.map-caption .sub { display: block; font: 400 13px/1.3 var(--font-body); color: var(--muted); }
.pin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.pin-big { position: relative; width: 36px; height: 48px; }
.pin-big svg { display: block; filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.pin-big.dead .pin-label { bottom: 34px; }
.stage-pin svg { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.map.placing, .map.placing .leaflet-interactive { cursor: crosshair; }
.pin-label { position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 800 22px/1 var(--font-display); color: #fff; -webkit-text-stroke: 1px rgba(0,0,0,.6); text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.cluster { display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.88); color: #1b2430; font: 700 13px/1 var(--font-display); box-shadow: 0 0 0 6px rgba(242,169,0,.45); }
.cluster.dead { background: rgba(255,255,255,.92); color: #b3261e; font-size: 11px; box-shadow: 0 0 0 4px rgba(229,57,53,.55); }
.temp-pin .pin { background: var(--accent); width: 20px; height: 20px; }
.leaflet-popup-content { margin: 12px 14px; font: 13px/1.4 var(--font-body); }
.leaflet-container { font-family: var(--font-body); }

/* toolbar + table */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.filter-line { display: flex; gap: 8px; flex: 1; min-width: 0; }
.filter-line input { max-width: 340px; padding: 6px 10px; }
.filter-panel { padding: 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-row select { width: auto; padding: 5px 8px; }
.table-wrap { flex: 1; min-height: 0; overflow: auto; }
table.sites { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1080px; }
.sites th { position: sticky; top: 0; z-index: 2; background: var(--head); color: var(--head-ink); font: 700 12px/1.2 var(--font-display); text-align: left; padding: 9px 8px; white-space: nowrap; border-bottom: 1px solid var(--line); user-select: none; }
.sites th.sortable { cursor: pointer; }
.sites th .arrow { opacity: .7; font-size: 10px; margin-left: 3px; }
.sites th.c, .sites td.c { text-align: center; }
.sites td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; background: var(--panel); }
.sites tr { cursor: pointer; }
.sites tbody tr:not(.group-row):hover td { background: var(--panel-2); }
.sites tr.sel td { background: var(--select); color: var(--select-ink); }
.sites tr.archived td { opacity: .55; }
.status-cell { min-width: 132px; }
.st { display: block; font-weight: 700; }
.st::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--dot, var(--muted)); box-shadow: 0 0 0 1px rgba(27,36,48,.55); margin-right: 6px; vertical-align: 0; }
.ns { display: block; font-size: 12px; font-weight: 700; color: var(--ns, var(--muted)); margin-left: 14px; }
.site-name { font-weight: 600; }
.group-row td { background: var(--panel-2); font: 800 13px/1.2 var(--font-display); padding: 10px 10px 8px; cursor: default; border-bottom: 1px solid var(--line); position: sticky; top: 34px; z-index: 1; }
.group-row.sub td { font: 700 12px/1.2 var(--font-body); color: var(--muted); padding: 6px 10px 6px 30px; position: static; }
.group-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 1px rgba(27,36,48,.55); margin-right: 8px; vertical-align: -1px; }
.group-n { color: var(--muted); font-weight: 600; margin-left: 4px; }
.rec-chip { display: block; margin: 4px 0 0 14px; border: 1px dashed var(--line); background: none; color: var(--muted); border-radius: 12px; padding: 1px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.rec-chip:hover { border-color: var(--muted); color: var(--ink); }
.rec-chip.on { border: 1px solid #b45f06; background: #fce5cd; color: #7f3f00; }
.legend-sub { cursor: default; opacity: .9; }
.site-cell { min-width: 190px; }
.sites td.fin { white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.sites td.impacts { font-size: 12px; white-space: nowrap; min-width: 90px; }
.pin-flag { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 700; color: #8a5a00; background: #fff3cd; border-radius: 4px; padding: 0 6px; }
.phone-only { display: none; }
.cell-sub { display: block; font-size: 12px; color: var(--muted); }
.sites tr.sel .cell-sub { color: inherit; opacity: .8; }
.flag { color: var(--line); }
.flag.on { color: var(--danger); }
.star.on { color: var(--accent); }
.bell.due { color: var(--danger); }
.bell.soon { color: var(--accent); }
.chk { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; }
.empty-row td { text-align: center; color: var(--muted); padding: 40px; cursor: default; }

/* comments */
.feed { background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.feed-head { padding: 10px 14px; border-bottom: 1px solid var(--line); font: 700 14px/1.3 var(--font-display); }
.feed-list { flex: 1; overflow: auto; min-height: 0; }
.comment { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.comment .when { font-size: 12px; font-weight: 700; }
.comment .who { display: block; font-weight: 400; color: var(--muted); }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.mention { color: var(--n-tenant); font-weight: 600; }
.comment .pin-btn.on { color: var(--accent); }
.composer { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--panel-2); }
.composer-meta { font-size: 12px; font-weight: 700; display: grid; }
.composer-meta .muted { font-weight: 400; }
.composer-input { position: relative; display: grid; gap: 4px; }
.share-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.share-toggle input { margin: 0; accent-color: var(--accent); }
.vis-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; white-space: normal; }
.vis-badge { font-size: 10px; font-weight: 700; letter-spacing: .02em; border-radius: 4px; padding: 1px 6px; }
.vis-badge.internal { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.vis-badge.shared { background: #e3f1e6; color: #1f6b35; }
.link-btn { border: 0; background: none; padding: 0; font-size: 11px; font-weight: 600; color: var(--n-tenant); text-decoration: underline; cursor: pointer; }
.mention-list { position: absolute; bottom: 100%; left: 0; margin-bottom: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; min-width: 200px; z-index: 50; }
.mention-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; }
.mention-list button.hi, .mention-list button:hover { background: var(--panel-2); }
.side { background: var(--panel-2); padding: 12px 14px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.pinned-list { display: grid; gap: 8px; }
.pinned { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.pinned .who { font-size: 11px; color: var(--muted); display: block; margin-bottom: 2px; }
.member-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.member-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mini-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--panel); font: 700 10px/1 var(--font-display); flex: none; }

/* modal */
.overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(8, 12, 18, .5); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.modal { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); width: min(520px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.modal-md { width: min(940px, 100%); }
.team-body { display: grid; gap: 12px; }
.team-note { margin: -8px 0 0 26px; }
.modal-wide { width: min(1040px, 100%); height: min(680px, 100%); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.modal-head h2 { font: 800 20px/1.2 var(--font-display); margin: 0; flex: 1; min-width: 0; text-wrap: balance; }
.modal-body { padding: 18px 22px; overflow: auto; display: grid; gap: 12px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; align-items: center; flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.field { display: grid; gap: 4px; }
.field > span { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.confirm-bar { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }

/* editor: three columns like the old input screen */
.editor { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px 200px 1fr; }
.ed-col { overflow: auto; padding: 14px; border-right: 1px solid var(--line); display: grid; align-content: start; gap: 4px; }
.ed-col:last-child { border-right: 0; padding: 18px 22px; gap: 14px; }
.ed-nav { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 8px; font-weight: 700; }
.ed-nav:hover { background: var(--panel-2); }
.ed-nav.on { background: var(--accent); color: var(--accent-ink); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; align-items: center; }
.kv label { font-weight: 700; font-size: 13px; }
.computed { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.computed b { font-size: 15px; }
.list-rows { display: grid; gap: 6px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.list-row a { color: var(--n-tenant); font-weight: 600; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.view-link { flex: none !important; font-size: 12px; }
.upload-row progress { flex: 1; min-width: 60px; height: 8px; accent-color: var(--accent); }
.up-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.list-row .meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.history-item { font-size: 13px; border-left: 3px solid var(--line); padding: 4px 10px; }
.history-item .meta { font-size: 12px; color: var(--muted); }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }

.team-table { width: 100%; border-collapse: collapse; }
.team-table td, .team-table th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
.code-wrap { display: grid; gap: 8px; }
.link-bar { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; font-size: 13px; }
.link-bar p { margin: 0; }
.link-row { display: flex; gap: 8px; min-width: 0; }
.link-row input { flex: 1; min-width: 0; font-size: 12px; }
.team-actions { display: flex; gap: 4px; flex-wrap: wrap; min-width: 200px; }
.team-actions .btn { white-space: nowrap; }
.team-table input, .team-table select { padding: 5px 8px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.steps input { margin-top: 8px; max-width: 200px; font-size: 18px; letter-spacing: .15em; }
.qr { margin: 10px 0 6px; width: 184px; padding: 8px; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.qr img, .qr canvas { display: block; }
.secret { font-family: ui-monospace, Menlo, monospace; background: var(--panel-2); padding: 2px 6px; border-radius: 4px; user-select: all; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 3000; background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; max-width: calc(100% - 32px); }
.toast.err { background: var(--danger); color: #fff; }

/* hide less important columns on mid widths */
@media (max-width: 1300px) { .wide-only { display: none; } table.sites { min-width: 860px; } }

/* phones and small tablets: one pane at a time */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 8px 12px; }
  .brand-name { display: none; }
  .views { order: 3; flex-basis: 100%; }
  .top-actions { margin-left: auto; }
  .layout { display: block; position: relative; }
  .pane { position: absolute; inset: 0; display: none; }
  .layout[data-tab="map"] .map-pane { display: block; }
  .layout[data-tab="sites"] .grid-pane { display: flex; }
  .layout[data-tab="comments"] .comments-pane { display: flex; flex-direction: column; }
  .comments-pane .feed { flex: 1; }
  .comments-pane .side { max-height: 32%; }
  .tabbar { display: flex; border-top: 1px solid var(--line); background: var(--panel); padding: 0 max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px)); }
  .tabbar button { flex: 1; border: 0; background: none; padding: 12px 4px; font-weight: 700; color: var(--muted); }
  .tabbar button.on { color: var(--ink); box-shadow: inset 0 3px 0 var(--accent); }
  .comment, .composer { grid-template-columns: 1fr auto; }
  .phone-hide { display: none; }
  .phone-only { display: inline !important; }
  table.sites { min-width: 0; }
  .site-cell { min-width: 0; }
  .status-cell { min-width: 0; }
  .comment .when, .composer-meta { grid-column: 1 / -1; }
  .composer-meta { display: none; }
  .editor { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .ed-col { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .ed-col:last-child { display: grid; border-bottom: 0; padding: 16px; }
  .ed-col:empty { display: none; }
  .ed-nav { white-space: nowrap; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .kv label { margin-top: 6px; }
  .field-row { grid-template-columns: 1fr; }
  .modal-wide { height: 100%; }
  .map-caption { bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 900px) { .resizer { display: none; } }
