/* ─────────────────────────────────────────────────────────────
   ERF Studio — the agent's side of the desk.
   Dense where it counts, quiet everywhere else.
   ───────────────────────────────────────────────────────────── */

.studio-body {
  --studio-bg: #f3f1ea;
  --studio-panel: #fbfaf6;
  --studio-line: #dedacf;
  --studio-line-soft: #e9e5da;
  --studio-ink: #19261f;
  --studio-muted: #68756d;
  --studio-accent: #e9a83d;
  --studio-accent-soft: #fbf0d9;
  --studio-green: #2c7d58;
  --studio-green-soft: #e4f1e8;
  --studio-red: #a74f34;
  --sidebar-width: 238px;
  background: var(--studio-bg);
  color: var(--studio-ink);
  font-family: 'Instrument Sans', 'Segoe UI', sans-serif;
  min-height: 100vh;
}

.studio-body .wa-float,
.studio-body .site-footer,
.studio-body .site-header {
  display: none !important;
}

.studio-body .toast {
  bottom: 1.5rem;
  z-index: 250;
}

.studio-shell {
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.studio-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  overflow-y: auto;
  color: #f2f0e9;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(237, 169, 59, 0.08), transparent 60%),
    #101b17;
  border-right: 1px solid rgba(242, 240, 233, 0.08);
}

.studio-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0 10px 20px;
  border-bottom: 1px solid rgba(242, 240, 233, 0.1);
}

.studio-brand .brand {
  align-items: flex-end;
  gap: 0.45rem;
  color: #f2f0e9;
}

.studio-brand .brand-word {
  font-size: 2.15rem;
  line-height: 0.8;
}

.studio-brand__sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.52rem;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(242, 240, 233, 0.42);
  padding-bottom: 0.16rem;
}

.studio-demo-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #16231f;
  background: var(--studio-accent);
  padding: 0.3rem 0.4rem;
  border-radius: 2px;
}

.studio-agency {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1rem 0 1.4rem;
  padding: 0.65rem 0.6rem;
  border: 1px solid rgba(242, 240, 233, 0.1);
  border-radius: 5px;
  background: rgba(242, 240, 233, 0.035);
}

.studio-agency__mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(242, 240, 233, 0.08);
  border-radius: 3px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--studio-accent);
  letter-spacing: -0.02em;
}

.studio-agency strong {
  display: block;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.2;
}

.studio-agency span {
  display: block;
  margin-top: 0.12rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.48rem;
  color: rgba(242, 240, 233, 0.38);
  letter-spacing: 0.02em;
}

.studio-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.studio-nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 42px;
  padding: 0 0.6rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(242, 240, 233, 0.58);
  text-align: left;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.18s, color 0.18s;
}

.studio-nav__item:hover {
  background: rgba(242, 240, 233, 0.055);
  color: #f2f0e9;
}

.studio-nav__item.is-active {
  background: rgba(242, 240, 233, 0.08);
  color: #f2f0e9;
}

.studio-nav__item.is-active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--studio-accent);
}

.studio-nav__item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.8;
}

.studio-nav__badge {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.53rem;
  color: rgba(242, 240, 233, 0.42);
}

.studio-nav__badge--accent {
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 100px;
  background: var(--studio-accent);
  color: #16231f;
  font-weight: 500;
}

.studio-nav__live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.48rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(242, 240, 233, 0.35);
}

.studio-nav__live i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #69c694;
}

.studio-sidebar__spacer {
  flex: 1;
  min-height: 2rem;
}

.studio-sidebar__bottom {
  padding-top: 1rem;
  border-top: 1px solid rgba(242, 240, 233, 0.1);
}

.studio-side-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  color: rgba(242, 240, 233, 0.52);
  transition: background 0.18s, color 0.18s;
}

.studio-side-link:hover {
  background: rgba(242, 240, 233, 0.055);
  color: #f2f0e9;
}

.studio-side-link svg {
  width: 14px;
  height: 14px;
}

.studio-profile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.65rem;
  padding: 0.6rem;
  border-radius: 4px;
  background: rgba(242, 240, 233, 0.03);
}

.studio-profile img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
}

.studio-profile strong {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(242, 240, 233, 0.9);
}

.studio-profile span {
  display: block;
  font-size: 0.58rem;
  color: rgba(242, 240, 233, 0.38);
  margin-top: 0.12rem;
}

.studio-profile__status {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #68c794;
}

.studio-mobile-scrim,
.studio-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(10, 19, 15, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.studio-mobile-scrim[hidden],
.studio-scrim[hidden] {
  display: none;
}

/* ── Main / topbar ─────────────────────────────────────── */

.studio-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.studio-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1.2rem, 3vw, 2.6rem);
  background: rgba(243, 241, 234, 0.92);
  border-bottom: 1px solid var(--studio-line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.studio-topbar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.studio-burger {
  display: none;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--studio-line);
  border-radius: 4px;
  background: transparent;
}

