/* Mobile-first, friendly, rounded, Moving-Compared-ish vibe */
:root{
  --bg: #f4f0e6;
  --highlight: #f6f15a;
  --cream: #fff8dc;
  --surface: #ffffff;
  --ink: #141414;
  --muted: #5a574f;
  --border: #141414;
  --shadow: 0 8px 0 rgba(20,20,20,.25);
  --accent: #5b3df5;
  --accentSoft: rgba(91,61,245,.10);
  --successSoft: rgba(28,183,127,.16);
  --warningSoft: rgba(247,185,60,.20);
  --dangerSoft: rgba(239,68,68,.18);
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --pad: 18px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--font);
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--highlight) 0 280px, var(--bg) 280px 100%),
    var(--bg);
}

a{color:inherit}
button, input, select, textarea{font:inherit}
.container{max-width: 1200px; margin: 0 auto; padding: 20px var(--pad) 110px;}
@media (min-width: 768px){
  .container{padding-bottom: 20px;}
}

/* Utilities */
.row{display:flex; align-items:center; gap:10px;}
.space-between{justify-content:space-between}
.muted{color: var(--muted);}
.small{font-size: 12px;}
.pill{
  display:inline-flex; align-items:center; gap:6px;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--cream);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill[data-active="true"]{background: var(--highlight);}
.pill[data-tone="success"]{background: var(--successSoft);}
.pill[data-tone="warning"]{background: var(--warningSoft);}
.pill[data-tone="danger"]{background: var(--dangerSoft);}
.card{
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card.flat{box-shadow:none}
.card.pad{padding: 14px;}
.h1{font-size: 20px; font-weight: 700; margin:0;}
.h2{font-size: 16px; font-weight: 700; margin:0;}
.kv{display:grid; grid-template-columns: 1fr; gap: 10px;}
@media (min-width: 540px){
  .kv{grid-template-columns: 1fr 1fr;}
}
.kv .item{padding: 10px 12px; border: 2px solid var(--border); border-radius: var(--radius-md); background: var(--cream);}
.kv .label{font-size: 12px; color: var(--muted); margin-bottom: 4px;}
.kv .value{font-size: 14px; font-weight: 600;}

/* Layout */
.shell{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  position: relative;
}
.listPane,
.detailPane{
  border-radius: 24px;
  background: rgba(255,255,255,.6);
  padding: 10px;
}
@media (min-width: 768px){
  .shell{
    grid-template-columns: 360px 1fr;
    align-items: start;
  }
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--highlight);
  border-bottom: 3px solid var(--border);
  box-shadow: 0 6px 0 rgba(20,20,20,.2);
}
.topbar-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px var(--pad);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.brand{
  display:flex; align-items:center; gap:10px;
}
.logo{
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 6px 0 rgba(20,20,20,.25);
  border: 2px solid var(--border);
}
.icon-btn{
  width: 44px; height: 44px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--cream);
  display:grid; place-items:center;
  cursor:pointer;
  box-shadow: var(--shadow);
}

.search{
  display:flex; gap:10px; align-items:center;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search input{
  border: none; outline: none; width: 100%;
  font-size: 14px;
}

.leadlist{display:flex; flex-direction:column; gap: 12px;}
.leadcard{
  padding: 16px;
  cursor:pointer;
  transition: transform .08s ease, background .12s ease;
}
.leadcard:hover{transform: translateY(-2px);}
.leadcard[data-selected="true"]{background: var(--highlight);}
.leadmeta{display:flex; align-items:center; justify-content:space-between; gap: 10px; margin-top: 8px;}
.summary{margin-top: 6px; color: var(--muted); font-size: 13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.badges{display:flex; gap:8px; align-items:center; flex-wrap:wrap;}
.channel-dots{display:flex; gap:6px; align-items:center;}
.dot{width:8px;height:8px;border-radius:999px;background:rgba(20,20,20,.25);}
.dot.on{background:var(--accent);}

.detail{min-height: 60vh; background: var(--surface);}
.detail-header{
  padding: 14px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}
.detail-title{display:flex; flex-direction:column; gap: 6px;}
.actions{display:flex; gap: 8px; flex-wrap:wrap; justify-content:flex-end;}
.btn{
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--cream);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.btn.primary{background: var(--accent); color: white; border-color: var(--border);}
.btn:active{transform: translateY(1px);}
.tabs{display:flex; gap: 8px; padding: 0 14px 14px;}
.tab{
  flex: 1;
  height: 44px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--cream);
  cursor:pointer;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.tab[data-active="true"]{background: var(--highlight);}
.detail-body{padding: 0 14px 14px;}
.timeline{display:flex; flex-direction:column; gap: 10px;}
.timeline-item{
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--cream);
}
.timeline-item .head{display:flex; justify-content:space-between; gap: 10px;}
.timeline-item .title{font-weight: 800;}
.timeline-item .body{margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.35;}
.timeline-item details{margin-top:6px;}
.timeline-item summary{cursor:pointer; color: var(--accent); font-weight: 700; font-size: 13px;}
.banner{
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px dashed var(--border);
  background: var(--cream);
}

/* Mobile: list vs detail */
@media (max-width: 767px){
  .shell[data-mode="list"] .detailPane{display:none;}
  .shell[data-mode="detail"] .listPane{display:none;}
}

/* Mobile comms dock */
.commsDock{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
  background: var(--highlight);
  border-top: 2px solid var(--border);
  z-index: 40;
}
@media (min-width: 768px){
  .commsDock{display:none;}
}
.commsRow{
  max-width: 1200px; margin: 0 auto;
  display:grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.commsAction{
  height: 56px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--cream);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap: 4px;
  cursor:pointer;
  box-shadow: var(--shadow);
}
.commsAction span{font-size: 12px; font-weight: 700;}
.commsAction:disabled{opacity:.45; cursor:not-allowed}

/* Bottom sheet */
.sheetOverlay{
  position: fixed; inset: 0;
  background: rgba(20,20,20,.45);
  display:none;
  z-index: 60;
}
.sheetOverlay[data-open="true"]{display:block;}
.sheet{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-width: 700px;
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 0 -20px 50px rgba(20,20,20,.25);
  padding: 16px;
}
.sheet .handle{width:48px;height:5px;border-radius:999px;background:rgba(11,16,32,.18);margin:6px auto 10px;}
.sheet textarea{
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  min-height: 110px;
  outline:none;
}
.sheet select, .sheet input{
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  outline:none;
}
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap: 10px;}
@media (max-width: 480px){.grid2{grid-template-columns: 1fr;}}
