@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap');
/* Reset WP styles that leak through */
#pcrm-app * { box-sizing: border-box; }
#pcrm-app a { text-decoration: none; }
body.page-template-default { background: #f5f5f3; }

/* ── Layout ───────────────────────────────────────────────── */
#pcrm-app {
  display: flex;
  min-height: 100vh;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: #201e1a;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.pcrm-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #201e1a;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 100;
  overflow: hidden;
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo img.site-logo { max-height: 36px; width: auto; filter: brightness(0) invert(1); }
.sidebar-logo .site-name-text { color: #fff; font-size: 16px; font-weight: 600; }

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; min-height: 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 1.25rem;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.1); color: #fff; }
.nav-icon { font-size: 8px; opacity: 0.6; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.5); }
.logout-btn { color: rgba(255,255,255,0.4); font-size: 16px; transition: color .15s; }
.logout-btn:hover { color: #fff; }
.nav-item-website { opacity: .7; }
.nav-item-website:hover { opacity: 1; }
.nav-item-external { margin-left: auto; opacity: .5; flex-shrink: 0; }

/* ── Buyer readiness score ──────────────────────────────────── */
.readiness-score-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fafaf8;
  border: 1.5px solid #ddd8d0;
  border-radius: 10px;
  margin-bottom: 12px;
}
.readiness-ring-wrap { flex-shrink: 0; }
.readiness-ring { transform: rotate(-90deg); }
.readiness-ring-bg   { fill: none; stroke: #f0f0ec; stroke-width: 4; }
.readiness-ring-fill { fill: none; stroke-width: 4; stroke-linecap: round;
                        transition: stroke-dashoffset .6s cubic-bezier(.4,0,.2,1), stroke .3s; }
.readiness-info { flex: 1; min-width: 0; }
.readiness-label { font-size: 11px; font-weight: 600; color: #888;
                   text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.readiness-score-text { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.readiness-factors { display: flex; flex-wrap: wrap; gap: 4px; }
.readiness-factor {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 500;
  padding: 2px 7px; border-radius: 20px;
}
.readiness-factor--yes { background: #e6f7ee; color: #1a7a40; }
.readiness-factor--no  { background: #f5f5f3; color: #aaa; }

/* ── Main area ────────────────────────────────────────────── */
.pcrm-main {
  margin-left: 220px;
  flex: 1;
  min-height: 100vh;
  background: #f5f5f3;
}

.pcrm-view { display: none; padding: 2rem; }
.pcrm-view.active { display: block; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.view-header h1 { font-size: 20px; font-weight: 600; color: #201e1a; font-family: 'Roboto', sans-serif; letter-spacing: -0.01em; }
.panel-header h2 { font-size: 16px; font-weight: 600; margin: 0; font-family: 'Roboto', sans-serif; }
.content-card-header { font-family: 'Roboto', sans-serif; font-weight: 600; }
.form-section h2 { font-size: 15px; font-weight: 600; margin-bottom: 1.25rem; color: #201e1a; font-family: 'Roboto', sans-serif; }
.modal-header h2 { font-size: 16px; font-weight: 600; margin: 0; font-family: 'Roboto', sans-serif; }

/* ── Metric cards ─────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}
.metric-card {
  background: #fff;
  border: 1px solid #ddd8d0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.metric-label { font-size: 12px; color: #888; margin-bottom: 6px; }
.metric-value { font-size: 26px; font-weight: 600; color: #201e1a; }
.metric-sub { font-size: 12px; color: #aaa; margin-top: 2px; }

/* ── Cards / lists ────────────────────────────────────────── */
.content-card {
  background: #fff;
  border: 1px solid #ddd8d0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.content-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f0f0ec;
  font-size: 13px;
  font-weight: 500;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Table ────────────────────────────────────────────────── */
.pcrm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pcrm-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 500;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #f0f0ec;
}
.pcrm-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f3;
  color: #201e1a;
  vertical-align: middle;
}
.pcrm-table tr:last-child td { border-bottom: none; }
.pcrm-table tr:hover td { background: #fafaf8; }

/* ── Status badges ────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}
.badge-pending  { background: #fff7e6; color: #8a5c00; }
.badge-active   { background: #e6f7ee; color: #1a7a40; }
.badge-sstc     { background: #e6f0ff; color: #1a4fa0; }
.badge-sold     { background: #f0f0f0; color: #666; }
.badge-new      { background: #e6f0ff; color: #1a4fa0; }
.badge-viewing  { background: #e6f7ee; color: #1a7a40; }
.badge-offer    { background: #fff7e6; color: #8a5c00; }
.badge-cold     { background: #f5f5f3; color: #888; }
.badge-offer-stage  { background: #fff7e6; color: #8a5c00; }
.badge-exchange { background: #e6f7ee; color: #1a7a40; }
.badge-completion { background: #f0f0f0; color: #666; }
.badge-fallen   { background: #fee; color: #a00; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  padding: 9px 18px;
  background: #201e1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary.btn-lg { padding: 12px 24px; font-size: 14px; }
.btn-secondary {
  padding: 7px 14px;
  background: transparent;
  color: #201e1a;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: #f5f5f3; }

/* ── Forms ────────────────────────────────────────────────── */
.pcrm-form { max-width: 720px; }
.form-section { background: #fff; border: 1px solid #ddd8d0; border-radius: 10px; padding: 1.5rem; margin-bottom: 1.25rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 13px; font-weight: 500; color: #444; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  color: #201e1a;
  outline: none;
  transition: border-color .15s;
  background: #fff;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #201e1a; }
.field textarea { resize: vertical; line-height: 1.5; }
.field-grid.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.optional { font-weight: 400; color: #aaa; font-size: 11px; margin-left: 4px; }
.field-hint { font-size: 12px; color: #888; margin-bottom: 0.75rem; margin-top: -0.5rem; }

/* ── Upload area ──────────────────────────────────────────── */
.upload-area { border: 2px dashed #ddd; border-radius: 10px; overflow: hidden; }
.upload-placeholder {
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  color: #888;
  transition: background .15s;
  font-size: 13px;
}
.upload-placeholder:hover { background: #fafaf8; }
.upload-icon { font-size: 24px; margin-bottom: 0.5rem; color: #bbb; }
.upload-hint { font-size: 12px; color: #aaa; margin-top: 4px; }
.photo-previews { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.photo-preview { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid #eee; }

/* ── Form actions ─────────────────────────────────────────── */
.form-actions { padding: 0.5rem 0; }
.submit-note { font-size: 12px; color: #aaa; margin-top: 0.75rem; }
.success-msg { background: #e6f7ee; border: 1px solid #a0dbb8; border-radius: 8px; padding: 10px 14px; color: #1a7a40; font-size: 13px; margin-bottom: 1rem; }
.error-msg { background: #fee; border: 1px solid #fcc; border-radius: 8px; padding: 10px 14px; color: #a00; font-size: 13px; margin-bottom: 1rem; }

/* ── Loading ──────────────────────────────────────────────── */
.loading { padding: 2rem; text-align: center; color: #aaa; font-size: 13px; }

/* ── Mobile elements: hidden on desktop by default ─────────── */
.mobile-header        { display: none; }
.mobile-bottom-nav    { display: none; }
.mobile-more-sheet    { display: none; }

/* ── Bottom nav base styles (outside media query so they render) ── */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: #fff;
  border-top: 1px solid #ddd8d0;
  z-index: 300;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-sizing: content-box;
  align-items: stretch;
  /* display flex set inside media query */
}
.mbnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 9.5px;
  font-weight: 500;
  color: #888;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  min-width: 0;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
  font-family: inherit;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mbnav-item.active         { color: #201e1a; }
.mbnav-item.active svg     { opacity: 1; }
.mbnav-item svg            { opacity: 0.5; transition: opacity 0.15s; flex-shrink: 0; }
.mbnav-item span           { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: block; }
.mbnav-badge {
  position: absolute;
  top: 8px; right: calc(50% - 16px);
  background: #e55; color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: none; align-items: center; justify-content: center;
  line-height: 1;
}
.mbnav-badge:not(:empty) { display: flex; }

/* ── More sheet base styles ─────────────────────────────────── */
.mobile-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  visibility: hidden;
}
.mobile-more-sheet.open {
  pointer-events: all;
  visibility: visible;
}
.more-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.25s ease;
}
.mobile-more-sheet.open .more-sheet-backdrop { background: rgba(0,0,0,0.45); }
.more-sheet-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 0 0 calc(env(safe-area-inset-bottom, 0) + 16px);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.12);
}
.mobile-more-sheet.open .more-sheet-panel { transform: translateY(0); }
.more-sheet-handle {
  width: 36px; height: 4px;
  background: #ddd; border-radius: 2px;
  margin: 12px auto 4px;
}
.more-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 12px 4px;
}
.more-sheet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 12px;
  text-decoration: none;
  color: #201e1a;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.more-sheet-item:active { background: #f0f0ec; }
.more-sheet-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: #f5f5f3;
  display: flex; align-items: center; justify-content: center;
  color: #201e1a;
}
.more-sheet-item--danger       { color: #a32d2d; }
.more-sheet-item--danger .more-sheet-icon { background: #fcebeb; color: #a32d2d; }
.more-sheet-badge {
  position: absolute;
  top: 10px; right: calc(50% - 28px);
  background: #e55; color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: none; align-items: center; justify-content: center;
}
.more-sheet-badge:not(:empty) { display: flex; }

/* ── Mobile top header base styles ──────────────────────────── */
.mobile-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #201e1a;
  padding: 0 1rem;
  z-index: 300;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.mobile-header .site-logo       { max-height: 28px; width: auto; filter: brightness(0) invert(1); }
.mobile-header .site-name-text  { color: #fff; font-size: 15px; font-weight: 600; }
.mobile-header-title            { flex: 1; font-size: 15px; font-weight: 500; color: rgba(255,255,255,0.85); text-align: center; }
.mobile-header-user {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff;
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hide desktop sidebar entirely */
  .pcrm-sidebar { display: none; }
  /* Show mobile elements */
  .mobile-header     { display: flex; }
  .mobile-bottom-nav { display: flex; align-items: stretch; }
  .mobile-more-sheet { display: block; }

  /* Main content uses full width, padded for fixed bottom nav + top header */
  .pcrm-main { margin-left: 0; padding-top: 56px; padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 8px); }
  .pcrm-view { padding: 1rem; }
  .view-header { margin-bottom: 1rem; }
  .view-header h1 { font-size: 18px; }

  /* Metric grid: 2 cols on mobile */
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .field-grid.two-col { grid-template-columns: 1fr; }

  /* Mobile top header */
  /* (styles defined above media query) */

  /* Mobile bottom nav bar */
  /* (styles defined above media query) */

  /* More bottom sheet */
  /* (styles defined above media query) */

  /* Side panels go full-screen on mobile */
  .side-panel { width: 100% !important; top: 56px !important; }

  /* Inbox: stack vertically on mobile */
  .inbox-layout { grid-template-columns: 1fr; height: auto; }
  .inbox-list { border-right: none; border-bottom: 1px solid #f0f0ec; max-height: 240px; }
  .inbox-chat { min-height: 300px; }

  /* Submit form: tighten up */
  .form-steps { flex-direction: column; gap: 4px; }
  .form-step-label { display: none; }
}

/* ── Nav badges ───────────────────────────────────────────── */
.nav-group-label { font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.08em; padding: 12px 1.25rem 4px; }
.nav-badge { background: #e55; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; margin-left: auto; }
.nav-item { display: flex; align-items: center; gap: 9px; }
.nav-item svg { flex-shrink: 0; opacity: 0.7; }

/* ── View date ────────────────────────────────────────────── */
.view-date { font-size: 13px; color: #aaa; }

/* ── Side panels ──────────────────────────────────────────── */
.side-panel {
  position: fixed; top: 0; right: 0; width: 460px; height: 100vh;
  background: #fff; border-left: 1px solid #ddd8d0;
  box-shadow: -4px 0 24px rgba(0,0,0,0.06);
  transform: translateX(100%);
  transition: transform .25s ease; z-index: 200; overflow: hidden;
  display: flex; flex-direction: column;
}
#edit-property-panel {
  width: min(800px, 96vw);
}
.side-panel.open { transform: translateX(0); }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid #f0f0ec; position: sticky; top: 0; background: #fff; z-index: 1; }
.panel-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #aaa; line-height: 1; padding: 0; }
.panel-close:hover { color: #201e1a; }
#panel-lead-body, #panel-tx-body { padding: 1.25rem 1.5rem; flex: 1; overflow-y: auto; }
#edit-property-body, #edit-property-analytics {
  flex: 1; min-height: 0; box-sizing: border-box; width: 100%;
}

/* ── Modals ───────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid #f0f0ec; position: sticky; top: 0; background: #fff; }
.modal-header button { background: none; border: none; font-size: 22px; cursor: pointer; color: #aaa; line-height: 1; }
.modal-body { padding: 1.5rem; }

/* ── Toggle / checkbox ────────────────────────────────────── */
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: #444; }
.toggle-input { display: none; }
.toggle-track { width: 36px; height: 20px; background: #ddd; border-radius: 20px; position: relative; transition: background .2s; flex-shrink: 0; }
.toggle-track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: left .2s; }
.toggle-input:checked + .toggle-track { background: #201e1a; }
.toggle-input:checked + .toggle-track::after { left: 19px; }

/* ── Multi-step form ──────────────────────────────────────── */
.form-steps { display: flex; gap: 0; margin-bottom: 1.5rem; background: #fff; border: 1px solid #ddd8d0; border-radius: 10px; overflow: hidden; }
.step { flex: 1; padding: 10px 8px; text-align: center; font-size: 12px; color: #aaa; border-right: 1px solid #ddd8d0; transition: all .15s; }
.step:last-child { border-right: none; }
.step.active { background: #201e1a; color: #fff; font-weight: 500; }
.step.done { background: #f5f5f3; color: #666; }
.form-page { display: none; }
.form-page.active { display: block; }
.form-nav { display: flex; gap: 10px; align-items: center; padding: 0.5rem 0; }

/* ── Offer comparison cards ───────────────────────────────── */
.offer-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 1rem; }
.offer-card { background: #fff; border: 1px solid #ddd8d0; border-radius: 10px; padding: 1rem 1.25rem; }
.offer-card.accepted { border-color: #a0dbb8; background: #f6fff9; }
.offer-card.rejected { opacity: 0.5; }
.offer-amount { font-size: 22px; font-weight: 600; color: #201e1a; margin-bottom: 4px; }
.offer-buyer { font-size: 13px; color: #888; margin-bottom: 10px; }
.offer-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.offer-tag { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #f0f0f0; color: #555; }
.offer-tag.positive { background: #e6f7ee; color: #1a7a40; }

/* ── Timeline ─────────────────────────────────────────────── */
.timeline { margin: 0; padding: 0; }
.tl-item { display: flex; gap: 12px; margin-bottom: 14px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 5px; top: 20px; bottom: -14px; width: 1px; background: #f0f0ec; }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 3px; flex-shrink: 0; }
.tl-dot-blue { background: #378ADD; }
.tl-dot-green { background: #3B6D11; }
.tl-dot-amber { background: #EF9F27; }
.tl-dot-gray { background: #ccc; }
.tl-content { flex: 1; }
.tl-note { font-size: 13px; color: #201e1a; }
.tl-time { font-size: 11px; color: #aaa; margin-top: 2px; }

/* ── Message thread ───────────────────────────────────────── */
.message-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1rem; max-height: 300px; overflow-y: auto; padding: 4px 0; }
.msg { max-width: 80%; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.msg-agent { background: #201e1a; color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.msg-buyer { background: #f0f0ec; color: #201e1a; align-self: flex-start; border-bottom-left-radius: 3px; }
.msg-time { font-size: 10px; opacity: 0.6; margin-top: 3px; }
.msg-compose { display: flex; gap: 8px; margin-top: 8px; }
.msg-compose textarea { flex: 1; padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; resize: none; font-family: inherit; }
.msg-compose button { align-self: flex-end; }

/* ── Vendor report ────────────────────────────────────────── */
.vendor-report-box { background: #f5f5f3; border-radius: 10px; padding: 1rem; margin-top: 1rem; }
.vendor-report-box textarea { width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; resize: vertical; font-family: inherit; min-height: 100px; }

/* ── Calendar week view ───────────────────────────────────── */
.week-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; }
.week-nav button { padding: 6px 14px; border: 1px solid #ddd; border-radius: 8px; background: none; cursor: pointer; font-size: 13px; }
.week-nav span { font-size: 14px; font-weight: 500; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-day { background: #fff; border: 1px solid #ddd8d0; border-radius: 8px; padding: 8px; min-height: 90px; }
.week-day-header { font-size: 11px; color: #888; margin-bottom: 6px; }
.week-day-date { font-size: 14px; font-weight: 500; color: #201e1a; }
.week-day.today { border-color: #201e1a; }
.viewing-pill { background: #201e1a; color: #fff; font-size: 11px; padding: 3px 7px; border-radius: 6px; margin-bottom: 4px; cursor: pointer; line-height: 1.3; }
.viewing-pill.confirmed { background: #1a7a40; }
.viewing-pill.completed { background: #888; }
.viewing-pill.cancelled { background: #f0f0f0; color: #aaa; text-decoration: line-through; }

/* ── Stat progress bars ───────────────────────────────────── */
.progress-bar-wrap { background: #f0f0ec; border-radius: 4px; height: 5px; margin-top: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: #201e1a; border-radius: 4px; transition: width .4s; }

/* ── Message bubbles (agent portal) ──────────────────────── */
.msg { display: inline-block; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.msg-agent { background: #201e1a; color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; float: right; clear: both; }
.msg-buyer { background: #f0f0ec; color: #201e1a; align-self: flex-start; border-bottom-left-radius: 3px; float: left; clear: both; }
.message-thread::after { content: ''; display: table; clear: both; }

/* ── File uploader ────────────────────────────────────────── */
.pcrm-uploader { width: 100%; }

.pcrm-drop-zone {
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fafaf8;
}
.pcrm-drop-zone:hover, .pcrm-drop-zone.drag-over {
  border-color: #201e1a;
  background: #f5f5f3;
}
.pcrm-drop-icon { color: #bbb; margin-bottom: 8px; }
.pcrm-drop-label { font-size: 13px; color: #555; font-weight: 500; }
.pcrm-drop-hint  { font-size: 12px; color: #aaa; margin-top: 4px; }

.pcrm-file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }

.pcrm-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #ddd8d0;
  border-radius: 9px;
  position: relative;
}
.pcrm-file-item.error { border-color: #fcc; background: #fff8f8; }
.pcrm-file-item.done  { border-color: #c8e6c9; }

.pcrm-file-icon { flex-shrink: 0; }
.pcrm-file-info { flex: 1; min-width: 0; }
.pcrm-file-name { font-size: 13px; font-weight: 500; color: #201e1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcrm-file-meta { font-size: 11px; color: #888; margin-top: 2px; }

.pcrm-file-progress { height: 3px; background: #f0f0ec; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.pcrm-file-progress-bar { height: 100%; background: #201e1a; border-radius: 3px; width: 0; transition: width .1s; }
.pcrm-file-item.done .pcrm-file-progress { display: none; }
.pcrm-file-item.error .pcrm-file-progress-bar { background: #e55; }

.pcrm-file-remove {
  background: none; border: none; color: #aaa; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 4px; margin-left: 4px;
  flex-shrink: 0;
}
.pcrm-file-remove:hover { color: #c00; }

.pcrm-file-link {
  font-size: 12px; color: #185FA5; margin-left: 8px;
  flex-shrink: 0; text-decoration: none;
}
.pcrm-file-link:hover { text-decoration: underline; }

/* ── Photo grid ───────────────────────────────────────────── */
.photo-reorder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.photo-grid-cell {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: grab;
  background: #f0f0ec;
  transition: border-color .15s, opacity .15s;
}
.photo-grid-cell:first-child { border-color: #201e1a; }
.photo-grid-cell.dragging  { opacity: .4; }
.photo-grid-cell.drag-target { border-color: #201e1a; border-style: dashed; }
.photo-grid-cell img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.photo-grid-badge {
  position: absolute; top: 5px; left: 5px;
  background: #201e1a; color: #fff;
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px;
  letter-spacing: .03em;
}
.photo-grid-num {
  position: absolute; bottom: 5px; right: 6px;
  background: rgba(0,0,0,.45); color: #fff;
  font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 10px;
}
.photo-grid-remove {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.5); color: #fff;
  border: none; border-radius: 50%;
  width: 20px; height: 20px; font-size: 14px; line-height: 20px;
  cursor: pointer; display: none; align-items: center; justify-content: center;
  padding: 0;
}
.photo-grid-cell:hover .photo-grid-remove { display: flex; }
.photo-grid-add {
  border: 2px dashed #ddd; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fafaf8; transition: background .15s, border-color .15s;
}
.photo-grid-add:hover { background: #f5f5f3; border-color: #bbb; }

/* ── Analytics dashboard ──────────────────────────────────── */
.an-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.an-metric {
  background: #fff;
  border: 1px solid #ddd8d0;
  border-radius: 11px;
  padding: 1rem 1.25rem;
}
.an-metric-label { font-size: 12px; color: #888; margin-bottom: 6px; }
.an-metric-value { font-size: 26px; font-weight: 700; color: #201e1a; display: flex; align-items: baseline; gap: 4px; }
.an-metric-sub   { font-size: 11px; color: #aaa; margin-top: 3px; }

.an-section {
  background: #fff;
  border: 1px solid #ddd8d0;
  border-radius: 11px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.an-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #201e1a;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.an-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0;
}
.an-two-col > div { margin-bottom: 1rem; }
.an-chart-wrap { position: relative; }

/* Period buttons */
.period-btn.active {
  background: #201e1a;
  color: #fff;
  border-color: #201e1a;
}

@media (max-width: 768px) {
  .an-metrics   { grid-template-columns: 1fr 1fr; }
  .an-two-col   { grid-template-columns: 1fr; }
}

/* ── Inbox layout ─────────────────────────────────────────── */
.inbox-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - 100px);
  background: #fff;
  border: 1px solid #ddd8d0;
  border-radius: 12px;
  overflow: hidden;
}

/* Conversation list */
.inbox-list {
  border-right: 1px solid #f0f0ec;
  overflow-y: auto;
}
.inbox-conv {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f3;
  transition: background .1s;
  position: relative;
}
.inbox-conv:hover  { background: #fafaf8; }
.inbox-conv.active { background: #f0ede8; }
.inbox-conv.unread .inbox-conv-name { font-weight: 700; }
.inbox-conv.unread .inbox-conv-preview { color: #201e1a; }

.inbox-conv-thumb {
  width: 42px; height: 42px; border-radius: 8px;
  overflow: hidden; flex-shrink: 0; background: #f0f0ec;
}
.inbox-conv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inbox-conv-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: #888; background: #ddd8d0;
}
.inbox-conv-body    { flex: 1; min-width: 0; }
.inbox-conv-top     { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 1px; }
.inbox-conv-name    { font-size: 13px; font-weight: 600; color: #201e1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-conv-time    { font-size: 11px; color: #aaa; flex-shrink: 0; }
.inbox-conv-prop    { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.inbox-conv-preview { font-size: 12px; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-unread-dot {
  position: absolute; top: 12px; right: 12px;
  background: #201e1a; color: #fff;
  font-size: 10px; font-weight: 600;
  min-width: 18px; height: 18px;
  border-radius: 20px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
}

/* Thread panel */
.inbox-thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.inbox-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0ec;
  flex-shrink: 0;
  background: #fff;
}
.inbox-thread-name { font-size: 15px; font-weight: 600; color: #201e1a; }
.inbox-thread-prop { font-size: 12px; color: #888; margin-top: 2px; }

.inbox-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafaf8;
}
.inbox-msg-row { display: flex; flex-direction: column; }
.inbox-msg-row--agent { align-items: flex-end; }
.inbox-msg-row--buyer { align-items: flex-start; }
.inbox-msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.inbox-msg-agent { background: #201e1a; color: #fff; border-bottom-right-radius: 4px; }
.inbox-msg-buyer { background: #fff; color: #201e1a; border: 1px solid #ddd8d0; border-bottom-left-radius: 4px; }
.inbox-msg-time  { font-size: 11px; color: #bbb; margin-top: 3px; padding: 0 4px; }

.inbox-compose {
  padding: 12px 16px;
  border-top: 1px solid #f0f0ec;
  background: #fff;
  flex-shrink: 0;
}
.inbox-compose textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 9px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  margin-bottom: 8px;
}
.inbox-compose textarea:focus { border-color: #201e1a; }
.inbox-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Empty state */
.inbox-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #aaa;
  text-align: center;
  padding: 2rem;
}

@media (max-width: 768px) {
  .inbox-layout { grid-template-columns: 1fr; }
  .inbox-list { max-height: 220px; border-right: none; border-bottom: 1px solid #f0f0ec; }
}

/* ── Admin broadcast messages in inbox ───────────────────────────── */
.inbox-admin-msg {
  border-left: 3px solid #201e1a !important;
}
.inbox-admin-msg .inbox-conv-thumb-placeholder {
  background: #201e1a;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

/* ── Property analytics tab ───────────────────────────────────────── */

/* Tab strip */
.prop-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 16px 22px 13px;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.prop-tab:hover       { color: #201e1a; }
.prop-tab-active      { color: #201e1a; border-bottom-color: #201e1a; }

/* ── Metrics row ──────────────────────────────────────────────────── */
.pa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 1.5rem;
}
.pa-metric {
  background: #f5f5f3;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.pa-metric-label { font-size: 10px; color: #888; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.pa-metric-value { font-size: 22px; font-weight: 700; color: #201e1a; line-height: 1; }
.pa-metric-sub   { font-size: 11px; color: #aaa; margin-top: 4px; }
.pa-metric-good  { color: #1a7a40; }
.pa-metric-warn  { color: #7a5c00; }
.pa-metric-bad   { color: #a00; }

/* ── Two-column layout for the body on wider panels ──────────────── */
.pa-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
  align-items: start;
}
.pa-body-full { grid-column: 1 / -1; }

/* ── Section ──────────────────────────────────────────────────────── */
.pa-section { margin-bottom: 1.5rem; }
.pa-section:last-child { margin-bottom: 0; }
.pa-section-title {
  font-size: 10px; font-weight: 700; color: #aaa;
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid #f0f0ec;
}

/* ── Funnel bars ──────────────────────────────────────────────────── */
.pa-funnel-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 9px; font-size: 13px;
}
.pa-funnel-label   { width: 140px; flex-shrink: 0; color: #555; font-size: 12px; }
.pa-funnel-bar-track {
  flex: 1; height: 7px; background: #f0f0ec;
  border-radius: 4px; overflow: hidden; min-width: 40px;
}
.pa-funnel-bar-fill {
  height: 100%; border-radius: 4px;
  background: #201e1a; transition: width .6s ease;
}
.pa-funnel-count   { width: 28px; text-align: right; font-weight: 600; color: #201e1a; font-size: 13px; flex-shrink: 0; }
.pa-funnel-pct     { width: 34px; text-align: right; font-size: 11px; color: #aaa; flex-shrink: 0; }

/* ── Milestone / benchmark rows ───────────────────────────────────── */
.pa-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid #f0f0ec; font-size: 13px;
  gap: 8px;
}
.pa-row:last-child  { border-bottom: none; }
.pa-row-label       { color: #555; flex: 1; }
.pa-row-vals        { display: flex; gap: 14px; align-items: center; flex-shrink: 0; }
.pa-row-this        { font-weight: 600; color: #201e1a; text-align: right; min-width: 44px; }
.pa-row-avg         { color: #bbb; font-size: 11px; text-align: right; min-width: 54px; }

/* ── Offer history ────────────────────────────────────────────────── */
.pa-offer-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid #f0f0ec; font-size: 13px;
  gap: 8px;
}
.pa-offer-row:last-child { border-bottom: none; }
.pa-offer-left  { flex: 1; min-width: 0; }
.pa-offer-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* ── Timeline chart ───────────────────────────────────────────────── */
.pa-timeline-wrap { height: 130px; position: relative; }

/* ── Transaction strip ────────────────────────────────────────────── */
.pa-tx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

/* ── Responsive: stack to single column on narrow screens ─────────── */
@media (max-width: 600px) {
  .pa-body          { grid-template-columns: 1fr; gap: 0; }
  .pa-funnel-label  { width: 110px; font-size: 11px; }
  #edit-property-panel { width: 100vw !important; }
}

/* ── Transaction section styles ──────────────────────────────────── */
.tx-section-title {
  font-size: 10px; font-weight: 700; color: #aaa;
  text-transform: uppercase; letter-spacing: .07em;
  margin: 1.25rem 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid #f0f0ec;
}
.tx-section-body { margin-bottom: 1rem; }

/* ── Chain visualiser modal ──────────────────────────────────────── */
.chain-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: modal-fadein .2s ease;
}
@keyframes modal-fadein { from { opacity:0 } to { opacity:1 } }

.chain-modal {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 960px; max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
  animation: modal-slidein .2s ease;
}
@keyframes modal-slidein { from { transform:translateY(12px);opacity:0 } to { transform:none;opacity:1 } }

.chain-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px; border-bottom: 1px solid #f0f0ec; flex-shrink: 0;
  gap: 10px;
}
.chain-modal-header h3 { margin: 0; font-size: 15px; font-weight: 600; }
.chain-modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }

/* ── Health banner ──────────────────────────────────────────────── */
.chain-health-bar {
  display: flex; align-items: center; gap: 10px;
  background: #f9f9f7; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 20px;
  border-left: 4px solid #888;
}
.chain-health-dot     { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.chain-health-label   { font-size: 13px; font-weight: 700; }
.chain-health-summary { font-size: 12px; color: #888; margin-left: 4px; }

/* ── Diagram (view mode) ────────────────────────────────────────── */
.chain-diagram-v2 { overflow: auto; padding-bottom: 8px; }

/* Vertical layout — stacked top to bottom */
.chain-diagram-v2--vertical {
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.chain-item--vertical { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 480px; }

/* Horizontal layout — left to right */
.chain-diagram-v2--horizontal {
  display: flex; flex-direction: row; align-items: flex-start; gap: 0;
  overflow-x: auto;
}
.chain-item--horizontal { display: flex; flex-direction: row; align-items: flex-start; flex-shrink: 0; }

/* Connectors */
.chain-connector--vertical {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 0; width: 100%; max-width: 480px;
}
.chain-connector--horizontal {
  display: flex; flex-direction: row; align-items: center;
  padding: 0 4px; margin-top: 28px;
}
.chain-connector-line {
  background: #e0ddd8;
}
.chain-connector--vertical  .chain-connector-line { width: 2px; height: 18px; }
.chain-connector--horizontal .chain-connector-line { height: 2px; width: 24px; }
.chain-connector-arrow { font-size: 16px; color: #bbb; line-height: 1; }

/* ── Chain card ─────────────────────────────────────────────────── */
.chain-card {
  width: 100%; max-width: 480px;
  background: #fff; border-radius: 10px;
  padding: 14px 16px; border: 1px solid #ddd8d0;
  transition: box-shadow .15s;
  position: relative;
}
.chain-item--horizontal .chain-card { width: 200px; max-width: none; }
.chain-card:hover  { box-shadow: 0 4px 14px rgba(0,0,0,.07); }
.chain-card--subject { background: #f5f5f3; }

.chain-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 6px;
}
.chain-card-role {
  font-size: 10px; font-weight: 700; color: #aaa;
  text-transform: uppercase; letter-spacing: .06em;
}
.chain-card-badges { display: flex; gap: 4px; }
.chain-badge {
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 8px;
  text-transform: uppercase; letter-spacing: .04em;
}
.chain-badge--ftb { background: #e8f0fe; color: #1a56c4; }
.chain-badge--cf  { background: #e6f9ee; color: #1a7a40; }

.chain-card-name   { font-size: 14px; font-weight: 600; color: #201e1a; margin-bottom: 5px; min-height: 20px; }
.chain-card-status { font-size: 11px; font-weight: 600; margin-bottom: 6px; }

.chain-card-mort, .chain-card-solicitor {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: #888; margin-bottom: 4px;
}

.chain-card-note {
  margin-top: 8px; padding: 6px 8px; background: #fafaf7;
  border-radius: 6px; cursor: pointer; transition: background .15s;
  border-left: 2px solid #e0ddd8;
}
.chain-card-note:hover    { background: #f5f5f0; }
.chain-card-note-text     { font-size: 11px; color: #555; line-height: 1.4; }
.chain-card-note-count    { font-size: 10px; color: #aaa; margin-top: 2px; }

.chain-card-actions {
  margin-top: 8px; display: flex; justify-content: flex-end;
}
.chain-card-edit-btn {
  background: none; border: none; font-size: 11px; color: #aaa;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: background .15s, color .15s;
}
.chain-card-edit-btn:hover { background: #f0f0ec; color: #555; }

/* ── Edit mode ──────────────────────────────────────────────────── */
.chain-edit-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

.chain-edit-row {
  border: 1.5px solid #ddd8d0; border-radius: 10px;
  overflow: hidden;
}
.chain-edit-row-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #f9f9f7; border-bottom: 1px solid #ddd8d0; gap: 10px;
}
.chain-edit-number {
  width: 22px; height: 22px; border-radius: 50%;
  background: #201e1a; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chain-edit-fields { padding: 12px 14px; }
.chain-edit-remove {
  background: none; border: none; font-size: 18px; color: #ccc;
  cursor: pointer; padding: 0; line-height: 1; transition: color .15s;
}
.chain-edit-remove:hover { color: #e04040; }
.chain-edit-footer {
  display: flex; align-items: center; gap: 10px;
  padding-top: 12px; border-top: 1px solid #f0f0ec;
  flex-wrap: wrap;
}

/* ── Note history ────────────────────────────────────────────────── */
.chain-note-history { display: flex; flex-direction: column; gap: 6px; }
.chain-note-history-item {
  padding: 7px 10px; background: #f9f9f7; border-radius: 6px;
  border-left: 2px solid #e0ddd8; font-size: 12px;
}

@media (max-width: 600px) {
  .chain-diagram-v2--horizontal { flex-direction: column; }
  .chain-item--horizontal       { flex-direction: column; align-items: center; }
  .chain-connector--horizontal  { flex-direction: column; margin-top: 0; padding: 4px 0; }
  .chain-connector--horizontal .chain-connector-line { width: 2px; height: 16px; }
  .chain-item--horizontal .chain-card { width: 100%; }
}


/* ── Viewing feedback page (tokenised) ───────────────────────────── */
.feedback-page {
  max-width: 480px; margin: 60px auto; padding: 0 20px; text-align: center;
}
.feedback-stars { display: flex; justify-content: center; gap: 12px; margin: 24px 0; }
.feedback-star  {
  font-size: 40px; cursor: pointer; color: #ddd8d0;
  transition: color .15s; line-height: 1;
}
.feedback-star.lit, .feedback-star:hover ~ .feedback-star { color: #f5a623; }
.feedback-star.lit ~ .feedback-star { color: #ddd8d0; }

/* ── Live Chat panel ─────────────────────────────────────────────── */
.chat-avatar-placeholder {
  background: linear-gradient(135deg, #201e1a, #444);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.chat-online-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4cd964;
  margin-right: 4px;
  animation: chat-pulse 2s infinite;
}
@keyframes chat-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

.chat-empty-state {
  text-align: center; color: #aaa; font-size: 13px;
  padding: 3rem 1rem; line-height: 1.6;
}

.chat-messages { scroll-behavior: smooth; }

/* Typing dots in chat thread */
.chat-typing-indicator {
  display: flex; align-items: center; gap: 3px;
  padding: 8px 16px;
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #bbb; animation: chat-typing-bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity:.6; }
  30%            { transform: translateY(-5px); opacity:1; }
}

/* Escalate button highlight */
.chat-conv .inbox-conv-prop {
  font-size: 11px; color: #888;
}

/* ── Morning briefing dashboard ──────────────────────────────────── */
.dash-stat-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 1.25rem;
}
.dash-stat-tile {
  background: #f5f5f3; border-radius: 10px;
  padding: 14px 12px; text-align: center;
  transition: background .15s;
}
.dash-stat-tile:hover { background: #eeede9; }
.dst-val       { font-size: 26px; font-weight: 700; color: #201e1a; line-height: 1; }
.dst-val.dst-alert { color: #e04040; }
.dst-lbl       { font-size: 11px; color: #888; margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

.dash-section  { background: #fff; border: 1px solid #ddd8d0; border-radius: 12px; padding: 14px 16px; }
.dash-section-title {
  font-size: 10px; font-weight: 700; color: #aaa;
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
/* Quick-add task widget */
.dash-quick-task { margin-top: 1rem; }
.quick-task-row {
  display: flex;
  gap: 7px;
  align-items: stretch;
}
.quick-task-input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #ddd8d0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: #201e1a;
  background: #fafaf8;
  transition: border-color .15s, background .15s;
  outline: none;
  min-width: 0;
}
.quick-task-input:focus {
  border-color: #201e1a;
  background: #fff;
}
.quick-task-input::placeholder { color: #bbb; }
.quick-task-priority {
  padding: 0 10px;
  border: 1.5px solid #ddd8d0;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  color: #444;
  background: #fafaf8;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
  flex-shrink: 0;
}
.quick-task-priority:focus { border-color: #201e1a; }
.quick-task-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  background: #201e1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
  flex-shrink: 0;
  white-space: nowrap;
}
.quick-task-btn:hover { opacity: 0.82; }
.quick-task-status {
  font-size: 12px;
  min-height: 18px;
  margin-top: 6px;
  padding-left: 2px;
  color: #888;
}

/* Logo upload card */
.logo-card-body {
  padding: 1.25rem !important;
}
.logo-upload-wrap {
  display: flex !important;
  align-items: flex-start !important;
  gap: 20px !important;
  padding: 4px 0 8px !important;
  flex-wrap: wrap !important;
}
.logo-preview-area {
  width: 140px !important;
  height: 90px !important;
  border-radius: 10px !important;
  border: 1.5px solid #ddd8d0 !important;
  background: #fafaf8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}
.logo-preview-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  padding: 10px !important;
}
.logo-preview-placeholder {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  color: #ccc !important;
  font-size: 11px !important;
  text-align: center !important;
  padding: 10px !important;
}
.logo-upload-controls {
  flex: 1 !important;
  min-width: 200px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  justify-content: center !important;
}
.logo-upload-hint {
  font-size: 12px !important;
  color: #888 !important;
  line-height: 1.55 !important;
  margin: 0 !important;
}
.logo-upload-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13px !important;
}
.logo-upload-status {
  font-size: 12px !important;
  color: #888 !important;
  min-height: 16px !important;
}

.dash-today-pill {
  background: #201e1a; color: #fff; font-size: 9px;
  font-weight: 700; padding: 2px 7px; border-radius: 10px;
  letter-spacing: .06em;
}

/* Viewing rows on dashboard */
.dash-viewing-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid #f0f0ec;
  cursor: pointer; transition: background .1s;
}
.dash-viewing-row:last-child { border-bottom: none; }
.dash-viewing-row:hover      { background: #fafaf8; margin: 0 -4px; padding-left: 4px; padding-right: 4px; border-radius: 6px; }
.dash-viewing-time  { width: 44px; font-size: 13px; font-weight: 700; color: #201e1a; flex-shrink: 0; }
.dash-viewing-body  { flex: 1; min-width: 0; }
.dash-viewing-name  { font-size: 13px; font-weight: 600; color: #201e1a; }
.dash-viewing-prop  { font-size: 11px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Attention rows */
.dash-attention-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #f0f0ec;
  cursor: pointer; transition: background .1s;
}
.dash-attention-row:last-child { border-bottom: none; }
.dash-attention-row:hover      { background: #fafaf8; margin: 0 -4px; padding-left: 4px; padding-right: 4px; border-radius: 6px; }
.dar-icon  { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; background: #f5f5f3; display: flex; align-items: center; justify-content: center; }
.dar-body  { flex: 1; min-width: 0; }
.dar-title { font-size: 13px; font-weight: 600; color: #201e1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dar-sub   { font-size: 11px; color: #888; }
.dar-age   { font-size: 11px; color: #aaa; flex-shrink: 0; }
.dar-tick  {
  background: none; border: 1.5px solid #ddd8d0; border-radius: 50%;
  width: 24px; height: 24px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #888; transition: all .15s;
}
.dar-tick:hover { background: #1a7a40; border-color: #1a7a40; color: #fff; }

/* ── Tasks ───────────────────────────────────────────────────────── */
.task-list    { display: flex; flex-direction: column; gap: 2px; }
.task-group   { margin-bottom: 1rem; }
.task-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; margin-bottom: 6px; padding: 0 4px;
}

.task-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: #fff; border: 1px solid #ddd8d0;
  margin-bottom: 4px; transition: box-shadow .15s;
}
.task-row:hover      { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.task-row.task-done  { opacity: .5; }
.task-row.task-overdue { border-left: 3px solid #e04040; }

.task-check {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  border: 2px solid #d0ccc5; border-radius: 50%;
  background: none; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: all .15s;
}
.task-check:hover  { border-color: #1a7a40; background: #1a7a40; }
.task-check.checked { background: #1a7a40; border-color: #1a7a40; }

.task-body   { flex: 1; min-width: 0; cursor: pointer; }
.task-title  { font-size: 13px; font-weight: 500; color: #201e1a; margin-bottom: 3px; }
.task-meta   { font-size: 11px; color: #aaa; }
.task-overdue-label { color: #e04040; font-weight: 600; }

.task-delete {
  background: none; border: none; font-size: 16px; color: #ddd;
  cursor: pointer; flex-shrink: 0; padding: 0; line-height: 1;
  transition: color .15s;
}
.task-delete:hover { color: #e04040; }

@media (max-width: 768px) {
  .dash-stat-strip { grid-template-columns: repeat(3, 1fr); }
}

/* ── Agent "On my way" tracking button ───────────────────────────── */
.btn-tracking {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--border, #ddd8d0);
  background: var(--white, #faf8f4);
  color: var(--ink, #201e1a);
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-tracking:hover {
  border-color: var(--accent, #c05a28);
  color: var(--accent, #c05a28);
}
.btn-tracking:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-tracking--active {
  background: #fdf4f0;
  border-color: var(--accent, #c05a28);
  color: var(--accent, #c05a28);
  animation: tracking-glow 2s ease-in-out infinite;
}
@keyframes tracking-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,90,40,0.2); }
  50%       { box-shadow: 0 0 0 5px rgba(192,90,40,0); }
}

/* Mobile: show On my way button more prominently on small screens */
@media (max-width: 768px) {
  .btn-tracking {
    height: 36px;
    font-size: 13px;
    padding: 0 14px;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }
}