.studio-burger svg {
  width: 18px;
  height: 18px;
}

.studio-crumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--studio-muted);
  white-space: nowrap;
}

.studio-crumb strong {
  color: var(--studio-ink);
  font-weight: 500;
}

.studio-crumb > span:nth-child(2) {
  opacity: 0.4;
}

.studio-topbar__right {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 1.5vw, 1.2rem);
}

.studio-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.54rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--studio-muted);
  white-space: nowrap;
}

.studio-site-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--studio-muted);
  transition: color 0.18s;
  white-space: nowrap;
}

.studio-site-link:hover {
  color: var(--studio-ink);
}

.studio-site-link svg {
  width: 11px;
  height: 11px;
}

/* ── Buttons / controls ────────────────────────────────── */

.s-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--studio-line);
  border-radius: 4px;
  background: var(--studio-panel);
  color: var(--studio-ink);
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}

.s-btn:hover {
  border-color: rgba(25, 38, 31, 0.35);
  transform: translateY(-1px);
}

.s-btn svg {
  width: 14px;
  height: 14px;
}

.s-btn--primary {
  background: var(--studio-ink);
  color: var(--studio-bg);
  border-color: var(--studio-ink);
}

.s-btn--primary:hover {
  background: #244537;
  border-color: #244537;
}

.s-btn--outline {
  background: transparent;
}

.s-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--studio-muted);
}

.s-btn--ghost:hover {
  color: var(--studio-ink);
  background: rgba(25, 38, 31, 0.045);
}

.s-btn--sm {
  min-height: 34px;
  padding: 0.45rem 0.72rem;
  font-size: 0.69rem;
}

.s-btn--whatsapp {
  background: var(--whatsapp);
  border-color: var(--whatsapp);
  color: #fff;
}

.s-btn--whatsapp:hover {
  background: #0c7b42;
  border-color: #0c7b42;
}

.s-btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.s-count {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  border-radius: 100px;
  background: var(--studio-accent-soft);
  color: #815415;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  font-weight: 500;
}

.s-select {
  appearance: none;
  min-height: 36px;
  padding: 0.45rem 1.9rem 0.45rem 0.7rem;
  border: 1px solid var(--studio-line);
  border-radius: 4px;
  background-color: var(--studio-panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2319261f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--studio-ink);
  cursor: pointer;
}

.s-textlink {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--studio-muted);
  text-decoration: underline;
  text-decoration-color: rgba(25, 38, 31, 0.2);
  text-underline-offset: 3px;
  white-space: nowrap;
}

.s-textlink:hover {
  color: var(--studio-ink);
  text-decoration-color: var(--studio-ink);
}

.s-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--studio-line);
  border-radius: 2px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.48rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--studio-muted);
  white-space: nowrap;
}

.s-badge--accent {
  background: var(--studio-accent-soft);
  border-color: #ecd4a4;
  color: #815415;
}

.s-badge--live {
  background: var(--studio-green-soft);
  border-color: #cbe2d3;
  color: var(--studio-green);
}

/* ── Layout ────────────────────────────────────────────── */

.studio-content {
  padding: clamp(1.5rem, 3vw, 2.4rem) clamp(1.2rem, 3vw, 2.6rem) 3.5rem;
}

.studio-screen {
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
  animation: studio-in 0.32s var(--ease);
}

@keyframes studio-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(1.5rem, 2.4vw, 2rem);
}

.studio-overline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--studio-muted);
  margin-bottom: 0.65rem;
}

.screen-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(2rem, 3.2vw, 2.85rem);
  font-weight: 540;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.screen-title .dot {
  color: var(--studio-accent);
}

.screen-sub {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--studio-muted);
  max-width: 60ch;
}

.screen-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ── Stats ─────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.stat-card {
  position: relative;
  padding: 1.05rem 1.1rem 0.95rem;
  background: var(--studio-panel);
  border: 1px solid var(--studio-line);
  border-radius: 6px;
  overflow: hidden;
}

.stat-card--accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--studio-accent);
}

.stat-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.53rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--studio-muted);
}

.stat-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--studio-bg);
  color: var(--studio-muted);
}

.stat-icon svg {
  width: 12px;
  height: 12px;
}

.stat-card__value {
  margin: 0.45rem 0 0.4rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 560;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.stat-unit {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--studio-muted);
  margin-left: 0.2rem;
}

.stat-card__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 14px;
  font-size: 0.61rem;
  color: var(--studio-muted);
}

.stat-note b {
  font-weight: 600;
  color: var(--studio-ink);
}

.trend {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.53rem;
  letter-spacing: 0.01em;
}

.trend--up {
  color: var(--studio-green);
}

