/* ============================================================
   TOKENS & RESET
   ============================================================ */
:root {
  --green:       #2ea84a;
  --green-dark:  #1e7b34;
  --green-light: #eaf6ed;
  --green-glow:  rgba(46,168,74,.18);
  --blue:        #3b82f6;
  --red:         #ef4444;
  --gold:        #f59e0b;

  --bg:          #f0f4f1;
  --surface:     #ffffff;
  --surface2:    #f7faf8;
  --border:      rgba(46,168,74,.18);
  --border-hard: #e4eae6;
  --text-1:      #111a14;
  --text-2:      #4a5a50;
  --text-3:      #8a9e92;

  --nav-bg:      #1a2d20;
  --nav-text:    rgba(255,255,255,.75);

  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   22px;

  --shadow-card: 0 2px 12px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --shadow-pop:  0 12px 40px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);
  --transition:  all .2s ease;
}

body.dark-mode {
  --bg:        #0c1410;
  --surface:   #141f17;
  --surface2:  #1a2820;
  --border:    rgba(255,255,255,.07);
  --border-hard:#232e26;
  /* Pedro 2026-05-17: dropped primary text from near-white #eef3f0 to a
     softer off-white (#c8d3cc) so values like task titles, locations,
     names, and chat messages stop "blasting" the user in dark mode.
     Apple/Material both cap dark-mode primary text around 85-87% white;
     this lands at ~83% and feels markedly easier on the eyes while
     still hitting WCAG AAA contrast against the dark surfaces. */
  --text-1:    #c8d3cc;
  --text-2:    #8a9d92;
  --text-3:    #5a7060;
  --nav-bg:    #0a1209;
  --shadow-card: 0 2px 12px rgba(0,0,0,.35);
  --shadow-pop:  0 12px 40px rgba(0,0,0,.55);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Lock the home viewport so the page itself never scrolls.
   Each column inside (.sidebar-filter, .main-content-area,
   .messages-column) has its own overflow-y:auto and handles its
   internal scroll. This way the sidebars stay pinned in their
   side rails forever — they can't drift up out of view because
   there's no page scroll to drift with. Modal overlays use
   position:fixed and z-index so they're unaffected. */
body.home-page {
  height: 100vh;
  overflow: hidden;
}
body.home-page .app-wrapper {
  height: 100vh;
  overflow: hidden;
}
/* #providerView is a sibling of .app-wrapper (not a child). When the
   user is in provider mode, .app-wrapper is hidden via JS and the
   provider view takes its place — so it needs the same viewport lock
   so the provider sidebar/main/messages columns (each calc(100vh - 108px)
   with internal overflow-y:auto) stay pinned and don't drift. */
body.home-page #providerView.active {
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(46,168,74,.25); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(46,168,74,.5); }

/* ============================================================
   NAV
   ============================================================ */
.nav-container {
  background: linear-gradient(135deg,#0d1610,#1a2d20 50%,#0d1610);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
}

.main-nav {
  width: 70%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

/* Top strip */
.main-nav-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 12px;
  color: var(--nav-text);
}
.main-nav-top a {
  color: var(--nav-text);
  text-decoration: none;
  transition: color .2s;
}
.main-nav-top a:hover { color: #fff; }
.top-divider { margin: 0 8px; opacity: .3; }
.active-mode { color: #4ade80 !important; font-weight: 800; cursor: default; }

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
  color: #fff !important;
  text-decoration: none;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.social-icon svg { width: 12px; height: 12px; display: block; }

/* Hover: swap to the brand's official color so the icon "lights up"
   and feels like the real social platform, not a generic green chip.
   The lift + shadow signals interactivity. */
.social-icon.fb:hover {
  background: #1877F2 !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(24,119,242,.45);
}
.social-icon.ig:hover {
  /* Instagram brand gradient (orange → pink → purple). */
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(220,39,67,.45);
}

/* Placeholder state for icons whose link isn't set up yet. The cursor
   and lower opacity tell the user it's not yet active; hover stays
   neutral so it doesn't pretend to be live. */
.social-icon.is-placeholder { cursor: not-allowed; opacity: .55; }
.social-icon.is-placeholder:hover {
  background: rgba(255,255,255,.15) !important;
  transform: none;
  box-shadow: none;
}

.nav-top-right { display: flex; align-items: center; gap: 4px; }

.theme-toggle-btn {
  background: transparent; border: none;
  color: var(--nav-text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  transition: background .2s, color .2s;
}
.theme-toggle-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.theme-toggle-btn svg { width: 15px; height: 15px; }
body.dark-mode .moon-icon { display: none !important; }
body.dark-mode .sun-icon { display: block !important; }
.sun-icon { display: none; }

/* Bottom main bar */
.main-nav-bottom {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  position: relative;
}

/* Profile card in nav */
.profile-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  flex-shrink: 0;
}
.profile-card-top { display: flex; align-items: center; gap: 10px; }

.avatar-container {
  position: relative;
  flex-shrink: 0;
}
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green);
  display: block;
}
.avatar-fallback {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.2);
}

.profile-info { display: flex; flex-direction: column; gap: 2px; }
.profile-stars { color: #f59e0b; font-size: 11px; letter-spacing: 1px; }
.profile-meta { font-size: 11px; color: rgba(255,255,255,.6); }
.profile-meta strong { color: #4ade80; }
.username { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.9); }

/* Balance */
.balance-container {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-size: 12px;
  color: rgba(255,255,255,.8);
  margin-top: 2px;
}
.balance-label { opacity: .7; font-size: 11px; }
.currency-select {
  background: transparent; color: #fff;
  border: none; outline: none;
  font-weight: 700; cursor: pointer;
  font-size: 12px;
  appearance: none;         /* Idinagdag para sa modern browsers */
  -webkit-appearance: none; /* Mananatili ito para sa older Safari/Chrome */
}
.currency-select option { background: #1a2d20; color: #fff; }
.balance-amount { font-weight: 800; letter-spacing: .5px; font-size: 12px; color: #fff; }
.eye-btn {
  background: none; border: none;
  color: rgba(255,255,255,.5); cursor: pointer;
  display: flex; align-items: center; padding: 0; margin-left: 2px;
  transition: color .2s;
}
.eye-btn:hover { color: #fff; }
.eye-btn svg { width: 14px; height: 14px; }

/* Search */
.search-container {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  top: 50%;
  width: 40%;
  max-width: 600px;
  display: flex;
  /* Stacking context above .search-marquee so the live-search dropdown
     (which opens below the input and overlaps with the marquee strip)
     renders cleanly on top instead of bleeding the marquee text
     through its background. */
  z-index: 10;
}

/* Marquee strip BELOW the search input (sibling of .search-container,
   not inside it). Same horizontal centering and width as the search
   bar so the two visually align as a stacked unit. The vertical
   offset (calc(50% + ~26px)) puts the marquee just under the bottom
   edge of the search input. Two copies of the content scroll
   seamlessly via translateX(-50%). Pauses on hover so users can
   read; honors prefers-reduced-motion. */
.search-marquee {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% + 38px));
  width: 40%;
  max-width: 600px;
  /* Sit BEHIND the .search-container so the live-search dropdown
     covers the marquee instead of mixing text with it. */
  z-index: 1;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: .2px;
  /* Transparent background — text reads against the dark nav directly. */
  background: transparent;
  padding: 5px 0;
  user-select: none;
  pointer-events: auto;
}
.search-marquee-track {
  display: inline-block;
  white-space: nowrap;
  /* paddingless so the seamless loop math (-50%) works. */
  animation: search-marquee-scroll 30s linear infinite;
}
.search-marquee-track > span {
  margin-right: 18px;
}
.search-marquee-sep {
  color: rgba(255,255,255,.35);
}
.search-marquee:hover .search-marquee-track {
  animation-play-state: paused;
}
@keyframes search-marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .search-marquee-track { animation: none; }
}
.search-input {
  flex: 1;
  background: #ffffff;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: var(--radius-md);
  padding: 9px 110px 9px 14px;
  color: #1a1a1a;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}
.search-input::placeholder { color: #999; }
.search-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,168,74,.2);
}
.search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--green);
  color: #fff; border: none;
  border-radius: calc(var(--radius-md) - 2px);
  padding: 7px 18px;
  font-family: 'Inter', sans-serif;
  font-weight: 700; font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.search-btn:hover { background: var(--green-dark); }

/* Live search dropdown */
.live-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--border-hard);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  max-height: 320px;
  overflow-y: auto;
  z-index: 500;
  display: none;
}
body.dark-mode .live-search-dropdown {
  background: var(--surface);
  border-color: var(--border-hard);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.live-search-dropdown.open { display: block; }
.live-search-dropdown:empty { display: none; }

.live-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--border);
}
.live-search-item:last-child { border-bottom: none; }
.live-search-item:hover { background: rgba(46,168,74,.04); }
body.dark-mode .live-search-item:hover { background: rgba(46,168,74,.08); }

