/* Studio admin interface.
   Mobile first: the assistant works from a phone as often as a laptop. */

:root {
  --ink: #16202c;
  --ink-2: #4a5766;
  --ink-3: #7d8896;
  --line: #e3e7ed;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --accent: #0a6ed1;
  --accent-ink: #ffffff;
  --ok: #15803d;
  --ok-bg: #e8f6ec;
  --warn: #a25c00;
  --warn-bg: #fdf3e3;
  --err: #b42318;
  --err-bg: #fdeceb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 4px 14px rgba(16, 32, 48, .04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 16px/1.55 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
code { background: #eef1f5; padding: .1em .35em; border-radius: 4px; font-size: .875em; }

.muted { color: var(--ink-2); }
.is-hidden { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--panel);
  padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ------------------------------------------------------------- signed out */

.bare {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px 20px;
}
.bare__card {
  width: 100%; max-width: 380px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 28px;
  box-shadow: var(--shadow);
}
.bare__brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; letter-spacing: -.02em; margin-bottom: 20px; color: var(--ink);
}
.bare__foot { margin-top: 20px; color: var(--ink-3); font-size: .875rem; }
.bare__alt { margin: 14px 0 0; text-align: center; font-size: .875rem; }

/* ------------------------------------------------------------------ chrome */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--ink); color: #fff;
  padding-top: max(10px, env(safe-area-inset-top));
}
.topbar__menu {
  background: none; border: 0; color: inherit; padding: 6px; margin: -6px;
  cursor: pointer; border-radius: 8px; display: grid; place-items: center;
}
.topbar__menu:focus-visible { outline: 2px solid #fff; }
.topbar__brand { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.topbar__brand span { letter-spacing: -.02em; }
/* Build id at the top, next to the brand — visible without scrolling. */
.topbar__ver { align-self: center; margin-left: 12px; font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .6); white-space: nowrap; }
@media (max-width: 720px) { .topbar__ver { display: none; } }
.topbar__site { margin-left: auto; }
.topbar__site select {
  background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px; padding: 5px 8px; font: inherit; font-size: .875rem; max-width: 42vw;
}
.topbar__site--static { font-size: .875rem; color: rgba(255, 255, 255, .75); }
.topbar__view {
  color: rgba(255, 255, 255, .85); font-size: .875rem; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .25); padding: 5px 10px; border-radius: 8px;
}
.topbar__view:hover { background: rgba(255, 255, 255, .12); }

/* Always reserve the scrollbar gutter so the centered content (and the tab bar
   with it) never jumps sideways between a tall page and a short one. */
html { scrollbar-gutter: stable; }
.shell { display: block; }