/* ── Panels ─────────────────────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-grid--lower {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
}

.s-panel {
  background: var(--studio-panel);
  border: 1px solid var(--studio-line);
  border-radius: 6px;
  min-width: 0;
}

.s-panel--flush {
  overflow: hidden;
}

.s-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.8rem;
}

.s-panel__head h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.03rem;
  font-weight: 580;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.s-panel__head p {
  margin-top: 0.2rem;
  font-size: 0.64rem;
  color: var(--studio-muted);
}

.s-panel__footlink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.8rem 1.15rem;
  border: 0;
  border-top: 1px solid var(--studio-line-soft);
  background: transparent;
  color: var(--studio-muted);
  font-size: 0.68rem;
  text-align: left;
  transition: color 0.18s, background 0.18s;
}

.s-panel__footlink:hover {
  color: var(--studio-ink);
  background: rgba(25, 38, 31, 0.025);
}

.s-panel__footlink span {
  font-size: 0.8rem;
}

.s-segmented {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--studio-line);
  border-radius: 3px;
  background: var(--studio-bg);
  flex-shrink: 0;
}

.s-segmented button {
  padding: 0.35rem 0.55rem;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--studio-muted);
  font-size: 0.59rem;
  font-weight: 500;
}

.s-segmented button.is-active {
  background: var(--studio-panel);
  color: var(--studio-ink);
  box-shadow: 0 1px 2px rgba(25, 38, 31, 0.08);
}

/* Chart */
.chart-legend {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0 1.15rem 0.3rem;
  font-size: 0.61rem;
  color: var(--studio-muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot--all {
  background: var(--studio-ink);
}

.legend-dot--wa {
  background: var(--studio-accent);
}

.chart-total {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.enquiry-chart {
  padding: 0.35rem 0.85rem 0.85rem;
}

.enquiry-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.enquiry-chart .chart-grid {
  stroke: var(--studio-line-soft);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.enquiry-chart .chart-axis-label {
  fill: #8a948d;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.04em;
}

.enquiry-chart .chart-area {
  fill: url(#chartWash);
}

/* Reply list */
.reply-list {
  border-top: 1px solid var(--studio-line-soft);
}

.reply-row {
  display: flex;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 1.15rem;
  border: 0;
  border-bottom: 1px solid var(--studio-line-soft);
  background: transparent;
  text-align: left;
  transition: background 0.16s;
}

.reply-row:hover {
  background: rgba(25, 38, 31, 0.025);
}

.reply-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--studio-accent-soft);
  color: #7d5214;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.72rem;
  font-weight: 650;
}

.reply-body {
  min-width: 0;
  flex: 1;
}

.reply-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.reply-top strong {
  font-size: 0.71rem;
  font-weight: 600;
}

.reply-top time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.46rem;
  color: #98a099;
  white-space: nowrap;
}

.reply-message {
  display: block;
  max-width: 100%;
  margin-top: 0.13rem;
  font-size: 0.64rem;
  color: var(--studio-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.47rem;
  color: #8f9992;
}

.reply-meta .source-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--studio-accent);
}

.reply-meta .source-dot[data-source='Finder'] {
  background: #437d8d;
}

.reply-meta .source-dot[data-source='Website'] {
  background: #9a7c53;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.s-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.s-table th {
  padding: 0.55rem 1.15rem;
  border-top: 1px solid var(--studio-line-soft);
  border-bottom: 1px solid var(--studio-line-soft);
  background: rgba(243, 241, 234, 0.55);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.46rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--studio-muted);
  white-space: nowrap;
}

.s-table td {
  padding: 0.62rem 1.15rem;
  border-bottom: 1px solid var(--studio-line-soft);
  font-size: 0.69rem;
  vertical-align: middle;
}

.s-table tbody tr:last-child td {
  border-bottom: 0;
}

.s-table tbody tr {
  transition: background 0.15s;
}

.s-table tbody tr:hover {
  background: rgba(25, 38, 31, 0.022);
}

.s-table--compact th:nth-child(4),
.s-table--compact td:nth-child(4) {
  text-align: right;
}

.property-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 190px;
}

.property-thumb {
  width: 40px;
  height: 34px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.property-cell strong {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-cell span {
  display: block;
  margin-top: 0.14rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.46rem;
  color: var(--studio-muted);
}

.table-price {
  font-weight: 600;
  white-space: nowrap;
}

.table-price small {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.44rem;
  font-weight: 400;
  color: var(--studio-muted);
  margin-top: 0.12rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.26rem 0.4rem;
  border-radius: 2px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.44rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.status-badge--live {
  background: var(--studio-green-soft);
  color: var(--studio-green);
}

.status-badge--live::before {
  background: var(--studio-green);
}

.status-badge--draft {
  background: #ece9e1;
  color: #7d837e;
}

.status-badge--draft::before {
  background: #929b94;
}

.status-badge--under_offer {
  background: var(--studio-accent-soft);
  color: #815415;
}

.status-badge--under_offer::before {
  background: #c0882f;
}

.table-icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--studio-muted);
}

.table-icon-btn:hover {
  border-color: var(--studio-line);
  color: var(--studio-ink);
  background: var(--studio-panel);
}

.table-icon-btn svg {
  width: 13px;
  height: 13px;
}

/* Diary */
.diary {
  padding: 0 0.6rem 0.5rem;
}

.diary-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--studio-line-soft);
}