.live-search-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.live-search-info { flex: 1; min-width: 0; }
.live-search-name {
  font-size: 13px; font-weight: 700; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live-search-name mark {
  background: rgba(46,168,74,.15); color: var(--green); font-weight: 800;
  border-radius: 2px; padding: 0 1px;
}
.live-search-detail {
  font-size: 11px; color: var(--text-3); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live-search-badges { display: flex; gap: 4px; flex-shrink: 0; }
.live-search-badge {
  font-size: 9px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px;
}
.live-search-badge.verified { background: rgba(46,168,74,.08); color: var(--green); }
.live-search-badge.provider { background: rgba(59,130,246,.08); color: var(--blue); }
.live-search-badge.client { background: rgba(245,158,11,.08); color: #d97706; }

.live-search-empty {
  padding: 20px; text-align: center;
  color: var(--text-3); font-size: 12px;
}
.live-search-loading {
  padding: 14px; text-align: center;
  color: var(--text-3); font-size: 12px;
}
/* @keyframes pulse — defined in the Chatbox section below */
.live-search-section {
  font-size: 9px; font-weight: 800; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .6px;
  padding: 8px 14px 4px; background: var(--surface2);
}
body.dark-mode .live-search-section { background: rgba(255,255,255,.02); }

/* Logo */
.logo-container { margin-left: auto; }
.logo-text {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -.5px;
}
.care-connect { color: #fff; }
.ph { color: #4ade80; margin-left: 3px; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.app-wrapper {
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   TABS
   ============================================================ */
.tab-header {
  display: flex;
  background: var(--surface);
  border-bottom: 2px solid var(--border-hard);
  gap: 2px;
  padding: 6px 6px 0;
  flex-shrink: 0;
}
body.dark-mode .tab-header {
  background: #141f17;
  border-color: #232e26;
}

.tab-link {
  flex: 1;
  padding: 7px 8px 8px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: var(--transition);
  margin-bottom: -2px;
}
.tab-link:hover { color: var(--green); background: var(--green-light); }
body.dark-mode .tab-link:hover { background: rgba(46,168,74,.08); }
.tab-link.active {
  color: var(--green);
  border-bottom-color: var(--green);
  background: var(--surface);
  font-weight: 800;
}
body.dark-mode .tab-link.active { background: #141f17; }

/* Tab content */
.tab-content { display: none; flex-direction: column; min-height: 0; }
.tab-content.active-tab { display: flex; }

/* Tab banner */
.tab-top-banner {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
  color: #fff;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: .1px;
  /* Phase 6 hotfix: no negative margins — banner should fill its container
     naturally so text doesn't get clipped against the viewport edge or
     overlapped by the sidebar. */
}

/* ============================================================
   DUAL LAYOUT
   ============================================================ */
.tab-main-body.dual-layout {
  display: flex !important;
  flex-direction: row;
  flex: 1;
  min-height: calc(100vh - 200px);
  background: var(--bg);
  gap: 0;
}

.sidebar-filter {
  width: 15%;
  min-width: 200px;
  flex-shrink: 0;
  padding: 16px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border-hard);
  overflow-y: auto;
  /* Matched to main + messages height after Phase 1 of Sample-3 redesign. */
  height: calc(100vh - 108px);
  /* Stick to the top of the viewport so filters stay visible when the
     user scrolls long provider lists. Activates only when the outer
     page actually scrolls — harmless on viewports where the home
     fits without scrolling. */
  position: sticky;
  top: 0;
  align-self: flex-start;
}
body.dark-mode .sidebar-filter { background: #141f17; border-color: #232e26; }

/* Phase 1 of Sample-3 redesign (2026-05-02): the -46px hack that
   used to pull sidebars up into the tab-header-strip is no longer
   correct now that the strip is hidden. Set margin-top:0 so the
   sidebars start at the top of the dual-layout, and bump column
   heights up by 46px (154→108) so the layout reaches the viewport
   bottom instead of leaving a white gap.
   Also matched .main-content-area's height (was 200) to the same
   formula so all three columns align flush at the bottom. */
.tab-content > .tab-main-body.dual-layout > .sidebar-filter,
.tab-content > .tab-main-body.dual-layout > .messages-column,
.provider-tab-content > .tab-main-body.dual-layout > .sidebar-filter,
.provider-tab-content > .tab-main-body.dual-layout > .messages-column {
  margin-top: 0;
  height: calc(100vh - 108px);
}

.main-content-area {
  flex: 1;
  overflow-y: auto;
  /* Matches the sidebars' height calc (108 = nav-only, after the
     46-pixel tab-header-strip was hidden in Phase 1 of the Sample-3
     redesign on 2026-05-02). All three columns flush at the bottom. */
  height: calc(100vh - 108px);
  /* 16px on all sides per user direction. Replaces the prior
     padding:0 2px 2px (which kept the sticky stats bar flush with
     the scroll container's top edge). */
  padding: 16px;
  background: var(--bg);
}

/* Pedro 2026-05-17: when the As-Client view's main-content-area is
   flex-column + overflow:hidden (inline style on that one container),
   #professionalsContainer becomes the actual scrolling region — so the
   filter button + post-task banner stay pinned at the top while only
   the cards grid scrolls. min-height:0 is the flex-child fix that lets
   it shrink to its parent's available space instead of overflowing.
   The .result-header-container's sticky positioning still works
   correctly relative to this new scroll container. */
#professionalsContainer {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
/* Pedro 2026-05-17: same trick for the Task Feed view — the post-task
   banner stays pinned at the top, only the activity feed (posted tasks
   list) scrolls. */
#taskFeedActivity {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Messages column — right sidebar for chat list */
.messages-column {
  width: 15%;
  min-width: 200px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border-hard);
  /* Matched to sidebar/main height after Phase 1 of Sample-3 redesign
     (was 200; now 108 since the tab-header-strip is hidden). */
  height: calc(100vh - 108px);
  /* Stick to the viewport so the messages list stays visible while the
     provider grid scrolls. Same pattern as .sidebar-filter on the left. */
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.dark-mode .messages-column { background: #141f17; border-color: #232e26; }
.msg-col-header {
  padding: 12px 12px 11px;
  margin-top: 2px;
  border-bottom: 1px solid var(--border-hard);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.msg-col-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 6px;
}
.msg-col-actions {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.msg-col-actions span { cursor: pointer; }
.msg-col-actions span:hover { color: var(--green); }
.msg-col-search {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-hard);
}
.msg-col-search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-hard);
  border-radius: 14px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 10px;
  color: var(--text-1);
  outline: none;
  box-sizing: border-box;
}
.msg-col-search input:focus { border-color: var(--green); }
.msg-col-list {
  flex: 1;
  overflow-y: auto;
}
.msg-item {
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.msg-item:hover {
  background: var(--bg);
}
.msg-avatar {
  position: relative;
  flex-shrink: 0;
}
.msg-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2ea84a, #1e7a33);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.msg-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: #4ade80;
  border: 1.5px solid var(--surface);
  border-radius: 50%;
}
.msg-info {
  flex: 1;
  min-width: 0;
}
.msg-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.msg-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-time {
  font-size: 8px;
  color: var(--text-3);
  flex-shrink: 0;
}
.msg-preview {
  font-size: 9px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.msg-preview.unread {
  color: var(--text-1);
  font-weight: 700;
}
/* "has-events" — chat unread OR unseen agreement events. Subtle visual
   cue so the user notices something needs attention even when chat is
   technically read but a payment/review/etc. just landed. */
.msg-item.has-events {
  background: linear-gradient(90deg, rgba(46,168,74,.06), transparent 70%);
  border-left: 3px solid var(--green);
  padding-left: 7px; /* base 10px - 3px border = 7px to keep avatar aligned */
}
.msg-item.has-events .msg-name { font-weight: 800; color: var(--text-1); }
.msg-item.has-events .msg-time { color: var(--green); font-weight: 700; }
.msg-unread-badge {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Per-row kebab menu trigger (Pedro 2026-05-18) ────────────
 * Three-dot button on the right edge of each conversation row.
 * Subtle by default, becomes visible on row hover or focus. The
 * popup it spawns lives at body-level (.msg-kebab-menu) so it
 * escapes the row's overflow-clip and z-index stack.
 * ─────────────────────────────────────────────────────────────── */
.msg-item { position: relative; }
.msg-kebab-btn {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  opacity: 0;
  transition: opacity .12s ease, background .12s ease, color .12s ease;
  flex-shrink: 0;
  margin-left: 4px;
  padding: 0;
}
.msg-kebab-btn svg { width: 16px; height: 16px; }
.msg-item:hover .msg-kebab-btn,
.msg-item:focus-within .msg-kebab-btn { opacity: .65; }
.msg-kebab-btn:hover {
  opacity: 1 !important;
  background: rgba(46, 168, 74, .12);
  color: var(--green);
}
.msg-kebab-btn:focus-visible {
  opacity: 1;
  outline: 2px solid var(--green);
  outline-offset: 1px;
}
@media (hover: none) { .msg-kebab-btn { opacity: .5; } }

/* Mute indicator inline with the contact name */
.msg-muted-ico {
  width: 11px;
  height: 11px;
  vertical-align: -1px;
  color: var(--text-3);
  margin-left: 3px;
  opacity: .85;
}
.msg-item.is-muted .msg-name { color: var(--text-3); }
.msg-item.is-muted .msg-unread-badge { background: var(--text-3); }

/* ── Kebab popup menu ─────────────────────────────────────────
 * Body-level absolute-positioned popup. Anchored by JS to the
 * trigger button (below-right by default, flips to above-left
 * on viewport edges). CareConnect-themed: green accent, our
 * surface + border variables, subtle drop shadow.
 * ─────────────────────────────────────────────────────────────── */
.msg-kebab-menu {
  position: fixed;
  z-index: 999999;
  width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .06);
  padding: 5px;
  font-family: inherit;
  animation: mkmFadeIn .12s ease-out;
}
@keyframes mkmFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mkm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: none;
  background: transparent;
  color: var(--text-1);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  border-radius: 6px;
  transition: background .1s ease, color .1s ease;
}
.mkm-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-2);
  transition: color .1s ease;
}
.mkm-item:hover {
  background: rgba(46, 168, 74, .08);
  color: var(--green);
}
.mkm-item:hover svg { color: var(--green); }
.mkm-item.mkm-danger:hover {
  background: rgba(239, 68, 68, .08);
  color: #ef4444;
}
.mkm-item.mkm-danger:hover svg { color: #ef4444; }
.mkm-item:focus-visible {
  outline: none;
  background: rgba(46, 168, 74, .12);
  color: var(--green);
}
.mkm-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}
.msg-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--text-3);
}
.msg-empty-icon {
  font-size: 28px;
  margin-bottom: 6px;
}
.msg-empty-text {
  font-size: 10px;
  font-weight: 600;
}
/* Floating chat button — shown only on mobile/tablet */
.msg-floating-btn {
  display: none;
}
@media (max-width: 900px) {
  .messages-column {
    display: none;
  }
  .msg-floating-btn {
    display: flex;
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 20px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(46,168,74,.4);
    z-index: 100;
  }
}

/* Sidebar labels */
.sidebar-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 6px 0;
}
.sidebar-label:not(:first-child) { margin-top: 14px; }

/* Input containers */
.custom-input-container {
  display: flex;
  align-items: center;
  background: var(--surface) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  margin-bottom: 10px;
  transition: var(--transition);
  min-height: 38px;
}
body.dark-mode .custom-input-container {
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.1) !important;
}
.custom-input-container:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}
.input-icon {
  margin-right: 8px;
  font-size: 13px;
  flex-shrink: 0;
  color: var(--green);
  font-weight: 800;
}
.borderless-input {
  flex: 1; width: 100%;
  border: none !important; outline: none !important;
  padding: 0 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text-1) !important;
  background: transparent !important;
}
.borderless-input::placeholder {
  color: var(--text-3) !important;
  font-weight: 400 !important;
}
select.borderless-input { cursor: pointer; }
select.borderless-input option { background: var(--surface); color: var(--text-1); }
input[type="number"].borderless-input::-webkit-inner-spin-button,
input[type="number"].borderless-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Checkbox list */
.checkbox-list { display: flex; flex-direction: column; gap: 3px; }
.custom-checkbox-label {
  display: flex;
  align-items: center;
  padding: 6px 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
body.dark-mode .custom-checkbox-label {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.07);
}
.custom-checkbox-label:hover { border-color: var(--green); color: var(--green); transform: translateX(2px); }
.custom-checkbox-label .checkbox-input { display: none; }
.custom-checkbox-label::before {
  content: "";
  display: inline-block;
  width: 13px; height: 13px;
  margin-right: 8px;
  border: 2px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
  transition: var(--transition);
}
.custom-checkbox-label:has(input[type="checkbox"]:checked),
.custom-checkbox-label.checked {
  background: var(--green-light);
  color: var(--green);
  border-color: var(--green);
}
body.dark-mode .custom-checkbox-label:has(input[type="checkbox"]:checked),
body.dark-mode .custom-checkbox-label.checked {
  background: rgba(46,168,74,.1);
}
.custom-checkbox-label:has(input[type="checkbox"]:checked)::before,
.custom-checkbox-label.checked::before {
  border-color: var(--green); background: var(--green);
  box-shadow: inset 0 0 0 2.5px #fff;
}

/* Radio group */
.radio-group { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.custom-radio-label {
  display: flex;
  align-items: center;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  padding: 2px 0;
}
.custom-radio-label input[type="radio"] { display: none; }
.custom-radio-label::before {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;
  margin-right: 8px;
  border: 2px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
  transition: var(--transition);
}
.custom-radio-label:has(input[type="radio"]:checked) span { color: var(--green); font-weight: 700; }
.custom-radio-label:has(input[type="radio"]:checked)::before {
  border-color: var(--green); background: var(--green);
  box-shadow: inset 0 0 0 2px #fff;
}

/* Slider */
.budget-slider-container { margin-bottom: 10px; }
.budget-slider-container label {
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 700;
  color: var(--text-2); margin-bottom: 6px;
}
.budget-slider-container input[type=range] { appearance: none; width: 100%; background: transparent; }
.budget-slider-container input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 14px; width: 14px;
  border-radius: 50%; background: var(--green);
  cursor: pointer; margin-top: -5px;
  box-shadow: 0 2px 5px rgba(0,0,0,.2);
}
.budget-slider-container input[type=range]::-webkit-slider-runnable-track {
  height: 4px; background: #d3d3d3; border-radius: 4px;
}
body.dark-mode .budget-slider-container input[type=range]::-webkit-slider-runnable-track { background: #333; }

/* GO button */
.go-btn {
  background: var(--green); color: #fff; border: none;
  padding: 5px 10px; border-radius: var(--radius-sm);
  font-weight: 800; font-size: 11px; cursor: pointer;
  margin-left: 5px; transition: background .2s;
}
.go-btn:hover { background: var(--green-dark); }

/* ============================================================
   GLASS BANNER + POST TASK BTN
   ============================================================ */
.post-task-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-top: 0;            /* per user direction */
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: box-shadow .25s, border-color .25s;
}
body.dark-mode .post-task-banner { background: var(--surface); }
.post-task-banner:hover {
  box-shadow: 0 8px 28px var(--green-glow);
  border-color: rgba(46,168,74,.35);
}
.banner-text h3 {
  font-size: 16px; font-weight: 800;
  color: var(--green); margin-bottom: 3px;
  font-family: 'Inter', sans-serif;
}
.banner-text p { font-size: 13px; color: var(--text-2); }

.post-job-btn {
  background: var(--green); color: #fff;
  border: none; padding: 11px 22px;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-weight: 800; font-size: 13px;
  cursor: pointer; white-space: nowrap;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(46,168,74,.3);
}
.post-job-btn:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46,168,74,.4);
}

/* ============================================================
   RESULT HEADER
   ============================================================ */