.sidenav {
  position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 50;
  background: var(--panel); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .18s ease;
  display: flex; flex-direction: column; padding-top: 12px;
}
.sidenav.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(16, 32, 48, .45); }
.sidenav ul { list-style: none; margin: 0; padding: 8px; }
.sidenav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 500;
}
.sidenav a:hover { background: #f0f2f5; }
.sidenav li.is-sub a { padding-left: 30px; font-size: .9em; }
.sidenav li.is-sub svg { width: 16px; height: 16px; }
.sidenav a.is-active { background: #e8f1fc; color: var(--accent); }
.sidenav__out { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.sidenav__out button {
  width: 100%; background: none; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px; font: inherit; color: var(--ink-2); cursor: pointer;
}
.sidenav__out button:hover { background: #f0f2f5; }

/* Explicit width (not max-width) so the content box is the SAME size on every
   page. A grid item with `margin:0 auto` and only a max-width is sized to its
   content and then centred, which is why narrow pages (Landlords) drifted right
   while wide pages (Clients) sat left. A fixed width + auto margins centres it
   identically everywhere, and scrollbar-gutter keeps the viewport steady. */
.content { padding: 18px 24px 64px; width: min(100%, 1560px); margin: 0 auto; }

@media (min-width: 900px) {
  .topbar__menu { display: none; }
  /* minmax(0,1fr) — NOT plain 1fr — so a wide child (the kanban board) scrolls
     inside its own overflow:auto instead of stretching the column past the
     viewport and shoving the whole page sideways. */
  .shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
  .sidenav { position: sticky; top: 52px; height: calc(100dvh - 52px); transform: none; inset: auto; }
  .sidenav.is-open { box-shadow: none; }
  .content { padding: 28px 32px 80px; }
}

/* ------------------------------------------------------------------ blocks */

.page-head {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start;
  justify-content: space-between; margin-bottom: 20px;
}
.page-head p { margin: 0; }
.page-head--sticky {
  position: sticky; top: 52px; z-index: 30; background: var(--bg);
  padding: 12px 0; margin: -12px 0 16px; border-bottom: 1px solid var(--line);
}
.page-head h1 { margin: 0; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* The header action row was never styled (only .actions was), so its buttons
   crowded and wrapped raggedly. Same flex/gap as .actions; right-aligned so a
   long heading and the buttons stay on their own sides. Fixes ~13 screens. */
.page-head__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.back { font-size: .8125rem; text-decoration: none; color: var(--ink-2); display: block; margin-bottom: 2px; }
.back::before { content: "\2190  "; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: inherit; font-weight: 550;
  font-size: .9375rem; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f0f2f5; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #0960b8; }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--err); border-color: #f2c3bf; background: var(--err-bg); }
.btn--danger:hover { background: #fbdedb; }

/* Per-row delete on list screens, and the editors' delete sections. */
.row__delete { flex: 0 0 auto; margin-left: 8px; display: flex; align-items: center; }
.settings-panel__section--danger { border-top: 2px solid #f2c3bf; }
.settings-panel__section--danger h3 { color: var(--err); }
.btn--small { padding: 7px 12px; font-size: .875rem; }
.btn--tiny { padding: 4px 9px; font-size: .8125rem; }
.btn--block { width: 100%; margin-top: 6px; }

.flash {
  border-radius: 10px; padding: 12px 14px; margin: 0 0 16px;
  font-size: .9375rem; border: 1px solid transparent;
}
.flash--ok { background: var(--ok-bg); color: var(--ok); border-color: #c5e6d0; }
.flash--warn { background: var(--warn-bg); color: var(--warn); border-color: #f0dcb8; }
.flash--error { background: var(--err-bg); color: var(--err); border-color: #f2c3bf; }

.notice {
  background: var(--warn-bg); border: 1px solid #f0dcb8; border-radius: 10px;
  padding: 13px 15px; margin-bottom: 16px;
}
.notice strong { display: block; margin-bottom: 3px; }
.notice p { margin: 0; font-size: .9375rem; color: var(--ink-2); }
.notice--quiet { background: #eef4fb; border-color: #cfe0f3; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.stat:hover { border-color: #cdd4dd; }
.stat__n { display: block; font-size: 1.75rem; font-weight: 680; letter-spacing: -.02em; }
.stat__l { display: block; font-size: .8125rem; color: var(--ink-2); }

.panel, .card-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card-box--danger { border-color: #f2c3bf; }

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.rows > .row:first-child { border-top: 0; }
/* A listing row with the admin-only "we manage" checkbox beside it. */
.rowwrap { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); }
.rows > .rowwrap:first-child { border-top: 0; }
.rowwrap > .row { flex: 1; min-width: 0; border-top: 0; }
.managed-flag { flex: none; margin: 0; }
.managed-flag label { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--ink-3); white-space: nowrap; cursor: pointer; }
.pill--managed { background: #0a7d33; color: #fff; border-color: #0a7d33; }
.pill--citi { background: #b3005a; color: #fff; border-color: #b3005a; }
.row-flags { flex: none; display: flex; flex-direction: column; gap: 4px; }

/* Private, staff-only listing details */
.private-box { border-left: 4px solid #0a7d33; }
.private-box .field-group { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
.private-box .field-group legend { font-weight: 700; font-size: .8125rem; padding: 0 6px; }
.private-box .checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 14px; font-size: .875rem; }
.private-box .checkgrid label { display: flex; align-items: center; gap: 6px; }

/* CitiNest — Airbnb embeds, each in its own isolated frame */
.bnb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin: 12px 0 20px; }
.bnb-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.bnb-frame { width: 100%; height: 300px; border: 0; display: block; background: var(--bg); }
.bnb-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); }
.bnb-card__actions { display: flex; gap: 6px; flex: none; }
.rows--cards .row {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.row__main { flex: 1; min-width: 0; text-decoration: none; color: inherit; display: block; }
.row__title { display: block; font-weight: 570; }
.row__sub { display: block; font-size: .8125rem; color: var(--ink-2); }
.row__tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

.pill {
  font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: #eef1f5; color: var(--ink-2); white-space: nowrap;
}
.pill--live { background: var(--ok-bg); color: var(--ok); }
.pill--draft { background: #eef1f5; color: var(--ink-2); }
.pill--sched { background: #e8f1fc; color: var(--accent); }
.pill--edit { background: var(--warn-bg); color: var(--warn); }
.pill--feat { background: #f3ecfb; color: #6d28d9; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 2px; }
.tabs a {
  padding: 7px 13px; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); font-size: .9375rem; white-space: nowrap;
}
.tabs a.is-active { background: var(--ink); color: #fff; }
.tabs a span { opacity: .6; font-size: .8125rem; }

.empty { color: var(--ink-2); padding: 20px 0; }

/* ------------------------------------------------------------------ forms */

/* The `hidden` attribute must always win. Class selectors like `.field` and
   `.grid-2` set an explicit display, which out-specifies the browser's default
   `[hidden]{display:none}` and leaves "hidden" blocks visible (e.g. the
   residential building picker showing on a commercial listing). This makes the
   attribute authoritative studio-wide. */
[hidden] { display: none !important; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .8125rem; font-weight: 570; margin-bottom: 5px; color: var(--ink-2); }
.field small { display: block; font-size: .75rem; color: var(--ink-3); margin-top: 4px; }
.field.is-edited > span::after {
  content: " edited"; color: var(--warn); background: var(--warn-bg);
  padding: 1px 6px; border-radius: 999px; font-size: .6875rem; margin-left: 5px;
}

input[type="text"], input[type="password"], input[type="search"], input[type="number"],
input[type="email"], input[type="url"], input[type="tel"], input[type="date"], input[type="time"],
input[type="datetime-local"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; line-height: 1.4; min-height: 42px; background: var(--panel); color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}
textarea { resize: vertical; line-height: 1.55; }
.input--code { font-size: 1.5rem; letter-spacing: .35em; text-align: center; }

.check { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 10px; cursor: pointer; }
.check input { margin-top: 3px; flex: none; width: 17px; height: 17px; accent-color: var(--accent); }

.grid-2 { display: grid; gap: 0 14px; }
@media (min-width: 620px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.slug { display: flex; align-items: center; gap: 4px; }
.slug > span { color: var(--ink-3); font-size: .875rem; flex: none; }

.searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.searchbar input { flex: 1; }

.inline-form { margin-top: 12px; }
details summary { cursor: pointer; font-size: .875rem; color: var(--ink-2); margin-bottom: 10px; }

/* ----------------------------------------------------------------- editor */

.editor__grid { display: block; }
@media (min-width: 1000px) {
  .editor__grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
}

.field--title input {
  font-size: 1.5rem; font-weight: 650; letter-spacing: -.02em;
  padding: 12px 14px; border-color: transparent; background: var(--panel);
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 3px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px 10px 0 0; border-bottom: 0; position: sticky; top: 106px; z-index: 20;
}
.toolbar button {
  min-width: 34px; height: 32px; padding: 0 8px; border: 0; border-radius: 7px;
  background: none; font: inherit; font-size: .875rem; color: var(--ink-2); cursor: pointer;
}
.toolbar button:hover { background: #eef1f5; color: var(--ink); }
.toolbar button.is-on { background: var(--ink); color: #fff; }
/* A real .btn dropped into a toolbar (e.g. a Save button) keeps its button look.
   The bare ".toolbar button" rule above is only for the editor's icon buttons;
   ".toolbar .btn" (two classes) outweighs it, so Save/Update read as buttons. */
.toolbar .btn { min-width: 0; height: auto; padding: 9px 16px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; color: var(--ink); }
.toolbar .btn:hover { background: #f0f2f5; }
.toolbar .btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.toolbar .btn--primary:hover { background: #0960b8; color: var(--accent-ink); }
.toolbar .btn--danger { color: var(--err); border-color: #f2c3bf; background: var(--err-bg); }
.toolbar .btn--tiny { padding: 4px 9px; font-size: .8125rem; }
/* Property editor state bar: Preview / Draft / Save / Publish + a Live/Draft pill */
.statebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.statepill { font-size: .78rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; letter-spacing: .01em; }
.statepill--live { background: #e6f4ea; color: #1a7f37; }
.statepill--draft { background: #fdeaea; color: #b42318; }

.prose {
  background: var(--panel); border: 1px solid var(--line); border-radius: 0 0 10px 10px;
  padding: 18px 20px; min-height: 55vh; font-size: 1.0625rem; line-height: 1.7;
}
.prose:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.prose:empty::before { content: attr(data-placeholder); color: var(--ink-3); }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-size: 1.3rem; margin: 1.4em 0 .4em; }
.prose h3 { font-size: 1.1rem; margin: 1.3em 0 .4em; }
.prose blockquote {
  margin: 1.2em 0; padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line); color: var(--ink-2);
}
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose figure { margin: 1.4em 0; }
.prose figcaption { font-size: .875rem; color: var(--ink-2); margin-top: 6px; }
.prose ul, .prose ol { padding-left: 1.3em; }

.wordcount { font-size: .8125rem; color: var(--ink-3); margin: 8px 0 0; }
.save-state { font-size: .8125rem; color: var(--ink-3); }

.checks { margin-top: 16px; }
.checks__group { border-radius: 10px; padding: 13px 15px; margin-bottom: 10px; }
.checks__group--block { background: var(--err-bg); border: 1px solid #f2c3bf; }
.checks__group--warn { background: var(--warn-bg); border: 1px solid #f0dcb8; }
.checks__group h3 { margin: 0 0 7px; font-size: .875rem; }
.checks__group ul { margin: 0; padding-left: 1.1em; font-size: .875rem; }
.checks__group li { margin-bottom: 4px; }
.checks__group em { display: block; color: var(--ink-2); font-size: .8125rem; }

.status-line { display: flex; align-items: center; gap: 10px; font-size: .875rem; }

.cover-pick__preview {
  border: 1px dashed var(--line); border-radius: 9px; min-height: 96px;
  display: grid; place-items: center; overflow: hidden; margin-bottom: 8px;
}
.cover-pick__preview img { width: 100%; height: auto; display: block; }
.cover-pick__actions { display: flex; gap: 6px; margin-bottom: 12px; }

.revisions { list-style: none; margin: 0; padding: 0; font-size: .875rem; }
.revisions li {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 7px 0; border-top: 1px solid var(--line);
}
.revisions li:first-child { border-top: 0; }

.totp { background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.totp__qr {
  display: flex; justify-content: center; padding: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px;
}
.totp__qr svg { width: 220px; height: 220px; max-width: 100%; }
.totp__manual summary {
  cursor: pointer; font-size: .875rem; color: var(--ink-2); margin-bottom: 8px;
}
.totp__key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; word-break: break-all; margin: 8px 0;
}

/* ------------------------------------------------------------------ media */

.uploader { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.uploader__drop {
  display: grid; place-items: center; gap: 3px; text-align: center;
  padding: 30px 20px; background: var(--panel);
  border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer;
}
.uploader__drop.is-over { border-color: var(--accent); background: #f2f8ff; }
.uploader__drop input { display: none; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.photo-grid__item {
  margin: 0; background: var(--surface-2, #f5f7fa); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; display: flex; flex-direction: column;
}
.photo-grid__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-grid__item .btn { margin: 8px; align-self: flex-start; }
/* Photo preview thumb: the image fills it; a small badge marks the cover/order. */
.pthumb { position: relative; background: #eef1f5; }
.pthumb__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.pthumb__none { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; font-size: 12px; }
.pthumb__badge { position: absolute; top: 6px; left: 6px; background: rgba(17,17,17,.78); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 7px; border-radius: 6px; }

/* Drag-to-reorder, make-cover and multi-upload for listing photos (#4). */
.pthumb[draggable="true"] { cursor: grab; }
.pthumb[draggable="true"]:active { cursor: grabbing; }
.pthumb__grip { position: absolute; top: 6px; right: 6px; color: #fff;
  background: rgba(17,17,17,.5); border-radius: 6px; padding: 2px 5px;
  font-size: 10px; line-height: 1; letter-spacing: -2px; pointer-events: none; }
.pthumb__actions { display: flex; gap: 6px; padding: 8px 8px 0; }
.pthumb__actions .inline-form { margin: 0; }
.pthumb__actions .btn { margin: 0; }
.pthumb__cover[disabled] { opacity: .5; }
.pthumb__alt { display: flex; gap: 6px; padding: 8px; margin: 0; }
.pthumb__alt input { flex: 1; font-size: .8125rem; padding: 6px 8px; }
.pthumb__alt .btn { margin: 0; }
.photo-grid__item.is-dragging { opacity: .4; outline: 2px dashed var(--accent); outline-offset: -2px; }
.photo-order-bar { margin: 0 0 18px; background: #f2f8ff; border: 1px solid #cfe3fb;
  border-radius: 10px; padding: 10px 12px; }
.photo-order-bar form { display: flex; align-items: center; gap: 10px; margin: 0; flex-wrap: wrap; }

.dropzone { display: grid; place-items: center; gap: 4px; text-align: center;
  padding: 26px 20px; background: var(--panel); cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius); }
.dropzone:hover { border-color: var(--accent); }
.dropzone.is-over { border-color: var(--accent); background: #f2f8ff; }
.dropzone.is-busy { opacity: .7; pointer-events: none; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dropzone__title { font-size: 1rem; }

/* Residential / Commercial tabs on the listings screen (#7/#8). */
.segtabs { display: flex; gap: 6px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.segtab { padding: 8px 16px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 9px 9px 0 0; background: #f5f7fa; color: var(--ink-2);
  text-decoration: none; font-weight: 550; margin-bottom: -1px; }
.segtab.is-on { background: var(--panel); color: var(--accent); border-bottom: 1px solid var(--panel); }

/* Prominent, clearly-labelled property search box, with the filters on their
   own row beneath it so the search field is unmistakable (#2). */
.propsearch { display: block; margin: 0 0 8px; }
.searchbox { margin: 0 0 12px; }
.searchbox__label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 6px; color: var(--ink); }
.searchbox__row { display: flex; align-items: center; gap: 8px; position: relative; }
.searchbox__icon { position: absolute; left: 14px; z-index: 1; color: var(--accent); pointer-events: none; }
/* Selector deliberately more specific than the global input[type=search] rule,
   or the left padding is overridden and the icon lands on top of the text. */
.searchbox__row input.searchbox__input {
  flex: 1; min-width: 0; padding: 13px 14px 13px 46px; font-size: 1rem;
  border: 2px solid var(--accent); border-radius: 10px; background: var(--panel);
  color: var(--ink); box-shadow: 0 0 0 3px #e8f1fc;
}
.searchbox__row input.searchbox__input::placeholder { color: #8b97a5; }
.searchbox__row input.searchbox__input:focus { outline: none; box-shadow: 0 0 0 4px #d3e6fb; }
.searchbox .btn { flex: none; padding: 12px 20px; }
/* Compact dropdowns that flow in a wrapping row (the global select:100% would
   otherwise stack them full-width and push the list far down the page). */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filterbar select { width: auto; flex: 0 1 auto; min-width: 132px; }
.filterbar__label { font-size: .74rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; margin-right: 2px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.gallery__item {
  margin: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.gallery__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery__item figcaption { padding: 9px 10px; }
.gallery__alt { display: flex; gap: 5px; margin-bottom: 5px; }
.gallery__alt input { font-size: .8125rem; padding: 6px 8px; }

.picker { border: 0; border-radius: 14px; padding: 0; width: min(720px, 94vw); max-height: 84vh; box-shadow: var(--shadow); }
.picker::backdrop { background: rgba(16, 32, 48, .5); }
.picker__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel);
}
.picker__head h2 { margin: 0; }
.picker__upload { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.picker__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 9px; padding: 15px 18px; overflow-y: auto;
}
.picker__empty { padding: 0 18px 18px; }

/* The related-articles chooser: one row per post, thumb + title + date. */
.related-picker__hint { padding: 10px 18px 0; margin: 0; }
.related-picker__list { display: flex; flex-direction: column; gap: 6px; padding: 12px 18px; overflow-y: auto; max-height: 56vh; }
.related-pick { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.related-pick:hover { background: var(--bg); }
.related-pick input[type="checkbox"] { flex: 0 0 auto; }
.related-pick__thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; background: var(--line); display: block; }
.related-pick__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.related-pick__meta strong { font-weight: 600; line-height: 1.25; }
.related-pick__meta time { color: var(--ink-3); font-size: .8125rem; }
.thumb { padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; cursor: pointer; background: none; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.thumb:hover, .thumb:focus-visible { border-color: var(--accent); outline: none; }

/* ------------------------------------------------------------------ table */

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.table__detail { max-width: 460px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }

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

/* ------------------------------------------------------------ block editor */

.btn--outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--outline:hover { background: var(--bg); }

.editor-page { margin: -18px -16px; }
@media (min-width: 860px) { .editor-page { margin: -28px -32px; } }

.editor-top {
  position: sticky; top: 0; z-index: 21; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.editor-top__back { display: flex; padding: 6px; border-radius: 8px; color: var(--ink-2); }
.editor-top__back:hover { background: var(--bg); }
.editor-top__status { flex: 1; min-width: 0; font-size: .8125rem; color: var(--ink-3); }
.editor-top__saved { white-space: nowrap; }
.editor-top__actions { display: flex; gap: 6px; flex-wrap: wrap; }

.editor-body { max-width: 760px; margin: 0 auto; padding: 28px 16px 120px; }
.editor-title {
  display: block; width: 100%; border: none; font: 650 1.75rem/1.3 var(--font); letter-spacing: -.01em;
  padding: 4px 0 14px; margin-bottom: 10px; border-bottom: 1px solid var(--line); background: transparent;
}
.editor-title:focus { outline: none; border-bottom-color: var(--accent); }
.editor-canvas { min-height: 320px; }

/* Custom-block chrome (Button/Gallery/TOC/Callout editing UI) */
.sk-block { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px; margin: 4px 0; }
.sk-block__row { display: flex; gap: 8px; flex-wrap: wrap; }
.sk-block-input {
  flex: 1; min-width: 120px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: 14px/1.4 var(--font); background: var(--panel); color: var(--ink);
}
.sk-block-input--small { flex: none; width: auto; }
.sk-block-input--color { flex: none; width: 44px; height: 34px; padding: 2px; cursor: pointer; }
.sk-block__preview { margin-top: 8px; max-width: 140px; }
.sk-block__preview .sk-gallery-edit { grid-template-columns: 1fr; }
.sk-block__remove {
  flex: none; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-2); font-size: 15px; line-height: 1; cursor: pointer;
}
.sk-block__add {
  margin-top: 8px; padding: 6px 12px; border: 1px dashed var(--line); border-radius: 8px;
  background: transparent; color: var(--accent); font-size: .875rem; cursor: pointer;
}
.sk-block__editable { min-height: 1.6em; padding: 6px 2px; }
.sk-block--toc { color: var(--ink-3); font-size: .875rem; font-style: italic; }

.sk-gallery-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.sk-gallery-edit__item { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.sk-gallery-edit__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sk-gallery-edit__remove {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(20, 24, 30, .65); color: #fff; font-size: 15px; line-height: 1; cursor: pointer;
}

/* Public-page rendering of the same blocks (mirrors lib/BlockRender.php) */
.sk-divider { border: none; border-top: 1px solid var(--line, #e3e7ed); margin: 2em 0; }
.sk-checklist { list-style: none; padding: 0; }
.sk-check { display: flex; gap: 8px; align-items: baseline; }
.sk-callout { border-radius: 10px; padding: 14px 16px; margin: 1em 0; }
.sk-callout--info { background: #e7f1fc; }
.sk-callout--warning { background: #fdf3e3; }
.sk-toc { border: 1px solid #e3e7ed; border-radius: 10px; padding: 14px 18px; margin: 1.5em 0; }
.sk-toc__label { font-weight: 650; margin: 0 0 .4em; }
.sk-embed { position: relative; padding-top: var(--sk-embed-ratio, 56.25%); margin: 1.5em 0; }
.sk-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sk-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 1.5em 0; }
.sk-columns { display: grid; gap: 20px; margin: 1.5em 0; }
@media (min-width: 640px) { .sk-columns { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.sk-hero {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 14px; min-height: 320px; padding: 48px 32px; margin: 1.5em 0; border-radius: 14px; overflow: hidden;
  background: var(--sk-hero-bg, #16202c); color: #fff;
}
.sk-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.sk-hero::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(0deg, rgba(0,0,0,.35), rgba(0,0,0,.15)); }
.sk-hero__heading, .sk-hero__subhead, .sk-hero__cta { position: relative; z-index: 1; margin: 0; }
.sk-hero__heading { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.15; }
.sk-hero__subhead { font-size: 1.0625rem; max-width: 46em; opacity: .92; }
.sk-hero__cta { margin-top: 6px; }
.sk-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin: 1.5em 0; }
.sk-feature-grid__item { padding: 20px; border: 1px solid var(--line, #e3e7ed); border-radius: 12px; }
.sk-feature-grid__heading { margin: 0 0 .4em; font-size: 1.0625rem; }
.sk-feature-grid__text { margin: 0; opacity: .85; }

/* --------------------------------------------------------- settings panel */

.small { font-size: .8125rem; }
.check-list { max-height: 220px; overflow-y: auto; margin-bottom: 10px; }

.editor-layout { display: flex; align-items: flex-start; }
.editor-body { flex: 1; min-width: 0; }

.settings-panel {
  flex: none; width: 320px; max-width: 100vw; background: var(--panel); border-left: 1px solid var(--line);
  padding: 18px 20px 80px; box-sizing: border-box; overflow-y: auto;
}
.settings-panel[hidden] { display: none; }
.settings-panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.settings-panel__head h2 { margin: 0; }
.settings-panel__close { border: none; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-2); padding: 4px 8px; }
.settings-panel__section { border-top: 1px solid var(--line); padding: 16px 0; }
.settings-panel__section:first-of-type { border-top: none; padding-top: 0; }
.settings-panel__section h3 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: 0 0 10px; }

@media (max-width: 860px) {
  .editor-layout { position: relative; }
  .settings-panel {
    /* Above every sticky in-page header this panel might open over
       (.editor-top is 21, .page-head--sticky is 30) — a lower z-index here
       left the panel's own content rendered but visually covered, found by
       opening the Direct Mode History panel in a real browser at this width. */
    position: fixed; inset: 0; z-index: 45; width: 100%; padding-top: 14px;
  }
  /* Spec §4.9: 44px minimum touch target. The editor top bar is this
     screen's densest cluster of buttons, so it is the one place worth a
     dedicated override rather than resizing every .btn in the app. */
  .editor-top { flex-wrap: wrap; }
  .editor-top__actions .btn { min-height: 44px; padding: 11px 14px; }
  .editor-top__back { min-width: 44px; min-height: 44px; }
}

/* ------------------------------------------------------------------- help */

.help-article { max-width: 640px; }
.help-article h2 { margin-top: 1.6em; }
.help-article h2:first-child { margin-top: 0; }
.help-article ul { padding-left: 1.3em; }
.help-article li { margin-bottom: .4em; }
.help-article code { background: var(--bg); padding: 1px 5px; border-radius: 5px; font-size: .875em; }
.help-article pre { background: var(--bg); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }

/* ------------------------------------------------------------ dashboard v1 */

.stats-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stats-strip__tile {
  flex: 1; min-width: 160px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
}
.stats-strip__tile strong { font-size: 1.15rem; }
.stats-strip__tile span { font-size: .8125rem; color: var(--ink-3); }
.stats-strip__tile--hint strong { font-size: .95rem; color: var(--ink-2); }

.row__main--with-thumb { display: flex; align-items: center; gap: 12px; }
.row__thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg); }
.row__thumb--empty { border: 1px dashed var(--line); }
.row__body { flex: 1; min-width: 0; }
.row__title .pill { margin-left: 6px; vertical-align: middle; }

/* ----------------------------------------------------------------- SEO tab */

.seo-checklist { list-style: none; padding: 0; margin: 10px 0; }
.seo-checklist__item { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: .875rem; }
.seo-checklist__mark { flex: none; width: 18px; text-align: center; font-weight: 700; }
.seo-checklist__item--pass .seo-checklist__mark { color: var(--ok); }
.seo-checklist__item--fail .seo-checklist__mark { color: var(--ink-3); }
.seo-checklist__hint { display: block; color: var(--ink-3); font-weight: 400; }

.google-preview {
  display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 14px; background: var(--panel); font-family: arial, sans-serif;
}
.google-preview__title { display: block; color: #1a0dab; font-size: 1.125rem; line-height: 1.3; }
.google-preview__url { display: block; color: #006621; font-size: .8125rem; margin: 2px 0 4px; }
.google-preview__desc { display: block; color: #545454; font-size: .875rem; line-height: 1.4; }

.structured-data-preview {
  background: var(--bg); border-radius: 8px; padding: 12px 14px; font-size: .75rem;
  overflow-x: auto; max-height: 240px; overflow-y: auto;
}

/* ------------------------------------------------------------ direct edit */

/* The editor must never make the STUDIO page scroll sideways. The previewed
   site page is responsive, so it reflows to the frame's width; anything
   genuinely wider than the frame gets the iframe's own scrollbar, localised to
   the preview rather than shoving the whole admin sideways. */
.direct-edit { position: relative; max-width: 100%; }
.direct-edit__frame {
  display: block; width: 100%; max-width: 100%; min-height: 70vh;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.editor-page { max-width: 100%; overflow-x: clip; }
.direct-edit__toolbar {
  display: flex; gap: 2px; background: var(--ink); border-radius: 8px; padding: 4px;
  box-shadow: var(--shadow); z-index: 60;
}
.direct-edit__toolbar[hidden] { display: none; }
.direct-edit__toolbar button {
  border: none; background: transparent; color: #fff; padding: 6px 10px; border-radius: 5px;
  font: inherit; cursor: pointer; min-width: 32px;
}
.direct-edit__toolbar button:hover { background: rgba(255,255,255,.15); }

/* Prev/next pagination on the admin list screens (posts, pages). */
.admin-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }

/* Grouped feature checkboxes in the listing editors. */
.features-picker { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0 0 16px; }
.features-picker legend { font-weight: 650; padding: 0 4px; }
.features-picker__group { margin: 14px 0 6px; font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.features-picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; }
.features-picker .check { margin: 0; }

/* Feature icons beside the checkbox labels in the listing editors. */
.features-picker .check .feat-ic { width: 18px; height: 18px; flex: 0 0 auto; color: var(--ink-2); margin: 0 2px; }
.features-picker .check { display: flex; align-items: center; gap: 6px; }

/* Listing review freshness: dots, labels, and the clickable bar chart. */
.fresh-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: baseline; }
.fresh-dot--red { background: #d92d20; }
.fresh-dot--yellow { background: #f79009; }
.fresh-dot--green { background: #12b76a; }
.fresh-label--red { color: #b42318; }
.fresh-label--yellow { color: #a25c00; }
.fresh-label--green { color: #15803d; }
.freshbar { padding: 14px 16px; margin-bottom: 16px; }
.freshbar__track { display: flex; gap: 3px; height: 34px; border-radius: 8px; overflow: hidden; }
.freshbar__seg {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 650; font-size: .875rem; text-decoration: none;
  min-width: 30px; transition: filter .12s ease;
}
.freshbar__seg:hover { filter: brightness(1.08); }
.freshbar__seg.is-on { outline: 3px solid var(--ink); outline-offset: -3px; }
.freshbar__seg--red { background: #d92d20; }
.freshbar__seg--yellow { background: #f79009; }
.freshbar__seg--green { background: #12b76a; }
.freshbar__legend { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.freshbar__key { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.freshbar__key.is-on { font-weight: 650; }
.freshbar__key:hover { text-decoration: underline; }

/* Inbox lists and the per-lead delete. */
.inbox-list { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.inbox-list li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.inbox-list--focus { list-style: disc; padding-left: 20px; }
.inbox-list--focus li { display: list-item; }
.lead__delete { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Writers screen forms. */
.writers-rename { display: flex; gap: 8px; align-items: center; }
.writers-rename input { max-width: 190px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.writers-add { display: flex; gap: 8px; align-items: center; max-width: 420px; }
.writers-add input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }

/* Calendar month grid. */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); padding: 0; overflow: hidden; }
.cal__head { background: var(--bg); padding: 8px 6px; text-align: center; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.cal__day { background: var(--panel); min-height: 86px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal__day--pad { background: var(--bg); }
.cal__day--today { background: #eef6ff; }
.cal__num { font-size: .8125rem; color: var(--ink-3); }
.cal__day--today .cal__num { color: var(--accent); font-weight: 700; }
.cal__event {
  display: block; font-size: .75rem; line-height: 1.3; padding: 3px 6px;
  border-radius: 6px; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal__event:hover { filter: brightness(.96); }
.cal__event--unassigned { background: #f0f2f5; color: var(--ink-2); }
.cal__legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cal__key { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: .75rem; }
.cal__month { min-width: 130px; text-align: center; }
@media (max-width: 700px) { .cal__day { min-height: 60px; } .cal__event { font-size: .6875rem; } }
.cal__plus {
  float: right; width: 18px; height: 18px; line-height: 16px; text-align: center;
  border-radius: 50%; border: 1px solid var(--line); color: var(--ink-3);
  text-decoration: none; font-weight: 700; opacity: 0; transition: opacity .12s;
}
.cal__day:hover .cal__plus, .cal__plus:focus { opacity: 1; }
.cal__plus:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.cal__event--custom { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.cal__event--custom > .cal__zap { margin-left: auto; display: inline; }
.cal__zap button {
  border: 0; background: none; color: var(--ink-3); cursor: pointer;
  font-size: .875rem; line-height: 1; padding: 0 2px;
}
.cal__zap button:hover { color: var(--danger, #b3261e); }
.cal__addform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cal__addform input[type="text"] { flex: 1 1 220px; }

/* Prefixed address field on the page editor --------------------------- */
.field__prefixed { display: flex; align-items: center; gap: 0; }
.field__prefix { color: var(--ink-3); font-size: .875rem; white-space: nowrap; padding-right: 4px; }
.field__prefixed input { flex: 1; min-width: 0; }

/* Pending client-change approvals ------------------------------------- */
.pending-box { border-left: 4px solid #e8a13c; }
.pending-box__item { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.pending-box__diff { font-size: .875rem; margin: 4px 0 8px; }
.pending-box__diff s { color: var(--ink-3); }
.pending-box__actions { display: flex; gap: 8px; }
.pending-box__actions form { display: inline; }

/* Kanban board -------------------------------------------------------- */
.kanban { margin-bottom: 18px; }
.kanban__lanehead {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); padding: 14px 4px 4px; margin: 4px 0 2px;
}
/* The scrolling track of fixed-width columns, like Trello and HubSpot. */
.kanban__row {
  display: flex; gap: 12px; align-items: flex-start; overflow-x: auto;
  padding: 2px 2px 14px; scroll-snap-type: x proximity;
}
.kanban__row::-webkit-scrollbar { height: 10px; }
.kanban__row::-webkit-scrollbar-thumb { background: rgba(16, 32, 48, .2); border-radius: 6px; }
.kanban__row::-webkit-scrollbar-track { background: transparent; }
.kanban__col {
  flex: 0 0 280px; width: 280px; background: #f1f2f4; border: 1px solid transparent;
  border-radius: 12px; padding: 8px; min-height: 56px; max-height: calc(100dvh - 210px);
  display: flex; flex-direction: column; gap: 8px; overflow-y: auto; scroll-snap-align: start;
}
.kanban__col::-webkit-scrollbar { width: 8px; }
.kanban__col::-webkit-scrollbar-thumb { background: rgba(16, 32, 48, .16); border-radius: 6px; }
.kanban__col.is-target { border-color: var(--accent); background: #e6f0fb; box-shadow: inset 0 0 0 1px rgba(10, 110, 209, .35); }
.kanban__colhead {
  font-weight: 700; font-size: .875rem; display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 4px; position: sticky; top: -8px; background: #f1f2f4; z-index: 1;
  margin: -8px -8px 0; padding: 12px 12px 8px; border-radius: 12px 12px 0 0;
}
.kanban__count {
  font-size: .75rem; font-weight: 600; color: var(--ink-2); background: rgba(16, 32, 48, .09);
  border-radius: 999px; padding: 1px 9px; min-width: 22px; text-align: center; margin-left: auto;
}
.kanban__colhead.is-over .kanban__count { color: #fff; background: var(--err); }
/* Tinted (owner-coloured) stage headers: the count badge rides on the header
   colour, so give it a translucent-white chip and inherit the header's text. */
.kanban__colhead--tint { box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.kanban__colhead--tint .kanban__count { background: rgba(255,255,255,.24); color: inherit; }

.kcard {
  background: var(--panel); border: 1px solid #e5e9ef; border-radius: 9px; padding: 0; cursor: grab;
  box-shadow: 0 1px 2px rgba(16, 32, 48, .07); transition: box-shadow .12s ease, transform .12s ease, border-color .12s ease;
}
.kcard:hover { box-shadow: 0 3px 10px rgba(16, 32, 48, .13); transform: translateY(-1px); border-color: #d5dbe3; }
.kcard[open] { box-shadow: 0 3px 12px rgba(16, 32, 48, .15); cursor: default; }
.kcard.is-dragging { opacity: .9; transform: rotate(2.5deg); box-shadow: 0 10px 24px rgba(16, 32, 48, .24); cursor: grabbing; }
.kcard summary { list-style: none; padding: 9px 11px; cursor: pointer; }
.kcard summary::-webkit-details-marker { display: none; }
.kcard__title { display: block; font-size: .875rem; font-weight: 600; line-height: 1.35; color: var(--ink); }
.kcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: .72rem; color: var(--ink-3); }
.kcard__owner {
  display: inline-flex; align-items: center; gap: 5px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px 1px 6px; color: var(--ink-2); font-weight: 550;
}
.kcard__owner::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.kcard__due { display: inline-flex; align-items: center; gap: 3px; }
.kcard__due::before { content: "\1F552"; font-size: .85em; }
.kcard__due.is-late { color: var(--err); font-weight: 700; }
.kcard__body { padding: 2px 11px 11px; border-top: 1px solid var(--line); margin-top: 4px; }
.kcard__body p { font-size: .8125rem; margin: 8px 0; color: var(--ink-2); }
.kcard__edit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.kcard__edit input, .kcard__edit textarea, .kcard__edit select { font-size: .8125rem; }

.kanban__col-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.kanban__col-row input[type="text"] { flex: 1; }
.kanban__wip { display: flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--ink-3); }
.kanban__wip input { width: 64px; }

/* HTML mode on the new-page editor ----------------------------------- */
.html-mode { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; background: var(--panel); }
.html-mode summary { cursor: pointer; }
.html-mode__form { margin-top: 10px; }
.html-mode__form textarea { width: 100%; font-family: ui-monospace, monospace; font-size: .8125rem; }

/* Client profiles ---------------------------------------------------- */
.shortlist-picker { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.shortlist-picker summary { cursor: pointer; }
.shortlist-picker__list { max-height: 320px; overflow-y: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.shortlist-picker__item {
  display: flex; gap: 8px; align-items: baseline; padding: 5px 6px;
  border-radius: 6px; font-size: .875rem;
}
.shortlist-picker__item:hover { background: var(--bg); }
.shortlist-picker__item input { flex: 0 0 auto; }
.shortlist-picker__item .muted { margin-left: auto; white-space: nowrap; }

/* Client Tools grabs -------------------------------------------------- */
.grab-item { display: flex; gap: 16px; align-items: flex-start; }
.grab-item__img { width: 180px; max-width: 30%; border-radius: 8px; object-fit: cover; aspect-ratio: 4 / 3; background: var(--bg); }
.grab-item__body { flex: 1; min-width: 0; }
.grab-item__body h2 { margin-top: 0; }
.grab-item__facts { margin: 4px 0 8px; }
@media (max-width: 700px) { .grab-item { flex-direction: column; } .grab-item__img { width: 100%; max-width: none; } }

/* Where a website lead enquired from */
.lead__from dd a { word-break: break-all; }
.lead__from--none dd { font-style: italic; }

/* Key information panel on a lead */
.lead__keyinfo { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 4px 0 12px; }
.lead__keyinfo summary { cursor: pointer; }
.lead__keyinfo .grid-2 { margin-top: 10px; }

/* Contact activity timeline */
.lead__logger { margin: 10px 0; }
.lead__logrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lead__logrow select { flex: 0 0 auto; }
.lead__logrow input[type="text"] { flex: 1 1 220px; }
.lead__logrow input[type="date"] { flex: 0 0 auto; }
.timeline-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.timeline-filter button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 12px; font-size: .8125rem; cursor: pointer; color: var(--ink-2); }
.timeline-filter button.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.timeline__icon { flex: none; width: 24px; text-align: center; }
.timeline__body { min-width: 0; }
.timeline__meta { display: block; font-size: .75rem; color: var(--ink-3); margin-top: 2px; }
.timeline__check { border: 0; background: none; cursor: pointer; font-size: 1rem; padding: 0 4px 0 0; }
.timeline__task.is-done { text-decoration: line-through; color: var(--ink-3); }
.timeline__due { font-style: normal; color: var(--ink-3); font-size: .8125rem; }
.timeline__due.is-late { color: #b3261e; font-weight: 600; }

/* Contact pipeline cards (reuse .kanban/.kcard from the Board) */
.kcard__open { display: block; font-weight: 600; font-size: .875rem; text-decoration: none; color: var(--ink); padding: 10px 11px 4px; line-height: 1.35; }
.kcard__open:hover { color: var(--accent); }
.kcard--pipe .kcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 11px 10px; margin-top: 4px; font-size: .72rem; }
.kcard__tasks { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.kcard__note { margin: 0; padding: 0 11px 10px; font-size: .8125rem; color: var(--ink-2); line-height: 1.4; }

/* CRM saved-view tabs */
.crm-views { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.crm-views__wrap { display: inline-flex; align-items: center; }
.crm-views__tab { padding: 6px 12px; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--ink-2); font-size: .9375rem; }
.crm-views__tab.is-on { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.crm-views__del { display: inline; }
.crm-views__del button { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: .9rem; padding: 0 4px; }
.crm-views__del button:hover { color: var(--danger, #b3261e); }
.crm-views__save { display: flex; gap: 8px; margin-top: 10px; }
.crm-views__save input[type="text"] { flex: 1 1 260px; }

/* Deals on a contact */
.lead__deals { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 4px 0 12px; }
.lead__deals summary { cursor: pointer; }
.deal-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.deal-row input[type="text"] { flex: 1 1 160px; }
.deal-row--new { border-top: 1px dashed var(--line); padding-top: 10px; }

/* Pages hub — thumbnail grid (task #30 phase 1). Each thumb is a live/preview
   render of the page in a scaled, non-interactive iframe, so what you see on
   the card is the real page, not a stand-in. Fixed 260px cards keep the
   iframe's scale factor deterministic (1200px logical width -> 260px). */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, 260px); gap: 18px; margin-top: 4px; }
.pcard { width: 260px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel, #fff); }
.pcard__thumb { display: block; position: relative; width: 260px; height: 180px; overflow: hidden; background: #f3f4f6; border-bottom: 1px solid var(--line); }
.pcard__frame { position: absolute; inset: 0; }
.pcard__frame iframe { width: 1200px; height: 830px; border: 0; transform: scale(0.2167); transform-origin: top left; pointer-events: none; background: #fff; }
.pcard__badge { position: absolute; top: 8px; right: 8px; }
.pcard__body { padding: 10px 12px 12px; }
.pcard__title { display: block; font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.25; }
.pcard__title:hover { text-decoration: underline; }
.pcard__path { font-size: 12px; color: var(--muted, #6b7280); margin: 2px 0 10px; word-break: break-all; }
.pcard__acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pcard__del { display: inline; margin: 0; }
@media (prefers-color-scheme: dark) { .pcard__thumb, .pcard__frame iframe { background: #fff; } }

/* Pages hub groups: "Pages you build here" and "Current site pages". */
.pages-group { margin-top: 22px; }
.pages-group__title { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.pages-group .pgrid { margin-top: 0; }

/* ---- Visual page builder (task #30 phase 2) ---- */
.vb { display: grid; gap: 16px; margin: 16px 0; }
@media (min-width: 780px) { .vb { grid-template-columns: 210px 1fr; align-items: start; } }
.vb__palette { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
@media (min-width: 780px) { .vb__palette { position: sticky; top: 64px; } }
.vb__palette-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: 0 0 10px; }
.vb__palette-buttons { display: grid; gap: 6px; }
.vb__add { text-align: left; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; }
.vb__add:hover { background: #eef2f8; border-color: var(--accent); }
.vb__hint { margin: 12px 0 0; }
.vb__canvas { min-height: 120px; }
.vb__sections { display: flex; flex-direction: column; gap: 12px; }
.vb__empty { border: 2px dashed var(--line); border-radius: 12px; padding: 34px; text-align: center; }

.vb-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.vb-card__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; background: #f4f6f9; border-bottom: 1px solid var(--line); }
.vb-card__name { font-weight: 650; font-size: 14px; }
.vb-card__controls { display: flex; gap: 4px; }
.vb-ico { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line);
  background: var(--panel); border-radius: 7px; cursor: pointer; color: var(--ink-2); font-size: 14px; line-height: 1; }
.vb-ico:hover { background: #eef2f8; color: var(--ink); }
.vb-ico--del:hover { background: var(--err-bg); color: var(--err); border-color: #f2c3bf; }
.vb-card__body { padding: 12px; display: grid; gap: 10px; }
.vb-f { display: grid; gap: 4px; }
.vb-f > span { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.vb-f input[type="text"], .vb-f textarea, .vb-f select { width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.vb-f--inline { grid-template-columns: auto 1fr; align-items: center; }
.vb-f--inline > span { grid-column: 1; }
.vb-f--inline input[type="color"] { width: 44px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; }
.editor-top__switch { font-size: 13px; color: var(--accent); text-decoration: none; margin-left: 10px; }
.editor-top__switch:hover { text-decoration: underline; }

/* ---- Landlords / Developers CRM tabs (task #40) ---- */
.cols2 { display: grid; gap: 16px; align-items: start; }
@media (min-width: 860px) { .cols2 { grid-template-columns: 380px 1fr; } }
.grid--pair { display: grid; gap: 12px; }
@media (min-width: 520px) { .grid--pair { grid-template-columns: 1fr 1fr; } }
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none;
  color: var(--ink-2); background: var(--panel); font-size: 13px; font-weight: 550; }
.chip:hover { background: #eef2f8; }
.chip--on { background: var(--accent); color: #fff; border-color: var(--accent); }
.row__flags { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* ---- CRM contact record page (HubSpot-style three columns) ---- */
.record { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1040px) { .record { grid-template-columns: 340px minmax(0,1fr) 320px; } }
/* Two-column variant: a wide editable "about" main + a narrow related-records rail. */
@media (min-width: 1040px) { .record.record--sidebar { grid-template-columns: minmax(0, 1fr) 360px; } }
.record__col { min-width: 0; }
.record__col--main { min-width: 0; }
/* Wide tables (e.g. a landlord's Transactions) scroll inside the narrow rail instead of overflowing it. */
.record__col--side .table { display: block; overflow-x: auto; }
/* Progressive-disclosure groups inside a record column (HubSpot-style "show more"). */
.record__more { border-top: 1px solid var(--line); margin: 14px 0 0; }
.record__more > summary { cursor: pointer; list-style: none; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; padding: 12px 2px 6px; display: flex; align-items: center; gap: 7px; }
.record__more > summary::-webkit-details-marker { display: none; }
.record__more > summary::before { content: "\25B8"; font-size: .7rem; color: var(--ink-3); transition: transform .15s ease; }
.record__more[open] > summary::before { transform: rotate(90deg); }
.record__more > summary:hover { color: var(--ink); }
.record__more .field-group { border: 0; padding: 0; margin: 6px 0 2px; }
.record__more .field-group legend { padding: 0; }
.record__about .field { margin-bottom: 10px; }
.record__about .actions { margin-top: 6px; }
.crm-list .row__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- Share on social composer (Wix-style) ---- */
.soc-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; position: sticky; top: 52px; z-index: 20; }
.soc-bar__to { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.soc-bar__when { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.soc-when { display: inline-flex; align-items: center; gap: 5px; font-size: .875rem; }
.soc-chip { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--soc, #555); color: #fff; font-size: 11px; font-weight: 700; opacity: .3; transition: opacity .12s; }
.soc-chip[data-on="1"] { opacity: 1; }

.soc-ch { border-left: 4px solid var(--soc, #999); opacity: .72; transition: opacity .12s; }
.soc-ch.is-on { opacity: 1; }
.soc-ch__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.soc-badge { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--soc, #555); color: #fff; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.soc-badge--sm { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
.soc-ch__name { font-weight: 700; font-size: 1rem; }
.soc-toggle { margin-left: auto; display: inline-flex; cursor: pointer; }
.soc-toggle input { position: absolute; opacity: 0; }
.soc-toggle__track { width: 40px; height: 23px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.soc-toggle__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.soc-toggle input:checked + .soc-toggle__track { background: var(--soc, var(--accent)); }
.soc-toggle input:checked + .soc-toggle__track::after { left: 19px; }
.soc-toggle input:focus-visible + .soc-toggle__track { outline: 2px solid var(--accent); outline-offset: 2px; }

.soc-ch__grid { display: grid; gap: 18px; }
@media (min-width: 820px) { .soc-ch__grid { grid-template-columns: 1fr 300px; } }
.soc-field > span { display: flex; justify-content: space-between; align-items: baseline; }
.soc-count { font-size: .75rem; color: var(--ink-3); font-weight: 500; }
.soc-count.is-over { color: var(--err); font-weight: 700; }

.soc-media { margin-top: 4px; }
.soc-media__label { display: block; font-size: 13px; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
.soc-media__row { display: flex; gap: 12px; align-items: flex-start; }
.soc-media__thumb { flex: 0 0 120px; width: 120px; background: #eef1f5; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; display: grid; place-items: center; position: relative; }
.soc-media__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.soc-media__ph { text-align: center; font-size: 11px; color: var(--ink-3); padding: 6px; }
.soc-media__acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.soc-media__acts label { position: relative; overflow: hidden; }

.soc-ch__side { display: flex; flex-direction: column; gap: 10px; }
.soc-prev { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.soc-prev__bar { display: flex; align-items: center; gap: 7px; padding: 8px 10px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); }
.soc-prev__img { background: #eef1f5; }
.soc-prev__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.soc-prev__text { margin: 0; padding: 10px; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; max-height: 140px; overflow: auto; }
.soc-actions { display: flex; flex-direction: column; gap: 6px; }
.soc-connect { margin: 2px 0 0; }

/* ---- Client payment plan (task #49) ---- */
.txn-acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.txn-acts form { margin: 0; }
.soc-schedule tr.is-paid td { color: var(--ink-3); text-decoration: line-through; }
.soc-schedule tr.is-paid td:last-child { text-decoration: none; }
.soc-schedule tr.is-late td { background: var(--err-bg); }

/* ---- Contact role checkboxes (task #41) ---- */
.rolebox { display: flex; flex-wrap: wrap; gap: 8px; }
.check--pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; background: var(--panel); font-size: .875rem; }
.check--pill:has(input:checked) { border-color: var(--accent); background: #e8f1fc; color: var(--accent); font-weight: 600; }
.pill--role { background: #eef2f8; color: var(--ink-2); border: 1px solid var(--line); margin-left: 4px; }
.txn-add { margin-top: 12px; }
.txn-add summary { cursor: pointer; }
.txn-add form { margin-top: 10px; display: grid; gap: 10px; }

/* Cover thumbnail on each property row (mfc-listings). Additive; a site whose
   rows have no .row__thumb is unaffected. */
.row__thumb { flex: 0 0 auto; width: 64px; height: 44px; border-radius: 6px; overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.row__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row__thumb--none { width: 100%; height: 100%; background: repeating-linear-gradient(45deg, var(--line) 0 6px, transparent 6px 12px); opacity: .5; }

/* Building photo on a commercial contact — preview + upload/replace. */
.ccphoto { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.ccphoto__img { width: 132px; height: 96px; flex: none; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.ccphoto__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ccphoto__img.is-empty { border-style: dashed; }
.ccphoto__side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ccphoto__form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ccphoto__file { max-width: 210px; font-size: .82rem; }

/* Bulk-select + delete toolbar on the Properties list. */
.bulkbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.bulkbar__all { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .85rem; font-weight: 600; }
.bulkbar__count { min-width: 86px; }
.bulkbar__hint { margin-left: auto; }
.bulkbar button[disabled] { opacity: .5; cursor: not-allowed; }
.rowpick { flex: none; width: 18px; height: 18px; cursor: pointer; }

/* Default-cover picker on the New property form (radio variant of .phpick). */
.phpick--new .phpick__h { margin: 0 0 .3rem; font-size: 1rem; }
.phpick--new .phpick__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .55rem; margin-top: .7rem; }
.phpick--new .phpick__opt { position: relative; display: block; width: auto; margin: 0; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; }
.phpick--new .phpick__opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.phpick--new .phpick__opt img { display: block; width: 100%; height: 104px; object-fit: cover; }
.phpick--new .phpick__opt .phpick__label { display: block; padding: .35rem .5rem; font-size: .75rem; font-weight: 600; color: #1c1c1c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phpick--new .phpick__opt:hover { border-color: #bcbcbc; }
.phpick--new .phpick__opt:has(input:checked) { border-color: #4a8f3c; box-shadow: 0 0 0 2px rgba(74,143,60,.18); }
.phpick--new .phpick__opt:has(input:checked) .phpick__label { color: #4a8f3c; }
.phpick--new .phpick__opt--none { display: flex; flex-direction: column; }
.phpick--new .phpick__nonebox { height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 10px; text-align: center; background: var(--bg); color: var(--muted); font-weight: 600; }
.phpick--new .phpick__nonebox small { font-weight: 400; font-size: .72rem; }

/* Safety: a hidden feature set must never render (some resets drop [hidden]). */
.features-picker__set[hidden] { display: none; }

/* ============================================================ command palette
   Global ⌘K search — one box across every CRM store (leads, clients, owners,
   developers, projects, commercial, properties). Topbar trigger is styled for
   the dark top bar. */
.topbar__search { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.08); color: #e2e8f1; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 6px 10px; font: inherit; font-size: .82rem; cursor: pointer; }
.topbar__search:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.26); }
.topbar__search svg { opacity: .85; }
.topbar__search kbd { font: inherit; font-size: .72rem; background: rgba(255,255,255,.16); border-radius: 5px; padding: 1px 6px; letter-spacing: .02em; }
@media (max-width: 700px) { .topbar__search span, .topbar__search kbd { display: none; } .topbar__search { padding: 7px; } }

.cmdk { width: min(620px, 94vw); padding: 0; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(16,32,48,.28); background: var(--panel); color: var(--ink); margin: 12vh auto auto; overflow: hidden; }
.cmdk::backdrop { background: rgba(16,32,48,.42); }
.cmdk__bar { display: flex; align-items: center; gap: 11px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.cmdk__icon { color: var(--ink-3); flex: none; }
.cmdk__bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.05rem; padding: 2px 0; }
.cmdk__bar input::placeholder { color: var(--ink-3); }
.cmdk__esc { font: inherit; font-size: .72rem; color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; flex: none; }
.cmdk__results { max-height: min(56vh, 440px); overflow-y: auto; padding: 6px; }
.cmdk__results[data-loading] { opacity: .55; }
.cmdk__group { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 12px 12px 5px; }
.cmdk__row { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); cursor: pointer; }
.cmdk__row.is-on { background: var(--accent); color: var(--accent-ink); }
.cmdk__t { font-weight: 600; font-size: .95rem; }
.cmdk__s { font-size: .82rem; color: var(--ink-3); margin-left: auto; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.cmdk__row.is-on .cmdk__s { color: rgba(255,255,255,.85); }
.cmdk__empty { padding: 28px 16px; text-align: center; color: var(--ink-3); font-size: .9rem; }
.cmdk__foot { display: flex; justify-content: space-between; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--line); background: var(--bg); color: var(--ink-3); font-size: .74rem; }
.cmdk__foot kbd { font: inherit; font-size: .68rem; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin: 0 1px; background: var(--panel); }

/* ============================================================ approval queue */
.appr__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.appr__who { display: flex; align-items: center; gap: 10px; }
.appr__label { font-size: 1.05rem; }
.appr__diff { width: 100%; border-collapse: collapse; }
.appr__diff th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.appr__diff td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .9rem; }
.appr__f { font-weight: 600; white-space: nowrap; }
.appr__old { color: var(--ink-2); }
.appr__new { color: var(--ok, #157a4a); background: var(--ok-bg, #e7f6ee); font-weight: 500; }
.appr__act { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.appr__reject { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 240px; }
.appr__reject input { flex: 1; min-width: 0; }
.appr__recent { list-style: none; margin: 10px 0 0; padding: 0; }
.appr__recent li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

/* ============================================================ calendar 2.0 +
   booking. Additive — extends the existing .cal grid with week/agenda views,
   drag-to-reschedule affordances, and the Booking control panel. */
.cal__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.cal__views { display: flex; gap: 6px; }
.cal__nav { display: flex; align-items: center; gap: 8px; }
.cal--week .cal__day { min-height: 150px; }
.cal__day--week { position: relative; }
.cal__event[draggable="true"] { cursor: grab; }
.cal__event.is-dragging { opacity: .4; }
.cal__day--drop { outline: 2px dashed var(--accent); outline-offset: -3px; background: #eaf3fd; }
.cal__day[data-day] { transition: background .12s ease; }

/* Agenda list */
.agenda { display: flex; flex-direction: column; }
.agenda__day { display: grid; grid-template-columns: 62px 1fr; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.agenda__day:last-child { border-bottom: 0; }
.agenda__date { text-align: center; line-height: 1.1; padding-top: 2px; }
.agenda__dow { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.agenda__num { display: block; font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.agenda__mon { display: block; font-size: .72rem; color: var(--ink-3); }
.agenda__date.is-today .agenda__num { color: var(--accent); }
.agenda__items { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.agenda__items .cal__event { white-space: normal; }

/* Generic scroll wrapper for wide tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.tablewrap table { width: 100%; min-width: 520px; border-collapse: collapse; }
.tablewrap th, .tablewrap td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .9rem; }
.tablewrap thead th { background: var(--bg); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.tablewrap tbody tr:last-child td { border-bottom: 0; }

/* Booking control panel */
.book__types { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 20px; }
.book__type { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--panel); }
.book__type.is-off { opacity: .62; }
.book__type-h { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.book__type-act { display: flex; gap: 6px; flex: none; }
.book__link { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.book__url { display: block; overflow-x: auto; white-space: nowrap; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: .82rem; color: var(--ink-2); }
.book__share { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.book__share .is-copied { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.pill--off { background: var(--bg); color: var(--ink-3); }
.book__form { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.book__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 8px 0; }
.book__grid label, .book__full, .book__rules label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.book__grid input, .book__grid select, .book__full textarea, .book__rules input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-weight: 400; }
.book__full { margin: 8px 0; }
.book__check { flex-direction: row !important; align-items: center; gap: 8px; }
.book__check input { width: 17px; height: 17px; accent-color: var(--accent); }
.book__agentpick { margin: 4px 0 12px; }
.book__agentpick select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; margin-left: 6px; }
.book__week { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.book__day { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; }
.book__dayname { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.book__win { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; }
.book__win input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.book__rules { display: flex; flex-wrap: wrap; gap: 16px; margin: 10px 0; }
@media (max-width: 620px) { .book__day { grid-template-columns: 1fr; } .book__win { margin-bottom: 4px; } }

/* ================================================================ assistant */
.asst__find { display: flex; gap: 8px; margin: 4px 0 16px; }
.asst__find input[type="search"] { flex: 1; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); }
.asst__find input[type="search"]:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.picklist { display: flex; flex-direction: column; gap: 2px; }
.pick { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name kind" "sub kind"; gap: 0 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.pick:hover { background: var(--bg); border-color: var(--line); }
.pick__name { grid-area: name; font-weight: 600; }
.pick__sub { grid-area: sub; color: var(--ink-3); font-size: .82rem; }
.pick__kind { grid-area: kind; align-self: center; }

.asst__contact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.asst__id h2 { margin: 0 0 4px; }
.asst__facts { display: flex; flex-wrap: wrap; gap: 12px; }
.asst__contact-act { display: flex; align-items: center; gap: 8px; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 1.05rem; text-decoration: none; }
.iconbtn:hover { background: var(--bg); }
.iconbtn.is-empty { border-color: var(--err); animation: iconshake .4s ease; }
@keyframes iconshake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.nba { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.nba__btn { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--ink); text-align: left; }
.nba__btn:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.nba__btn--warn { border-color: #f0c98a; background: var(--warn-bg); }
.nba__btn--warn:hover { border-color: var(--warn); }
.nba__ic { font-size: 1.25rem; line-height: 1.3; flex: none; }
.nba__t { display: flex; flex-direction: column; gap: 2px; }

.asst__cols { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 900px) { .asst__cols { grid-template-columns: 1fr 1fr; align-items: start; } }
.asst__rightcol { display: grid; gap: 16px; align-content: start; }
.asst__right { display: flex; flex-direction: column; gap: 16px; }
.asst__h3 { margin: 14px 0 6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.asst__line { margin: 4px 0; }
.asst__timeline { list-style: none; margin: 0; padding: 0; }
.asst__timeline li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.asst__timeline li:last-child { border-bottom: 0; }

.asst__pbselect { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .88rem; margin-bottom: 10px; }
.asst__pbselect select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.play2 { list-style: none; counter-reset: none; margin: 6px 0 4px; padding: 0; }
.stage2 { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; overflow: hidden; }
.stage2__btn { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; background: var(--panel); border: 0; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.stage2__btn:hover { background: var(--bg); }
.stage2__n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); color: var(--ink-3); display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.stage2__t { display: flex; flex-direction: column; gap: 2px; }
.stage2--on { border-color: var(--accent); }
.stage2--on .stage2__n { background: var(--accent); color: #fff; }
.stage2--on .stage2__btn { background: #eef6ff; }
.stage2--done .stage2__n { background: var(--ok); color: #fff; }

.tpl, .qa__item { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.tpl > summary, .qa__item > summary { cursor: pointer; padding: 10px 12px; font-weight: 600; list-style: none; }
.tpl > summary::-webkit-details-marker, .qa__item > summary::-webkit-details-marker { display: none; }
.tpl > summary::before, .qa__item > summary::before { content: "▸ "; color: var(--ink-3); }
.tpl[open] > summary::before, .qa__item[open] > summary::before { content: "▾ "; }
.tpl__body, .qa__a { margin: 0 12px 10px; padding: 10px 12px; background: var(--bg); border-radius: 8px; color: var(--ink-2); }
.tpl__share { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.tpl__share .is-copied { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }

/* ================================================================= meetings */
.mtg__new-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.mtg__new label, .mtg__full { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.mtg__new input, .mtg__new select, .mtg__full input { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.mtg__full { margin: 12px 0; }
.mtg__att { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0 12px; }
.mtg__att legend { font-size: .78rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 0 6px; }
.mtg__attrow { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 8px; margin-bottom: 8px; }
.mtg__attrow input { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
.mtg__video { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mtg__list { display: flex; flex-direction: column; gap: 4px; }
.mtg { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.mtg:hover { background: var(--bg); border-color: var(--accent); }
.mtg__t { display: flex; flex-direction: column; gap: 2px; }
.mtg__att-links { display: flex; flex-direction: column; gap: 8px; }
.mtg__att-link { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
@media (max-width: 620px) { .mtg__attrow { grid-template-columns: 1fr; } }

/* workflow sub-nav */
.wf { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 5; }
.wf__step { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .88rem; background: var(--panel); }
.wf__step:hover { border-color: var(--accent); color: var(--accent); }
.wf__step span { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .78rem; }

/* notetaker */
.note__bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.note__rec.is-rec { background: var(--err); border-color: var(--err); animation: recpulse 1.4s ease-in-out infinite; }
@keyframes recpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(180, 35, 24, .4); } 50% { box-shadow: 0 0 0 6px rgba(180, 35, 24, 0); } }
.note__text { width: 100%; font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); resize: vertical; line-height: 1.6; }
.note__text:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

/* task list */
.mtg__taskadd { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; margin: 8px 0; }
.mtg__taskadd input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.tasks { list-style: none; margin: 6px 0; padding: 0; }
.task { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--panel); }
.task.is-dragging { opacity: .4; }
.task--done .task__text { text-decoration: line-through; color: var(--ink-3); }
.task__grip { cursor: grab; color: var(--ink-3); user-select: none; }
.task__chk button, .task__del button { background: none; border: 0; cursor: pointer; font-size: 1.1rem; color: var(--ink-2); padding: 0 4px; }
.task__del button:hover { color: var(--danger, #b3261e); }
.task__text { flex: 1; }
.task__who { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 620px) { .mtg__taskadd { grid-template-columns: 1fr; } .task__who { width: 100%; } }

/* ================================================================= payments */
.pay__totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.pay__stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.pay__stat--warn { border-color: #f0c98a; background: var(--warn-bg); }
.pay__stat--ok { border-color: #a9d9ba; background: var(--ok-bg); }
.pay__n { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay__methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.pay__method { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel); }
.pay__qr { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; flex: none; background: #fff; }
.pay__method-b { min-width: 0; }
.pay__addmethod { margin-top: 8px; }
.pay__addmethod > summary { cursor: pointer; font-weight: 600; padding: 6px 0; color: var(--accent); }
.pay__form { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 6px; }
.pay__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.pay__form label, .pay__typebox label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.pay__form input, .pay__form select, .pay__typebox input { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.pay__typebox { margin: 12px 0; padding: 12px; background: var(--bg); border-radius: 10px; }
.pay__sched { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.pay__sched-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pay__row--paid { opacity: .6; }
.pay__row--paid td:first-child { text-decoration: none; }
.pay__row--over td { background: #fdf1f0; }
.pay__lineadd { display: grid; grid-template-columns: 2fr 1fr 1.1fr 1.2fr 1.2fr auto; gap: 8px; margin-top: 10px; }
.pay__lineadd input, .pay__lineadd select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 720px) { .pay__totals { grid-template-columns: 1fr; } .pay__lineadd { grid-template-columns: 1fr 1fr; } }

/* ===================================================================== Kiri */
.km { font-family: "Khmer OS", "Noto Sans Khmer", "Khmer Sangam MN", sans-serif; display: block; font-size: .88em; color: var(--ink-3); margin-top: .12rem; line-height: 1.7; }
.km-inline { font-family: "Khmer OS", "Noto Sans Khmer", "Khmer Sangam MN", sans-serif; }
.kiri--nokm .km { display: none; }
.ktabbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ktabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.ktab { border: 0; background: transparent; padding: 7px 16px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.ktab.is-on { background: var(--panel); color: var(--accent); box-shadow: var(--shadow); }
.kdot { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; font-size: .72rem; }
/* Kiri agent desk: one full-width column — workflows on top, ask box + answers
   below. NB: the class is .kiri-desk, NOT .kiri — the floating "Ask Kiri" chat
   widget (kiri-chat.js) injects `.kiri{position:fixed;...}`, so a page container
   sharing that class gets yanked out of flow and overlays everything. */
.kiri-desk { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.kiri-panel { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.kiri-panel__h { margin: 0 0 12px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
#klang { font-family: "Khmer OS", "Noto Sans Khmer", "Khmer Sangam MN", sans-serif; }

.kw-crumbs { font-size: .82rem; color: var(--ink-3); margin-bottom: 10px; min-height: 1.1rem; }
.kw-crumbs a { color: var(--accent); text-decoration: none; }
.kw-body { min-height: 120px; }
.ktrees { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 8px; }
.ktree { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 14px; cursor: pointer; font: inherit; color: var(--ink); }
.ktree:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.ktree__ic { font-size: 1.6rem; }
.ktree__t { font-weight: 600; }
.kq { font-size: 1.25rem; font-weight: 600; margin-bottom: 12px; }
.kguide { background: var(--warn-bg); border: 1px solid #f0c98a; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: .92rem; color: var(--ink-2); }
.kopts { display: flex; flex-direction: column; gap: 8px; max-width: 620px; }
.kopt { text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--panel); border-radius: 10px; padding: 12px 14px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.kopt:hover { background: #eef6ff; border-left-color: var(--accent); }
.kleaf { border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--line)); background: var(--ok-bg); border-radius: 14px; padding: 16px 18px; max-width: 640px; }
.kbadge { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--ok); border-radius: 6px; padding: .15rem .5rem; margin-bottom: .5rem; }
.kleaf h3 { margin: 0 0 .3rem; }
.kbody { color: var(--ink-2); margin: .3rem 0 0; }
.kassets { display: flex; flex-wrap: wrap; gap: 6px; margin: .8rem 0; }
.kchip { font-size: .78rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .25rem .55rem; }
.kacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: .6rem; }
.kw-chat { display: flex; gap: 8px; margin-top: 16px; }
.kw-chat input { flex: 1; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); }
.kw-chat input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

.ka-results { margin-top: 14px; }
.kans, .kmiss { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.kmiss { padding: 12px 14px; }
.kans > summary { cursor: pointer; padding: 11px 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
.kans__cat { font-family: "IBM Plex Mono", monospace; font-size: .7rem; color: var(--ink-3); font-weight: 400; }
.kans__a { margin: 0 14px 12px; color: var(--ink-2); }

.kc { border: 1px solid var(--line); border-radius: 14px; padding: 0; max-width: 560px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(16,24,40,.25); }
.kc::backdrop { background: rgba(16,24,40,.45); }
.kc__form { padding: 18px; margin: 0; }
.kc__form h3 { margin: 0 0 10px; }
.kc__send { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* =================================================== collapsible nav groups */
.sidenav__top { margin: 0 0 2px; padding: 0; list-style: none; }
.navgroup { border: 0; margin: 0; }
.navgroup > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); user-select: none; }
.navgroup > summary::-webkit-details-marker { display: none; }
.navgroup > summary::marker { content: ""; }
.navgroup > summary:hover { color: var(--ink); }
.navgroup > summary svg:first-child { opacity: .8; }
.navgroup__chev { margin-left: auto; transition: transform .15s ease; }
.navgroup[open] > summary .navgroup__chev { transform: rotate(180deg); }
.navgroup > ul { margin: 0 0 4px; padding: 0; list-style: none; }

/* ============================================== Co-Broke hub tabs (market cluster) */
.markettabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.markettab { flex: 0 0 auto; padding: 9px 15px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.markettab:hover { color: var(--accent); }
.markettab.is-on { color: var(--accent); border-bottom-color: var(--accent); }

/* section sub-tabs — the current menu group's items, constant across the top */
/* Filing-cabinet folder tabs: rounded tops sitting on a shelf line, the active
   folder pulled to the front and merged with the panel below it. */
.grouptabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; margin: 0 0 18px; padding: 8px 0 0; border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.grouptab { flex: 0 0 auto; margin-bottom: -1px; padding: 8px 16px; border: 1px solid var(--line); border-bottom-color: transparent; border-radius: 9px 9px 0 0; background: var(--bg); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.grouptab:hover { background: var(--panel); color: var(--accent); }
.grouptab.is-on { background: var(--panel); color: var(--accent); border-color: var(--line); border-bottom-color: var(--panel); }
/* second row: the active tab's sub-sections (e.g. Calendar → Booking · Meetings · Payments) */
.secnav { margin: 0 0 18px; }
.secnav .grouptabs { margin: 0 0 8px; }
.subtabs { display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; border-bottom: 1px solid var(--line); }
.subtab { flex: 0 0 auto; padding: 7px 13px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .86rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtab:hover { color: var(--accent); }
.subtab.is-on { color: var(--accent); border-bottom-color: var(--accent); }
#content.is-navloading { opacity: .5; transition: opacity .12s ease; }

/* ============================================ Ask Kiri — global launcher */
.kiri-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; background: #0e8077; color: #fff; font: inherit; font-weight: 600; padding: 11px 16px; border-radius: 999px; box-shadow: 0 6px 20px rgba(14,128,119,.42); }
.kiri-fab:hover { background: #0a6a63; }
/* The Ask Kiri logo (owner's transparent PNG) as the launcher: shown as-is on a
   transparent button, no pill. */
.kiri-fab--img { background: transparent !important; padding: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
.kiri-fab--img:hover { background: transparent !important; }
.kiri-fab__img { width: 74px; height: 74px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,.28)); transition: transform .12s ease; }
.kiri-fab--img:hover .kiri-fab__img { transform: translateY(-2px) scale(1.04); }
.kiri-fab svg { transform: translateY(-1px); }
@media (max-width: 640px) { .kiri-fab span { display: none; } .kiri-fab { padding: 13px; } }
.kiri-ask { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(520px, calc(100% - 28px)); max-height: 80vh; box-shadow: 0 24px 70px rgba(16,24,40,.3); color: var(--ink); background: var(--panel); }
.kiri-ask::backdrop { background: rgba(16,24,40,.4); }
.kiri-ask__h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.kiri-ask__x { border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink-3); }
.kiri-ask__form { display: flex; gap: 8px; padding: 14px 16px; }
.kiri-ask__form input { flex: 1; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); }
.kiri-ask__form input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.kiri-ask__results { padding: 0 16px; overflow-y: auto; }
.kiri-ask__ans { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.kiri-ask__ans > summary { cursor: pointer; padding: 10px 12px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
.kiri-ask__cat { font-family: "IBM Plex Mono", monospace; font-size: .7rem; color: var(--ink-3); font-weight: 400; }
.kiri-ask__ans p { margin: 0 12px 10px; color: var(--ink-2); }
.kiri-ask__acts { padding: 0 12px 12px; }
.kiri-ask__miss { padding: 8px 2px 14px; }
.kiri-ask__foot { padding: 12px 16px; border-top: 1px solid var(--line); }

/* ================================================ commercial meeting form */
.cf__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 6px 0 14px; }
.cf { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; }
.cf--full { grid-column: 1 / -1; }
.cf__lab { font-weight: 600; color: var(--ink-2); }
.cf input, .cf select, .cf textarea { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.cf input:focus, .cf select:focus, .cf textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

/* ============================================== custom proposal cards */
.cc__add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cc__copy { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.cc__copy input { flex: 1; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.cc__imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.cc__img { position: relative; width: 120px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.cc__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc__imgx { position: absolute; top: 3px; right: 3px; border: 0; background: rgba(0,0,0,.6); color: #fff; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; line-height: 1; }
.cc__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cc__card { display: grid; grid-template-columns: auto 74px 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.cc__card:hover { border-color: var(--accent); }
.cc__pick { width: 17px; height: 17px; accent-color: var(--accent); }
.cc__ph { width: 74px; height: 56px; border-radius: 6px; overflow: hidden; background: var(--bg); }
.cc__ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc__b { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cc__b strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc__price { font-weight: 700; }
.cc__sharebar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cc__sharebar input { flex: 1; min-width: 180px; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
@media (max-width: 560px) { .cc__card { grid-template-columns: auto 1fr; } .cc__ph { display: none; } }

/* ================================================== contact vault */
.vault__warn { background: var(--warn-bg); border: 1px solid #f0c98a; color: var(--warn); border-radius: 10px; padding: 9px 12px; margin: 8px 0; font-weight: 600; font-size: .9rem; }
.vault__docs { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 12px; }
.vault__doc { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; width: 260px; }
.vault__thumb { flex: 0 0 auto; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.vault__thumb img { width: 100%; height: 100%; object-fit: cover; }
.vault__file { font-family: "IBM Plex Mono", monospace; font-weight: 700; color: var(--ink-3); }
.vault__meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vault__docacts { display: flex; gap: 6px; margin-top: auto; }
.vault__log { list-style: none; margin: 6px 0; padding: 0; }
.vault__log li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.vault__log li:last-child { border-bottom: 0; }
.vault__inc { font-weight: 500; }
.vault__x { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 1.1rem; }
.vault__x:hover { color: var(--danger, #b3261e); }

/* ================================================== Kiri accordion (on a contact) */
.kiriacc .asst__pbselect { margin-bottom: 10px; }
.acc { display: flex; flex-direction: column; gap: 6px; }
.acc__item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.acc__item.is-open { border-color: var(--accent); }
.acc__head { display: flex; align-items: flex-start; gap: 8px; width: 100%; text-align: left; background: var(--panel); border: 0; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.acc__item.is-open > .acc__head { background: #eef6ff; }
.acc__n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); color: var(--ink-3); display: grid; place-items: center; font-size: .78rem; font-weight: 700; }
.acc__item.is-open .acc__n { background: var(--accent); color: #fff; }
.acc__t { display: flex; flex-direction: column; gap: 1px; font-weight: 600; }
.acc__ans { font-weight: 400; color: var(--accent); font-size: .85rem; }
.acc__b { padding: 4px 12px 12px; }
.acc__b p { margin: .3rem 0; color: var(--ink-2); }
.acc__guide { background: var(--warn-bg); border: 1px solid #f0c98a; border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: .88rem; color: var(--ink-2); }
.acc__opts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }

/* ready messages on a contact */
.lmsg { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.lmsg > summary { cursor: pointer; padding: 10px 12px; font-weight: 600; }
.lmsg .note__text { margin: 0 12px; width: calc(100% - 24px); }
.lmsg .tpl__share { padding: 8px 12px 12px; }

/* ------------------------------------------------ Kiri workflow guidance box
   A calm, reusable "what to do next / why it matters" note. Used across the
   pipeline editor, proposal maker and listing forms so agents always see the
   next step in context. */
.workflow-note {
  background: #eef6ff; border: 1px solid #cfe4fb; border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 14px; margin: 0 0 18px;
  font-size: .9rem; line-height: 1.5; color: var(--ink-2);
}
.workflow-note strong { color: var(--ink); }
.workflow-note--seo { background: #eefaf1; border-color: #c7ead2; border-left-color: #1a7f45; }

/* ------------------------------------------------------- pipeline stage editor */
.stage-editor { padding: 4px 4px 18px; }
.stage-editor__table { width: 100%; }
.stage-editor__table th { font-size: .8rem; color: var(--ink-2); text-align: left; }
.stage-editor__key { font-size: .82rem; color: var(--ink-3); background: var(--bg); padding: 2px 7px; border-radius: 6px; }
.stage-editor__default { display: inline-block; margin-left: 8px; font-size: .78rem; }
.stage-editor__hint { margin: 10px 4px 0; font-size: .85rem; }
.stage-editor__actions { display: flex; gap: 10px; align-items: center; margin: 16px 4px 0; }
.stage-editor__reset { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.input--num { width: 4.5rem; text-align: center; }

/* ------------------------------------------------------- approval rules (governance) */
.gov { padding: 4px 4px 18px; }
.gov__table { width: 100%; }
.gov__table th { text-align: left; font-size: .8rem; color: var(--ink-2); }
.gov__table td { vertical-align: top; padding-top: 12px; padding-bottom: 12px; }
.gov__label { font-weight: 600; }
.gov__help { font-size: .82rem; margin-top: 2px; max-width: 42ch; }
.gov__opt { display: flex; align-items: center; gap: 7px; padding: 3px 0; cursor: pointer; }
.gov__opt input { accent-color: var(--accent); }
.gov__locked { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.gov__tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.gov__tag--on { background: #e6f5ec; color: #1a7f45; }
.gov__tag--soon { background: var(--warn-bg); color: var(--warn); }
.gov__actions { display: flex; gap: 10px; align-items: center; margin: 16px 4px 0; }

/* Listing header: stack title-then-actions identically for every property type.
   Plain .page-head is space-between + wrap, so a SHORT title (e.g. an off-plan
   with no district) let the toolbar ride up top-right while long titles pushed it
   below — content-dependent and inconsistent. Stacking makes all four types match. */
.page-head--stack { flex-direction: column; align-items: stretch; }
.page-head--stack > div:first-child { min-width: 0; }
.page-head--stack .actions { justify-content: flex-start; }

/* ============================ unified contact-sheet header ============================
   One identity spine shared by every contact type (developer / commercial / investor /
   landlord / client / lead) via views/partials/contact-header.php. Per-type accent set
   inline as --ctype so the stripe, avatar and badges recolour without new classes. */
:root{
  --ctype-dev:#5b53d6; --ctype-comm:#0f8a86; --ctype-inv:#b8791b;
  --ctype-land:#2f8f4e; --ctype-client:#8a52c4; --ctype-lead:#0a6ed1;
}
.chsheet{ position:relative; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:18px 20px; margin-bottom:16px; overflow:hidden; --ctype:var(--accent); }
.chsheet::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--ctype); }
.chsheet__back{ display:inline-block; margin-bottom:8px; font-size:.8125rem; }
.chsheet__row{ display:flex; gap:16px; align-items:flex-start; }
.chsheet__avatar{ flex:none; width:54px; height:54px; border-radius:13px; display:grid; place-items:center;
  font-weight:700; font-size:1.25rem; color:#fff; background:var(--ctype); letter-spacing:-.02em; }
.chsheet__main{ flex:1; min-width:0; }
.chsheet__title{ display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.chsheet__title h1{ margin:0; font-size:1.35rem; letter-spacing:-.02em; }
.chsheet__badge{ font-size:.68rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  padding:3px 9px; border-radius:999px; color:var(--ctype);
  background:color-mix(in srgb, var(--ctype) 13%, var(--panel));
  border:1px solid color-mix(in srgb, var(--ctype) 32%, transparent); }
/* Record-TYPE pill: the solid, unmissable "what this record is" (Lead, Client,
   Landlord…). Filled in the type accent so it reads apart from the outline
   stage/status badges beside it. */
.chsheet__type{ font-size:.66rem; font-weight:800; text-transform:uppercase; letter-spacing:.06em;
  padding:3px 10px; border-radius:999px; color:#fff; background:var(--ctype);
  border:1px solid var(--ctype); order:-1; }
/* Media library picker overlay (?r=media.list). Reusable across the editor. */
.mpick{ position:fixed; inset:0; z-index:3000; display:grid; place-items:center; padding:3vh 3vw; background:rgba(10,14,20,.55); }
.mpick__box{ display:flex; flex-direction:column; width:min(980px,96vw); height:min(82vh,780px); background:var(--panel,#fff); border:1px solid var(--line,#e2e2e2); border-radius:14px; overflow:hidden; box-shadow:0 24px 70px rgba(0,0,0,.3); }
.mpick__bar{ display:flex; align-items:center; gap:12px; padding:12px 14px; border-bottom:1px solid var(--line,#e2e2e2); }
.mpick__title{ font-size:1rem; white-space:nowrap; }
.mpick__search{ flex:1; min-width:0; padding:8px 12px; border:1px solid var(--line,#d8d8d8); border-radius:8px; font:inherit; }
.mpick__x{ background:none; border:0; font-size:22px; line-height:1; cursor:pointer; color:var(--ink-2,#727272); }
.mpick__grid{ flex:1; overflow-y:auto; padding:12px; display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; align-content:start; }
.mpick__cell{ position:relative; padding:0; border:2px solid transparent; border-radius:10px; overflow:hidden; cursor:pointer; background:var(--panel-2,#f2f2f2); aspect-ratio:3/2; }
.mpick__cell img{ width:100%; height:100%; object-fit:cover; display:block; }
.mpick__cell:hover{ border-color:var(--line,#d8d8d8); }
.mpick__cell.is-on{ border-color:var(--accent,#d70404); }
.mpick__tick{ position:absolute; top:6px; right:6px; width:22px; height:22px; border-radius:50%; background:var(--accent,#d70404); color:#fff; display:none; place-items:center; font-size:13px; }
.mpick__cell.is-on .mpick__tick{ display:grid; }
.mpick__cap{ position:absolute; left:0; right:0; bottom:0; padding:3px 6px; font-size:10px; line-height:1.3; color:#fff; background:linear-gradient(transparent,rgba(0,0,0,.72)); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mpick__more{ grid-column:1/-1; padding:10px; border:1px dashed var(--line,#d8d8d8); border-radius:8px; background:none; cursor:pointer; font:inherit; }
.mpick__empty{ grid-column:1/-1; padding:44px; text-align:center; color:var(--ink-2,#727272); }
.mpick__foot{ display:flex; align-items:center; gap:10px; padding:12px 14px; border-top:1px solid var(--line,#e2e2e2); }
.mpick__sp{ flex:1; }
.mpick__count{ color:var(--ink-2,#727272); font-size:.9rem; }
.mpick__name{ display:none; position:absolute; inset:0; padding:8px; align-items:center; justify-content:center; text-align:center; font-size:11px; line-height:1.3; color:var(--ink-2,#727272); word-break:break-word; }
.mpick__cell--noimg img{ display:none; }
.mpick__cell--noimg .mpick__name{ display:flex; }
/* Category chips — the "boxes" an agent narrows thousands of photos by. */
.mpick__chips{ display:flex; flex-wrap:wrap; gap:8px; padding:10px 14px 0; }
.mpick__chip{ border:1px solid var(--line,#d8d8d8); background:var(--panel,#fff); color:var(--ink,#222); border-radius:999px; padding:6px 13px; font:inherit; font-size:13px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.mpick__chip span{ opacity:.55; font-weight:700; }
.mpick__chip:hover{ border-color:var(--ink-2,#9a9a9a); }
.mpick__chip.is-on{ background:var(--accent,#d70404); border-color:var(--accent,#d70404); color:#fff; }
.mpick__chip.is-on span{ opacity:.9; color:#fff; }
/* "Add from media library" — a second path to the photo grid, beside the uploader. */
.from-library{ display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:12px; }
.from-library__or{ color:var(--ink-2,#727272); font-size:.85rem; text-transform:uppercase; letter-spacing:.04em; }
.from-library__hint{ font-size:.85rem; }
/* Clickable list rows/cards (row-link.js): the whole row navigates, no button. */
.row--link{ cursor:pointer; }
.row--link:hover{ background:var(--bg,#f6f7f9); }
.row--link:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
/* Page editor: two-column layout matching the post editor — content on the left,
   all the SEO / settings as a right sidebar (not stacked full-width below). */
.pg-layout{ display:grid; gap:20px; align-items:start; }
@media (min-width:1100px){ .pg-layout{ grid-template-columns:minmax(0,1fr) 340px; } }
.pg-layout__main{ min-width:0; }
.pg-layout__side{ min-width:0; display:flex; flex-direction:column; gap:16px; }
.pg-layout__side > .card-box{ margin:0; }
.pg-layout .editor-body{ min-height:340px; }
.chsheet__sub{ color:var(--ink-2); font-size:.9rem; margin-top:3px; }
.chsheet__sub b{ color:var(--ink); font-weight:600; }
.chsheet__side{ display:flex; flex-direction:column; align-items:flex-end; gap:9px; flex:none; }
.chsheet__owner{ font-size:.8rem; color:var(--ink-2); }
.chsheet__owner b{ color:var(--ink); }
.chsheet__icons{ display:flex; gap:7px; }
.chsheet__icons a{ width:34px; height:34px; border-radius:9px; border:1px solid var(--line); background:var(--bg);
  display:grid; place-items:center; color:var(--ink-2); text-decoration:none; transition:.14s; }
.chsheet__icons a:hover{ color:var(--ctype); border-color:var(--ctype); }
.chsheet__actions{ display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.chsheet__metrics{ display:grid; grid-template-columns:repeat(auto-fit,minmax(88px,1fr)); gap:1px;
  background:var(--line); border:1px solid var(--line); border-radius:10px; overflow:hidden; margin-top:16px; }
.chsheet__metric{ background:var(--panel); padding:11px 14px; }
.chsheet__metric .k{ font-size:1.2rem; font-weight:700; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.chsheet__metric .l{ font-size:.7rem; color:var(--ink-3); text-transform:uppercase; letter-spacing:.05em; margin-top:1px; }
@media (max-width:620px){ .chsheet__row{ flex-wrap:wrap; } .chsheet__side{ align-items:flex-start; width:100%; } }

/* ------------------------------------------ message templates (admin + partial) */
.tpl__head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.msgtpl{ margin-bottom:14px; }
.msgtpl--new{ border-style:dashed; }
.msgtpl__top{ display:grid; grid-template-columns:1fr 12rem 6rem; gap:12px; align-items:end; }
.msgtpl__stages{ margin:10px 0; }
.msgtpl__stagelab{ display:block; font-size:.8rem; color:var(--ink-2); margin-bottom:6px; }
.msgtpl__stagegrid{ display:flex; flex-wrap:wrap; gap:6px 16px; }
.msgtpl__foot{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:8px; }
.msgtpl__btns{ display:flex; gap:8px; }
.msgtpl__addhead{ margin:22px 4px 10px; font-size:1.05rem; }
@media (max-width:640px){ .msgtpl__top{ grid-template-columns:1fr; } }

/* ------------------------------------------- inbox review rows (assign + priority) */
.inbox-list--rows{ display:flex; flex-direction:column; margin-top:4px; }
.inbox-row{ display:flex; align-items:center; gap:10px; padding:9px 0; border-top:1px solid var(--line); }
.inbox-row:first-child{ border-top:0; }
.inbox-row__t{ flex:1; min-width:0; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.inbox-row__f{ white-space:nowrap; }
.inbox-row--urgent{ background:#fdf0ee; border-radius:8px; padding:9px 8px; }
.inbox-prio{ margin:0; }
.inbox-prio select{ font-size:.76rem; padding:3px 6px; border:1px solid var(--line); border-radius:7px; background:var(--panel); color:var(--ink-2); }
.pill--own{ background:#eef2f7; color:var(--ink-2); border:1px solid var(--line); }
/* agent teams (groups) */
.grpitem{ border:1px solid var(--line); border-radius:10px; margin-bottom:8px; }
.grpitem--new > summary{ color:var(--accent); }
.grpitem > summary{ cursor:pointer; padding:10px 12px; font-weight:500; }
.grpform{ padding:4px 12px 12px; }
.grpmembers{ display:flex; flex-wrap:wrap; gap:6px 16px; margin:10px 0; }

/* ---------------------------------------------- pages editor (settings + SEO) */
.coverpick{ display:flex; flex-direction:column; gap:8px; }
.coverpick__img{ width:100%; max-width:280px; aspect-ratio:16/9; object-fit:cover; border:1px solid var(--line); border-radius:10px; background:var(--bg); }
.coverpick__btns{ display:flex; gap:8px; }
.pg-checks{ display:flex; flex-wrap:wrap; gap:6px 16px; margin-top:4px; }
.pg-social, .pg-meta{ margin-top:12px; border-top:1px solid var(--line); padding-top:10px; }
.pg-social > summary, .pg-meta > summary{ cursor:pointer; font-weight:600; font-size:.9rem; }
.pg-social .grid--pair, .pg-meta .grid--pair{ margin-top:10px; }
/* booking inline edit */
.book__edit{ display:inline-block; margin-right:6px; }
.book__edit > summary{ list-style:none; }
.book__edit > summary::-webkit-details-marker{ display:none; }
.book__editform{ position:absolute; z-index:20; margin-top:6px; background:var(--panel); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); padding:14px; width:min(360px,90vw); text-align:left; }

/* ----------------------------------------- inline "Guide me" workflow (no navigation) */
.guideme{ margin:0 0 16px; }
.guideme > summary{ list-style:none; display:inline-flex; align-items:center; gap:8px; cursor:pointer;
  background:var(--accent); color:var(--accent-ink); border:1px solid var(--accent); border-radius:9px;
  padding:9px 16px; font-weight:600; font-size:.9rem; user-select:none; }
.guideme > summary::-webkit-details-marker{ display:none; }
.guideme > summary::after{ content:"▾"; font-size:.8em; opacity:.9; }
.guideme[open] > summary::after{ content:"▴"; }
.guideme__panel{ margin-top:10px; }
.guideme__panel .card-box{ border-color:var(--accent); }

/* WeChat / copy icon in the contact header */
.chsheet__copy{ width:34px; height:34px; border-radius:9px; border:1px solid var(--line); background:var(--bg);
  display:grid; place-items:center; color:var(--ink-2); cursor:pointer; transition:.14s; padding:0; }
.chsheet__copy:hover{ color:var(--ctype); border-color:var(--ctype); }
.chsheet__copy.is-copied{ color:#1a7f45; border-color:#1a7f45; background:#e6f5ec; }
/* clickable rows (a whole row/card navigates via data-href) */
[data-href]{ cursor:pointer; }
tr[data-href]:hover{ background:#f6f8fb; }

/* inline "add a new landlord/owner" box on the listing form */
.addnew{ margin-top:8px; border:1px dashed var(--line); border-radius:10px; }
.addnew > summary{ cursor:pointer; padding:9px 12px; font-weight:600; font-size:.9rem; color:var(--accent); }
.addnew > summary::-webkit-details-marker{ display:none; }
.addnew[open] > summary{ border-bottom:1px dashed var(--line); }
.addnew .grid-2{ padding:12px; }
.addnew > small{ display:block; padding:0 12px 12px; }

/* Checkbox grids flow across in tight columns everywhere (not just private boxes),
   so long option lists (e.g. target districts) are a few rows, not one tall column. */
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 3px 16px; font-size: .875rem; }
.checkgrid label { display: flex; align-items: center; gap: 6px; }

/* contact profile: sub-headings + social-handle adder */
.form-sub{ font-size:.8rem; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-3); margin:18px 0 8px; font-weight:700; }
.form-sub:first-of-type{ margin-top:4px; }
.socials{ display:flex; flex-direction:column; gap:8px; margin:4px 0 10px; }
.socials__row{ display:grid; grid-template-columns:11rem 1fr auto; gap:8px; align-items:center; }
.socials__foot{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
@media (max-width:520px){ .socials__row{ grid-template-columns:1fr 1fr; } }
/* social chips in the contact header */
.chsheet__soc{ min-width:34px; height:34px; padding:0 8px; border-radius:9px; border:1px solid var(--line);
  background:var(--bg); display:inline-grid; place-items:center; color:var(--ink-2); text-decoration:none;
  font-size:.72rem; font-weight:700; letter-spacing:.02em; cursor:pointer; transition:.14s; }
.chsheet__soc:hover{ color:var(--ctype); border-color:var(--ctype); }

/* ================================= Contacts hub ================================= */
.ct-search{ display:flex; gap:8px; margin-bottom:14px; }
.ct-search input[type=search]{ flex:1; padding:10px 14px; border:1px solid var(--line); border-radius:10px; font:inherit; background:var(--panel); color:var(--ink); }
.ct-tabs{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.ct-tab{ display:inline-flex; align-items:center; gap:7px; padding:7px 13px; border-radius:999px; border:1px solid var(--line); background:var(--panel); color:var(--ink-2); text-decoration:none; font-weight:600; font-size:.86rem; --ct:var(--accent); }
.ct-tab span{ font-size:.75rem; color:var(--ink-3); background:var(--bg); border-radius:999px; padding:0 7px; }
.ct-tab:hover{ color:var(--ink); }
.ct-tab.is-on{ color:#fff; background:var(--ct); border-color:var(--ct); }
.ct-tab.is-on span{ color:#fff; background:rgba(255,255,255,.25); }
.ct-az{ display:flex; flex-wrap:wrap; gap:2px; margin-bottom:14px; }
.ct-az__l{ min-width:26px; text-align:center; padding:4px 6px; border-radius:7px; font-size:.8rem; font-weight:600; color:var(--ink-2); text-decoration:none; }
.ct-az__l:hover{ background:var(--bg); }
.ct-az__l.is-on{ background:var(--accent); color:#fff; }
.ct-az__l.is-empty{ color:var(--ink-3); opacity:.4; pointer-events:none; }
.ct-listbox{ padding:14px 16px; }
.ct-count{ margin:0 0 8px; }
.ct-list{ display:flex; flex-direction:column; }
.ct-row{ display:grid; grid-template-columns:auto 1fr auto auto; gap:12px; align-items:center; padding:9px 6px; border-top:1px solid var(--line); border-radius:8px; }
.ct-row:first-child{ border-top:0; }
.ct-row:hover{ background:#f6f8fb; }
.ct-row__av{ width:38px; height:38px; border-radius:10px; display:grid; place-items:center; color:#fff; font-weight:700; font-size:.85rem; flex:none; }
.ct-row__main{ min-width:0; display:flex; flex-direction:column; }
.ct-row__name{ font-weight:600; color:var(--ink); text-decoration:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ct-row__sub{ font-size:.78rem; color:var(--ink-3); }
.ct-row__types{ display:flex; flex-wrap:wrap; gap:4px; justify-content:flex-end; }
.ct-badge{ font-size:.66rem; font-weight:700; text-transform:uppercase; letter-spacing:.03em; padding:2px 7px; border-radius:999px; color:var(--ct,var(--accent)); background:color-mix(in srgb, var(--ct,var(--accent)) 12%, var(--panel)); border:1px solid color-mix(in srgb, var(--ct,var(--accent)) 30%, transparent); }
.ct-row__ph{ font-size:.8rem; color:var(--ink-2); white-space:nowrap; font-variant-numeric:tabular-nums; }
@media (max-width:640px){ .ct-row{ grid-template-columns:auto 1fr; } .ct-row__types,.ct-row__ph{ display:none; } }

/* commercial building log — compact, icon-driven activity in the left column */
.bldlog__add{ margin:6px 0 10px; }
.bldlog__row{ display:grid; grid-template-columns:auto 1fr auto; gap:8px; align-items:center; }
.bldlog__list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; }
.bldlog__item{ display:flex; gap:10px; align-items:flex-start; padding:8px 0; border-top:1px solid var(--line); }
.bldlog__item:first-child{ border-top:0; }
.bldlog__ic{ flex:none; width:26px; height:26px; border-radius:7px; display:grid; place-items:center; background:var(--bg); font-size:.9rem; }
.bldlog__item--repair .bldlog__ic{ background:#eef4ff; }
.bldlog__item--issue .bldlog__ic{ background:#fdeeee; }
.bldlog__item--viewing .bldlog__ic{ background:#eefaf1; }
.bldlog__item--inquiry .bldlog__ic{ background:#fef7e6; }
.bldlog__body{ flex:1; min-width:0; display:flex; flex-direction:column; }
.bldlog__text{ font-size:.9rem; }
.bldlog__meta{ font-size:.72rem; color:var(--ink-3); }
.bldlog__x{ border:0; background:none; color:var(--ink-3); cursor:pointer; font-size:1.15rem; line-height:1; padding:2px 5px; border-radius:6px; }
.bldlog__x:hover{ color:#b42318; background:var(--bg); }
/* Calendar-sourced log entries: a read-only marker (managed on the Calendar, not deletable here). */
.bldlog__cal{ text-decoration:none; font-size:1rem; line-height:1; padding:2px 5px; border-radius:6px; opacity:.8; }
.bldlog__cal:hover{ opacity:1; background:var(--bg); }
.bldlog__item--viewing .bldlog__ic{ filter:none; }

/* Customise-pipeline: per-stage header colour pickers + live preview chip. */
.stagecol { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stagecol__prev {
  display: inline-flex; align-items: center; min-width: 96px; max-width: 170px;
  padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: .8rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.stagecol__pick { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; }
.stagecol__pick input[type="color"] {
  width: 40px; height: 30px; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: none; cursor: pointer;
}
.stagecol__pick input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.stagecol__pick input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.stagecol__lbl { font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