.diary-item:last-child {
  border-bottom: 0;
}

.diary-time {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.03rem;
  font-weight: 570;
  letter-spacing: -0.025em;
  line-height: 1;
}

.diary-time small {
  display: block;
  margin-top: 0.15rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.43rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--studio-muted);
}

.diary-main {
  min-width: 0;
}

.diary-main strong {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diary-main span {
  display: block;
  font-size: 0.58rem;
  color: var(--studio-muted);
  margin-top: 0.12rem;
}

.diary-avatar {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--studio-bg);
  display: grid;
  place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.61rem;
  font-weight: 650;
}

.diary-note {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0.35rem 1.15rem 1rem;
  padding: 0.7rem;
  background: var(--studio-bg);
  border-radius: 3px;
}

.diary-note svg {
  width: 14px;
  height: 14px;
  color: var(--studio-green);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.diary-note p {
  font-size: 0.6rem;
  line-height: 1.5;
  color: var(--studio-muted);
}

/* ── Listings screen ──────────────────────────────────── */

.listing-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--studio-line-soft);
}

.studio-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 190px;
  max-width: 340px;
}

.studio-search svg {
  position: absolute;
  left: 0.7rem;
  width: 13px;
  height: 13px;
  color: var(--studio-muted);
  pointer-events: none;
}

.studio-search input {
  width: 100%;
  min-height: 36px;
  padding: 0.45rem 0.7rem 0.45rem 1.9rem;
  border: 1px solid var(--studio-line);
  border-radius: 4px;
  background: transparent;
  font-size: 0.7rem;
}

.studio-search input::placeholder {
  color: rgba(25, 38, 31, 0.36);
}

.studio-search input:focus {
  outline: 0;
  border-color: rgba(25, 38, 31, 0.4);
}

.tool-count {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--studio-muted);
}

.s-table--listings .property-cell {
  min-width: 210px;
}

.s-table--listings td {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.location-cell {
  white-space: nowrap;
  color: var(--studio-muted);
  font-size: 0.66rem;
}

.views-cell {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.55rem;
  color: var(--studio-muted);
  text-align: right;
}

.status-select {
  appearance: none;
  min-height: 28px;
  padding: 0.28rem 1.3rem 0.28rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.45rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='%2319261f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
}

.status-select--live {
  background-color: var(--studio-green-soft);
  color: var(--studio-green);
}

.status-select--draft {
  background-color: #ece9e1;
  color: #6f7771;
}

.status-select--under_offer {
  background-color: var(--studio-accent-soft);
  color: #815415;
}

.table-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  border-top: 1px solid var(--studio-line-soft);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.48rem;
  letter-spacing: 0.02em;
  color: var(--studio-muted);
}

.table-empty {
  padding: 2.5rem 1rem;
  text-align: center;
}

.table-empty h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.4rem;
  font-weight: 560;
  letter-spacing: -0.035em;
}

.table-empty p {
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: var(--studio-muted);
}

/* ── Leads / kanban ───────────────────────────────────── */

.lead-meta-row {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.02em;
  color: var(--studio-muted);
}

.lead-meta-row b {
  color: var(--studio-ink);
  font-weight: 500;
}

.lead-meta-row__note {
  margin-left: auto;
  color: #89938c;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: start;
}

.kanban-col {
  background: #eae7de;
  border: 1px solid #dfdbd0;
  border-radius: 5px;
  min-width: 0;
  transition: background 0.18s, border-color 0.18s;
}

.kanban-col.is-over {
  background: #e2decf;
  border-color: rgba(25, 38, 31, 0.3);
}

.kanban-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--studio-muted);
}

.kanban-col__head > span:first-child {
  color: var(--studio-ink);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.kanban-count {
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 100px;
  background: rgba(25, 38, 31, 0.07);
  font-size: 0.47rem;
  color: var(--studio-muted);
}

.kanban-col__drop {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.45rem 0.55rem;
  min-height: 120px;
}

.kanban-card {
  position: relative;
  padding: 0.65rem;
  border: 1px solid var(--studio-line);
  border-radius: 4px;
  background: var(--studio-panel);
  cursor: grab;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}

.kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(25, 38, 31, 0.08);
  border-color: #c9c3b5;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.is-dragging {
  opacity: 0.45;
  transform: rotate(1deg);
}

.kanban-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.44rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--studio-muted);
  white-space: nowrap;
}

.source-tag::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--studio-accent);
}

.source-tag[data-source='Finder']::before {
  background: #437d8d;
}

.source-tag[data-source='Website']::before {
  background: #9a7c53;
}

.source-tag[data-source='Walk-in']::before {
  background: #805c8b;
}

.kanban-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.43rem;
  color: #9aa29c;
  white-space: nowrap;
}