.result-header-container {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  padding: 14px 8px 12px;
  border-bottom: 1px solid var(--border-hard);
  /* Pin to the top of the scrolling .main-content-area so the
     "Accounts Found" counter stays visible as the user scrolls through
     the provider grid below. Background is opaque so cards don't show
     through; z-index keeps it above cards but below modals. */
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
}
.result-counter {
  font-size: 13px; font-weight: 700;
  color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.result-counter span {
  background: var(--green); color: #fff;
  padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 800;
}
.task-stats {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
}
.stat-clickable {
  cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background .2s;
  display: inline-flex; align-items: baseline; gap: 4px;
  font-size: 13px;
}
.stat-clickable:hover { background: rgba(0,0,0,.05); }
body.dark-mode .stat-clickable:hover { background: rgba(255,255,255,.06); }
.stat-num { font-weight: 800; font-size: 13px; line-height: 1; }
.text-blue  { color: var(--blue); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.stat-divider { opacity: .3; margin: 0 2px; }

/* ============================================================
   PROFESSIONAL ID CARD (Landscape PRC Style)
   ============================================================ */
.professional-grid {
  display: grid;
  /* Desktop: exactly 3 columns per Pedro's spec. Responsive
     breakpoints below collapse to 2 on tablet and 1 on phone so the
     cards don't get crushed at smaller widths. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 20px;
}
@media (max-width: 1024px) {
  .professional-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .professional-grid { grid-template-columns: 1fr; }
}

/* ── REDESIGNED provider card (option B) ──
   Vertical block: dark-green header band + table-style body + footer
   with action button. Matches the modal/task-card "branded chrome".
   All inner elements inherit font-family from the page so the Inter
   stack stays consistent — no element should declare a different
   font-family inside this card. */
.professional-card {
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex !important;
  flex-direction: column !important;
  gap: 0;
  padding: 0;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.professional-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px var(--green-glow);
  border-color: var(--green);
}

/* Dark-green header band — same color token as modals + task cards. */
.prof-card-head {
  background: var(--nav-bg);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-family: inherit;
}
.prof-card-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.prof-card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.18);
  font-family: inherit;
}
.prof-card-name-block { min-width: 0; }
.prof-card-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.prof-card-role {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,.78);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin: 2px 0 0;
  font-family: inherit;
}
.prof-card-verified {
  width: 14px;
  height: 14px;
  color: #fff;
  flex-shrink: 0;
}
.prof-card-rank {
  /* Pedro 2026-05-17: moved from the dark head chip into the body
     row, so the chip now sits on a light card background. Switched
     palette to a green-tinted pill so it reads cleanly there.
     Still works on dark backgrounds via the dark-mode override below
     in case any caller still places it on a dark surface. */
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(46,168,74,.12);
  color: var(--green, #1e7a33);
  letter-spacing: .3px;
  font-family: inherit;
  flex-shrink: 0;
}
body.dark-mode .prof-card-rank {
  background: rgba(46,168,74,.18);
  color: #4ade80;
}

/* Body — table-style rows: [label chip] [value]. Same pattern as the
   task-feed posted-task cards. */
.prof-card-body {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(86px, max-content) 1fr;
  gap: 8px 14px;
  align-items: start;
}
.prof-card-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--text-3);
  text-transform: uppercase;
  white-space: nowrap;
  padding-top: 2px;
  font-family: inherit;
}
.prof-card-label .lucide-ico {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--green-dark, #1e7a33);
  background: var(--green-light, #e8f7ec);
  border-radius: 5px;
  padding: 4px;
  box-sizing: content-box;
}
.prof-card-value {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-1);
  word-break: break-word;
  font-family: inherit;
  font-weight: 600;
}
.prof-card-value-money {
  font-weight: 800;
  color: var(--green-deep, #1e7a33);
}
.prof-card-status-on {
  color: var(--green-deep, #1e7a33);
  font-weight: 700;
}
.prof-card-status-off {
  color: var(--text-3);
  font-weight: 600;
}

/* Footer — right-aligned solid-green VIEW PROFILE button. Reuses the
   existing .view-btn class so the global click handler stays wired,
   but overrides its visual to match the rest of the app's primary
   green action buttons (Send, Submit, etc.).
   margin-top:auto pushes the footer to the bottom of the card so
   the button sits at the same vertical position across every card
   in a row regardless of body content height (some cards have
   3-line locations, some 1-line — without this the buttons drift
   up and down across the grid). Grid items stretch to row height
   by default, so the auto-margin has real space to consume. */
.prof-card-foot {
  margin-top: auto;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(0,0,0,.06);
  display: flex;
  justify-content: flex-end;
  font-family: inherit;
}
.professional-card .prof-card-foot .view-btn {
  width: auto;
  padding: 8px 18px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  cursor: pointer;
  transition: background .2s;
  font-family: inherit;
  margin-top: 0;
}
.professional-card .prof-card-foot .view-btn:hover {
  background: var(--green-deep, #1e7a33);
  color: #fff;
}

/* Dark-mode tweaks — keep the body readable on a dark card surface. */
body.dark-mode .professional-card { border-color: rgba(255,255,255,.08); }
body.dark-mode .prof-card-foot { border-top-color: rgba(255,255,255,.08); }

/* Left side: photo + badges — pinned to top */
.card-left {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 80px;
  position: sticky;
  top: 0;
}

.card-photo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.card-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.badge-verified,
.badge-available {
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 20px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-verified {
  background: rgba(46,168,74,0.1);
  color: var(--green);
}

.badge-available {
  background: rgba(59,130,246,0.1);
  color: var(--blue);
}

/* Right side: all info */
.card-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-info h4 {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 2px 0;
  color: var(--text-1);
}

.card-info .role {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.stars-val {
  color: var(--gold);
  font-weight: 800;
}

.rank {
  color: var(--text-3);
}

.card-price {
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
  background: rgba(46,168,74,0.1);
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
  align-self: flex-start;
  margin: 4px 0;
}

.card-location {
  font-size: 10px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 3px;
}

.view-btn {
  width: 100%;
  padding: 6px 0;
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
  border-radius: 8px;
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.view-btn:hover {
  background: var(--green);
  color: white;
}

/* Mobile */
@media (max-width: 600px) {
  .professional-grid {
    grid-template-columns: 1fr;
  }
  .card-left {
    width: 70px;
  }
  .card-photo {
    width: 60px;
    height: 60px;
    font-size: 20px;
  }
}

/* ============================================================
   MODAL OVERLAY & CONTAINER
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  justify-content: center; align-items: center;
  opacity: 0; transition: opacity .3s;
}
.modal-overlay.show { display: flex; opacity: 1; }

.modal-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 92%; max-width: 560px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  transform: translateY(-16px);
  transition: transform .3s;
}
.modal-overlay.show .modal-container { transform: translateY(0); }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-hard);
}
body.dark-mode .modal-header { border-color: #232e26; }
.modal-title { font-family: 'Inter', sans-serif; font-size: 17px; font-weight: 800; color: var(--green); }
.close-btn {
  background: none; border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 20px; font-weight: 700; color: var(--text-3);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.close-btn:hover { background: rgba(239,68,68,.1); color: var(--red); }

.modal-body { padding: 18px 22px; max-height: 70vh; overflow-y: auto; }
.modal-label {
  display: block; font-size: 10px; font-weight: 800;
  color: var(--text-3); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: .7px;
}

.modal-row { display: flex; gap: 10px; align-items: flex-end; }
.modal-col { flex: 1; }
.modal-body .custom-input-container:not(.textarea-container) {
  min-height: 42px; height: 42px; margin-bottom: 12px;
}
.textarea-container {
  align-items: flex-start; padding-top: 10px;
  min-height: 80px !important; height: auto !important;
  margin-bottom: 14px;
}
.textarea-input { resize: none; font-weight: 400 !important; color: var(--text-2) !important; }

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-hard);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--surface2);
}
body.dark-mode .modal-footer { background: rgba(255,255,255,.02); border-color: #232e26; }

.cancel-btn {
  background: transparent; border: 1.5px solid var(--border-hard);
  padding: 10px 20px; border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif; font-weight: 700; color: var(--text-2);
  cursor: pointer; transition: var(--transition);
}
.cancel-btn:hover { background: var(--bg); border-color: var(--text-3); }

/* Star rating */
.modal-star {
  font-size: 22px; color: #ccc;
  transition: transform .2s, color .2s;
  user-select: none; line-height: 1;
  cursor: pointer;
}
.modal-star:hover { transform: scale(1.3); }
#datePickerContainer { display: none; flex-direction: column; width: 100%; }

/* ============================================================
   TASK HISTORY MODAL
   ============================================================ */
.history-modal {
  max-width: 820px !important;
  width: 94% !important;
  height: 480px;
  display: flex;
  flex-direction: column;
}
.history-modal .agree-header  { flex-shrink: 0; }
.history-modal .history-tabs  { flex-shrink: 0; }
.history-modal > div:nth-child(3) { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.history-modal .history-table-header { flex-shrink: 0; }
.history-modal .agree-footer { flex-shrink: 0; }
.history-tabs {
  display: flex; border-bottom: 1px solid var(--border-hard);
  background: var(--surface);
}
body.dark-mode .history-tabs { background: var(--surface); border-color: #232e26; }
.history-tab-btn {
  flex: 1; padding: 13px 0;
  background: transparent; border: none;
  border-bottom: 3px solid transparent;
  font-family: 'Inter', sans-serif;
  font-weight: 800; font-size: 12px; color: var(--text-3);
  cursor: pointer; text-transform: uppercase; letter-spacing: .5px;
  transition: var(--transition);
}
.history-tab-btn:hover { color: var(--green); background: var(--green-light); }
body.dark-mode .history-tab-btn:hover { background: rgba(46,168,74,.06); }
.history-tab-btn.active { color: var(--green); border-bottom-color: var(--green); }

.history-table-header {
  display: flex; padding: 11px 18px;
  background: var(--surface2);
  font-size: 10px; font-weight: 800;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border-hard);
}
body.dark-mode .history-table-header { background: rgba(255,255,255,.02); border-color: #232e26; }

.history-pane { display: none; }
.history-pane.active { display: block; }

/* Each row is exactly 50px tall — 5 rows = 250px fixed body */
.history-row {
  display: flex; align-items: center;
  height: 50px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-hard);
  font-size: 12px;
  transition: background .15s;
  background: var(--surface);
  flex-shrink: 0;
}
body.dark-mode .history-row { background: var(--surface); border-color: #232e26; }
.history-row:hover { background: var(--surface2); }
.history-row.empty-slot {
  color: var(--text-3);
  font-style: italic;
  font-size: 11px;
  justify-content: center;
  pointer-events: none;
  user-select: none;
}
.history-row.empty-slot:hover { background: var(--surface); }

.col-check  { width: 28px; flex-shrink: 0; }
.col-name   { flex: 2.4; padding-right: 10px; }
.col-desc   { flex: 3.4; padding-right: 10px; }
.col-budget { flex: 1.3; padding-right: 10px; }
.col-status { flex: 0 0 96px; text-align: center; padding-right: 8px; }

.history-cb-input { cursor: pointer; accent-color: var(--green); }
.cell-name  { font-weight: 700; color: var(--text-1); }
.cell-desc  { color: var(--text-2); font-size: 11px; }
.cell-budget{ color: var(--green); font-weight: 800; }

/* Status badges — all share the same pill shape as Active */
.badge-blue   { display: inline-block; background: rgba(59,130,246,.12); color: var(--blue);  padding: 4px 10px; border-radius: 20px; font-weight: 800; font-size: 10px; letter-spacing: .2px; }
.badge-green  { display: inline-block; background: rgba(46,168,74,.12);  color: var(--green); padding: 4px 10px; border-radius: 20px; font-weight: 800; font-size: 10px; letter-spacing: .2px; }
.badge-red    { display: inline-block; background: rgba(239,68,68,.12);  color: var(--red);   padding: 4px 10px; border-radius: 20px; font-weight: 800; font-size: 10px; letter-spacing: .2px; }
.badge-orange { display: inline-block; background: rgba(245,158,11,.14); color: #d97706;      padding: 4px 10px; border-radius: 20px; font-weight: 800; font-size: 10px; letter-spacing: .2px; }

.history-modal-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px;
  background: var(--surface); border-top: 1px solid var(--border-hard);
}
body.dark-mode .history-modal-footer { border-color: #232e26; }
.clear-history-btn { color: var(--red) !important; border-color: var(--red) !important; background: rgba(239,68,68,.05) !important; }
.clear-history-btn:hover { background: rgba(239,68,68,.12) !important; }
.delete-history-btn { background: var(--text-1) !important; box-shadow: none !important; }
.delete-history-btn:hover { background: #333 !important; }
body.dark-mode .delete-history-btn { background: #4ade80 !important; color: #0c1410 !important; }

/* ============================================================
   TASK DETAIL MODAL — LANDSCAPE STYLE
   ============================================================ */
#taskDetailOverlay.modal-overlay { align-items: center; }

.task-detail-container {
  max-width: 780px !important;
  border-radius: 18px !important;
  overflow: hidden;
}

/* Header strip */
.td-header {
  background: var(--nav-bg);
  padding: 12px 22px;
  display: flex; justify-content: space-between; align-items: center;
}
.td-brand-name { font-size: 11px; font-weight: 800; color: #4ade80; letter-spacing: .4px; }
.td-task-id    { font-size: 9px; color: rgba(255,255,255,.35); letter-spacing: .8px; margin-top: 2px; }
.td-header-right { display: flex; align-items: center; gap: 10px; }
.task-detail-close-btn {
  background: rgba(255,255,255,.1); border: none;
  width: 26px; height: 26px; border-radius: 50%;
  color: rgba(255,255,255,.6); font-size: 15px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.task-detail-close-btn:hover { background: rgba(255,255,255,.2); }

/* Landscape body — two columns */
.td-body {
  display: flex;
}

/* LEFT — title + description */
.td-left {
  flex: 0 0 230px;
  border-right: 1px dashed var(--border-hard);
  padding: 18px 20px;
  display: flex; flex-direction: column; justify-content: space-between;
}
body.dark-mode .td-left { border-color: #2a3d2e; }
.td-title {
  font-size: 18px; font-weight: 800; color: var(--text-1);
  margin: 0 0 14px; line-height: 1.25;
}
.td-desc-lbl {
  font-size: 9px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 5px;
}
.td-desc-text {
  font-size: 12px; color: var(--text-2); line-height: 1.65;
}
.td-timestamp-block {
  margin-top: 16px; padding-top: 12px;
  border-top: 0.5px solid var(--border-hard);
}
body.dark-mode .td-timestamp-block { border-color: #232e26; }
.td-ts-label { font-size: 9px; color: var(--text-3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; }
.td-ts-val   { font-size: 11px; font-weight: 700; color: var(--green); }

/* RIGHT — 3-col fields grid */
.td-right { flex: 1; padding: 16px 20px; }

.td-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.td-field {
  padding: 9px 0;
  border-bottom: 0.5px solid var(--border-hard);
  padding-right: 16px;
}
body.dark-mode .td-field { border-color: #232e26; }
.td-field:nth-child(3n) { padding-right: 0; }
.td-field.no-border { border-bottom: none; }
.td-field-label {
  font-size: 9px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px;
}
.task-detail-field-value {
  font-size: 13px; font-weight: 700; color: var(--text-1);
}
.task-detail-field-value.green { color: var(--green); }
.task-detail-field-value.amber { color: #d97706; }
.task-detail-field-value.blue  { color: var(--blue); }
.task-detail-field-value.red   { color: var(--red); }

/* Interested button */
.task-detail-interested-btn {
  background: none; border: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 800;
  color: var(--green); cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; gap: 5px;
  transition: color .2s;
}
.task-detail-interested-btn:hover { color: var(--green-dark); }
.td-interested-num { font-size: 16px; font-weight: 800; line-height: 1; }
.td-interested-arrow { font-size: 10px; opacity: .7; }

/* Interested expanded grid */
.td-interested-panel {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0.5px solid var(--border-hard);
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  animation: fadeUp .2s ease;
}
body.dark-mode .td-interested-panel { border-color: #232e26; }
.td-interested-panel.open { display: grid; }

.task-detail-person {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: var(--radius-md);
  cursor: pointer; border: 0.5px solid var(--border-hard);
  transition: background .15s, border-color .15s;
}
.task-detail-person:hover { background: var(--green-light); border-color: rgba(46,168,74,.3); }
body.dark-mode .task-detail-person:hover { background: rgba(46,168,74,.08); }
.task-detail-person-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.task-detail-person-name { font-size: 12px; font-weight: 700; color: var(--text-1); }
.task-detail-person-skill { font-size: 10px; color: var(--text-3); }
.task-detail-person-arrow { font-size: 12px; color: var(--text-3); margin-left: auto; }

/* Footer */
.td-footer {
  border-top: 0.5px solid var(--border-hard);
  padding: 10px 22px;
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--surface2);
}
body.dark-mode .td-footer { border-color: #232e26; }
.td-close-footer {
  background: transparent; border: 1.5px solid var(--border-hard);
  padding: 6px 18px; border-radius: 20px;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
  color: var(--text-2); cursor: pointer; transition: var(--transition);
}
.td-close-footer:hover { background: var(--bg); }

.td-edit-btn {
  background: rgba(59,130,246,.1);
  border: 1.5px solid rgba(59,130,246,.2);
  padding: 6px 18px; border-radius: 20px;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
  color: var(--blue); cursor: pointer; transition: var(--transition);
}
.td-edit-btn:hover { background: rgba(59,130,246,.18); border-color: rgba(59,130,246,.35); }
.td-edit-btn:disabled { opacity: .35; cursor: not-allowed; }

.td-cancel-btn {
  background: rgba(239,68,68,.1);
  border: 1.5px solid rgba(239,68,68,.2);
  padding: 6px 18px; border-radius: 20px;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
  color: var(--red); cursor: pointer; transition: var(--transition);
}
.td-cancel-btn:hover { background: rgba(239,68,68,.2); border-color: rgba(239,68,68,.35); }
.td-cancel-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Clickable row */
.history-row:not(.empty-slot) { cursor: pointer; }
.history-row:not(.empty-slot):hover { background: rgba(46,168,74,.05) !important; }
body.dark-mode .history-row:not(.empty-slot):hover { background: rgba(46,168,74,.08) !important; }

/* ===== PROFILE VIEW MODAL — LANDSCAPE ===== */
#profileViewOverlay.modal-overlay { align-items: center; z-index: 10001 !important; }
.pv-header {
  background: var(--nav-bg);
  padding: 14px 22px;
  display: flex; align-items: center; gap: 14px;
}
.pv-avatar-lg {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff; font-size: 16px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 2px solid rgba(255,255,255,.2);
}
.pv-header-info { flex: 1; }
.pv-name  { font-size: 14px; font-weight: 800; color: #fff; margin: 0 0 2px; }
.pv-skill { font-size: 11px; color: rgba(255,255,255,.5); }
.pv-close {
  background: rgba(255,255,255,.1); border: none;
  width: 26px; height: 26px; border-radius: 50%;
  color: rgba(255,255,255,.6); font-size: 15px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pv-close:hover { background: rgba(255,255,255,.2); }

/* Stats grid — portrait layout: 2 columns × 3 rows so the 6 stat
   cells stack neatly inside the 440px-wide modal. Each cell gets a
   right + bottom border for the grid feel; the last column / last
   row drop their respective border so the edge stays clean. */
.pv-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-bottom: 0.5px solid var(--border-hard);
}
body.dark-mode .pv-grid { border-color: #232e26; }
.pv-cell {
  padding: 12px 16px;
  border-right: 0.5px solid var(--border-hard);
  border-bottom: 0.5px solid var(--border-hard);
}
body.dark-mode .pv-cell { border-color: #232e26; }
/* Right column drops its right border. */
.pv-cell:nth-child(2n) { border-right: none; }
/* Last row drops its bottom border (matches the grid's outer
   border-bottom which already separates this row from the next
   section). */
.pv-cell:nth-last-child(-n+2) { border-bottom: none; }
.pv-lbl { font-size: 9px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.provider-detail-value { font-size: 13px; font-weight: 700; color: var(--text-1); }
.provider-detail-value.green { color: var(--green); }
.provider-detail-value.gold  { color: var(--gold); }
.provider-detail-value.red   { color: var(--red); }


/* pv-footer and provider-contact-btn moved to expanded profile section below */
.provider-contact-btn {
  background: var(--green); color: #fff; border: none;
  padding: 9px 22px; border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: 13px;
  cursor: pointer; transition: background .2s;
}
.provider-contact-btn:hover { background: var(--green-dark); }

/* ============================================================
   CONFIRM MODAL
   ============================================================ */
.confirm-modal {
  max-width: 360px !important; padding: 32px !important;
  text-align: center; border: none !important;
  border-radius: 20px !important;
  animation: scaleUp .3s cubic-bezier(.175,.885,.32,1.275) forwards;
}
@keyframes scaleUp { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm-icon-circle {
  width: 60px; height: 60px;
  background: rgba(239,68,68,.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.confirm-title { font-family: 'Inter', sans-serif; font-size: 20px; font-weight: 800; color: var(--text-1); margin-bottom: 8px; }
body.dark-mode .confirm-title { color: #eef3f0; }
.confirm-desc { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 24px; }
.confirm-btn-group { display: flex; gap: 10px; }
.btn-cancel-modern {
  flex: 1; padding: 12px; background: var(--bg); color: var(--text-2);
  border: none; border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: background .2s;
}
body.dark-mode .btn-cancel-modern { background: #2a3a2e; color: #9ab0a0; }
.btn-cancel-modern:hover { background: var(--border-hard); }
.btn-delete-modern {
  flex: 1; padding: 12px; background: var(--red); color: #fff;
  border: none; border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 4px 14px rgba(239,68,68,.25);
}
.btn-delete-modern:hover { background: #dc2626; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(239,68,68,.35); }
.btn-confirm-payment {
  flex: 1; padding: 12px; background: var(--green); color: #fff;
  border: none; border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 4px 14px rgba(46,168,74,.25);
}
.btn-confirm-payment:hover { background: var(--green-dark); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(46,168,74,.35); }

/* ============================================================
   MOBILE FILTER TOGGLE
   ============================================================ */
.filter-toggle-btn {
  display: none; background: var(--green); color: #fff;
  border: none; border-radius: 30px;
  padding: 9px 18px; font-weight: 700; font-size: 13px;
  margin-bottom: 12px; cursor: pointer; width: 100%; text-align: center;
  box-shadow: 0 2px 8px rgba(46,168,74,.3);
}

/* Mobile bottom nav — hidden by default, shown via media query */
.mobile-bottom-nav { display: none; }

/* ============================================================
   RESPONSIVE — MOBILE APP FEEL
   ============================================================ */

/* ---- Tablet ---- */
@media (max-width: 900px) {
  .tab-link { font-size: 12px; padding: 9px 4px; }
  .logo-text { font-size: 18px; }
  .main-nav-top { display: none; }
}

/* ---- Mobile (≤ 600px) — Full App Experience ---- */
@media (max-width: 600px) {

  /* Hide top strip entirely on mobile */
  .main-nav-top { display: none; }

  /* Nav bottom becomes a compact app header */
  .main-nav-bottom {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
  }

  /* Profile card — compact horizontal pill */
  .profile-card { min-width: unset; flex-direction: row; align-items: center; gap: 8px; }
  .profile-card-bottom { display: none; }
  .profile-card-top { gap: 8px; }
  .avatar-fallback { width: 36px; height: 36px; font-size: 13px; }
  .profile-info .profile-stars { display: none; }
  .profile-info .profile-meta { display: none; }
  .username { font-size: 11px; font-weight: 800; color: #fff; white-space: nowrap; }

  /* Search — full row below header */
  .search-container { grid-column: 1 / -1; order: 3; max-width: 100%; }
  .search-input { font-size: 14px; padding: 11px 100px 11px 14px; border-radius: 12px; }
  .search-btn { padding: 8px 16px; font-size: 13px; }

  /* Logo — compact */
  .logo-container { margin-left: 0; }
  .logo-text { font-size: 16px; letter-spacing: -.3px; }

  /* Bottom mobile tab bar — note the [data-redesign-hidden] override
     below: when the home is Service-Hub-only (Phase 1 of the
     Sample-3 redesign), the bottom nav is hidden on mobile too,
     since its 5 buttons mirror the desktop tab strip that's now
     suppressed. Without this stronger selector the !important
     declaration would force the nav back into view. */
  .mobile-bottom-nav[data-redesign-hidden="phase1-sample3"] {
    display: none !important;
  }
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--nav-bg);
    border-top: 1px solid rgba(255,255,255,.08);
    z-index: 200;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -4px 20px rgba(0,0,0,.25);
  }
  .mob-tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    background: transparent; border: none;
    color: rgba(255,255,255,.45);
    font-family: 'Inter', sans-serif;
    font-size: 9px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .3px;
    cursor: pointer;
    transition: color .2s;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-tab-btn .mob-icon { font-size: 20px; line-height: 1; }
  .mob-tab-btn.active { color: #4ade80; }
  .mob-tab-btn.active .mob-icon { filter: drop-shadow(0 0 6px rgba(74,222,128,.5)); }

  /* Add bottom padding so content isn't hidden behind bottom nav */
  .app-wrapper { padding-bottom: 68px; }

  /* Tab header — scrollable row on mobile */
  .tab-header-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-header { flex-wrap: nowrap; min-width: max-content; }
  .tab-link { flex: none; min-width: 100px; font-size: 12px; padding: 10px 12px; }

  /* Banner */
  .tab-top-banner { font-size: 13px; padding: 12px 14px; }

  /* Dual layout — stack vertically */
  .tab-main-body.dual-layout {
    flex-direction: column !important;
    min-height: auto;
    gap: 0;
  }

  /* Sidebar becomes a slide-down drawer */
  .sidebar-filter {
    display: none;
    width: 100% !important;
    height: auto !important;
    max-height: 70vh;
    border-right: none;
    border-bottom: 1px solid var(--border-hard);
    padding: 14px;
    overflow-y: auto;
    animation: slideDown .25s ease;
  }
  .sidebar-filter.open { display: block; }
  @keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

  /* Main content full width */
  .main-content-area {
    height: auto;
    min-height: 50vh;
    padding: 12px;
  }

  /* Filter toggle — visible, full width */
  .filter-toggle-btn {
    display: flex !important;
    align-items: center; justify-content: center;
    gap: 6px;
    width: 100%; margin-bottom: 12px;
    padding: 11px;
    font-size: 14px; font-weight: 800;
    border-radius: 12px;
  }

  /* Glass banner — keep horizontal, just tighten padding */
  .post-task-banner { padding: 14px 14px; border-radius: 14px; gap: 10px; }
  .banner-text h3 { font-size: 14px; }
  .banner-text p { font-size: 12px; }
  .post-job-btn { padding: 10px 16px; font-size: 13px; white-space: nowrap; }

  /* Cards — 2-column grid */
  .professional-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .professional-card { padding: 14px 10px 12px; border-radius: 14px; }
  .card-photo { width: 54px; height: 54px; font-size: 18px; }
  .card-info h4 { font-size: 13px; }
  .card-info .role { font-size: 9px; }
  .card-price { font-size: 12px; }
  .card-location { font-size: 10px; margin-bottom: 8px; }
  .view-btn { font-size: 11px; padding: 8px; border-radius: 8px; }
  .badge-verified, .badge-available { font-size: 8px; padding: 2px 5px; }

  /* Stats row — compact */
  .result-counter { font-size: 12px; }
  .task-stats { font-size: 11px; }
  .stat-clickable { padding: 3px 5px; }

  /* Coming soon */
  .coming-soon-wrapper { min-height: 50vh; padding: 20px; }
  .coming-soon-card { padding: 28px 20px; border-radius: 18px; }
  .coming-soon-icon { font-size: 44px; }
  .coming-soon-card h3 { font-size: 20px; }
  .coming-soon-card p { font-size: 12px; }
  .return-btn { width: 100%; padding: 13px; font-size: 14px; }

  /* Modals — full-screen bottom sheet on mobile */
  .modal-overlay { align-items: flex-end; }
  .modal-container {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 22px 22px 0 0 !important;
    max-height: 92vh;
    display: flex; flex-direction: column;
    transform: translateY(40px);
  }
  .modal-overlay.show .modal-container { transform: translateY(0); }
  .modal-body { overflow-y: auto; flex: 1; padding: 16px; }
  .modal-header { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .modal-row { flex-direction: column; gap: 0; }
  .modal-col { width: 100%; }
  .modal-body .custom-input-container:not(.textarea-container) { height: 46px; min-height: 46px; }

  /* History modal — bottom sheet */
  .history-modal { max-width: 100% !important; border-radius: 22px 22px 0 0 !important; }
  .history-pane { max-height: 45vh; }
  .history-table-header { font-size: 9px; padding: 9px 12px; }
  .history-row { padding: 11px 12px; }
  .col-desc { display: none; }
  .history-modal-footer { padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .history-tab-btn { font-size: 10px; padding: 11px 0; }

  /* Confirm modal — centered small card */
  .modal-overlay:has(.confirm-modal) { align-items: center; }
  .confirm-modal {
    width: 88% !important;
    max-width: 320px !important;
    border-radius: 20px !important;
  }

  /* Hide desktop tab wrapper */
  .desktop-tabs-wrapper { display: none; }
}

/* Very small phones — keep 1 column. The redesigned provider card
   (option B) has a header band + 4 body rows + footer, so squeezing
   two cards into a sub-360px viewport would crush the content.
   Override the legacy 1fr 1fr rule. */
@media (max-width: 360px) {
  .professional-grid { grid-template-columns: 1fr; gap: 10px; }
}
/* ============================================================
   COMING SOON CARDS - RESTORED & FIXED
   ============================================================ */
.coming-soon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  min-height: calc(100vh - 250px);
  padding: 40px 20px;
}

.coming-soon-card {
  max-width: 380px;
  width: 100%;
  padding: 40px 30px;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--border-hard);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

body.dark-mode .coming-soon-card {
  background: var(--surface);
  border-color: #2a3d2e;
}

.coming-soon-icon {
  font-size: 56px;
  margin-bottom: 16px;
  display: inline-block;
}

.coming-soon-card h3 {
  font-family: 'Inter', sans-serif;
  color: var(--text-1);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

body.dark-mode .coming-soon-card h3 {
  color: #4ade80;
}

.coming-soon-card p {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.return-btn {
  padding: 10px 22px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 12px rgba(46,168,74,0.3);
}

.return-btn:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
}


.tab-main-body.dual-layout .coming-soon-wrapper {
  flex: 1;
  min-height: auto;
  padding: 40px;
}



/* ============================================================
   EXPANDED PUBLIC PROFILE VIEW (Client-Safe)
   Fixed box — header/tabs/footer pinned, content area locked
   ============================================================ */
.profile-view-container {
  /* Portrait orientation: narrower than the old 640px landscape so
     the modal feels like a profile card rather than a wide info
     panel. The 6-cell stats grid below collapses to 2 columns at
     this width and reads top-to-bottom naturally. */
  max-width: 440px !important;
  width: 94% !important;
  border-radius: 18px !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto;
}

.pv-badge-pill {
  display: inline-block;
  font-size: 9px; font-weight: 800;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(46,168,74,.15); color: #4ade80;
}
.pv-badge-avail { background: rgba(59,130,246,.15); color: #60a5fa; }

/* Header — fixed */
.pv-header { flex-shrink: 0; }

/* Tabs strip — fixed */
.pv-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-hard);
  background: var(--surface);
  flex-shrink: 0;
}
body.dark-mode .pv-tabs { background: var(--surface); border-color: #232e26; }
.provider-view-tab-btn {
  flex: 1; padding: 11px 8px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 700;
  color: var(--text-3);
  background: transparent; border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all .2s;
}
.provider-view-tab-btn:hover { color: var(--green); background: var(--green-light); }
body.dark-mode .provider-view-tab-btn:hover { background: rgba(46,168,74,.06); }
.provider-view-tab-btn.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 800;
}

/* Tab panels — ALL same fixed height, scroll inside */
.provider-view-tab-panel {
  display: none;
  height: 340px;
  overflow-y: auto;
}
.provider-view-tab-panel.active { display: block; }

/* Footer — fixed */
.pv-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-hard);
  background: var(--surface2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
body.dark-mode .pv-footer { border-color: #232e26; background: rgba(255,255,255,.02); }

/* About section */
.pv-about-section, .pv-skills-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-hard);
}
body.dark-mode .pv-about-section, body.dark-mode .pv-skills-section { border-color: #232e26; }
.pv-about-label {
  font-size: 9px; font-weight: 800; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .7px;
  margin-bottom: 6px;
}
.pv-about-text {
  font-size: 13px; color: var(--text-2); line-height: 1.65;
}
.pv-skill-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.provider-skill-tag {
  font-size: 10px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
  background: var(--green-light); color: var(--green);
}
body.dark-mode .provider-skill-tag { background: rgba(46,168,74,.1); }

/* Credentials tab */
.pv-cred-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 16px 20px;
}
.provider-credential-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex; align-items: flex-start; gap: 10px;
  transition: border-color .2s;
}
body.dark-mode .provider-credential-card { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.06); }
.provider-credential-card:hover { border-color: var(--green); }
.provider-credential-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
body.dark-mode .provider-credential-icon { background: rgba(46,168,74,.1); }
.provider-credential-info { flex: 1; min-width: 0; }
.provider-credential-name { font-size: 12px; font-weight: 700; color: var(--text-1); margin-bottom: 2px; }
.provider-credential-detail { font-size: 10px; color: var(--text-3); }
.provider-credential-verified {
  font-size: 9px; font-weight: 800;
  color: var(--green);
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 4px;
}

.pv-cred-note {
  padding: 10px 20px 14px;
  font-size: 11px; color: var(--text-3);
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2);
  border-top: 1px solid var(--border-hard);
}
body.dark-mode .pv-cred-note { background: rgba(255,255,255,.02); border-color: #232e26; }

/* Portfolio tab — Pedro 2026-05-17 v2: single column, compact list-
   style rows matching the Completed Agreements list look. No aspect-
   ratio constraint — the tile auto-sizes to its content. */
.pv-portfolio-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 6px; padding: 12px 16px;
}
.provider-portfolio-item {
  /* aspect-ratio removed — tiles size to content for the compact list */
  background: var(--surface2);
  border-radius: 10px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--text-3);
  border: 1px solid var(--border);
  /* Pedro 2026-05-17: default cursor neutral. Clickable rows get their
     own cursor:pointer via inline style so non-clickable popup rows
     don't lie with a hand cursor. */
  cursor: default;
  transition: background .15s, border-color .15s;
}
/* Hover applies only to rows the renderer marked cursor:pointer.
   Pedro 2026-05-17: matched the Agreement Registry list hover —
   stronger green wash (.06 bg, .45 border) so the highlight reads
   the same as agreement rows for consistency across the app. */
.provider-portfolio-item[style*="cursor:pointer"]:hover {
  background: rgba(46,168,74,.06);
  border-color: rgba(46,168,74,.45);
}
body.dark-mode .provider-portfolio-item { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.06); }

/* Reviews tab */
.pv-reviews-list { padding: 16px 20px; }
.provider-review-card {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-hard);
}
body.dark-mode .provider-review-card { border-color: #232e26; }
.provider-review-card:last-child { border-bottom: none; }
.provider-review-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.provider-review-author { font-size: 12px; font-weight: 700; color: var(--text-1); }
.provider-review-stars { font-size: 12px; color: var(--gold); letter-spacing: 1px; }
.provider-review-text { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.provider-review-date { font-size: 10px; color: var(--text-3); margin-top: 4px; }

/* Footer — additional elements */
.pv-footer-right { display: flex; gap: 8px; }
.pv-member-since { font-size: 10px; color: var(--text-3); }
.provider-hire-btn {
  background: var(--green); color: #fff; border: none;
  padding: 9px 20px; border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: 12px;
  cursor: pointer; transition: background .2s;
  box-shadow: 0 3px 10px rgba(46,168,74,.25);
}
.provider-hire-btn:hover { background: var(--green-dark); }

/* ============================================================
   CHATBOX
   ============================================================ */
.chatbox-panel {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 380px; height: 520px;
  background: var(--surface);
  border: 1px solid var(--border-hard);
  border-radius: 18px;
  box-shadow: 0 16px 60px rgba(0,0,0,.18);
  z-index: 10005;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideUp .3s ease both;
}
@keyframes chatSlideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.chatbox-panel.open { display: flex; }
body.dark-mode .chatbox-panel { background: var(--surface); border-color: #232e26; }

/* Pedro 2026-05-17: "Open in bigger view" — click ⛶ in chatbox header to
   inflate the floating panel into a centered modal-style chat (~720×80vh)
   with a dim backdrop. Click again or close the chat to shrink back. */
.chatbox-panel.expanded {
  width: min(720px, 92vw) !important;
  height: min(800px, 84vh) !important;
  bottom: auto !important;
  right: auto !important;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  animation: chatExpandIn .22s ease both;
}
@keyframes chatExpandIn {
  from { opacity: .6; transform: translate(-50%, -50%) scale(.96); }
  to   { opacity: 1;  transform: translate(-50%, -50%) scale(1); }
}
.chatbox-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 20, 17, .45);
  backdrop-filter: blur(2px);
  z-index: 10004;            /* one below .chatbox-panel (10005) */
  display: none;
  animation: fadeIn .2s ease both;
}
.chatbox-backdrop.show { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Pedro 2026-05-17: SPLIT VIEW.
   New #chatboxBody wraps the messages list + a new #chatDetailPane.
   Default: only messages visible (detail pane hidden, messages full-width).
   When user clicks an agreement card while the chatbox is EXPANDED, JS
   adds .has-detail to the panel — messages shrink to a 38% left rail and
   the detail pane shows the agreement details in the right 62%.
   When the chatbox is NOT expanded but has-detail is set (e.g. small
   floating mode), the messages hide entirely so the detail pane gets
   the whole panel — same UX as the full modal. */
#chatboxBody {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.chatbox-detail-pane {
  display: none;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--border-hard);
  overflow-y: auto;
  min-width: 0;
}
.chatbox-detail-pane-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
  font-size: 12px; font-weight: 800; color: var(--text-1);
}
.chatbox-detail-pane-body {
  flex: 1; overflow-y: auto;
  padding: 14px;
}
.chatbox-detail-close-btn {
  background: transparent; border: none; cursor: pointer;
  width: 26px; height: 26px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 18px;
}
.chatbox-detail-close-btn:hover { background: rgba(0,0,0,.06); color: var(--text-1); }

/* Split-view active: messages on the left, detail pane on the right. */
.chatbox-panel.expanded.has-detail .chatbox-messages {
  flex: 0 0 38%;
  max-width: 38%;
}
.chatbox-panel.expanded.has-detail .chatbox-detail-pane {
  display: flex;
  flex: 1;
}

/* Non-expanded but has-detail (small floating mode) — collapse messages,
   give the detail pane the whole body. */
.chatbox-panel:not(.expanded).has-detail .chatbox-messages { display: none; }
.chatbox-panel:not(.expanded).has-detail .chatbox-detail-pane {
  display: flex;
  flex: 1;
  border-left: none;
}

.chatbox-header {
  background: var(--nav-bg);
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.chatbox-header-left { display: flex; align-items: center; gap: 10px; }
.chatbox-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.15);
}
.chatbox-name { font-size: 13px; font-weight: 800; color: #fff; margin: 0; }
.chatbox-status { font-size: 10px; color: #4ade80; margin: 0; }
.chatbox-header-actions { display: flex; gap: 4px; }
.chatbox-action-btn {
  background: rgba(255,255,255,.08); border: none;
  width: 28px; height: 28px; border-radius: 8px;
  color: rgba(255,255,255,.6); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.chatbox-action-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Pedro 2026-05-17: harden the expand-toggle button against the multi-
   click bug. Two defensive layers:
   (1) pointer-events: none on the inner SVGs so a tap is ALWAYS reported
       on the button itself (no event-target weirdness with polyline / line
       children) — bubble is unaffected, the click still reaches onclick.
   (2) touch-action: manipulation so iOS Safari doesn't insert its 300ms
       click delay or fire a phantom second event after the touch. */
.chat-expand-toggle-btn { touch-action: manipulation; }
.chat-expand-toggle-btn svg { pointer-events: none; }

/* CSS-driven icon swap — no innerHTML manipulation from JS. Default state
   shows the maximize icon (arrows-out), hides minimize. When the parent
   panel has .expanded, the swap inverts.
   Pedro 2026-05-17 follow-up: bumped to !important after a report that
   both SVGs were rendering side-by-side in the button — defensive against
   any future selector with higher specificity that might set display. */
.chat-expand-ico-maximize { display: inline-block !important; }
.chat-expand-ico-minimize { display: none          !important; }
.chatbox-panel.expanded .chat-expand-ico-maximize { display: none          !important; }
.chatbox-panel.expanded .chat-expand-ico-minimize { display: inline-block  !important; }

.chatbox-task-bar {
  background: var(--green-light);
  padding: 8px 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; color: var(--green-dark);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
body.dark-mode .chatbox-task-bar { background: rgba(46,168,74,.08); border-color: #232e26; }
.chatbox-task-icon { font-size: 13px; }
.chatbox-task-text { flex: 1; font-weight: 700; }
.chatbox-agreement-btn {
  background: var(--green); color: #fff; border: none;
  padding: 4px 10px; border-radius: 6px;
  font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 800;
  cursor: pointer; white-space: nowrap;
  transition: background .2s;
}
.chatbox-agreement-btn:hover { background: var(--green-dark); }

.chatbox-messages {
  flex: 1; overflow-y: auto;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.chat-system-msg {
  /* Pedro 2026-05-17: simplified, single-source-of-truth styling. All the
     scattered call sites in clientView.js set inline background/color
     overrides (some loud green, some yellow, some blue, etc.) which made
     the chat feel like a Christmas tree. !important here neutralizes those
     inline styles so every system message renders as a subtle, near-
     transparent grey line — timeline events you can skim past. The card-
     style banners (.chat-agreement-card, .payment-request) keep their
     colors because they are action items, not status events. */
  text-align: center !important;
  font-size: 10.5px !important;
  color: var(--text-3) !important;
  background: transparent !important;
  padding: 3px 8px !important;
  border-radius: 0 !important;
  margin: 1px 0 !important;
  display: block;
  line-height: 1.45 !important;
  font-weight: 500 !important;
  letter-spacing: .01em;
}
.chat-system-msg strong {
  color: var(--text-2) !important;
  font-weight: 600 !important;
}
.chat-system-msg .icon-pill,
.chat-system-msg svg.lucide-ico {
  width: 11px !important;
  height: 11px !important;
  opacity: .55 !important;
  vertical-align: -2px !important;
  margin-right: 2px;
}
.chat-system-msg .icon-pill { background: transparent !important; padding: 0 !important; }
body.dark-mode .chat-system-msg { color: var(--text-3) !important; background: transparent !important; }

/* ── Defensive: hide chat elements that ended up truly empty (e.g. a
   system message rendered with an empty notification body, or a stray
   empty text bubble). ── */
.chat-system-msg:empty,
.chat-msg:empty,
.chat-msg-time:empty { display: none !important; }

/* ── Hide ONLY agreement cards with literally zero children/content. ── */
.chat-agreement-card:empty { display: none !important; }
/* (Removed the `:not(:has(*))` rule — it was wrongly hiding cards that
   had children whose visibility was suppressed by the height-collapse bug.) */

/* ── Compact agreement card sizing.
   The card renders ~70px tall — small enough to keep the chat scannable,
   big enough to read the title/price/status. flex-shrink:0 keeps it from
   collapsing when other tall content shares the chat. min-height floor
   (50px) provides a safety margin if the inner content fails to render. ── */
.chat-agreement-card {
  min-height: 50px;
  flex-shrink: 0;
}
.chat-agreement-card:active { transform: scale(0.99); }

/* ── Time-gap divider ──
   Renders between messages that are >30 minutes apart so the user can
   see at a glance when the conversation paused. Format:
       ──────── 3:00 PM ────────
   Two flex-grow lines flanking a small time label.                       */
.chat-time-gap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 6px;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  user-select: none;
  opacity: .8;
}
.chat-time-gap::before,
.chat-time-gap::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-hard);
}
body.dark-mode .chat-time-gap::before,
body.dark-mode .chat-time-gap::after { background: rgba(255,255,255,.08); }

.chat-msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px; line-height: 1.55;
  position: relative;
  animation: msgFade .2s ease;
}
@keyframes msgFade { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.chat-msg.sent {
  align-self: flex-end;
  background: var(--green);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.received {
  align-self: flex-start;
  background: var(--surface2);
  color: var(--text-1);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
body.dark-mode .chat-msg.received { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.08); }
.chat-msg-time {
  font-size: 9px; opacity: .6;
  margin-top: 4px;
  text-align: right;
}
.chat-msg.received .chat-msg-time { text-align: left; }
.chat-msg-attachment {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.15);
  padding: 6px 10px; border-radius: 8px;
  margin-top: 6px;
}
.chat-msg.received .chat-msg-attachment { background: rgba(0,0,0,.04); }

.chat-agreement-card {
  background: var(--surface);
  border: 2px solid var(--green);
  border-radius: 12px;
  padding: 14px;
  margin: 4px 0;
  /* Pedro 2026-05-17: narrower + role-aware alignment so agreement
     cards read like chat bubbles (right=mine, left=theirs) instead
     of full-width banners. */
  max-width: 72%;
  align-self: center;
}
.chat-agreement-card.sent     { align-self: flex-end;   border-color: rgba(46,168,74,.45); }
.chat-agreement-card.received { align-self: flex-start; }

/* Payment-request banner gets the same role-aware narrow treatment.
   The banner is generated as a top-level <div id="payreq-XXX"> by
   buildPaymentRequestCard — selector targets that id-prefix. */
[id^="payreq-"]          { max-width: 72% !important; }
[id^="payreq-"].sent     { align-self: flex-end;   margin-left: auto;  }
[id^="payreq-"].received { align-self: flex-start; margin-right: auto; }
.chat-agreement-card .agreement-chat-title {
  font-size: 12px; font-weight: 800; color: var(--green);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px;
}
.chat-agreement-card .agreement-chat-detail {
  font-size: 11px; color: var(--text-2);
  display: flex; justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}
.chat-agreement-card .agreement-chat-detail:last-child { border-bottom: none; }
.chat-agreement-card .agreement-chat-label { color: var(--text-3); font-weight: 600; }
.chat-agreement-card .agreement-chat-value { font-weight: 700; color: var(--text-1); }
body.dark-mode .chat-agreement-card { background: var(--surface); border-color: var(--green); }

.chatbox-input-area {
  padding: 10px 10px 10px 10px;
  border-top: 1px solid var(--border-hard);
  display: flex; align-items: center; gap: 4px;
  background: var(--surface);
  flex-shrink: 0;
  box-sizing: border-box;
}
body.dark-mode .chatbox-input-area { border-color: #232e26; }
.chatbox-attach-btn {
  background: none; border: none;
  font-size: 16px; cursor: pointer;
  color: var(--text-3); transition: color .2s;
  padding: 4px;
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chatbox-attach-btn:hover { color: var(--green); }
.chatbox-input {
  flex: 1; min-width: 0;
  border: 1.5px solid var(--border-hard);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: 'Inter', sans-serif; font-size: 13px;
  color: var(--text-1); background: var(--surface2);
  outline: none; transition: border-color .2s;
}
body.dark-mode .chatbox-input { background: rgba(255,255,255,.04); color: #fff; border-color: #333; }
.chatbox-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.chatbox-voice-btn {
  background: none; border: 1px solid var(--border-hard);
  font-size: 14px; cursor: pointer;
  color: var(--text-3); transition: all .2s;
  width: 32px; height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chatbox-voice-btn:hover { border-color: var(--green); color: var(--green); }
.chatbox-send-btn,
.chatbox-agreement-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--green); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s;
  flex-shrink: 0;
}
.chatbox-send-btn:hover,
.chatbox-agreement-btn:hover { background: var(--green-deep, #1e7a33); }
/* Lucide icons inside these buttons need to read white on the green
   pill background — explicit since .lucide-ico defaults inherit
   currentColor which is fine here, but the SVG ships with no fill
   so the stroke takes the color of the parent (white via the rule
   above). */
.chatbox-agreement-btn .lucide-ico { width: 16px; height: 16px; }

/* ─── Create Agreement button — auto-hover flash to draw attention ───
   Cycles the background between the default green and the hover
   darker-green so the button looks like an invisible cursor is
   hovering over it and lifting off, on, off, on. Subtle enough not to
   feel like a strobe, but distinctly different from a static pill so
   the user's eye gets drawn there. Pauses on real hover (user
   engaged) and stops permanently after the user has opened the
   agreement modal at least once (body.has-opened-agreement, added by
   openAgreementModal — see clientView.js). Honors
   prefers-reduced-motion for accessibility. */
@keyframes chatboxAgreementHoverFlash {
  0%, 100% { background: var(--green); }
  50%      { background: var(--green-deep, #1e7a33); }
}
.chatbox-agreement-btn {
  animation: chatboxAgreementHoverFlash 1.2s ease-in-out infinite;
}
.chatbox-agreement-btn:hover { animation-play-state: paused; }
body.has-opened-agreement .chatbox-agreement-btn { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .chatbox-agreement-btn { animation: none; }
}
.chatbox-send-btn:hover { background: var(--green-dark); }

/* Chat bubble (minimized) */
.chat-bubble {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 10004;
  box-shadow: 0 6px 24px rgba(46,168,74,.4);
  transition: transform .2s;
  animation: chatSlideUp .3s ease both;
}
.chat-bubble:hover { transform: scale(1.08); }
.chat-bubble-avatar { font-size: 18px; font-weight: 800; }
.chat-bubble-dot {
  position: absolute; top: 2px; right: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--green);
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ============================================================
   AGREEMENT MODAL
   ============================================================ */
.agreement-container {
  max-width: 600px !important;
  width: 94% !important;
  height: auto;
  max-height: 92vh;
  border-radius: 18px !important;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.agree-header {
  background: var(--nav-bg);
  padding: 10px 18px;
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.agree-header-brand { font-size: 10px; color: #4ade80; font-weight: 800; letter-spacing: .4px; }
.agree-header-title { font-size: 14px; font-weight: 800; color: #fff; margin-top: 2px; }

.agree-body {
  padding: 12px 18px;
  overflow-y: auto;
  flex: 1;
}

.agree-parties {
  display: flex; align-items: center;
  justify-content: center; gap: 18px;
  padding: 8px 14px;
  background: var(--surface2);
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
body.dark-mode .agree-parties { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.06); }
.agree-party { text-align: center; }
.agree-party-label { font-size: 9px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.agree-party-name { font-size: 14px; font-weight: 800; color: var(--text-1); }
.agree-arrow { font-size: 18px; color: var(--green); font-weight: 800; }

.agree-field-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.agree-row { display: flex; gap: 10px; }
.agree-field { flex: 1; }
.agree-label {
  display: block; font-size: 10px; font-weight: 800;
  color: var(--text-3); text-transform: uppercase;
  letter-spacing: .6px; margin-bottom: 3px;
}
.agree-input, .agree-select {
  width: 100%;
  border: 1.5px solid var(--border-hard);
  border-radius: 8px;
  padding: 7px 11px;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text-1); background: var(--surface);
  outline: none; transition: border-color .2s;
}
body.dark-mode .agree-input, body.dark-mode .agree-select { background: rgba(255,255,255,.04); color: #fff; border-color: #333; }
/* Pedro 2026-05-17: <option> elements use the browser's NATIVE rendering
   for the open dropdown, which ignored our dark-mode select styling and
   left options unreadable (white text on white background — Pedro
   reported the Post Expiration dropdown looking blank in dark mode).
   Explicit background + color on `option` is one of the few things
   browsers honour for native selects. Targets every modal-side select
   AND the generic body.dark-mode select for any future ones. */
body.dark-mode .agree-select option,
body.dark-mode select option {
  background: #1a2d20;
  color: #e5e7e9;
}
/* The placeholder/disabled "Select…" option reads a touch dimmer so it
   feels less clickable than the real choices. */
body.dark-mode .agree-select option[disabled],
body.dark-mode select option[disabled] {
  color: #8a9b8e;
}
.agree-input:focus, .agree-select:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.agree-textarea {
  width: 100%;
  border: 1.5px solid var(--border-hard);
  border-radius: 8px;
  padding: 7px 11px;
  font-family: 'Inter', sans-serif;
  font-size: 13px; color: var(--text-2);
  background: var(--surface);
  outline: none; resize: none;
  transition: border-color .2s;
}
body.dark-mode .agree-textarea { background: rgba(255,255,255,.04); color: #ccc; border-color: #333; }
.agree-textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }

.agree-terms-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
body.dark-mode .agree-terms-box { background: rgba(255,255,255,.02); border-color: rgba(255,255,255,.06); }
.agree-terms-title { font-size: 11px; font-weight: 800; color: var(--text-1); margin-bottom: 6px; }
.agree-terms-list {
  list-style: none; padding: 0;
  font-size: 11px; color: var(--text-2); line-height: 1.5;
}
.agree-terms-list li::before { content: "•"; color: var(--green); font-weight: 800; margin-right: 6px; }
.agree-check-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-1);
  margin-top: 8px; cursor: pointer;
}
.agree-check-label input { accent-color: var(--green); width: 16px; height: 16px; cursor: pointer; }

.agree-signatures {
  display: flex; gap: 14px; margin-bottom: 4px;
}
.agree-sig { flex: 1; }
.agree-sig-label { font-size: 10px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.agreement-signature-box {
  height: 48px;
  border: 2px dashed var(--border-hard);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.agreement-signature-box:hover { border-color: var(--green); background: var(--green-light); }
body.dark-mode .agreement-signature-box:hover { background: rgba(46,168,74,.06); }
.agreement-signature-placeholder { font-size: 11px; color: var(--text-3); }
.agreement-signature-box.signed {
  border-color: var(--green);
  border-style: solid;
  background: var(--green-light);
}
body.dark-mode .agreement-signature-box.signed { background: rgba(46,168,74,.1); }
.agreement-signature-name {
  font-family: 'Georgia', serif;
  font-size: 16px; font-style: italic;
  font-weight: 700; color: var(--green);
}

.agree-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border-hard);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--surface2);
  flex-shrink: 0;
}
body.dark-mode .agree-footer { background: rgba(255,255,255,.02); border-color: #232e26; }
.agreement-submit-btn {
  background: var(--green); color: #fff; border: none;
  padding: 10px 24px; border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: 13px;
  cursor: pointer; transition: background .2s;
  box-shadow: 0 4px 12px rgba(46,168,74,.3);
}
.agreement-submit-btn:hover { background: var(--green-dark); }

/* ============================================================
   CHATBOX RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .chatbox-panel {
    bottom: 0; right: 0; left: 0;
    width: 100%; height: 100vh;
    border-radius: 0;
    max-height: 100vh;
  }
  /* Pedro 2026-05-17: on mobile the chat already fills the viewport,
     so the ⛶ "Open in bigger view" button is meaningless. Hide it
     and skip the backdrop entirely. */
  #chatExpandBtn { display: none !important; }
  .chatbox-backdrop { display: none !important; }
  .pv-cred-grid { grid-template-columns: 1fr; }
  /* Pedro 2026-05-17: portfolio is single-column everywhere now */
  .pv-portfolio-grid { grid-template-columns: 1fr; }
  .pv-grid { grid-template-columns: repeat(3, 1fr); }
  .profile-view-container { max-width: 100% !important; width: 100% !important; border-radius: 18px 18px 0 0 !important; }
  .profile-view-container .provider-view-tab-panel { height: 50vh; }
  .agreement-container { height: 85vh !important; max-width: 100% !important; width: 100% !important; border-radius: 18px 18px 0 0 !important; }
  .agree-row { flex-direction: column; gap: 12px; }
  .agree-signatures { flex-direction: column; }
}

/* ============================================================
   CHAT FAB + CONTACTS PANEL
   ============================================================ */
.chat-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 24px;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10003;
  box-shadow: 0 6px 28px rgba(46,168,74,.45);
  transition: transform .2s, box-shadow .2s;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 8px 32px rgba(46,168,74,.5); }
.chat-fab-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 20px; height: 20px;
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 800;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
  font-family: 'Inter', sans-serif;
}

.chat-contacts-panel {
  position: fixed;
  bottom: 92px; right: 24px;
  width: 320px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border-hard);
  border-radius: 18px;
  box-shadow: 0 16px 60px rgba(0,0,0,.18);
  z-index: 10004;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideUp .25s ease both;
}
.chat-contacts-panel.open { display: flex; }
body.dark-mode .chat-contacts-panel { background: var(--surface); border-color: #232e26; }

.chat-contacts-header {
  background: var(--nav-bg);
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.chat-contacts-header h4 {
  color: #fff; font-size: 15px; font-weight: 800;
  font-family: 'Inter', sans-serif;
}

.chat-contacts-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-hard);
}
body.dark-mode .chat-contacts-search { border-color: #232e26; }
.chat-contacts-search input {
  width: 100%;
  border: 1.5px solid var(--border-hard);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 12px; color: var(--text-1);
  background: var(--surface2);
  outline: none;
  transition: border-color .2s;
}
body.dark-mode .chat-contacts-search input { background: rgba(255,255,255,.04); color: #fff; border-color: #333; }
.chat-contacts-search input:focus { border-color: var(--green); }

.chat-contacts-list {
  flex: 1; overflow-y: auto;
}
.chat-contact-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.chat-contact-item:hover { background: var(--green-light); }
body.dark-mode .chat-contact-item:hover { background: rgba(46,168,74,.06); }
body.dark-mode .chat-contact-item { border-color: rgba(255,255,255,.04); }
.chat-contact-item.unread { background: rgba(46,168,74,.04); }
.chat-contact-av {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.chat-contact-online {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: #4ade80;
  border: 2px solid var(--surface);
}
.chat-contact-info { flex: 1; min-width: 0; }
.chat-contact-name { font-size: 13px; font-weight: 700; color: var(--text-1); }
.chat-contact-last { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-contact-meta { text-align: right; flex-shrink: 0; }
.chat-contact-time { font-size: 10px; color: var(--text-3); }
.chat-contact-unread {
  min-width: 18px; height: 18px;
  background: var(--green); color: #fff;
  font-size: 9px; font-weight: 800;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-top: 4px; margin-left: auto;
}

/* Chat back button */
.chatbox-back-btn {
  background: rgba(255,255,255,.08); border: none;
  width: 28px; height: 28px; border-radius: 8px;
  color: rgba(255,255,255,.7); font-size: 18px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  margin-right: 4px;
}
.chatbox-back-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Voice recording */
.chatbox-voice-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: transparent; color: var(--text-3);
  border: 1.5px solid var(--border-hard);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s;
  font-size: 16px; flex-shrink: 0;
  user-select: none; -webkit-user-select: none;
}
.chatbox-voice-btn:hover { border-color: var(--green); color: var(--green); }
.chatbox-voice-btn.recording {
  background: rgba(239,68,68,.1); border-color: #ef4444; color: #ef4444;
  animation: pulse 1s infinite;
}

.chatbox-voice-bar {
  padding: 10px 14px;
  background: rgba(239,68,68,.05);
  border-top: 1px solid rgba(239,68,68,.12);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.voice-recording-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ef4444;
  animation: pulse 1s infinite;
  flex-shrink: 0;
}
.voice-timer {
  font-family: 'Inter', monospace;
  font-size: 14px; font-weight: 800; color: #ef4444;
  flex: 1;
}
.voice-cancel-btn, .voice-send-btn {
  padding: 5px 12px; border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 700;
  border: none; cursor: pointer;
  transition: background .2s;
}
.voice-cancel-btn { background: var(--surface2); color: var(--text-2); }
.voice-cancel-btn:hover { background: var(--border-hard); }
.voice-send-btn { background: var(--green); color: #fff; }
.voice-send-btn:hover { background: var(--green-dark); }

/* Image preview */
.chatbox-img-preview {
  padding: 8px 14px;
  background: var(--surface2);
  border-top: 1px solid var(--border-hard);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
body.dark-mode .chatbox-img-preview { background: rgba(255,255,255,.03); border-color: #232e26; }
.chatbox-img-preview img {
  width: 40px; height: 40px;
  border-radius: 8px; object-fit: cover;
  border: 1px solid var(--border);
}
.chatbox-img-preview span {
  flex: 1; font-size: 11px; font-weight: 600; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chatbox-img-preview button {
  background: rgba(239,68,68,.1); border: none;
  width: 24px; height: 24px; border-radius: 6px;
  color: #ef4444; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Chat image message */
.chat-msg-image {
  max-width: 200px; border-radius: 10px;
  overflow: hidden; margin-top: 4px;
}
.chat-msg-image img {
  width: 100%; display: block;
  border-radius: 10px;
}

/* Voice message in chat */
.chat-voice-msg {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1);
  padding: 8px 12px; border-radius: 10px;
  margin-top: 4px;
}
.chat-msg.received .chat-voice-msg { background: rgba(0,0,0,.04); }
.voice-play-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: none;
  color: #fff; font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.chat-msg.received .voice-play-btn { background: var(--green); color: #fff; }
.voice-wave {
  display: flex; align-items: center; gap: 2px; flex: 1;
}
.voice-wave-bar {
  width: 3px; border-radius: 2px;
  background: rgba(255,255,255,.4);
  transition: height .2s;
}
.chat-msg.received .voice-wave-bar { background: var(--green); opacity: .4; }
.voice-duration {
  font-size: 10px; opacity: .7; font-weight: 600;
}

@media (max-width: 600px) {
  .chat-fab { bottom: 76px; right: 16px; width: 50px; height: 50px; font-size: 20px; }
  .chat-contacts-panel { bottom: 0; right: 0; left: 0; width: 100%; max-height: 70vh; border-radius: 18px 18px 0 0; }
}

/* ============================================================
   TASK COMPLETION MODAL
   ============================================================ */
.tc-container { max-width:520px !important; width:94% !important; border-radius:18px !important; overflow:hidden; }
.tc-header {
  background:var(--nav-bg); padding:16px 20px;
  display:flex; align-items:center; gap:12px;
}
.tc-header-icon { font-size:28px; }
.tc-header-title { font-size:15px; font-weight:800; color:#fff; }
.tc-header-sub { font-size:11px; color:rgba(255,255,255,.45); margin-top:2px; }
.tc-body { padding:20px; }
.tc-summary {
  background:var(--surface2); border:1px solid var(--border);
  border-radius:12px; padding:14px; margin-bottom:18px;
}
body.dark-mode .tc-summary { background:rgba(255,255,255,.03); border-color:rgba(255,255,255,.06); }
.tc-sum-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:6px 0; border-bottom:1px solid var(--border);
  font-size:12px;
}
.tc-sum-row:last-child { border-bottom:none; }
.tc-sum-label { color:var(--text-3); font-weight:600; }
.tc-sum-value { color:var(--text-1); font-weight:700; }
.tc-sum-value.tc-price { color:var(--green); font-size:14px; font-weight:800; }
.tc-question {
  font-size:14px; font-weight:800; color:var(--text-1);
  margin-bottom:14px; text-align:center;
}
.tc-options { display:flex; flex-direction:column; gap:8px; }
.tc-option-btn {
  display:flex; align-items:center; gap:12px;
  padding:14px 16px; border-radius:12px;
  background:var(--surface); border:1.5px solid var(--border-hard);
  cursor:pointer; transition:all .25s; text-align:left;
  font-family:'Inter',sans-serif;
}
body.dark-mode .tc-option-btn { background:rgba(255,255,255,.03); border-color:rgba(255,255,255,.08); }
.tc-option-btn:hover { transform:translateX(4px); }
.tc-accept:hover { border-color:var(--green); background:var(--green-light); }
body.dark-mode .tc-accept:hover { background:rgba(46,168,74,.08); }
.tc-dispute:hover { border-color:#f59e0b; background:rgba(245,158,11,.06); }
.tc-cancel-task:hover { border-color:var(--red); background:rgba(239,68,68,.04); }
.tc-opt-icon { font-size:24px; flex-shrink:0; }
.tc-opt-title { font-size:13px; font-weight:800; color:var(--text-1); display:block; }
.tc-opt-desc { font-size:11px; color:var(--text-3); display:block; margin-top:2px; }

/* ============================================================
   RATING MODAL
   ============================================================ */
.rating-modal-container {
  max-width:400px !important; border-radius:20px !important;
  overflow:hidden; text-align:center;
}
.rate-header {
  background:var(--nav-bg); padding:20px;
  display:flex; align-items:center; gap:14px;
  justify-content:center;
}
.rate-avatar {
  width:50px; height:50px; border-radius:50%;
  background:linear-gradient(135deg,var(--green),var(--green-dark));
  color:#fff; font-size:18px; font-weight:800;
  display:flex; align-items:center; justify-content:center;
  border:2px solid rgba(255,255,255,.15);
}
.rate-title { font-size:16px; font-weight:800; color:#fff; text-align:left; }
.rate-title span { color:#4ade80; }
.rate-sub { font-size:11px; color:rgba(255,255,255,.4); text-align:left; margin-top:2px; }
.rate-body { padding:24px 20px 16px; }
.rate-stars-row { display:flex; justify-content:center; gap:8px; margin-bottom:12px; }
.rate-star {
  font-size:36px; color:#ddd; cursor:pointer;
  transition:transform .15s, color .15s;
  user-select:none; line-height:1;
}
.rate-star:hover { transform:scale(1.2); }
.rate-star.active { color:#f59e0b; }
.rate-label-text {
  font-size:13px; font-weight:700; color:var(--text-3);
  margin-bottom:16px; min-height:20px;
}
.rate-comment {
  width:100%; border:1.5px solid var(--border-hard);
  border-radius:10px; padding:10px 14px;
  font-family:'Inter',sans-serif; font-size:13px;
  color:var(--text-2); background:var(--surface);
  outline:none; resize:none; transition:border-color .2s;
}
body.dark-mode .rate-comment { background:rgba(255,255,255,.04); color:#ccc; border-color:#333; }
.rate-comment:focus { border-color:var(--green); box-shadow:0 0 0 3px var(--green-glow); }
.rate-footer {
  padding:14px 20px; border-top:1px solid var(--border-hard);
  display:flex; justify-content:flex-end; gap:10px;
  background:var(--surface2);
}
body.dark-mode .rate-footer { background:rgba(255,255,255,.02); border-color:#232e26; }

/* ============================================================
   PAYMENT SUCCESS
   ============================================================ */
.pay-success-container {
  max-width:380px !important; border-radius:22px !important;
  padding:36px 28px !important; text-align:center;
  border:none !important;
  animation:scaleUp .35s cubic-bezier(.175,.885,.32,1.275) forwards;
}
.pay-success-icon { font-size:52px; margin-bottom:12px; }
.pay-success-title {
  font-family:'Inter',sans-serif; font-size:22px; font-weight:800;
  color:var(--green); margin-bottom:6px;
}
.pay-success-amount {
  font-family:'Inter',sans-serif; font-size:32px; font-weight:900;
  color:var(--text-1); letter-spacing:-1px; margin-bottom:4px;
}
.pay-success-to { font-size:13px; color:var(--text-2); margin-bottom:18px; }
.pay-success-to strong { color:var(--text-1); }
.pay-success-details {
  background:var(--surface2); border:1px solid var(--border);
  border-radius:12px; padding:12px 14px;
  text-align:left;
}
body.dark-mode .pay-success-details { background:rgba(255,255,255,.03); border-color:rgba(255,255,255,.06); }
.pay-detail-row {
  display:flex; justify-content:space-between;
  font-size:12px; padding:5px 0;
  border-bottom:1px solid var(--border);
}
.pay-detail-row:last-child { border-bottom:none; }
.pay-detail-row span:first-child { color:var(--text-3); font-weight:600; }
.pay-detail-row span:last-child { color:var(--text-1); font-weight:700; }

/* Agreement card in chat — add Mark Complete button */
.agreement-complete-btn {
  display:block; width:100%; margin-top:10px;
  padding:8px; border-radius:8px;
  background:var(--green); color:#fff; border:none;
  font-family:'Inter',sans-serif; font-size:11px; font-weight:800;
  cursor:pointer; transition:background .2s;
  box-shadow:0 2px 8px rgba(46,168,74,.25);
}
.agreement-complete-btn:hover { background:var(--green-dark); }
.agreement-complete-btn.completed {
  background:transparent; color:var(--green);
  border:1.5px solid var(--green); box-shadow:none;
  cursor:default;
}

@media (max-width:600px) {
  .tc-container, .rating-modal-container, .pay-success-container { max-width:100% !important; border-radius:22px 22px 0 0 !important; }
}

/* DEAL badge for task history */
.badge-deal {
  display: inline-block;
  background: rgba(46,168,74,.12);
  color: var(--green);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: .2px;
}
.deal-row {
  border-left: 3px solid var(--green) !important;
}
.deal-row:not(.empty-slot):hover {
  background: rgba(46,168,74,.04) !important;
}

/* ============================================================
   AGREEMENT DETAIL POPUP — opened by row click on Pending rows
   ============================================================ */
.agreement-detail-container {
  max-width: 560px !important;
  width: 94% !important;
  display: flex;
  flex-direction: column;
}
.agr-detail-header {
  background: linear-gradient(135deg, #1f3c2a 0%, #2d5a3e 100%);
  padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
  border-radius: 18px 18px 0 0;
}
.agr-detail-kicker {
  color: #4ade80; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px;
  margin: 0;
}
.agr-detail-brand {
  color: #fff; font-size: 13px; font-weight: 600;
  margin: 2px 0 0;
}
.agr-detail-top {
  padding: 18px 20px 14px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-hard);
}
body.dark-mode .agr-detail-top { border-color: #232e26; }
.agr-detail-top-left { flex: 1; min-width: 0; }
.agr-detail-top-right { flex-shrink: 0; text-align: right; }
.agr-detail-small-label {
  font-size: 10px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .5px;
  margin: 0 0 3px;
}
.agr-detail-title {
  font-size: 16px; font-weight: 700; color: var(--text-1);
  margin: 0 0 8px;
}
.agr-detail-age-chip {
  display: inline-block; padding: 3px 10px;
  border-radius: 10px;
  background: rgba(245,158,11,.14); color: #854F0B;
  font-size: 10px; font-weight: 600;
}
body.dark-mode .agr-detail-age-chip { color: #fac775; }
.agr-detail-age-chip.overdue { background: rgba(239,68,68,.14); color: #A32D2D; }
body.dark-mode .agr-detail-age-chip.overdue { color: #f09595; }
.agr-detail-serial-lbl {
  font-size: 9px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .6px;
  margin: 0 0 4px;
}
.agr-detail-serial {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 11px; font-weight: 600; color: var(--text-1);
  letter-spacing: .3px;
  margin: 0 0 6px;
}
.agr-detail-barcode {
  display: flex; justify-content: flex-end; align-items: flex-end;
  gap: 1px; height: 34px;
}
.agr-detail-barcode span {
  display: inline-block;
  background: var(--text-1);
  height: 100%;
}
body.dark-mode .agr-detail-barcode span { background: var(--text-2); }

.agr-detail-body {
  padding: 16px 20px;
  background: var(--surface);
}
.agr-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
.agr-detail-value {
  font-size: 13px; color: var(--text-1);
  margin: 0;
}
.agr-detail-value.strong { font-weight: 600; }
.agr-detail-sig-box {
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: 8px;
}
body.dark-mode .agr-detail-sig-box { background: rgba(255,255,255,.03); }
.agr-detail-sig-text {
  font-size: 12px; color: var(--text-2);
  margin: 0;
}

.agr-detail-footer {
  padding: 12px 20px;
  background: var(--surface2);
  border-top: 1px solid var(--border-hard);
  display: flex; gap: 8px; justify-content: flex-end;
  flex-wrap: wrap;
  border-radius: 0 0 18px 18px;
}
body.dark-mode .agr-detail-footer { background: rgba(255,255,255,.02); border-color: #232e26; }

.agr-detail-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  border: 1px solid var(--border-hard);
}
.agr-detail-btn-outline {
  background: transparent;
  color: var(--text-2);
}
.agr-detail-btn-outline:hover {
  background: var(--surface);
  border-color: var(--text-3);
  color: var(--text-1);
}
.agr-detail-btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.agr-detail-btn-primary:hover {
  background: #258c3d;
  border-color: #258c3d;
}
.agr-detail-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* Mobile */
@media (max-width: 600px) {
  .agreement-detail-container { max-width: 100% !important; border-radius: 22px 22px 0 0 !important; }
  .agr-detail-footer { padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .agr-detail-btn { padding: 8px 12px; font-size: 11px; }
}

/* Pending tab count styling (added for 5-tab layout) */
.history-tab-btn .tab-count {
  display: inline-block;
  margin-left: 4px;
  color: var(--text-3);
  font-weight: 600;
}
.history-tab-btn.active .tab-count { color: var(--green); }

/* ============================================================
   DEALS TAB (Hybrid experiment, feature-flagged)
   ============================================================
   Kanban-style lanes that surface every agreement's lifecycle.
   Scoped to .deals-* classes so nothing else in the app is
   affected if/when the experiment ships or is rolled back.
   ============================================================ */
.deals-tab-body {
  padding: 20px 24px 28px;
  max-width: 1400px;
  margin: 0 auto;
}
.deals-tab-header {
  margin-bottom: 18px;
}
.deals-tab-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-1);
  margin: 0 0 4px 0;
  letter-spacing: -0.5px;
}
.deals-tab-sub {
  font-size: 12px;
  color: var(--text-3);
  margin: 0;
  line-height: 1.5;
}
.deals-tab-footnote {
  margin-top: 24px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px dashed var(--border-hard);
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.6;
}

.deals-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.deals-lane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  overflow: hidden;
}
.deals-lane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}
.deals-lane-icon { font-size: 14px; line-height: 1; }
.deals-lane-title { flex: 1; }
.deals-lane-count {
  background: rgba(0,0,0,.08);
  color: inherit;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 800;
  min-width: 22px;
  text-align: center;
}
.deals-lane-body {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 420px;
}
.deals-lane-empty {
  padding: 24px 8px;
  text-align: center;
  color: var(--text-3);
  font-size: 11px;
  font-style: italic;
}

/* Per-lane head colors. Background tints match the dot indicators. */
.deals-lane-yellow { background: rgba(245, 158, 11, .10); color: #b45309; }
.deals-lane-orange { background: rgba(234, 88, 12, .10);  color: #c2410c; }
.deals-lane-blue   { background: rgba(37, 99, 235, .10);  color: #1d4ed8; }
.deals-lane-red    { background: rgba(239, 68, 68, .10);  color: #b91c1c; }
.deals-lane-green  { background: rgba(34, 197, 94, .10);  color: #15803d; }
.deals-lane-grey   { background: rgba(107, 114, 128, .10);color: #4b5563; }

/* Card styling — hooks for Chunk 2 when real data wires in. */
.deal-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.deal-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  border-color: var(--border-hard);
}
.deal-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.deal-card-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deal-card-price {
  font-size: 12px;
  font-weight: 900;
  color: var(--green);
  flex-shrink: 0;
}
.deal-card-meta {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deal-age-chip {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 6px;
}
.deal-age-fresh { background: rgba(46,168,74,.12); color: var(--green-dark); }
.deal-age-warm  { background: rgba(245,158,11,.14); color: #b45309; }
.deal-age-stale { background: rgba(239,68,68,.14); color: #b91c1c; }

@media (max-width: 720px) {
  .deals-tab-body { padding: 14px 14px 22px; }
  .deals-tab-title { font-size: 18px; }
  .deals-lanes { grid-template-columns: 1fr; gap: 10px; }
  .deals-lane { min-height: 0; }
  .deals-lane-body { max-height: 320px; }
}
