/* =====================================================================
   Job Submission Tracker — interface styles

   Direction: a working control desk for a recruiting team.
   Deep Prussian navy chrome against a cool paper workspace, marigold
   reserved for the one thing that matters most on each screen, and
   monospace numerals so counts line up in a column the way a ledger does.

   Type: Bricolage Grotesque (display) / Plus Jakarta Sans (text) /
         JetBrains Mono (data)
   ===================================================================== */

:root{
  /* chrome */
  --navy-900:#08172E;
  --navy-800:#0E2444;
  --navy-700:#143257;
  --navy-600:#1C4272;

  /* brand */
  --blue-700:#17407F;
  --blue-600:#1E4FA3;
  --blue-500:#2C68C9;
  --blue-100:#D7E5F9;
  --blue-50:#EDF3FC;

  /* accent — used sparingly, for the standout figure only */
  --gold-600:#C97F12;
  --gold-500:#E39A2A;
  --gold-100:#FBEBCE;
  --gold-50:#FDF6EA;

  /* status */
  --green-600:#0E7C63;
  --green-50:#E3F4EF;
  --red-600:#BC3B32;
  --red-50:#FBEAE8;

  /* surface + text */
  --bg:#F3F6FA;
  --surface:#FFFFFF;
  --surface-2:#F8FAFC;
  --ink:#0C1B30;
  --body:#41546E;
  --muted:#77899E;
  --line:#E2E8F1;
  --line-soft:#EDF1F6;

  --r-sm:6px;
  --r:10px;
  --r-lg:14px;

  --shadow-sm:0 1px 2px rgba(12,27,48,.06);
  --shadow:0 1px 3px rgba(12,27,48,.07), 0 8px 24px -12px rgba(12,27,48,.18);
  --shadow-lg:0 24px 60px -20px rgba(8,23,46,.35);

  --sans:"Plus Jakarta Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --display:"Bricolage Grotesque",var(--sans);
  --mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
}

*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}