.kanban-name {
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.kanban-brief {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
  font-size: 0.58rem;
  color: var(--studio-muted);
}

.kanban-brief b {
  font-weight: 600;
  color: var(--studio-ink);
}

.kanban-message {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--studio-line-soft);
  font-size: 0.58rem;
  line-height: 1.45;
  color: var(--studio-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.kanban-agent {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.42rem;
  color: #8d958f;
}

.kanban-agent::before {
  content: '';
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--studio-bg);
}

.kanban-view {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.43rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--studio-muted);
}

.kanban-view:hover {
  color: var(--studio-ink);
}

.kanban-empty {
  padding: 1.2rem 0.6rem;
  border: 1px dashed #d1ccc0;
  border-radius: 4px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.46rem;
  letter-spacing: 0.02em;
  color: #959d96;
  text-transform: uppercase;
}

/* ── Concierge screen ─────────────────────────────────── */

.bot-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--studio-green);
  white-space: nowrap;
}

.bot-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--studio-green);
  box-shadow: 0 0 0 3px rgba(44, 125, 88, 0.12);
}

.stat-grid--bot {
  margin-bottom: 1rem;
}

.bot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.flow-list {
  border-top: 1px solid var(--studio-line-soft);
}

.flow-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem 1.15rem;
  border-bottom: 1px solid var(--studio-line-soft);
}

.flow-item__num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.51rem;
  color: #98a099;
}

.flow-item h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.86rem;
  font-weight: 580;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.flow-item p {
  margin-top: 0.15rem;
  font-size: 0.61rem;
  line-height: 1.45;
  color: var(--studio-muted);
  max-width: 52ch;
}

.flow-chip {
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--studio-line);
  border-radius: 100px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.44rem;
  letter-spacing: 0.02em;
  color: var(--studio-muted);
  white-space: nowrap;
}

.bot-guardrails {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  background: var(--studio-bg);
}

.bot-guardrails strong {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
}

.bot-guardrails p {
  margin-top: 0.2rem;
  font-size: 0.58rem;
  line-height: 1.5;
  color: var(--studio-muted);
  max-width: 64ch;
}

.bot-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bot-preview {
  overflow: hidden;
}

.mini-phone {
  margin: 0 1.15rem 1.15rem;
  border: 1px solid var(--studio-line);
  border-radius: 10px;
  background: #e9e2d5;
  overflow: hidden;
}

.mini-phone__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  background: #1b2822;
  color: #f2f0e9;
}

.mini-avatar {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--studio-accent);
  color: #17241f;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
}

.mini-phone__bar strong {
  display: block;
  font-size: 0.59rem;
}

.mini-phone__bar span {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.42rem;
  color: rgba(242, 240, 233, 0.45);
}

.mini-phone__chat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem;
}

.mini-bubble {
  align-self: flex-end;
  max-width: 86%;
  padding: 0.45rem 0.5rem;
  border-radius: 8px 2px 8px 8px;
  background: #d9f2de;
  font-size: 0.56rem;
  line-height: 1.4;
}

.mini-bubble--bot {
  align-self: flex-start;
  border-radius: 2px 8px 8px 8px;
  background: #fffef9;
}

.mini-card {
  display: flex;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 3px 8px 8px 8px;
  background: #fffef9;
}

.mini-card img {
  width: 48px;
  height: 53px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}

.mini-card span {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.39rem;
  color: var(--studio-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.mini-card strong {
  display: block;
  font-size: 0.55rem;
  line-height: 1.25;
  margin-top: 0.1rem;
}

.mini-card b {
  display: block;
  font-size: 0.57rem;
  margin-top: 0.16rem;
}

.mini-actions {
  display: flex;
  gap: 0.25rem;
  align-self: flex-end;
}

.mini-actions span {
  padding: 0.25rem 0.35rem;
  border: 1px solid rgba(25, 38, 31, 0.15);
  border-radius: 100px;
  background: rgba(255, 254, 249, 0.55);
  font-size: 0.42rem;
  color: var(--studio-muted);
}

.bot-leads {
  border-top: 1px solid var(--studio-line-soft);
}

.bot-lead {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.62rem 1.15rem;
  border: 0;
  border-bottom: 1px solid var(--studio-line-soft);
  background: transparent;
  text-align: left;
}

.bot-lead:hover {
  background: rgba(25, 38, 31, 0.025);
}

.bot-lead__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--studio-bg);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.58rem;
  font-weight: 650;
}

.bot-lead__body {
  min-width: 0;
  flex: 1;
}

.bot-lead__body strong {
  display: block;
  font-size: 0.64rem;
  font-weight: 600;
}

.bot-lead__body span {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.55rem;
  color: var(--studio-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-lead__time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.43rem;
  color: #98a099;
  white-space: nowrap;
}

/* ── Drawer ───────────────────────────────────────────── */

.studio-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 130;
  width: min(620px, 94vw);
  display: flex;
  flex-direction: column;
  background: var(--studio-panel);
  border-left: 1px solid var(--studio-line);
  box-shadow: -20px 0 70px rgba(14, 25, 20, 0.16);
  transform: translateX(104%);
  visibility: hidden;
  transition: transform 0.4s var(--ease), visibility 0.4s;
  overflow: hidden;
}

.studio-drawer > #drawerInner {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.studio-drawer .drawer-shell {
  flex: 1;
  min-height: 0;
}

.studio-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

.studio-scrim {
  z-index: 125;
}

.drawer-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.4rem 1rem;
  border-bottom: 1px solid var(--studio-line);
  background: var(--studio-panel);
}

.drawer-header__kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--studio-muted);
  margin-bottom: 0.35rem;
}

.drawer-header h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.55rem;
  font-weight: 570;
  letter-spacing: -0.045em;
  line-height: 1;
}

.drawer-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--studio-line);
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
}

.drawer-close:hover {
  background: var(--studio-bg);
}

.drawer-close svg {
  width: 14px;
  height: 14px;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.2rem 1.4rem 1.6rem;
}

.drawer-footer {
  padding: 0.9rem 1.4rem;
  border-top: 1px solid var(--studio-line);
  background: var(--studio-panel);
}

.drawer-section {
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--studio-line-soft);
}

.drawer-section:first-child {
  padding-top: 0;
}

.drawer-section:last-child {
  border-bottom: 0;
}

.drawer-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.drawer-section__head h3 {
  font-size: 0.73rem;
  font-weight: 600;
}

.drawer-section__head span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.46rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--studio-muted);
}

.s-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.s-field-grid--three {
  grid-template-columns: 1fr 1fr 1fr;
}

.s-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.s-field--full {
  grid-column: 1 / -1;
}

.s-field label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.47rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--studio-muted);
}

.s-input,
.s-textarea,
.s-field select {
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--studio-line);
  border-radius: 3px;
  background: #fffef9;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.74rem;
  color: var(--studio-ink);
}

.s-textarea {
  min-height: 128px;
  resize: vertical;
  line-height: 1.55;
}

.s-input:focus,
.s-textarea:focus,
.s-field select:focus {
  outline: 0;
  border-color: rgba(25, 38, 31, 0.55);
  box-shadow: 0 0 0 2px rgba(25, 38, 31, 0.06);
}

.s-input::placeholder,
.s-textarea::placeholder {
  color: rgba(25, 38, 31, 0.32);
}

.ai-draft-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.ai-note {
  margin-top: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-left: 2px solid var(--studio-accent);
  background: var(--studio-accent-soft);
  font-size: 0.6rem;
  line-height: 1.45;
  color: #73521e;
}

.photo-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}

.photo-choice {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 3px;
  background: var(--studio-bg);
}

.photo-choice img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.16s;
}

.photo-choice:hover img {
  opacity: 0.82;
}

.photo-choice.is-selected {
  border-color: var(--studio-ink);
}

.photo-choice.is-selected::after {
  content: '✓';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--studio-accent);
  color: #16231f;
  font-size: 0.55rem;
  font-weight: 700;
}

.chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip-toggle {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--studio-line);
  border-radius: 100px;
  background: transparent;
  font-size: 0.62rem;
  color: var(--studio-muted);
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.chip-toggle:hover {
  border-color: var(--studio-ink);
  color: var(--studio-ink);
}

.chip-toggle.is-selected {
  border-color: var(--studio-ink);
  background: var(--studio-ink);
  color: var(--studio-bg);
}

.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.drawer-error {
  margin-top: 0.6rem;
  color: var(--studio-red);
  font-size: 0.66rem;
}

.drawer-note {
  margin-top: 0.5rem;
  font-size: 0.58rem;
  line-height: 1.5;
  color: var(--studio-muted);
}

/* Lead detail drawer */
.lead-detail__top {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.1rem;
}

.lead-detail__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--studio-accent-soft);
  color: #7d5214;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1rem;
  font-weight: 650;
  flex-shrink: 0;
}

.lead-detail__name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.35rem;
  font-weight: 570;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.lead-detail__meta {
  margin-top: 0.2rem;
  font-size: 0.67rem;
  color: var(--studio-muted);
}

.lead-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}

.stage-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--studio-line);
  border-radius: 4px;
  background: var(--studio-bg);
  margin-bottom: 1rem;
}

.stage-control button {
  min-height: 30px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  font-size: 0.59rem;
  font-weight: 500;
  color: var(--studio-muted);
}

.stage-control button:hover {
  color: var(--studio-ink);
}

.stage-control button.is-active {
  background: var(--studio-panel);
  color: var(--studio-ink);
  box-shadow: 0 1px 2px rgba(25, 38, 31, 0.1);
}

.lead-brief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.lead-brief-item {
  padding: 0.6rem;
  border: 1px solid var(--studio-line-soft);
  border-radius: 3px;
  background: var(--studio-bg);
}