body{
  font-family:var(--sans);
  background:var(--bg);
  color:var(--ink);
  font-size:15px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

.mono,.tabular{font-family:var(--mono);font-variant-numeric:tabular-nums}

a{color:var(--blue-600);text-decoration:none}
a:hover{text-decoration:underline}

:focus-visible{outline:2.5px solid var(--blue-500);outline-offset:2px;border-radius:3px}

h1,h2,h3{font-family:var(--display);letter-spacing:-.021em;margin:0}

/* =========================== layout =========================== */
.shell{display:flex;min-height:100vh}

.sidebar{
  /* The column itself does not scroll: the nav in the middle does. Scrolling
     the whole column combined with margin-top:auto on the footer pushed
     "Sign out" outside the scrollable area, where it could not be reached. */
  overflow:hidden;
  width:246px;flex:0 0 246px;
  background:linear-gradient(178deg,var(--navy-700) 0%,var(--navy-800) 46%,var(--navy-900) 100%);
  color:#B9CADC;
  display:flex;flex-direction:column;
  padding:20px 14px 16px;
  position:sticky;top:0;
  height:100vh;
  height:100dvh;   /* dvh excludes the browser's own bars, so the footer is
                      not pushed under them on a phone. Ignored where
                      unsupported, leaving the 100vh above. */
  z-index:30;
}
/* a thin marigold seam where the chrome meets the workspace */
.sidebar::after{
  content:"";position:absolute;top:0;right:0;width:1px;height:100%;
  background:linear-gradient(180deg,rgba(227,154,42,.55),rgba(227,154,42,0) 42%);
}

.brand{display:flex;align-items:center;gap:11px;padding:4px 8px 0;margin-bottom:26px;text-decoration:none;flex:0 0 auto}
.brand:hover{text-decoration:none}
.brand-mark{
  width:36px;height:36px;flex:0 0 36px;border-radius:9px;
  background:linear-gradient(150deg,var(--gold-500),var(--gold-600));
  color:var(--navy-900);
  display:grid;place-items:center;
  font-family:var(--display);font-weight:800;font-size:15px;letter-spacing:-.03em;
  box-shadow:0 4px 14px -4px rgba(227,154,42,.6);
}
.brand-text{display:flex;flex-direction:column;line-height:1.15}
.brand-name{color:#fff;font-family:var(--display);font-weight:700;font-size:15.5px;letter-spacing:-.02em}
.brand-sub{font-family:var(--mono);font-size:9.5px;text-transform:uppercase;letter-spacing:.14em;color:#7E93AC}

.nav{
  display:flex;flex-direction:column;gap:2px;
  flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.nav-group{
  font-family:var(--mono);font-size:9.5px;text-transform:uppercase;letter-spacing:.15em;
  color:#69809B;padding:16px 10px 6px;
}
.nav-link{
  display:flex;align-items:center;gap:10px;
  padding:9px 10px;border-radius:8px;
  color:#B9CADC;font-size:14px;font-weight:500;text-decoration:none;
  position:relative;transition:background .13s ease,color .13s ease;
}
.nav-link svg{width:17px;height:17px;flex:0 0 17px;stroke:currentColor;fill:none;stroke-width:1.7;opacity:.85}
.nav-link:hover{background:rgba(255,255,255,.07);color:#fff;text-decoration:none}
.nav-link.is-active{background:rgba(255,255,255,.1);color:#fff;font-weight:600}
.nav-link.is-active svg{opacity:1;stroke:var(--gold-500)}
.nav-link.is-active::before{
  content:"";position:absolute;left:-14px;top:50%;transform:translateY(-50%);
  width:3px;height:20px;border-radius:0 3px 3px 0;background:var(--gold-500);
}
.nav-link--quiet{font-size:13px;color:#8DA1B8;padding:7px 10px}

.sidebar-foot{
  margin-top:0;padding-top:14px;border-top:1px solid rgba(255,255,255,.09);
  flex:0 0 auto;   /* always visible at the bottom, never pushed off */
}
.who{display:flex;align-items:center;gap:10px;padding:8px 10px 12px}
.who-avatar{
  width:32px;height:32px;flex:0 0 32px;border-radius:9px;
  background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.14);
  display:grid;place-items:center;color:#fff;
  font-family:var(--mono);font-size:12px;font-weight:600;
}
.who-text{display:flex;flex-direction:column;min-width:0}
.who-name{color:#fff;font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.who-meta{font-family:var(--mono);font-size:9.5px;text-transform:uppercase;letter-spacing:.11em;color:#7E93AC}

/* =========================== main =========================== */
.main{flex:1;min-width:0;display:flex;flex-direction:column;padding:0 32px 24px}

.topbar{
  position:sticky;top:0;z-index:20;
  margin:0 -32px 22px;padding:16px 32px;
  background:rgba(243,246,250,.88);
  backdrop-filter:saturate(180%) blur(10px);
  -webkit-backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:16px;
}
.topbar-titles{display:flex;flex-direction:column;min-width:0;flex:1 1 auto;overflow:hidden}
.page-title{font-size:23px;font-weight:700;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.page-kicker{
  font-family:var(--mono);font-size:10px;text-transform:uppercase;
  letter-spacing:.14em;color:var(--muted);margin-bottom:3px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;
}
.topbar-actions{margin-left:auto;display:flex;align-items:center;gap:9px;flex:0 0 auto}

/* The account menu sits apart from the action buttons. It has to stay out of
   any scrolling container, because overflow clips an absolutely positioned
   dropdown and the menu simply never appeared. */
.topbar-user{flex:0 0 auto;display:flex;align-items:center;margin-left:9px;position:relative;z-index:2}
.menu-btn{
  display:none;align-items:center;justify-content:center;
  width:38px;height:38px;padding:0;
  background:var(--surface);border:1px solid var(--line);border-radius:9px;
  cursor:pointer;color:var(--ink);
}
.menu-btn svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.9}

.foot{
  margin-top:auto;padding-top:26px;
  display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;
  font-size:12px;color:var(--muted);
}

/* =========================== panels =========================== */
.panel{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  box-shadow:var(--shadow);
  margin-bottom:20px;
  overflow:hidden;
}
.panel-head{
  padding:15px 20px;
  border-bottom:1px solid var(--line-soft);
  background:linear-gradient(180deg,var(--surface),var(--surface-2));
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
}
.panel-head h2{font-size:15.5px;font-weight:700}
.panel-body{padding:20px}

.eyebrow{
  font-family:var(--mono);font-size:10px;font-weight:500;
  text-transform:uppercase;letter-spacing:.13em;color:var(--muted);
}

.section-title{
  font-family:var(--display);font-size:13px;font-weight:700;
  letter-spacing:-.01em;color:var(--body);margin:0 0 10px;
}

/* =========================== stats =========================== */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(172px,1fr));gap:14px;margin-bottom:20px}
.stat{
  position:relative;overflow:hidden;
  background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-lg);padding:16px 18px;box-shadow:var(--shadow-sm);
}
.stat::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--blue-500);
}
.stat--accent::before{background:var(--gold-500)}
.stat--accent .stat-value{color:var(--gold-600)}
.stat-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.stat-label{
  font-family:var(--mono);font-size:9.5px;text-transform:uppercase;
  letter-spacing:.13em;color:var(--muted);
}
.stat-icon{
  width:28px;height:28px;border-radius:8px;display:grid;place-items:center;
  background:var(--blue-50);color:var(--blue-600);flex:0 0 28px;
}
.stat--accent .stat-icon{background:var(--gold-50);color:var(--gold-600)}
.stat-icon svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8}
.stat-value{
  font-family:var(--mono);font-variant-numeric:tabular-nums;
  font-size:31px;font-weight:600;line-height:1.05;letter-spacing:-.035em;color:var(--ink);
}
.stat-foot{font-size:11.5px;color:var(--muted);margin-top:4px}

/* =========================== forms =========================== */
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.field{display:flex;flex-direction:column;gap:6px}
.field--full{grid-column:1/-1}

label{font-size:12.5px;font-weight:600;color:var(--body);letter-spacing:.005em}
.hint{font-size:12px;color:var(--muted);line-height:1.45}

input[type=text],input[type=date],input[type=url],input[type=email],
input[type=password],input[type=file],input[type=number],select,textarea,.input{
  font:inherit;font-size:14.5px;color:var(--ink);
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r);
  padding:10px 12px;width:100%;
  transition:border-color .13s ease,box-shadow .13s ease;
}
input[type=file]{padding:8px 12px;font-size:13.5px;color:var(--body)}
input[type=date],input[type=number],select{font-variant-numeric:tabular-nums}
select{
  appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2377899E' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 11px center;padding-right:34px;
}
textarea{min-height:128px;resize:vertical;line-height:1.6}
input:focus,select:focus,textarea:focus{
  border-color:var(--blue-500);outline:none;
  box-shadow:0 0 0 3.5px var(--blue-50);
}
input[readonly]{background:var(--surface-2);color:var(--body)}
input[readonly]:focus{border-color:var(--line);box-shadow:none}
::placeholder{color:#9DAABC}

.field-lock{position:relative}
.field-lock svg{
  position:absolute;right:11px;top:50%;transform:translateY(-50%);
  width:14px;height:14px;stroke:var(--muted);fill:none;stroke-width:1.8;pointer-events:none;
}

.check{display:flex;gap:9px;align-items:flex-start;font-weight:400;font-size:13.5px;color:var(--body);cursor:pointer}
.check input{width:auto;margin-top:2px;accent-color:var(--blue-600)}

.form-actions{
  display:flex;gap:10px;align-items:center;flex-wrap:wrap;
  margin-top:22px;padding-top:18px;border-top:1px solid var(--line-soft);
}

/* =========================== buttons =========================== */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  font:inherit;font-size:14px;font-weight:600;letter-spacing:-.005em;
  padding:10px 17px;border-radius:var(--r);border:1px solid transparent;
  cursor:pointer;text-decoration:none;line-height:1.2;white-space:nowrap;
  transition:background .13s ease,border-color .13s ease,transform .08s ease,box-shadow .13s ease;
}
.btn:hover{text-decoration:none}
.btn:active{transform:translateY(1px)}
.btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.9}
.btn--primary{
  background:linear-gradient(180deg,var(--blue-600),var(--blue-700));
  color:#fff;box-shadow:0 1px 2px rgba(23,64,127,.3),0 6px 16px -8px rgba(23,64,127,.7);
}
.btn--primary:hover{background:linear-gradient(180deg,var(--blue-700),#12356B)}
.btn--ghost{background:var(--surface);border-color:var(--line);color:var(--ink);box-shadow:var(--shadow-sm)}
.btn--ghost:hover{border-color:#C6D2E2;background:var(--surface-2)}
.btn--danger{background:var(--surface);border-color:#EFCFCB;color:var(--red-600)}
.btn--danger:hover{background:var(--red-50);border-color:#E3B6B1}
.btn--sm{font-size:12.5px;padding:6px 11px;border-radius:8px;gap:5px}
.btn--sm svg{width:13px;height:13px}

/* =========================== alerts =========================== */
.alert{
  display:flex;gap:11px;align-items:flex-start;
  border-radius:var(--r);padding:13px 16px;margin-bottom:20px;
  font-size:14px;border:1px solid;box-shadow:var(--shadow-sm);
}
.alert svg{width:17px;height:17px;flex:0 0 17px;margin-top:1px;stroke:currentColor;fill:none;stroke-width:1.9}
.alert--success{background:var(--green-50);border-color:#BFE3D8;color:#0A5B49}
.alert--error{background:var(--red-50);border-color:#EFCFCB;color:#93312A}
.alert--info{background:var(--gold-50);border-color:var(--gold-100);color:#8A5A0C}
.alert ul{margin:6px 0 0 17px;padding:0}
.alert li{margin-top:2px}

/* =========================== tables =========================== */
.table-wrap{overflow-x:auto}
table.data{width:100%;border-collapse:collapse;font-size:14px}
table.data th,table.data td{padding:12px 16px;text-align:left;vertical-align:top;border-bottom:1px solid var(--line-soft)}
table.data thead th{
  font-family:var(--mono);font-size:9.5px;font-weight:500;
  text-transform:uppercase;letter-spacing:.12em;color:var(--muted);
  background:var(--surface-2);border-bottom:1px solid var(--line);
  white-space:nowrap;padding-top:10px;padding-bottom:10px;
}
table.data tbody tr{transition:background .1s ease}
table.data tbody tr:hover{background:var(--blue-50)}
table.data tbody tr:last-child td{border-bottom:0}
table.data td.num,table.data th.num{text-align:right;font-family:var(--mono);font-variant-numeric:tabular-nums}
table.data td.num{font-weight:600}
table.data td.nowrap{white-space:nowrap}
.cell-strong{font-weight:600;color:var(--ink)}
.cell-sub{display:block;font-size:12px;color:var(--muted);margin-top:2px}
.empty{padding:46px 20px;text-align:center;color:var(--muted)}
.empty-icon{
  width:44px;height:44px;margin:0 auto 12px;border-radius:12px;
  background:var(--blue-50);color:var(--blue-500);display:grid;place-items:center;
}
.empty-icon svg{width:21px;height:21px;stroke:currentColor;fill:none;stroke-width:1.6}
.empty strong{display:block;color:var(--ink);font-weight:600;margin-bottom:3px}

/* =========================== filters =========================== */
.filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(158px,1fr));gap:14px;align-items:end}
.filters .field{gap:5px}
.filter-actions{display:flex;gap:8px;flex-wrap:wrap}

.toolbar{
  display:flex;gap:10px;align-items:center;flex-wrap:wrap;
  padding-top:16px;margin-top:16px;border-top:1px dashed var(--line);
}
.chip{
  font-family:var(--mono);font-size:11px;letter-spacing:.02em;
  border:1px solid var(--line);background:var(--surface);border-radius:100px;
  padding:5px 12px;color:var(--body);text-decoration:none;
  transition:all .13s ease;
}
.chip:hover{border-color:var(--blue-500);color:var(--blue-600);background:var(--blue-50);text-decoration:none}
.chip.is-on{
  background:var(--navy-800);border-color:var(--navy-800);color:#fff;
  box-shadow:0 2px 8px -3px rgba(8,23,46,.5);
}

/* =========================== heatmap (signature) =========================== */
.heatmap-scroll{overflow-x:auto;padding-bottom:6px}
.heatmap{display:flex;gap:3px;min-width:min-content}
.hm-labels{display:flex;flex-direction:column;gap:3px;padding-right:6px;flex:0 0 auto}
.hm-labels span{
  height:13px;font-family:var(--mono);font-size:8.5px;color:var(--muted);
  display:flex;align-items:center;line-height:1;
}
.hm-weeks{display:flex;gap:3px}
.hm-week{display:flex;flex-direction:column;gap:3px}
.hm-cell{
  width:13px;height:13px;border-radius:3px;background:var(--line-soft);
  border:1px solid rgba(12,27,48,.04);
}
.hm-cell.l1{background:var(--blue-100)}
.hm-cell.l2{background:#A8C6EE}
.hm-cell.l3{background:var(--blue-500)}
.hm-cell.l4{background:var(--blue-700)}
.hm-cell.peak{background:var(--gold-500);border-color:var(--gold-600)}
.hm-cell.void{background:transparent;border-color:transparent}
.hm-months{display:flex;gap:3px;margin:0 0 4px 24px}
.hm-months span{font-family:var(--mono);font-size:8.5px;color:var(--muted);text-align:left;
  flex:0 0 13px;white-space:nowrap;overflow:visible}
.hm-legend{
  display:flex;align-items:center;gap:6px;margin-top:12px;
  font-family:var(--mono);font-size:9.5px;color:var(--muted);
}
.hm-legend .hm-cell{width:11px;height:11px}

/* =========================== day rail =========================== */
.rail{display:flex;flex-direction:column}
.rail-row{
  display:grid;grid-template-columns:118px 1fr 42px;gap:14px;align-items:center;
  padding:8px 0;border-bottom:1px solid var(--line-soft);
}
.rail-row:last-child{border-bottom:0}
.rail-date{font-family:var(--mono);font-size:12px;color:var(--body);white-space:nowrap}
.rail-track{background:var(--line-soft);border-radius:4px;overflow:hidden}
.rail-bar{
  display:block;height:16px;border-radius:4px;min-width:3px;
  background:linear-gradient(90deg,var(--blue-500),var(--blue-600));
}
.rail-row.is-peak .rail-bar{background:linear-gradient(90deg,var(--gold-500),var(--gold-600))}
.rail-count{font-family:var(--mono);font-variant-numeric:tabular-nums;text-align:right;font-weight:600;font-size:13px}

/* =========================== source bars =========================== */
.srcbars{display:flex;flex-direction:column;gap:12px}
.srcbar-top{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:5px}
.srcbar-name{font-size:13.5px;font-weight:600;color:var(--ink)}
.srcbar-val{font-family:var(--mono);font-size:12px;color:var(--muted)}
.srcbar-track{height:8px;border-radius:4px;background:var(--line-soft);overflow:hidden}
.srcbar-fill{display:block;height:100%;border-radius:4px;background:linear-gradient(90deg,var(--blue-500),var(--blue-600))}
.srcbar:first-child .srcbar-fill{background:linear-gradient(90deg,var(--gold-500),var(--gold-600))}

/* =========================== badges =========================== */
.badge{
  display:inline-block;font-family:var(--mono);font-size:9.5px;
  text-transform:uppercase;letter-spacing:.1em;padding:3px 8px;border-radius:100px;
  border:1px solid var(--line);color:var(--body);background:var(--surface-2);white-space:nowrap;
}
.badge--admin{background:var(--blue-50);border-color:var(--blue-100);color:var(--blue-700)}
.badge--off{background:var(--red-50);border-color:#EFCFCB;color:var(--red-600)}
.badge--on{background:var(--green-50);border-color:#BFE3D8;color:var(--green-600)}

.source-tag{
  display:inline-flex;align-items:center;gap:5px;
  font-size:12px;font-weight:600;padding:3px 9px;border-radius:100px;
  background:var(--blue-50);color:var(--blue-700);border:1px solid var(--blue-100);white-space:nowrap;
}
.source-tag::before{content:"";width:5px;height:5px;border-radius:50%;background:var(--blue-500)}
.source-tag--none{background:var(--surface-2);color:var(--muted);border-color:var(--line)}
.source-tag--none::before{background:#B8C4D3}

/* =========================== misc =========================== */
.thumb{
  width:46px;height:34px;object-fit:cover;border-radius:6px;
  border:1px solid var(--line);display:block;
  transition:transform .13s ease,box-shadow .13s ease;
}
.thumb:hover{transform:scale(1.06);box-shadow:var(--shadow)}
.thumb-lg{max-width:100%;border-radius:var(--r);border:1px solid var(--line);box-shadow:var(--shadow-sm)}
.desc-clip{display:block;max-width:330px;color:var(--body);font-size:12.5px;line-height:1.5}

.pager{
  display:flex;gap:10px;align-items:center;justify-content:space-between;
  padding:13px 20px;border-top:1px solid var(--line-soft);flex-wrap:wrap;background:var(--surface-2);
}
.pager-links{display:flex;gap:4px;flex-wrap:wrap}
.pager a,.pager span.cur{
  font-family:var(--mono);font-size:12px;min-width:30px;text-align:center;
  padding:5px 9px;border:1px solid var(--line);border-radius:7px;
  color:var(--body);text-decoration:none;background:var(--surface);
}
.pager span.cur{background:var(--navy-800);border-color:var(--navy-800);color:#fff}
.pager a:hover{border-color:var(--blue-500);color:var(--blue-600);text-decoration:none}
.pager-info{font-size:12.5px;color:var(--muted);font-family:var(--mono)}

.actions-inline{display:flex;gap:6px;flex-wrap:wrap}
.actions-inline form{margin:0}

/* =========================== login =========================== */
.login-split{min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr}
.login-brand{
  position:relative;overflow:hidden;
  background:linear-gradient(165deg,var(--navy-700),var(--navy-900) 62%);
  color:#fff;padding:52px 56px;display:flex;flex-direction:column;
}
/* faint grid, like a plotted week of submissions */
.login-brand::before{
  content:"";position:absolute;inset:0;
  background-image:linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px),
                   linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px);
  background-size:26px 26px;
  mask-image:radial-gradient(ellipse 78% 62% at 72% 32%,#000,transparent 78%);
  -webkit-mask-image:radial-gradient(ellipse 78% 62% at 72% 32%,#000,transparent 78%);
}
.login-brand::after{
  content:"";position:absolute;width:420px;height:420px;border-radius:50%;
  right:-150px;top:-130px;
  background:radial-gradient(circle,rgba(227,154,42,.24),transparent 66%);
}
.login-brand > *{position:relative;z-index:1}
.login-brand .brand{margin-bottom:auto}
.login-lead{
  font-family:var(--display);font-size:38px;line-height:1.14;font-weight:700;
  letter-spacing:-.03em;margin:0 0 16px;max-width:13ch;
}
.login-lead em{font-style:normal;color:var(--gold-500)}
.login-copy{color:#A9BDD3;font-size:15px;line-height:1.6;max-width:40ch;margin:0 0 34px}
.login-points{display:flex;gap:26px;flex-wrap:wrap;padding-top:26px;border-top:1px solid rgba(255,255,255,.11)}
.login-point{display:flex;flex-direction:column;gap:1px}
.login-point b{font-family:var(--mono);font-size:19px;font-weight:600;color:#fff;letter-spacing:-.02em}
.login-point span{font-family:var(--mono);font-size:9.5px;text-transform:uppercase;letter-spacing:.13em;color:#8098B4}

.login-panel{display:grid;place-items:center;padding:40px 28px;background:var(--surface)}
.login-form{width:100%;max-width:352px}
.login-title{font-size:26px;font-weight:700;margin:0 0 5px}
.login-sub{margin:0 0 26px;font-size:14px;color:var(--muted)}
.login-form .field{margin-bottom:16px}
.login-form .btn{width:100%;padding:12px}
.login-foot{margin-top:22px;font-size:12px;color:var(--muted);text-align:center}

/* =========================== responsive =========================== */
@media (max-width:1000px){
  .login-split{grid-template-columns:1fr}
  .login-brand{display:none}
}
@media (max-width:900px){
  .form-grid{grid-template-columns:1fr}
  .main{padding:0 16px 20px}
  .topbar{margin:0 -16px 18px;padding:12px 16px}
  .menu-btn{display:inline-flex}

  /* Menu, title and account on the first line; action buttons on the second,
     so nothing is squashed and the account menu stays top right. */
  .topbar{flex-wrap:wrap;row-gap:10px}
  .menu-btn{order:0}
  .topbar-titles{flex:1 1 auto;order:1;min-width:0}
  .topbar-user{order:2;margin-left:auto}
  .topbar-actions{
    order:3;width:100%;margin-left:0;
    overflow-x:auto;padding-bottom:2px;
    -webkit-overflow-scrolling:touch;scrollbar-width:none;
  }
  .topbar-actions::-webkit-scrollbar{display:none}
  .topbar-actions .btn,
  .topbar-actions .autoref{flex:0 0 auto}
  .page-title{font-size:18px}
  .page-kicker{font-size:9.5px;letter-spacing:.1em}
  .sidebar{
    position:fixed;left:0;top:0;
    height:100vh;height:100dvh;
    transform:translateX(-100%);transition:transform .2s ease;
    box-shadow:var(--shadow-lg);
  }
  .sidebar.is-open{transform:translateX(0)}
  .page-title{font-size:19px}
  .rail-row{grid-template-columns:92px 1fr 36px;gap:10px}
  .stat-value{font-size:26px}
  .panel-body{padding:16px}
  table.data th,table.data td{padding:10px 12px}
}
@media (max-width:520px){
  .stats{grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}
  .login-panel{padding:28px 20px}
}

@media (prefers-reduced-motion:reduce){
  *{transition:none !important;animation:none !important}
  .btn:active{transform:none}
  .thumb:hover{transform:none}
}

@media print{
  .sidebar,.topbar,.filters,.toolbar,.pager,.form-actions,.menu-btn{display:none !important}
  body{background:#fff}
  .main{padding:0}
  .panel{box-shadow:none;border-color:#CBD5E1;break-inside:avoid}
  .stat{box-shadow:none}
}

/* =====================================================================
   v2 additions: password eye, paste dropzone, charts, targets, hero
   ===================================================================== */

/* ---------- password show / hide ---------- */
.pw-wrap{position:relative;display:block}
.pw-wrap input{padding-right:42px}
.pw-eye{
  position:absolute;right:5px;top:50%;transform:translateY(-50%);
  width:30px;height:30px;padding:0;display:grid;place-items:center;
  background:transparent;border:0;border-radius:7px;cursor:pointer;color:var(--muted);
}
.pw-eye:hover{background:var(--blue-50);color:var(--blue-600)}
.pw-eye svg{width:17px;height:17px}

/* ---------- paste / drop zone ---------- */
.drop{
  border:1.5px dashed var(--line);border-radius:var(--r);
  background:var(--surface-2);padding:18px;text-align:center;cursor:pointer;
  transition:border-color .14s ease,background .14s ease;margin-bottom:9px;
}
.drop:hover,.drop.is-over{border-color:var(--blue-500);background:var(--blue-50)}
.drop.has-image{border-style:solid;background:var(--surface)}
.drop-inner{display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--muted)}
.drop-inner svg{width:26px;height:26px;color:var(--blue-500);margin-bottom:3px}
.drop-main{font-size:13.5px;font-weight:600;color:var(--ink)}
.drop-sub{font-size:12px}
.drop kbd{
  font-family:var(--mono);font-size:10.5px;background:var(--surface);
  border:1px solid var(--line);border-bottom-width:2px;border-radius:4px;padding:1px 5px;color:var(--body);
}
.drop.has-image .drop-inner{display:none}
.drop-preview:empty{display:none}
.drop-preview img{max-width:100%;max-height:210px;border-radius:8px;border:1px solid var(--line)}
.drop-note{
  display:flex;align-items:center;justify-content:center;gap:10px;
  margin-top:8px;font-family:var(--mono);font-size:11px;color:var(--muted);
}
.drop-clear{
  font:inherit;font-size:11px;background:transparent;border:1px solid var(--line);
  border-radius:6px;padding:2px 8px;color:var(--red-600);cursor:pointer;
}
.drop-clear:hover{background:var(--red-50)}

/* ---------- charts ---------- */
.chart{width:100%;height:auto;display:block;overflow:visible}
.ch-grid{stroke:var(--line-soft);stroke-width:1}
.ch-line{fill:none;stroke:var(--blue-600);stroke-width:2.2;stroke-linejoin:round;stroke-linecap:round}
.ch-dot{fill:var(--surface);stroke:var(--blue-600);stroke-width:2}
.ch-dot:hover{fill:var(--gold-500);stroke:var(--gold-600);r:4.5}
.ch-target{stroke:var(--gold-500);stroke-width:1.6;stroke-dasharray:5 4}
.ch-tlab{fill:var(--gold-600);font-family:var(--mono);font-size:10px;text-anchor:end}
.ch-ylab{fill:var(--muted);font-family:var(--mono);font-size:10px;text-anchor:end}
.ch-xlab{fill:var(--muted);font-family:var(--mono);font-size:10px;text-anchor:middle}

/* ---------- target bars ---------- */
.tbars{display:flex;flex-direction:column;gap:13px}
.tbar-top{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:5px}
.tbar-name{font-size:13.5px;font-weight:600;color:var(--ink)}
.tbar-val{font-family:var(--mono);font-size:11.5px;color:var(--muted)}
.tbar-track{display:block;height:9px;border-radius:5px;background:var(--line-soft);overflow:hidden}
.tbar-fill{display:block;height:100%;border-radius:5px;background:var(--blue-500)}
.tbar--hit    .tbar-fill{background:linear-gradient(90deg,var(--green-600),#12a884)}
.tbar--near   .tbar-fill{background:linear-gradient(90deg,var(--gold-500),var(--gold-600))}
.tbar--behind .tbar-fill{background:linear-gradient(90deg,#D9736A,var(--red-600))}
.tbar--none   .tbar-fill{background:var(--line)}

/* ---------- progress ring ---------- */
.ring{position:relative;display:inline-grid;place-items:center}
.ring svg{display:block}
.ring-track{fill:none;stroke:var(--line-soft);stroke-width:9}
.ring-fill{fill:none;stroke:var(--blue-500);stroke-width:9;stroke-linecap:round;transition:stroke-dasharray .5s ease}
.ring--hit    .ring-fill{stroke:var(--green-600)}
.ring--near   .ring-fill{stroke:var(--gold-500)}
.ring--behind .ring-fill{stroke:var(--red-600)}
.ring--none   .ring-fill{stroke:var(--line)}
.ring-text{position:absolute;text-align:center;line-height:1.15}
.ring-text b{display:block;font-family:var(--mono);font-size:25px;font-weight:600;letter-spacing:-.03em;color:var(--ink)}
.ring-text span{font-family:var(--mono);font-size:9.5px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted)}

/* ---------- target summary strip ---------- */
.target-strip{display:grid;grid-template-columns:auto 1fr;gap:24px;align-items:center}
.target-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px}
.target-item{display:flex;flex-direction:column;gap:5px}
.target-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.target-label{font-family:var(--mono);font-size:9.5px;text-transform:uppercase;letter-spacing:.12em;color:var(--muted)}
.target-figure{font-family:var(--mono);font-size:13px;font-weight:600}
.target-note{font-size:12px;color:var(--muted)}
.pill{
  display:inline-block;font-family:var(--mono);font-size:9.5px;text-transform:uppercase;
  letter-spacing:.09em;padding:2px 8px;border-radius:100px;border:1px solid;
}
.pill--hit{background:var(--green-50);border-color:#BFE3D8;color:var(--green-600)}
.pill--near{background:var(--gold-50);border-color:var(--gold-100);color:var(--gold-600)}
.pill--behind{background:var(--red-50);border-color:#EFCFCB;color:var(--red-600)}
.pill--none{background:var(--surface-2);border-color:var(--line);color:var(--muted)}

/* ---------- role permission picker ---------- */
.perm-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:18px}
.perm-group{border:1px solid var(--line);border-radius:var(--r);padding:14px 16px;background:var(--surface-2)}
.perm-group h3{font-size:12.5px;font-weight:700;margin-bottom:10px;color:var(--ink)}
.perm-list{display:flex;flex-direction:column;gap:9px}
.perm-list .check{font-size:13px;align-items:flex-start}
.perm-key{font-family:var(--mono);font-size:10px;color:var(--muted);display:block}

/* ---------- targets editor grid ---------- */
.tgrid input[type=number]{
  font:inherit;font-family:var(--mono);font-size:14px;width:80px;text-align:right;
  border:1px solid var(--line);border-radius:7px;padding:7px 9px;background:var(--surface);color:var(--ink);
}
.tgrid input[type=number]:focus{border-color:var(--blue-500);outline:none;box-shadow:0 0 0 3.5px var(--blue-50)}
.tgrid input[type=text]{font-size:13.5px}

/* ---------- login hero ---------- */
.hero-media{position:absolute;inset:0;z-index:0;overflow:hidden}
.hero-media img,.hero-media video{width:100%;height:100%;object-fit:cover}
.hero-media::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(165deg,rgba(20,50,87,.86),rgba(8,23,46,.94));
}
/* Built-in animated hero: slow drifting colour fields, no asset required */
.hero-auto{position:absolute;inset:0;z-index:0;overflow:hidden;background:var(--navy-900)}
.hero-blob{position:absolute;border-radius:50%;filter:blur(64px);opacity:.55;will-change:transform}
.hero-blob.b1{width:520px;height:520px;background:#1C4272;top:-140px;left:-110px;animation:drift1 22s ease-in-out infinite alternate}
.hero-blob.b2{width:430px;height:430px;background:#C97F12;bottom:-150px;right:-90px;opacity:.34;animation:drift2 27s ease-in-out infinite alternate}
.hero-blob.b3{width:360px;height:360px;background:#0E7C63;top:38%;right:16%;opacity:.28;animation:drift3 19s ease-in-out infinite alternate}
@keyframes drift1{to{transform:translate3d(90px,70px,0) scale(1.14)}}
@keyframes drift2{to{transform:translate3d(-80px,-60px,0) scale(1.2)}}
@keyframes drift3{to{transform:translate3d(50px,-80px,0) scale(.86)}}
.hero-scan{
  position:absolute;inset:0;
  background-image:linear-gradient(rgba(255,255,255,.05) 1px,transparent 1px),
                   linear-gradient(90deg,rgba(255,255,255,.05) 1px,transparent 1px);
  background-size:30px 30px;
  mask-image:radial-gradient(ellipse 80% 66% at 68% 34%,#000,transparent 80%);
  -webkit-mask-image:radial-gradient(ellipse 80% 66% at 68% 34%,#000,transparent 80%);
}
.login-brand.has-hero::before,.login-brand.has-hero::after{display:none}

@media (prefers-reduced-motion:reduce){
  .hero-blob{animation:none !important}
}

/* ---------- responsive additions ---------- */
@media (max-width:900px){
  .target-strip{grid-template-columns:1fr;gap:18px;justify-items:center;text-align:center}
  .perm-groups{grid-template-columns:1fr}
}

/* team target panel additions */
.target-sub{
  display:block;margin-top:2px;
  font-family:var(--mono);font-size:10.5px;letter-spacing:.04em;color:var(--muted);
}
.target-foot{
  margin:16px 0 0;padding-top:14px;border-top:1px dashed var(--line);
  font-size:13px;color:var(--body);
}

/* =====================================================================
   Chat
   ===================================================================== */
.chat{
  display:grid;grid-template-columns:270px 1fr;gap:16px;
  align-items:stretch;
  /* Height of the viewport minus the topbar, notice line and footer, so the
     panes scroll internally and the page keeps a single scrollbar. */
  height:calc(100vh - 210px);
  min-height:420px;
}

.chat-side{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:var(--shadow);display:flex;flex-direction:column;overflow:hidden;height:100%;min-height:0;
}
.chat-side-head{padding:12px 14px 8px;border-bottom:1px solid var(--line-soft);background:var(--surface-2)}
.chat-list{overflow-y:auto;padding:6px;min-height:0;flex:1}
.chat-list--contacts{flex:0 0 auto;max-height:38%;border-top:0}
.chat-empty-side{margin:0;padding:14px;font-size:12.5px;color:var(--muted);line-height:1.5}

.chat-item{
  display:flex;gap:10px;align-items:center;padding:9px 10px;border-radius:9px;
  text-decoration:none;color:var(--ink);
}
.chat-item:hover{background:var(--blue-50);text-decoration:none}
.chat-item.is-active{background:var(--navy-800)}
.chat-item.is-active .chat-item-name{color:#fff}
.chat-item.is-active .chat-item-last{color:#9FB3CA}
.chat-item.is-active .chat-avatar{background:rgba(255,255,255,.16);color:#fff;border-color:transparent}

.chat-avatar{
  width:34px;height:34px;flex:0 0 34px;border-radius:10px;display:grid;place-items:center;
  background:var(--blue-50);border:1px solid var(--blue-100);color:var(--blue-700);
  font-family:var(--mono);font-size:12px;font-weight:600;
}
.chat-avatar--quiet{background:var(--surface-2);border-color:var(--line);color:var(--muted)}
.chat-avatar svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8}

.chat-item-text{min-width:0;flex:1;display:flex;flex-direction:column;gap:1px}
.chat-item-top{display:flex;align-items:center;gap:8px;justify-content:space-between}
.chat-item-name{font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-item-last{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-badge{
  font-family:var(--mono);font-size:10px;font-weight:600;line-height:1;
  background:var(--gold-500);color:var(--navy-900);
  border-radius:100px;padding:3px 6px;min-width:18px;text-align:center;
}

.chat-main{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:var(--shadow);display:flex;flex-direction:column;overflow:hidden;height:100%;min-height:0;
}
.chat-head{
  flex-shrink:0;display:flex;align-items:center;gap:11px;padding:12px 16px;flex-wrap:wrap;
  border-bottom:1px solid var(--line-soft);background:linear-gradient(180deg,var(--surface),var(--surface-2));
}
.chat-head-text{display:flex;flex-direction:column;min-width:0}
.chat-head-name{font-family:var(--display);font-size:15px;font-weight:700;letter-spacing:-.01em}
.chat-head-sub{font-family:var(--mono);font-size:10.5px;color:var(--muted);letter-spacing:.05em}

.chat-log{flex:1;min-height:0;overflow-y:auto;padding:18px 16px;display:flex;flex-direction:column;gap:10px;background:var(--bg);justify-content:flex-start}
.chat-log--monitor{background:var(--surface)}
.chat-empty-log{margin:auto;color:var(--muted);font-size:13px}

.msg{display:flex;max-width:76%}
.msg--mine{align-self:flex-end;justify-content:flex-end}
.msg--flat{max-width:100%}
.msg-bubble{
  background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:9px 12px;box-shadow:var(--shadow-sm);min-width:0;
}
.msg--mine .msg-bubble{background:var(--blue-600);border-color:var(--blue-700);color:#fff}
.msg--mine .msg-bubble a{color:#fff;text-decoration:underline}
.msg--flat .msg-bubble{border-left:3px solid var(--blue-500);border-radius:8px;width:100%}
.msg-author{
  display:block;font-size:11.5px;font-weight:700;color:var(--blue-700);margin-bottom:3px;
}
.msg-body{font-size:14px;line-height:1.5;word-break:break-word;overflow-wrap:anywhere}
.msg-when{
  display:block;margin-top:5px;font-family:var(--mono);font-size:10px;
  color:var(--muted);letter-spacing:.04em;
}
.msg--mine .msg-when{color:rgba(255,255,255,.75)}

.msg-img{display:block;margin-top:7px;border-radius:9px;overflow:hidden;max-width:260px}
.msg-img img{display:block;width:100%;height:auto;border:1px solid var(--line);border-radius:9px}
.msg-file{
  display:flex;align-items:center;gap:9px;margin-top:7px;padding:8px 10px;
  border:1px solid var(--line);border-radius:9px;background:var(--surface-2);
  text-decoration:none;color:var(--ink);max-width:280px;
}
.msg-file:hover{border-color:var(--blue-500);text-decoration:none}
.msg-file svg{width:18px;height:18px;flex:0 0 18px;stroke:var(--blue-600);fill:none;stroke-width:1.7}
.msg-file-text{display:flex;flex-direction:column;min-width:0}
.msg-file-name{font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msg-file-size{font-family:var(--mono);font-size:10px;color:var(--muted)}
.msg--mine .msg-file{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.25)}
.msg--mine .msg-file svg{stroke:#fff}
.msg--mine .msg-file-name{color:#fff}
.msg--mine .msg-file-size{color:rgba(255,255,255,.75)}

.chat-composer{flex-shrink:0;border-top:1px solid var(--line-soft);padding:11px 14px 12px;background:var(--surface)}
.chat-inputs{display:flex;gap:9px;align-items:flex-end}
.chat-inputs textarea{
  flex:1;min-height:40px;max-height:150px;resize:none;padding:9px 12px;
  border-radius:10px;font-size:14px;line-height:1.45;
}
.chat-clip{
  width:40px;height:40px;flex:0 0 40px;border-radius:10px;display:grid;place-items:center;
  border:1px solid var(--line);background:var(--surface-2);cursor:pointer;color:var(--body);
}
.chat-clip:hover{border-color:var(--blue-500);color:var(--blue-600)}
.chat-clip svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.8}
.chat-hint{margin:7px 0 0;font-size:11.5px;color:var(--muted)}

.chat-attached{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:9px}
.chip-file{
  display:inline-flex;align-items:center;gap:7px;padding:5px 9px;border-radius:100px;
  background:var(--blue-50);border:1px solid var(--blue-100);font-size:12px;color:var(--blue-700);
}
.chip-file img{width:22px;height:22px;object-fit:cover;border-radius:4px}
.chip-file button{
  border:0;background:none;cursor:pointer;color:var(--blue-700);font-size:14px;line-height:1;padding:0 2px;
}
.chat-error{
  margin-bottom:9px;padding:8px 11px;border-radius:8px;font-size:12.5px;
  background:var(--red-50);border:1px solid #EFCFCB;color:var(--red-600);
}
.chat-readonly{
  display:flex;gap:9px;align-items:center;padding:12px 16px;
  border-top:1px solid var(--line-soft);background:var(--gold-50);color:#8A5A0C;font-size:13px;
}
.chat-readonly svg{width:16px;height:16px;flex:0 0 16px;stroke:currentColor;fill:none;stroke-width:1.9}

.chat-blank{margin:auto;text-align:center;color:var(--muted);padding:40px 20px}
.chat-blank strong{display:block;color:var(--ink);margin-bottom:3px}

.nav-link .nav-count{
  margin-left:auto;font-family:var(--mono);font-size:10px;font-weight:600;
  background:var(--gold-500);color:var(--navy-900);border-radius:100px;padding:2px 6px;min-width:17px;text-align:center;
}

@media (max-width:900px){
  .chat{grid-template-columns:1fr;height:auto;min-height:0}
  .chat-side{height:auto;max-height:300px}
  .chat-main{height:auto;min-height:460px}
  .msg{max-width:88%}
}

.chat-notice{
  display:flex;gap:9px;align-items:center;margin:0 0 14px;
  padding:9px 13px;border-radius:var(--r);
  background:var(--surface-2);border:1px solid var(--line);
  font-size:12.5px;color:var(--body);
}
.chat-notice svg{width:15px;height:15px;flex:0 0 15px;stroke:var(--muted);fill:none;stroke-width:1.8}

/* =====================================================================
   Floating chat widget
   ===================================================================== */
.cw{position:fixed;right:24px;bottom:24px;z-index:60}

.cw-bubble{
  position:relative;width:56px;height:56px;border-radius:50%;
  border:0;cursor:grab;display:grid;place-items:center;
  background:linear-gradient(150deg,var(--blue-500),var(--blue-700));
  box-shadow:0 6px 20px -6px rgba(23,64,127,.75),0 2px 6px rgba(12,27,48,.2);
  color:#fff;touch-action:none;transition:transform .14s ease,box-shadow .14s ease;
}
.cw-bubble:hover{transform:scale(1.05)}
.cw-bubble:active{cursor:grabbing}
.cw-bubble.is-dragging{transform:scale(1.08);box-shadow:0 12px 30px -8px rgba(23,64,127,.85)}
.cw-bubble svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.8}
.cw-count{
  position:absolute;top:-3px;right:-3px;min-width:20px;height:20px;padding:0 5px;
  border-radius:100px;background:var(--gold-500);color:var(--navy-900);
  font-family:var(--mono);font-size:11px;font-weight:700;line-height:20px;
  border:2px solid var(--surface);
}

.cw-panel{
  position:absolute;right:0;bottom:70px;width:344px;
  height:min(460px, calc(100vh - 140px));
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:var(--shadow-lg);display:flex;flex-direction:column;overflow:hidden;
}
.cw--left .cw-panel{right:auto;left:0}
.cw--top .cw-panel{bottom:auto;top:70px}

.cw-head{
  display:flex;align-items:center;gap:8px;padding:11px 12px;
  background:linear-gradient(160deg,var(--navy-700),var(--navy-900));color:#fff;
}
.cw-title{font-family:var(--display);font-weight:700;font-size:14px;flex:1;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cw-head button,.cw-head a{
  background:none;border:0;color:#B9CADC;cursor:pointer;font-size:16px;
  line-height:1;padding:3px 5px;border-radius:6px;text-decoration:none;
}
.cw-head button:hover,.cw-head a:hover{background:rgba(255,255,255,.14);color:#fff;text-decoration:none}
.cw-back{font-size:15px}
.cw-full{font-size:14px}

.cw-body{flex:1;overflow-y:auto;padding:8px}
.cw-log{
  background:var(--bg);display:flex;flex-direction:column;gap:9px;padding:14px 12px;
  justify-content:flex-start;
}

.cw-row{
  display:flex;gap:9px;align-items:center;padding:8px 9px;border-radius:9px;
  cursor:pointer;border:0;background:none;width:100%;text-align:left;
}
.cw-row:hover{background:var(--blue-50)}
.cw-row .chat-avatar{width:30px;height:30px;flex:0 0 30px;font-size:11px}
.cw-row-text{min-width:0;flex:1;display:flex;flex-direction:column}
.cw-row-name{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cw-row-last{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cw-row-badge{
  font-family:var(--mono);font-size:10px;font-weight:700;background:var(--gold-500);
  color:var(--navy-900);border-radius:100px;padding:2px 6px;
}
.cw-group{
  font-family:var(--mono);font-size:9.5px;text-transform:uppercase;letter-spacing:.13em;
  color:var(--muted);padding:10px 9px 5px;
}
.cw-empty{padding:18px 12px;font-size:12.5px;color:var(--muted);text-align:center}

.cw-msg{display:flex;max-width:82%;align-self:flex-start}
.cw-msg--mine{align-self:flex-end;justify-content:flex-end}
.cw-msg .msg-bubble{
  padding:8px 11px;border-radius:13px 13px 13px 4px;box-shadow:0 1px 2px rgba(12,27,48,.07);
}
.cw-msg--mine .msg-bubble{border-radius:13px 13px 4px 13px}
.cw-msg .msg-author{font-size:11px;margin-bottom:2px}
.cw-msg .msg-body{font-size:13px;line-height:1.45}
.cw-msg .msg-when{font-size:9.5px;margin-top:3px}
.cw-msg .msg-img{max-width:170px;margin-top:6px}
.cw-msg .msg-file{max-width:190px;padding:6px 8px;margin-top:6px}
.cw-msg .msg-file-name{font-size:11.5px}
.cw-msg .msg-file-size{font-size:9.5px}

/* a light divider between days is unnecessary here, but breathing room helps */
.cw-log .cw-msg + .cw-msg{margin-top:0}

.cw-composer{border-top:1px solid var(--line-soft);padding:9px 10px;background:var(--surface)}
.cw-inputs{display:flex;gap:7px;align-items:flex-end}
.cw-inputs textarea{
  flex:1;min-height:36px;max-height:110px;resize:none;padding:8px 10px;
  border-radius:9px;font-size:13px;line-height:1.4;
}
.cw-clip{
  width:34px;height:34px;flex:0 0 34px;border-radius:9px;display:grid;place-items:center;
  border:1px solid var(--line);background:var(--surface-2);cursor:pointer;color:var(--body);
}
.cw-clip:hover{border-color:var(--blue-500);color:var(--blue-600)}
.cw-clip svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8}
.cw-send{
  width:34px;height:34px;flex:0 0 34px;border-radius:9px;border:0;cursor:pointer;
  background:var(--blue-600);color:#fff;font-size:14px;line-height:1;
}
.cw-send:hover{background:var(--blue-700)}
.cw-send:disabled{opacity:.55;cursor:default}
.cw-attached{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:7px}
.cw-error{
  margin-bottom:7px;padding:6px 9px;border-radius:7px;font-size:11.5px;
  background:var(--red-50);border:1px solid #EFCFCB;color:var(--red-600);
}

@media (max-width:520px){
  .cw{right:14px;bottom:14px}
  .cw-panel{
    width:calc(100vw - 28px);height:min(70vh,460px);
    right:0;left:auto;
  }
  .cw--left .cw-panel{left:0;right:auto}
}

@media print{ .cw{display:none !important} }


/* =====================================================================
   Chat monitor: read the transcript as a conversation, not a list.
   Neither side is "me" here, so the two people get distinct but equally
   neutral colours rather than the blue used for your own messages.
   ===================================================================== */
.chat-log--monitor{background:var(--bg);padding:18px 18px 22px}

.mon-msg{max-width:72%;display:flex}
.mon-msg--left{align-self:flex-start}
.mon-msg--right{align-self:flex-end;justify-content:flex-end}
.mon-msg + .mon-msg{margin-top:2px}
.mon-msg.is-first{margin-top:12px}
.mon-msg:first-child{margin-top:0}

.mon-msg .msg-bubble{
  border-radius:14px;padding:9px 13px;box-shadow:0 1px 2px rgba(12,27,48,.06);
  border-left-width:1px;width:auto;
}
.mon-msg--left  .msg-bubble{
  background:var(--surface);border:1px solid var(--line);
  border-bottom-left-radius:5px;
}
.mon-msg--right .msg-bubble{
  background:#EAF1FB;border:1px solid #CBDDF4;
  border-bottom-right-radius:5px;
}
.mon-msg--left  .msg-author{color:var(--blue-700)}
.mon-msg--right .msg-author{color:#1F6F5C}
.mon-msg .msg-when{color:var(--muted)}

.mon-legend{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-left:auto}
.mon-key{
  display:inline-flex;align-items:center;gap:6px;
  font-size:11.5px;font-weight:600;color:var(--body);
  border:1px solid var(--line);background:var(--surface);
  border-radius:100px;padding:3px 10px;white-space:nowrap;
}
.mon-key::before{content:"";width:8px;height:8px;border-radius:3px}
.mon-key--left::before{background:var(--surface);border:1px solid #B9C6D6}
.mon-key--right::before{background:#CBDDF4;border:1px solid #9FC0E6}

@media (max-width:900px){
  .mon-msg{max-width:86%}
  .mon-legend{margin-left:0;width:100%}
}

/* =====================================================================
   Image viewer (lightbox)
   Images open here rather than in a new tab, with a Download button
   alongside so a picture can be saved the same way a document can.
   ===================================================================== */
.lb{
  position:fixed;inset:0;z-index:80;
  background:rgba(8,23,46,.88);
  backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);
  display:flex;flex-direction:column;
}
.lb-bar{
  display:flex;align-items:center;gap:10px;
  padding:12px 16px;color:#fff;flex-shrink:0;
  background:linear-gradient(180deg,rgba(8,23,46,.72),transparent);
}
.lb-name{
  flex:1;min-width:0;font-size:13.5px;font-weight:600;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.lb-btn{
  border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.1);
  color:#fff;border-radius:8px;padding:6px 13px;font:inherit;font-size:13px;
  font-weight:600;cursor:pointer;text-decoration:none;line-height:1.3;
}
.lb-btn:hover{background:rgba(255,255,255,.2);color:#fff;text-decoration:none}
.lb-close{font-size:19px;line-height:1;padding:4px 11px}

.lb-stage{
  flex:1;min-height:0;display:grid;place-items:center;
  padding:0 18px 22px;overflow:auto;
}
.lb-stage img{
  max-width:100%;max-height:100%;
  border-radius:8px;box-shadow:0 24px 60px -18px rgba(0,0,0,.7);
  background:#fff;
}

/* the small magnifier hint on a chat image */
.msg-img{position:relative}
.msg-img-zoom{
  position:absolute;right:6px;bottom:6px;
  width:24px;height:24px;border-radius:6px;
  background:rgba(8,23,46,.62);color:#fff;
  display:grid;place-items:center;font-size:12px;
  opacity:0;transition:opacity .13s ease;pointer-events:none;
}
.msg-img:hover .msg-img-zoom{opacity:1}

@media (max-width:520px){
  .lb-bar{padding:10px 12px}
  .lb-name{font-size:12.5px}
  .lb-stage{padding:0 10px 16px}
}

/* =====================================================================
   The hidden attribute must always win.
   Rules like .cw-panel{display:flex} otherwise override the browser's
   [hidden]{display:none}, leaving panels stuck open.
   ===================================================================== */
[hidden]{display:none !important}

/* ---- group chat additions ---- */
.chat-side-head--action{display:flex;align-items:center;justify-content:space-between;gap:8px}
.chat-side-head--action .btn{padding:3px 9px;font-size:11.5px}

.chat-newgroup{padding:10px 12px;border-bottom:1px solid var(--line-soft);background:var(--surface-2)}
.chat-newgroup input[type=text]{margin-bottom:8px;font-size:13px;padding:7px 10px}
.chat-members{max-height:150px;overflow-y:auto;margin-bottom:9px;display:flex;flex-direction:column;gap:2px}
.chat-member{
  display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:400;
  color:var(--ink);padding:4px 6px;border-radius:6px;cursor:pointer;
}
.chat-member:hover{background:var(--blue-50)}
.chat-member input{width:auto;margin:0;accent-color:var(--blue-600)}
.chat-newgroup .btn{width:100%;justify-content:center}

.chat-avatar--group{background:var(--gold-50);border-color:var(--gold-100);color:var(--gold-600)}
.chat-avatar--group svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.8}

.chat-addmember{display:flex;gap:6px;align-items:center;margin-left:auto}
.chat-addmember select{font-size:12px;padding:5px 26px 5px 9px;max-width:170px}
.chat-head .chat-head-sub{white-space:normal;line-height:1.4}

.cw-row .chat-avatar--group svg{width:15px;height:15px}

/* group transcripts have no "other side", so the bubbles run full width */
.mon-msg--wide{max-width:100%}
.mon-msg--wide .msg-bubble{width:100%}


/* ---- chat on small screens: one pane at a time ---- */
.chat-back{
  display:none;flex:0 0 auto;
  width:32px;height:32px;border-radius:9px;
  align-items:center;justify-content:center;
  border:1px solid var(--line);background:var(--surface);
  color:var(--ink);font-size:16px;text-decoration:none;
}
.chat-back:hover{border-color:var(--blue-500);color:var(--blue-600);text-decoration:none}

@media (max-width:900px){
  /* Showing the conversation list and the messages stacked means scrolling
     past everything to reach the thread. On a phone, show one or the other. */
  .chat{display:block;height:auto}

  /* No thread chosen, or one auto-selected for the desktop layout: show the
     list. Only an explicit choice opens the conversation full screen. */
  .chat--list .chat-main{display:none}
  .chat--auto .chat-main{display:none}
  .chat--open .chat-side{display:none}

  .chat-back{display:inline-flex}

  .chat-side,
  .chat-main{
    height:auto;
    max-height:none;
    min-height:calc(100vh - 190px);
  }

  .chat-side{display:flex}
  .chat-list{flex:0 1 auto;max-height:none}
  .chat-list--contacts{max-height:none}

  .chat-main{display:flex}
  .chat-log{min-height:240px}

  /* the composer sits at the bottom of the pane, not the page */
  .chat-composer{position:sticky;bottom:0}

  /* keep the floating bubble away from the send button */
  .chat--open ~ .cw,
  .cw{bottom:18px}
}

@media (max-width:560px){
  .chat-notice{font-size:12px;padding:8px 11px}
  .chat-head{gap:9px;padding:10px 12px}
  .chat-head-name{font-size:14px}
  .chat-head-sub{font-size:10.5px}
  .chat-addmember{width:100%;margin-left:0;margin-top:8px}
  .chat-addmember select{max-width:none;flex:1}
  .msg{max-width:90%}
  .chat-inputs textarea{font-size:16px}   /* 16px stops iOS zooming on focus */
}

/* backdrop behind the mobile menu */
.sidebar-scrim{display:none}
@media (max-width:900px){
  .sidebar-scrim{
    display:block;position:fixed;inset:0;z-index:29;
    background:rgba(8,23,46,.45);
    -webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);
  }
  body.nav-open{overflow:hidden}   /* stop the page scrolling behind the menu */
}

/* =====================================================================
   Scrollbars
   The default Windows bar is heavy and breaks the look of the dark
   column. These are thin and quiet, and appear only when the area is
   hovered. The regions stay scrollable either way — hiding a scrollbar
   must never hide the content behind it.
   ===================================================================== */

/* Firefox */
.nav,
.chat-list,
.chat-log,
.cw-body,
.chat-members,
.table-wrap,
.heatmap-scroll{
  scrollbar-width:thin;
  scrollbar-color:transparent transparent;
}
.nav:hover,
.chat-list:hover,
.chat-log:hover,
.cw-body:hover,
.chat-members:hover,
.table-wrap:hover,
.heatmap-scroll:hover{
  scrollbar-color:rgba(120,140,165,.45) transparent;
}

/* WebKit: Chrome, Edge, Safari */
.nav::-webkit-scrollbar,
.chat-list::-webkit-scrollbar,
.chat-log::-webkit-scrollbar,
.cw-body::-webkit-scrollbar,
.chat-members::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.heatmap-scroll::-webkit-scrollbar{
  width:8px;height:8px;
}
.nav::-webkit-scrollbar-track,
.chat-list::-webkit-scrollbar-track,
.chat-log::-webkit-scrollbar-track,
.cw-body::-webkit-scrollbar-track,
.chat-members::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.heatmap-scroll::-webkit-scrollbar-track{
  background:transparent;
}
.nav::-webkit-scrollbar-thumb,
.chat-list::-webkit-scrollbar-thumb,
.chat-log::-webkit-scrollbar-thumb,
.cw-body::-webkit-scrollbar-thumb,
.chat-members::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.heatmap-scroll::-webkit-scrollbar-thumb{
  background:transparent;border-radius:100px;
  border:2px solid transparent;background-clip:content-box;
}
.nav:hover::-webkit-scrollbar-thumb,
.chat-list:hover::-webkit-scrollbar-thumb,
.chat-log:hover::-webkit-scrollbar-thumb,
.cw-body:hover::-webkit-scrollbar-thumb,
.chat-members:hover::-webkit-scrollbar-thumb,
.table-wrap:hover::-webkit-scrollbar-thumb,
.heatmap-scroll:hover::-webkit-scrollbar-thumb{
  background:rgba(120,140,165,.45);background-clip:content-box;
}
.nav:hover::-webkit-scrollbar-thumb:hover,
.chat-list:hover::-webkit-scrollbar-thumb:hover,
.chat-log:hover::-webkit-scrollbar-thumb:hover{
  background:rgba(120,140,165,.7);background-clip:content-box;
}

/* the dark column needs a lighter thumb to show up at all */
.nav::-webkit-scrollbar-thumb{background:transparent}
.nav:hover::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.22);background-clip:content-box;
}
.nav:hover::-webkit-scrollbar-thumb:hover{
  background:rgba(255,255,255,.38);background-clip:content-box;
}
.nav{scrollbar-color:transparent transparent}
.nav:hover{scrollbar-color:rgba(255,255,255,.28) transparent}

/* corner where two bars meet */
.table-wrap::-webkit-scrollbar-corner{background:transparent}

/* A touch screen has no hover, so leave those bars visible but slim. */
@media (hover:none){
  .nav,.chat-list,.chat-log,.cw-body,.chat-members,.table-wrap,.heatmap-scroll{
    scrollbar-color:rgba(120,140,165,.4) transparent;
  }
  .nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.22);background-clip:content-box}
  .chat-list::-webkit-scrollbar-thumb,
  .chat-log::-webkit-scrollbar-thumb,
  .cw-body::-webkit-scrollbar-thumb,
  .table-wrap::-webkit-scrollbar-thumb{
    background:rgba(120,140,165,.4);background-clip:content-box;
  }
}

/* =====================================================================
   Account menu (top right)
   ===================================================================== */
.usermenu{position:relative}

.usermenu-btn{
  display:flex;align-items:center;gap:9px;
  padding:5px 9px 5px 6px;border-radius:100px;
  border:1px solid var(--line);background:var(--surface);
  cursor:pointer;font:inherit;color:var(--ink);
  box-shadow:var(--shadow-sm);
  transition:border-color .13s ease,background .13s ease;
}
.usermenu-btn:hover{border-color:#C6D2E2;background:var(--surface-2)}
.usermenu-btn.is-open{border-color:var(--blue-500);box-shadow:0 0 0 3px var(--blue-50)}

.usermenu-avatar{
  width:30px;height:30px;flex:0 0 30px;border-radius:50%;
  display:grid;place-items:center;
  background:linear-gradient(150deg,var(--navy-700),var(--navy-900));
  color:#fff;font-family:var(--mono);font-size:11px;font-weight:600;
}
.usermenu-text{display:flex;flex-direction:column;align-items:flex-start;line-height:1.2;min-width:0}
.usermenu-name{font-size:13px;font-weight:600;white-space:nowrap;max-width:140px;overflow:hidden;text-overflow:ellipsis}
.usermenu-role{
  font-family:var(--mono);font-size:9px;text-transform:uppercase;
  letter-spacing:.1em;color:var(--muted);white-space:nowrap;
}
.usermenu-caret{width:14px;height:14px;flex:0 0 14px;color:var(--muted);transition:transform .15s ease}
.usermenu-btn.is-open .usermenu-caret{transform:rotate(180deg)}

.usermenu-pop{
  position:absolute;right:0;top:calc(100% + 8px);z-index:70;
  min-width:216px;padding:6px;
  background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-lg);box-shadow:var(--shadow-lg);
}
.usermenu-head{
  padding:9px 11px 10px;margin-bottom:4px;
  border-bottom:1px solid var(--line-soft);
  display:flex;flex-direction:column;
}
.usermenu-head .usermenu-name{font-size:13.5px;max-width:none}
.usermenu-sub{font-family:var(--mono);font-size:10.5px;color:var(--muted)}

.usermenu-item{
  display:flex;align-items:center;gap:10px;
  padding:9px 11px;border-radius:8px;
  font-size:13.5px;font-weight:500;color:var(--ink);text-decoration:none;
}
.usermenu-item:hover{background:var(--blue-50);color:var(--blue-700);text-decoration:none}
.usermenu-item svg{width:16px;height:16px;flex:0 0 16px;stroke:currentColor;fill:none;stroke-width:1.8;opacity:.8}
.usermenu-item--exit{color:var(--red-600)}
.usermenu-item--exit:hover{background:var(--red-50);color:var(--red-600)}

/* the sidebar no longer carries a footer block */
.sidebar{padding-bottom:18px}

@media (max-width:900px){
  .usermenu-text{display:none}          /* just the avatar on a phone */
  .usermenu-btn{padding:4px;border-radius:50%}
  .usermenu-caret{display:none}
  .usermenu-pop{min-width:210px;right:0;max-width:calc(100vw - 24px)}
}

/* ---- IP access page ---- */
.ip-mine{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 18px}
.ip-badge{
  font-size:15px;font-weight:600;padding:7px 14px;border-radius:8px;
  background:var(--navy-800);color:#fff;letter-spacing:.02em;
}
.ip-ok{font-size:13px;color:var(--green-600);font-weight:600}
.ip-warn{font-size:13px;color:var(--amber);font-weight:600}
.ip-add{padding-top:16px;border-top:1px dashed var(--line)}

/* Name, value and the button on one line, all bottom-aligned. The hint moved
   out from under the value field, which was what pushed the row out of line. */
.ip-add-grid{
  display:grid;
  grid-template-columns:minmax(180px,1fr) minmax(220px,1.3fr) auto;
  gap:14px;align-items:end;
}
.ip-add-grid .field{gap:6px}
.ip-add-grid .field--btn .btn{white-space:nowrap;padding:10px 20px}
.ip-formats{margin:10px 0 0}
.ip-formats code{
  font-family:var(--mono);font-size:11.5px;background:var(--surface-2);
  border:1px solid var(--line);border-radius:4px;padding:1px 5px;
}

.ip-access-set select{min-width:132px;font-size:12.5px;padding:6px 28px 6px 10px}

@media (max-width:760px){
  .ip-add-grid{grid-template-columns:1fr}
  .ip-add-grid .field--btn .btn{width:100%}
}
.ip-notes p{margin:0 0 12px;font-size:13.5px;line-height:1.6;color:var(--body)}
.ip-notes p:last-child{margin-bottom:0}
.ip-notes code{
  font-family:var(--mono);font-size:12px;background:var(--surface-2);
  border:1px solid var(--line);border-radius:4px;padding:1px 5px;
}

/* ---- message status, edits and deletions ---- */
.tick{display:inline-flex;align-items:center;vertical-align:middle;margin-left:3px}
.tick svg{width:15px;height:10px;fill:none;stroke:currentColor;stroke-width:1.9;
  stroke-linecap:round;stroke-linejoin:round}
.tick--sent{color:rgba(255,255,255,.6)}
.tick--delivered{color:rgba(255,255,255,.75)}
.tick--seen{color:#7FD4FF}
.msg--mine .msg-when .tick--seen{color:#8FE0FF}

.msg-edited{font-style:italic;opacity:.75}

.msg--deleted .msg-bubble{background:var(--surface-2);border-style:dashed;color:var(--muted)}
.msg--deleted.msg--mine .msg-bubble{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.3)}
.msg-gone{font-style:italic;opacity:.8;font-size:13px}

/* right click menu */
.msg-menu{
  position:fixed;z-index:90;min-width:150px;padding:5px;
  background:var(--surface);border:1px solid var(--line);
  border-radius:10px;box-shadow:var(--shadow-lg);
  display:flex;flex-direction:column;
}
.msg-menu button{
  border:0;background:none;text-align:left;cursor:pointer;
  font:inherit;font-size:13.5px;color:var(--ink);
  padding:8px 11px;border-radius:7px;
}
.msg-menu button:hover{background:var(--blue-50);color:var(--blue-700)}
.msg-menu button[data-act="delete"]{color:var(--red-600)}
.msg-menu button[data-act="delete"]:hover{background:var(--red-50)}

/* inline editor */
.msg-edit{margin-top:6px}
.msg-edit textarea{
  width:100%;min-width:210px;font:inherit;font-size:13.5px;line-height:1.45;
  padding:8px 10px;border-radius:9px;border:1px solid var(--line);
  background:var(--surface);color:var(--ink);resize:vertical;
}
.msg-edit-btns{display:flex;gap:6px;margin-top:6px}

/* monitor flags */
.mon-flag{
  display:inline-block;margin-top:6px;padding:2px 8px;border-radius:100px;
  font-family:var(--mono);font-size:9.5px;text-transform:uppercase;letter-spacing:.09em;
  background:var(--surface-2);border:1px solid var(--line);color:var(--muted);
}
.mon-flag--del{background:var(--red-50);border-color:#EFCFCB;color:var(--red-600)}

/* ---- group members panel ---- */
.chat-members-btn{margin-left:auto;white-space:nowrap}
.group-panel{
  border-bottom:1px solid var(--line-soft);
  background:var(--surface-2);padding:12px 16px;
}
.group-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;flex-wrap:wrap}
.group-members{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;max-height:190px;overflow-y:auto}
.group-members li{
  display:flex;align-items:center;gap:9px;
  padding:5px 7px;border-radius:8px;background:var(--surface);
  border:1px solid var(--line);
}
.group-members .chat-avatar{width:26px;height:26px;flex:0 0 26px;font-size:10px}
.group-member-name{flex:1;min-width:0;font-size:13px;font-weight:600;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.group-members form{margin:0}
.group-add{display:flex;gap:7px;margin-top:10px}
.group-add select{flex:1;font-size:13px}
@media (max-width:560px){
  .group-add{flex-direction:column}
  .group-add .btn{width:100%}
}

/* ---- emoji picker ---- */
.chat-emoji-btn,.cw-emoji-btn{
  border:1px solid var(--line);background:var(--surface-2);cursor:pointer;
  border-radius:10px;line-height:1;padding:0;
  width:40px;height:40px;flex:0 0 40px;font-size:19px;
}
.cw-emoji-btn{width:34px;height:34px;flex:0 0 34px;font-size:16px;border-radius:9px}
.chat-emoji-btn:hover,.cw-emoji-btn:hover{border-color:var(--blue-500);background:var(--blue-50)}

.emoji-pop{
  position:fixed;z-index:95;width:296px;max-height:270px;overflow-y:auto;
  background:var(--surface);border:1px solid var(--line);
  border-radius:12px;box-shadow:var(--shadow-lg);padding:10px;
}
.emoji-group{
  font-family:var(--mono);font-size:9.5px;text-transform:uppercase;
  letter-spacing:.12em;color:var(--muted);margin:8px 2px 5px;
}
.emoji-group:first-child{margin-top:0}
.emoji-row{display:grid;grid-template-columns:repeat(8,1fr);gap:2px}
.emoji-cell{
  border:0;background:none;cursor:pointer;font-size:20px;line-height:1;
  padding:5px 0;border-radius:7px;
}
.emoji-cell:hover{background:var(--blue-50)}

/* ---- message info ---- */
.seen-modal{
  position:fixed;inset:0;z-index:96;display:grid;place-items:center;
  background:rgba(8,23,46,.5);padding:20px;
}
.seen-card{
  width:100%;max-width:340px;background:var(--surface);
  border-radius:var(--r-lg);box-shadow:var(--shadow-lg);padding:16px 18px 18px;
  max-height:80vh;overflow-y:auto;
}
.seen-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}
.seen-head strong{font-family:var(--display);font-size:15px}
.seen-close{border:0;background:none;font-size:20px;line-height:1;cursor:pointer;color:var(--muted);padding:2px 6px}
.seen-close:hover{color:var(--ink)}
.seen-sent{margin:0 0 14px;font-size:12px;color:var(--muted);font-family:var(--mono)}
.seen-sec{margin-bottom:14px}
.seen-sec:last-child{margin-bottom:0}
.seen-list{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-direction:column;gap:5px}
.seen-list li{display:flex;align-items:center;gap:8px;font-size:13.5px}
.seen-dot{width:7px;height:7px;border-radius:50%;background:var(--blue-500);flex:0 0 7px}
.seen-sec:last-child .seen-dot{background:var(--line)}
.seen-empty{margin:6px 0 0;font-size:12.5px;color:var(--muted)}

/* ---- message reactions ---- */
.react-row{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
.react-chip{
  display:inline-flex;align-items:center;gap:4px;
  padding:2px 8px;border-radius:100px;cursor:pointer;
  border:1px solid var(--line);background:var(--surface);
  font-size:13px;line-height:1.5;color:var(--ink);
}
.react-chip span{font-family:var(--mono);font-size:10.5px;color:var(--muted)}
.react-chip:hover{border-color:var(--blue-500);background:var(--blue-50)}
.react-chip.is-mine{border-color:var(--blue-500);background:var(--blue-50)}
.react-chip.is-mine span{color:var(--blue-700);font-weight:600}
.msg--mine .react-chip{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.3);color:#fff}
.msg--mine .react-chip span{color:rgba(255,255,255,.85)}
.msg--mine .react-chip.is-mine{background:rgba(255,255,255,.3);border-color:#fff}
.react-row--flat .react-chip{cursor:default}

.react-pick{
  position:fixed;z-index:97;display:flex;gap:2px;padding:5px;
  background:var(--surface);border:1px solid var(--line);
  border-radius:100px;box-shadow:var(--shadow-lg);
}
.react-pick button{
  border:0;background:none;cursor:pointer;font-size:20px;line-height:1;
  padding:5px 6px;border-radius:50%;
}
.react-pick button:hover{background:var(--blue-50);transform:scale(1.15)}
@media (prefers-reduced-motion:reduce){ .react-pick button:hover{transform:none} }

/* ---- mentions ---- */
.mention{
  color:var(--blue-700);font-weight:600;
  background:var(--blue-50);border-radius:4px;padding:0 3px;
}
.msg--mine .mention{color:#fff;background:rgba(255,255,255,.22)}
.mention--me{background:var(--gold-100);color:var(--gold-600)}
.msg--mine .mention--me{background:rgba(255,255,255,.34);color:#fff}

/* a message that mentions you stands out in the log */
.msg--at-me .msg-bubble{
  border-left:3px solid var(--gold-500);
  background:linear-gradient(90deg,var(--gold-50),var(--surface) 60%);
}

/* the @ marker on a conversation in the list */
.chat-at{
  font-family:var(--mono);font-size:11px;font-weight:700;line-height:1;
  background:var(--gold-500);color:var(--navy-900);
  border-radius:100px;padding:3px 6px;
}

/* the suggestion list */
.mention-pop{
  position:fixed;z-index:98;max-height:210px;overflow-y:auto;
  background:var(--surface);border:1px solid var(--line);
  border-radius:10px;box-shadow:var(--shadow-lg);padding:5px;
}
.mention-item{
  display:flex;flex-direction:column;gap:1px;width:100%;
  border:0;background:none;cursor:pointer;text-align:left;
  padding:7px 10px;border-radius:7px;font:inherit;
}
.mention-item:hover,.mention-item.is-active{background:var(--blue-50)}
.mention-name{font-size:13.5px;font-weight:600;color:var(--ink)}
.mention-user{font-family:var(--mono);font-size:11px;color:var(--muted)}

/* ---- replies ---- */
.msg-quote{
  display:block;margin-bottom:6px;padding:6px 9px;
  border-left:3px solid var(--blue-500);border-radius:6px;
  background:var(--surface-2);text-decoration:none;color:inherit;
  max-width:100%;overflow:hidden;
}
.msg-quote:hover{background:var(--blue-50);text-decoration:none}
.msg-quote-author{display:block;font-size:11.5px;font-weight:700;color:var(--blue-700)}
.msg-quote-text{
  display:block;font-size:12.5px;color:var(--body);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.msg--mine .msg-quote{
  background:rgba(255,255,255,.16);border-left-color:rgba(255,255,255,.7);
}
.msg--mine .msg-quote:hover{background:rgba(255,255,255,.24)}
.msg--mine .msg-quote-author{color:#fff}
.msg--mine .msg-quote-text{color:rgba(255,255,255,.85)}
.msg-quote--flat{cursor:default}

/* the message you jumped to */
.msg--flash .msg-bubble{animation:msgFlash 1.4s ease}
@keyframes msgFlash{
  0%,40%{box-shadow:0 0 0 3px var(--gold-500)}
  100%{box-shadow:none}
}
@media (prefers-reduced-motion:reduce){ .msg--flash .msg-bubble{animation:none} }

/* the bar above the composer while replying */
.reply-bar{
  display:flex;align-items:center;gap:9px;margin-bottom:9px;
  padding:7px 10px;border-radius:9px;
  background:var(--surface-2);border:1px solid var(--line);
}
.reply-bar-mark{width:3px;align-self:stretch;border-radius:3px;background:var(--blue-500);flex:0 0 3px}
.reply-bar-text{flex:1;min-width:0;display:flex;flex-direction:column}
.reply-bar-author{font-size:11.5px;font-weight:700;color:var(--blue-700)}
.reply-bar-excerpt{
  font-size:12.5px;color:var(--body);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.reply-bar-x{
  border:0;background:none;cursor:pointer;color:var(--muted);
  font-size:18px;line-height:1;padding:2px 5px;border-radius:6px;
}
.reply-bar-x:hover{background:var(--line-soft);color:var(--ink)}
.reply-bar--sm{padding:6px 8px;margin-bottom:7px}
.reply-bar--sm .reply-bar-excerpt{font-size:11.5px}

/* ---- working days ---- */
.wk-days{display:grid;grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:9px}
.wk-day{
  display:flex;flex-direction:column;gap:2px;cursor:pointer;
  padding:11px 12px;border-radius:10px;
  border:1px solid var(--line);background:var(--surface);
}
.wk-day span{font-size:13.5px;font-weight:600;color:var(--ink)}
.wk-day small{font-family:var(--mono);font-size:10px;text-transform:uppercase;
  letter-spacing:.1em;color:var(--muted)}
.wk-day input{width:auto;margin:0 0 4px;accent-color:var(--blue-600)}
.wk-day.is-off{background:var(--gold-50);border-color:var(--gold-100)}
.wk-day.is-off small{color:var(--gold-600)}
.work-note{margin:14px 0 0;padding-top:12px;border-top:1px dashed var(--line);line-height:1.6}
.work-hols{display:block;margin-top:3px;font-family:var(--mono);font-size:11.5px;color:var(--muted)}

/* ---- collapsible panels ---- */
.panel-head-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap}

.collapse-btn{
  display:inline-flex;align-items:center;gap:6px;
  padding:5px 11px;border-radius:100px;cursor:pointer;
  border:1px solid var(--line);background:var(--surface);
  font:inherit;font-size:12px;font-weight:600;color:var(--body);
}
.collapse-btn:hover{border-color:var(--blue-500);color:var(--blue-600);background:var(--blue-50)}
.collapse-btn svg{width:14px;height:14px;transition:transform .15s ease}
.collapse-btn.is-closed svg{transform:rotate(-90deg)}

.collapse-summary{
  display:flex;flex-wrap:wrap;gap:6px;
  padding:12px 20px;border-top:1px solid var(--line-soft);
  background:var(--surface-2);
}
.collapse-summary .chip{cursor:default;font-size:11px}
.collapse-summary .chip:hover{border-color:var(--line);color:var(--body);background:var(--surface)}

@media (prefers-reduced-motion:reduce){ .collapse-btn svg{transition:none} }

@media (max-width:560px){
  .collapse-summary{padding:10px 14px}
  .panel-head-right{width:100%;justify-content:space-between}
}

/* ---- BD performance report ---- */
.podium{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px}
.podium-item{
  position:relative;padding:16px 18px 16px 52px;border-radius:var(--r-lg);
  border:1px solid var(--line);background:var(--surface);box-shadow:var(--shadow-sm);
  display:flex;flex-direction:column;gap:2px;
}
.podium-rank{
  position:absolute;left:14px;top:16px;
  width:26px;height:26px;border-radius:50%;display:grid;place-items:center;
  font-family:var(--mono);font-size:12px;font-weight:700;
  background:var(--line-soft);color:var(--body);
}
.podium-item--1{border-color:var(--gold-100);background:linear-gradient(180deg,var(--gold-50),var(--surface) 70%)}
.podium-item--1 .podium-rank{background:var(--gold-500);color:var(--navy-900)}
.podium-item--2 .podium-rank{background:#C9D3DE;color:var(--navy-900)}
.podium-item--3 .podium-rank{background:#E2C4A0;color:var(--navy-900)}
.podium-name{font-family:var(--display);font-size:15px;font-weight:700;letter-spacing:-.01em}
.podium-score{font-family:var(--mono);font-size:22px;font-weight:600;color:var(--blue-700);line-height:1.2}
.podium-detail{font-size:12px;color:var(--muted);line-height:1.55;margin-top:4px}

.bd-weights{padding-top:18px;margin-top:18px;border-top:1px dashed var(--line)}

.weights-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.weights-total{
  font-family:var(--mono);font-size:10px;text-transform:uppercase;letter-spacing:.1em;
  padding:3px 9px;border-radius:100px;
  background:#E3F4EF;color:var(--green-600);border:1px solid #BFE3D8;
}
.weights-total.is-off{background:var(--gold-50);color:var(--gold-600);border-color:var(--gold-100)}

/* A row of small cards rather than four stretched text boxes. A weighting is
   a two digit number, so the box is sized for a two digit number. */
.weights-grid{
  display:flex;flex-wrap:wrap;align-items:stretch;gap:10px;
}
.weight-field{
  display:flex;flex-direction:column;gap:7px;
  padding:11px 13px;border-radius:10px;
  border:1px solid var(--line);background:var(--surface-2);
  min-width:0;
}
.weight-field label{
  font-size:11px;font-weight:700;color:var(--body);
  text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;
}
.weight-input{position:relative;display:inline-flex;align-items:center;width:86px}
.weight-input input{
  width:86px;padding:7px 26px 7px 10px;
  font-family:var(--mono);font-size:16px;font-weight:600;
  border-radius:8px;background:var(--surface);
}
.weight-suffix{
  position:absolute;right:10px;pointer-events:none;
  font-family:var(--mono);font-size:11.5px;color:var(--muted);
}
.weight-note{font-size:10.5px;color:var(--muted);line-height:1.4;white-space:nowrap}

.weight-field--action{
  border:0;background:none;padding:0;justify-content:flex-end;margin-left:auto;
}
.weight-field--action label{display:none}
.weight-field--action .btn{white-space:nowrap;height:42px}

.weights-note{margin:14px 0 0}

@media (max-width:900px){
  .weight-note{white-space:normal}
  .weight-field{flex:1 1 150px}
  .weight-field--action{flex:1 1 100%;margin-left:0}
  .weight-field--action .btn{width:100%}
}

/* the filter action buttons line up with the inputs beside them */
.field--btn .filter-actions{display:flex;gap:8px;align-items:center}
.field--btn .filter-actions .btn{height:42px;display:inline-flex;align-items:center;gap:7px}
.field--btn .filter-actions .btn svg{width:15px;height:15px}
@media (max-width:560px){
  .field--btn .filter-actions{width:100%}
  .field--btn .filter-actions .btn{flex:1 1 0;justify-content:center}
}

.ai-summary{
  font-size:14.5px;line-height:1.7;color:var(--ink);
  padding:16px 18px;border-radius:var(--r);
  background:var(--surface-2);border:1px solid var(--line);
  border-left:3px solid var(--blue-500);
}
.ai-note{margin:10px 0 0}

.delta-up{color:var(--green-600);font-weight:600}
.delta-down{color:var(--red-600);font-weight:600}
.pill--none{background:var(--surface-2);color:var(--muted);border-color:var(--line)}
.csv-sample{
  font-family:var(--mono);font-size:12px;line-height:1.7;
  background:var(--navy-900);color:#DCE6F2;
  padding:12px 14px;border-radius:var(--r);overflow-x:auto;margin:0 0 14px;
}

/* ---- leads ---- */
.lead-upload{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.lead-upload input[type=file]{max-width:340px}

.lead-modal{
  position:fixed;inset:0;z-index:96;display:grid;place-items:center;
  background:rgba(8,23,46,.55);padding:20px;
  overflow:auto;                      /* a tall card can still be reached */
}
.lead-modal-card{
  width:100%;max-width:560px;min-width:0;       /* min-width:0 matters: without
    it a wide table inside stretches the card past the edge of the screen and
    the close button ends up off it */
  max-height:86vh;max-height:86dvh;
  display:flex;flex-direction:column;
  background:var(--surface);border-radius:var(--r-lg);box-shadow:var(--shadow-lg);
  overflow:hidden;                    /* keeps the rounded corners */
}
.lead-modal-card--wide{max-width:min(920px, 100%)}

.lead-modal-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:14px;
  padding:16px 20px;border-bottom:1px solid var(--line-soft);
  flex:0 0 auto;min-width:0;
}
.lead-modal-head strong{
  font-family:var(--display);font-size:15.5px;display:block;
  overflow-wrap:anywhere;             /* a long file name wraps rather than
                                         widening the whole card */
}

.lead-modal-body{
  padding:18px 20px;
  flex:1 1 auto;min-height:0;min-width:0;
  overflow-y:auto;overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
}
/* The table scrolls sideways inside the body rather than pushing it wider. */
.lead-modal-body .table-wrap{
  border:0;margin:0;max-width:100%;overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.lead-modal-body .table-wrap table{min-width:540px}

/* ---- leads pool ---- */
.lead-mine td{background:rgba(14,124,99,.04)}

.lead-modal-title{min-width:0;flex:1}
.lead-modal-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.lead-modal-actions .btn{white-space:nowrap}
.lead-modal-actions .btn svg{width:14px;height:14px}
.is-applied{color:var(--green-600);border-color:#BFE3D8;background:#E3F4EF}

.lead-modal-meta{
  display:flex;flex-wrap:wrap;gap:8px;
  padding:12px 20px;background:var(--surface-2);
  border-bottom:1px solid var(--line-soft);
}
.lead-meta-item{
  display:inline-flex;align-items:baseline;gap:6px;
  font-size:12.5px;color:var(--ink);
  background:var(--surface);border:1px solid var(--line);
  border-radius:100px;padding:4px 11px;
}
.lead-meta-item em{
  font-style:normal;font-family:var(--mono);font-size:9.5px;
  text-transform:uppercase;letter-spacing:.09em;color:var(--muted);
}

/* the description, as it came from the job board */
.lead-modal-body{font-size:14px;line-height:1.65;color:var(--ink)}
.lead-modal-body h1,.lead-modal-body h2,.lead-modal-body h3,
.lead-modal-body h4,.lead-modal-body h5,.lead-modal-body h6{
  font-family:var(--display);font-size:15px;margin:18px 0 6px;
}
.lead-modal-body p{margin:0 0 11px}
.lead-modal-body ul,.lead-modal-body ol{margin:0 0 12px;padding-left:22px}
.lead-modal-body li{margin-bottom:5px}
.lead-modal-body strong{font-weight:700}
.lead-modal-body section,.lead-modal-body div{display:block}
.lead-modal-body table{width:100%;border-collapse:collapse;margin:0 0 12px}
.lead-modal-body td,.lead-modal-body th{border:1px solid var(--line);padding:6px 9px;text-align:left}

.pager{display:flex;align-items:center;justify-content:center;gap:14px;padding:16px 20px}

@media (max-width:640px){
  /* Full height on a phone, so a long description is not squeezed into a
     small box floating in the middle of the screen. */
  .lead-modal{padding:0;place-items:stretch}
  .lead-modal-card{
    max-width:100%;max-height:100vh;max-height:100dvh;
    border-radius:0;height:100%;
  }
  .lead-modal-head{
    flex-direction:column;align-items:stretch;
    position:sticky;top:0;background:var(--surface);z-index:2;
    padding-top:calc(16px + env(safe-area-inset-top, 0px));
  }
  .lead-modal-actions{justify-content:flex-start;flex-wrap:wrap}
  .lead-modal-actions .btn{flex:1 1 auto;justify-content:center}
  .lead-modal-meta{padding:10px 16px}
  .lead-modal-body{padding:16px;padding-bottom:calc(16px + env(safe-area-inset-bottom, 0px))}
  .lead-modal-body .table-wrap table{min-width:480px}
}
/* while a modal is open the page behind stays put */
body.modal-open{overflow:hidden}
.lead-also{
  display:inline-block;margin-left:6px;
  font-family:var(--mono);font-size:10px;color:var(--muted);
  border:1px solid var(--line);border-radius:100px;padding:2px 7px;
  cursor:help;
}

/* A note under the filter grid rather than inside one of its cells: a long
   hint in a single cell stretches that cell and drops every other field to
   the bottom of the row. */
.filter-note{
  margin:14px 0 0;padding-top:12px;
  border-top:1px dashed var(--line);line-height:1.6;
}
/* Apply and Reset stay side by side instead of stacking in a narrow cell. */
.field--btn .filter-actions{flex-wrap:nowrap}
.field--btn .filter-actions .btn{white-space:nowrap}

/* =========================== Leads Pool Grid =========================== */
.table-wrap.leads-table-wrap{overflow-x:auto}
table.data.leads-table{width:100%;border-collapse:collapse;font-size:13px;table-layout:auto}
table.data.leads-table th,
table.data.leads-table td{padding:8px 10px;vertical-align:top;border-bottom:1px solid var(--line-soft);line-height:1.35}
table.data.leads-table thead th{
  padding-top:8px;padding-bottom:8px;font-family:var(--mono);font-size:9.5px;
  font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);
  background:var(--surface-2);border-bottom:1px solid var(--line);white-space:nowrap;
}

/* Explicit Column Widths */
table.data.leads-table th.col-num,
table.data.leads-table td.col-num{width:36px;min-width:36px;padding:8px 4px;text-align:center}
table.data.leads-table th.col-match,
table.data.leads-table td.col-match{width:185px;min-width:175px;padding:8px 10px}
table.data.leads-table th.col-status,
table.data.leads-table td.col-status{width:95px;min-width:90px;padding:8px 6px;white-space:nowrap}
table.data.leads-table th.col-company,
table.data.leads-table td.col-company{width:130px;min-width:120px;padding:8px 10px}
table.data.leads-table th.col-title{width:100%;min-width:210px;padding:8px 12px}
table.data.leads-table td.col-title{padding:8px 12px}
table.data.leads-table th.col-stack,
table.data.leads-table td.col-stack{width:150px;min-width:135px;padding:8px 10px}
table.data.leads-table th.col-link,
table.data.leads-table td.col-link{width:65px;min-width:60px;padding:8px 4px;text-align:center;white-space:nowrap}
table.data.leads-table th.col-date,
table.data.leads-table td.col-date{width:155px;min-width:145px;padding:8px 10px;white-space:nowrap}
table.data.leads-table th.col-actions,
table.data.leads-table td.col-actions{width:80px;min-width:75px;padding:8px 14px 8px 6px;text-align:right;white-space:nowrap}

/* Compact Inner Elements for Leads Grid */
.lead-match-badge-row{display:flex;align-items:center;gap:5px;margin-bottom:2px}
.lead-match-badge-row .badge{font-size:10.5px;font-weight:700;padding:1.5px 6px;border-radius:8px;line-height:1.2}
.lead-score-text{font-size:10.5px;color:#64748b;font-weight:500}
.lead-dev-name-wrap{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-top:1px}
.lead-dev-name{font-size:13px;font-weight:600;color:#0f172a;line-height:1.25}
.lead-other-dev-tag{
  font-size:9.5px;font-weight:700;background:#e0f2fe;color:#0369a1;
  border:1px solid #bae6fd;padding:1px 5px;border-radius:10px;line-height:1.2;
  cursor:help;white-space:nowrap;
}
.lead-cv-link-wrap{margin-top:1px}
.lead-cv-link{
  font-size:11.5px;color:#2563eb;text-decoration:underline;display:inline-block;
  max-width:175px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  vertical-align:bottom;line-height:1.25;
}
.lead-cv-link:hover{color:#1d4ed8}
.lead-skills-wrap{display:flex;flex-wrap:wrap;gap:3px;margin-top:3px}
.lead-skill-tag{
  font-size:10px;background:#f1f5f9;color:#334155;border:1px solid #e2e8f0;
  padding:1px 5px;border-radius:3px;line-height:1.2;white-space:nowrap;
}
.lead-no-match{color:#94a3b8;font-size:12px}

.lead-company-name{font-weight:600;color:var(--ink);font-size:13px;line-height:1.3;word-break:break-word}
.lead-provider-tag{
  display:inline-block;margin-top:2px;font-size:10.5px;font-weight:normal;
  background:#f1f3f4;color:#5f6368;padding:1px 6px;border-radius:4px;line-height:1.25;
}

.lead-job-title{font-weight:600;color:var(--ink);font-size:13.5px;line-height:1.35;word-break:break-word}
.lead-location{display:block;font-size:11.5px;color:var(--muted);margin-top:1px;line-height:1.25}

.lead-stack-text{font-weight:500;font-size:12.5px;color:#1e293b;line-height:1.3;word-break:break-word}
.lead-detected-wrap{display:flex;flex-wrap:wrap;gap:2.5px;margin-top:2px}
.lead-detected-tag{
  font-size:10px;background:#f0fdf4;color:#15803d;border:1px solid #bbf7d0;
  padding:1px 5px;border-radius:3px;line-height:1.2;white-space:nowrap;
}
.lead-detected-tag--main{background:#f0fdf4;color:#166534;font-weight:500}
.lead-tag-more{font-size:10.5px;align-self:center;color:var(--muted);cursor:help}

.lead-open-link{
  display:inline-flex;align-items:center;gap:2px;font-size:11.5px;font-weight:600;
  color:#2563eb;background:#eff6ff;border:1px solid #dbeafe;padding:2px 7px;
  border-radius:4px;text-decoration:none;transition:all .12s ease;
}
.lead-open-link:hover{background:#dbeafe;color:#1d4ed8;text-decoration:none}

.lead-posted-date{font-family:var(--mono);font-size:12px;font-weight:500;color:var(--ink);line-height:1.3}
.lead-added-time{display:block;font-family:var(--sans);font-size:11px;color:#64748b;margin-top:2px;line-height:1.25;white-space:nowrap}

.lead-btn-details{
  display:inline-flex;align-items:center;justify-content:center;
  padding:4px 11px;font-size:12px;font-weight:600;border-radius:6px;
  white-space:nowrap;
}