.lead-brief-item span {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.43rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--studio-muted);
}

.lead-brief-item strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
}

.lead-contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.lead-contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--studio-line);
  border-radius: 3px;
  font-size: 0.6rem;
  color: var(--studio-muted);
}

.lead-contact-list a:hover {
  color: var(--studio-ink);
  border-color: rgba(25, 38, 31, 0.3);
}

.lead-contact-list svg {
  width: 11px;
  height: 11px;
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.7rem;
  border: 1px solid var(--studio-line-soft);
  border-radius: 3px;
  background: #f5f2ea;
}

.transcript-bubble {
  max-width: 86%;
  padding: 0.48rem 0.55rem;
  border-radius: 2px 7px 7px 7px;
  background: #fffef9;
  border: 1px solid var(--studio-line-soft);
  font-size: 0.63rem;
  line-height: 1.45;
  align-self: flex-start;
}

.transcript-bubble--out {
  align-self: flex-end;
  border-radius: 7px 2px 7px 7px;
  background: #dff2e4;
  border-color: #cfe7d5;
}

.transcript-bubble small {
  display: block;
  margin-top: 0.18rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.4rem;
  color: #99a19b;
  text-align: right;
}

.transcript-empty {
  padding: 1.2rem;
  text-align: center;
  font-size: 0.62rem;
  color: var(--studio-muted);
}

.linked-property {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid var(--studio-line);
  border-radius: 3px;
  background: var(--studio-bg);
  margin-top: 0.6rem;
}

.linked-property img {
  width: 54px;
  height: 45px;
  object-fit: cover;
  border-radius: 2px;
}

.linked-property div {
  min-width: 0;
  flex: 1;
}

.linked-property strong {
  display: block;
  font-size: 0.66rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.linked-property span {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.55rem;
  color: var(--studio-muted);
}

.linked-property svg {
  width: 13px;
  height: 13px;
  color: var(--studio-muted);
}

.lead-notes-area {
  width: 100%;
  min-height: 74px;
  padding: 0.55rem;
  border: 1px solid var(--studio-line);
  border-radius: 3px;
  background: #fffef9;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.67rem;
  line-height: 1.5;
  resize: vertical;
}

.lead-notes-save {
  margin-top: 0.4rem;
}

/* Empty state */
.s-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.68rem;
  color: var(--studio-muted);
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 1260px) {
  .studio-body {
    --sidebar-width: 220px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.9fr);
  }
  .bot-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.9fr);
  }
  .kanban {
    gap: 0.5rem;
  }
  .kanban-card {
    padding: 0.55rem;
  }
  .flow-chip {
    display: none;
  }
}

@media (max-width: 1100px) {
  .studio-sidebar {
    width: 250px;
    transform: translateX(-104%);
    visibility: hidden;
    transition: transform 0.35s var(--ease), visibility 0.35s;
  }
  .studio-sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
  }
  .studio-main {
    margin-left: 0;
  }
  .studio-burger {
    display: grid;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid,
  .dashboard-grid--lower,
  .bot-grid {
    grid-template-columns: 1fr;
  }
  .bot-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .studio-topbar {
    height: 56px;
    padding: 0 0.85rem;
  }
  .studio-date,
  .studio-site-link {
    display: none;
  }
  .studio-content {
    padding: 1.2rem 0.85rem 3rem;
  }
  .screen-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.2rem;
  }
  .screen-title {
    font-size: 2.15rem;
  }
  .screen-sub {
    font-size: 0.77rem;
  }
  .screen-actions {
    width: 100%;
  }
  .screen-actions .s-btn {
    flex: 1;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }
  .stat-card {
    padding: 0.85rem;
  }
  .stat-card__top {
    font-size: 0.47rem;
  }
  .stat-card__value {
    font-size: 1.9rem;
  }
  .stat-card__foot {
    font-size: 0.55rem;
    flex-wrap: wrap;
  }
  .stat-icon {
    display: none;
  }
  .s-panel__head {
    padding: 0.85rem 0.85rem 0.65rem;
  }
  .chart-legend {
    padding-inline: 0.85rem;
    gap: 0.6rem;
    font-size: 0.55rem;
  }
  .chart-total {
    display: none;
  }
  .enquiry-chart {
    padding: 0.2rem 0.4rem 0.65rem;
  }
  .reply-row {
    padding: 0.65rem 0.85rem;
  }
  .s-table th,
  .s-table td {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .diary-note {
    margin-inline: 0.85rem;
  }
  .listing-tools {
    padding: 0.7rem;
  }
  .studio-search {
    max-width: none;
    flex-basis: 100%;
  }
  .tool-count {
    margin-left: 0;
  }
  .table-foot {
    flex-direction: column;
    gap: 0.25rem;
    padding-inline: 0.75rem;
  }
  .s-table--listings th:nth-child(2),
  .s-table--listings td:nth-child(2),
  .s-table--listings th:nth-child(5),
  .s-table--listings td:nth-child(5),
  .s-table--listings th:nth-child(6),
  .s-table--listings td:nth-child(6) {
    display: none;
  }
  .s-table--compact th:nth-child(2),
  .s-table--compact td:nth-child(2),
  .s-table--compact th:nth-child(4),
  .s-table--compact td:nth-child(4) {
    display: none;
  }
  .property-cell {
    min-width: 0;
  }
  .property-thumb {
    width: 34px;
    height: 30px;
  }
  .property-cell strong {
    max-width: 150px;
    font-size: 0.66rem;
  }
  .kanban {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.5rem;
    margin-inline: -0.85rem;
    padding-inline: 0.85rem;
    scrollbar-width: thin;
  }
  .kanban-col {
    min-width: 270px;
    width: 270px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }
  .lead-meta-row__note {
    margin-left: 0;
    flex-basis: 100%;
  }
  .bot-side {
    display: flex;
  }
  .flow-item {
    grid-template-columns: 24px minmax(0, 1fr);
    padding-inline: 0.85rem;
  }
  .bot-guardrails {
    flex-direction: column;
    padding-inline: 0.85rem;
  }
  .mini-phone {
    margin-inline: 0.85rem;
  }
  .drawer-header,
  .drawer-body,
  .drawer-footer {
    padding-inline: 1rem;
  }
  .studio-drawer {
    width: 100%;
    max-width: none;
  }
  .photo-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .s-field-grid,
  .s-field-grid--three {
    grid-template-columns: 1fr 1fr;
  }
  .s-field--full {
    grid-column: 1 / -1;
  }
  .drawer-actions .s-btn {
    flex: 1;
  }
  .lead-detail__top {
    flex-wrap: wrap;
  }
  .lead-detail__actions {
    margin-left: 0;
    width: 100%;
  }
  .lead-brief-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stage-control {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 430px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .s-field-grid,
  .s-field-grid--three {
    grid-template-columns: 1fr;
  }
  .photo-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .studio-crumb span:first-child {
    display: none;
  }
  .studio-crumb > span:nth-child(2) {
    display: none;
  }
  .screen-actions .s-btn {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .studio-screen {
    animation: none;
  }
  .studio-drawer,
  .kanban-card,
  .s-btn {
    transition: none;
  }
}

.chart-insight {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-top: auto;
  padding: 0.8rem 1.15rem;
  border-top: 1px solid var(--studio-line-soft);
  background: rgba(243, 241, 234, 0.55);
  flex-wrap: wrap;
}

.s-panel--chart {
  display: flex;
  flex-direction: column;
}

.chart-insight > div span {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.43rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--studio-muted);
}

.chart-insight > div strong {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

.chart-insight__note {
  margin-left: auto;
  max-width: 36ch;
  font-size: 0.53rem;
  line-height: 1.45;
  color: var(--studio-muted);
  text-align: right;
}

@media (max-width: 760px) {
  .chart-insight {
    gap: 0.8rem;
    padding-inline: 0.85rem;
  }
  .chart-insight > div strong {
    font-size: 0.66rem;
  }
  .chart-insight__note {
    flex-basis: 100%;
    margin-left: 0;
    text-align: left;
  }
}
@media (max-width: 430px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .screen-title {
    font-size: 2rem;
  }
}

.studio-sidebar__close {
  display: none;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(242, 240, 233, 0.16);
  border-radius: 50%;
  background: transparent;
  color: rgba(242, 240, 233, 0.7);
  flex-shrink: 0;
}

.studio-sidebar__close:hover {
  color: #f2f0e9;
  border-color: rgba(242, 240, 233, 0.38);
}

.studio-sidebar__close svg {
  width: 13px;
  height: 13px;
}

@media (max-width: 1100px) {
  .studio-sidebar__close {
    display: grid;
  }
}

.studio-drawer {
  max-width: 100vw;
}

@media (max-width: 760px) {
  .studio-drawer {
    width: 100vw;
    max-width: 100vw;
  }
  .studio-brand {
    padding-right: 4px;
  }
  .studio-demo-pill {
    margin-left: auto;
  }
}

/* Tables on small screens: force a fixed layout so intrinsic column widths
   cannot expand the mobile layout viewport. Keep the important columns. */
@media (max-width: 760px) {
  .s-table--listings,
  .s-table--compact {
    table-layout: fixed;
    width: 100%;
  }
  .s-table--listings th:nth-child(3),
  .s-table--listings td:nth-child(3) {
    display: none;
  }
  .s-table--listings th,
  .s-table--listings td {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }
  .s-table--listings .property-cell {
    min-width: 0;
  }
  .s-table--listings .property-cell strong {
    max-width: 100%;
  }
  .s-table--listings .status-select {
    max-width: 100%;
  }
}

/* Local demo reset control, injected only when the static fallback is active. */
.studio-side-link--button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
