/* HC App, the Cold email tab (migration 065). public/tab-coldemail.css
   Every class starts with hce- (the tab's own), so nothing here can change
   another screen. Colors come from the page's own tokens (index.html :root);
   the two chart colors were checked for colorblind separation:
   first emails #2f7a4a, follow-ups #c9852a (the numbers also show in words,
   in each bar's label and in the table view). */
.coldemail-wrap{max-width:1040px;margin:0 auto;padding:12px 16px 40px}
@media (min-width:769px){.coldemail-wrap{padding:20px 24px 40px}}

/* Header */
.hce-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:6px}
.hce-title{font-size:20px;font-weight:800;letter-spacing:-.3px;color:var(--text)}
.hce-sub{font-size:12.5px;color:var(--text-muted);line-height:1.45;margin-top:4px;overflow-wrap:anywhere}
.hce-h3{font-size:15px;font-weight:800;color:var(--text);margin:18px 0 2px;display:flex;align-items:center;gap:8px}
.hce-numbers-title{margin-top:28px}
.hce-count{background:var(--brand-fill);color:var(--on-brand);border-radius:999px;font-size:11.5px;padding:1px 8px;font-weight:700}

/* Buttons */
.hce-btn{min-height:36px;padding:7px 12px;border:1px solid var(--border-mid);background:var(--surface);color:var(--text);border-radius:9px;font-size:13px;font-weight:600;cursor:pointer;line-height:1.2}
.hce-btn:hover{border-color:var(--green-light)}
.hce-btn:disabled{opacity:.5;cursor:not-allowed}
.hce-btn-main{background:var(--brand-fill);color:var(--on-brand);border-color:var(--brand-fill)}
.hce-btn-main:hover{background:var(--brand-fill-hover)}
.hce-btn-done{border-color:var(--soft-edge)}
.hce-btn-quiet{background:none;border-color:transparent;color:var(--green);padding:6px 8px}
.hce-btn-quiet:hover{background:var(--green-wash);border-color:transparent}
.hce-refresh{flex:0 0 auto}
.hce-history-btn{font-size:14px;font-weight:800;color:var(--text);padding-left:0}

/* Notices and plain lines */
/* The notice sticks under the top bar, so its Undo stays in view after a
   save far down the list. */
.hce-notice{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:var(--brand-wash2);border:1px solid var(--soft-edge);border-radius:var(--radius);padding:8px 12px;font-size:13px;margin:8px 0;position:sticky;top:calc(var(--hc-topbar-h) + 6px);z-index:5;box-shadow:var(--shadow)}
.hce-notice>span{flex:1 1 220px;overflow-wrap:anywhere}
.hce-notice-warn{background:var(--amber-pale);border-color:#f3d27a}
.hce-note-line{font-size:12.5px;margin:6px 0}
.hce-warn{color:var(--amber-dark);font-weight:600}
.hce-warn-text{color:var(--amber-dark)}
.hce-empty{padding:22px 4px;color:var(--text-muted);font-size:14px;line-height:1.5}
.hce-empty-good{color:var(--green);font-weight:600;padding:14px 4px}
.hce-copy{margin:6px 0 10px}

/* Do next */
.hce-items{list-style:none;display:flex;flex-direction:column;gap:10px;margin-top:10px}
.hce-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px 16px;box-shadow:var(--shadow-sm);min-width:0}
.hce-item-open{border-color:var(--green-light);box-shadow:var(--shadow)}
.hce-item-top{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.hce-tag{font-size:11px;font-weight:700;border-radius:6px;padding:2px 8px;background:var(--green-wash);color:var(--green)}
.hce-tag-reply_waiting{background:var(--blue-pale);color:#1d4ed8}
.hce-tag-warm_no_deal{background:#fbf1e2;color:#7a4a0c}
.hce-tag-deal_overdue{background:var(--red-pale);color:var(--red-dark)}
.hce-tag-deal_no_next_step{background:var(--amber-pale);color:var(--amber-dark)}
.hce-since{font-size:11.5px;color:var(--text-hint)}
.hce-item-title{font-size:15px;font-weight:700;margin-top:6px;overflow-wrap:anywhere}
.hce-item-why{font-size:13px;color:var(--text);margin-top:3px;line-height:1.45;overflow-wrap:anywhere}
.hce-how{margin:8px 0 0 20px;font-size:13px;color:var(--text-muted);line-height:1.5;overflow-wrap:anywhere}
.hce-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.hce-actions:empty{display:none}
.hce-actions-mark{margin-top:8px;padding-top:8px;border-top:1px solid var(--border)}

/* The mark box */
.hce-panel{margin-top:10px;background:var(--green-wash);border:1px solid var(--border);border-radius:var(--radius);padding:12px}
.hce-panel-title{font-weight:700;font-size:14px;overflow-wrap:anywhere}
.hce-panel-msg{margin-top:8px;font-size:13px;color:var(--red-dark);font-weight:600}
.hce-label{display:block;font-size:12px;font-weight:700;color:var(--text);margin:10px 0 4px}
.hce-input{width:100%;font:inherit;font-size:14px;padding:9px 10px;border:1px solid var(--border-mid);border-radius:9px;background:var(--surface);color:var(--text)}
.hce-textarea{resize:vertical;min-height:60px}
.hce-date{max-width:220px}
.hce-chips{display:flex;flex-wrap:wrap;gap:6px}
.hce-chip{min-height:36px;padding:6px 12px;border-radius:999px;border:1px solid var(--border-mid);background:var(--surface);font-size:13px;font-weight:600;cursor:pointer;color:var(--text)}
.hce-chip:disabled{opacity:.5;cursor:not-allowed}
.hce-chip.hce-on,.hce-pick.hce-on{background:var(--soft-fill);border-color:var(--soft-edge);color:var(--on-soft)}
.hce-link-results{margin-top:6px}
.hce-link-list{list-style:none;display:flex;flex-direction:column;gap:6px}
.hce-pick{width:100%;text-align:left;display:flex;flex-direction:column;gap:2px;padding:8px 10px;border:1px solid var(--border-mid);border-radius:9px;background:var(--surface);cursor:pointer;font:inherit;color:var(--text)}
.hce-pick-name{font-weight:700;font-size:13.5px;overflow-wrap:anywhere}
.hce-pick-meta{font-size:12px;color:var(--text-muted)}

/* History */
.hce-history{margin-top:6px}
.hce-hist{list-style:none;display:flex;flex-direction:column;gap:6px;margin-top:6px}
.hce-hist-row{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:8px 12px;font-size:13px;overflow-wrap:anywhere}
.hce-hist-row .hce-actions{margin-top:4px}
.hce-hist-undone{opacity:.72}
.hce-hist-when{color:var(--text-hint);font-size:12px}
.hce-hist-note{color:var(--text-muted);white-space:pre-wrap;margin-top:2px}
.hce-undone{font-size:12px;color:var(--text-hint)}

/* The numbers: cards */
.hce-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin-top:10px}
@media (min-width:900px){.hce-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.hce-card-wide{grid-column:1/-1}}
.hce-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px 16px;box-shadow:var(--shadow-sm);min-width:0}
.hce-card-title{font-size:14px;font-weight:800;color:var(--text)}
.hce-card-body{margin-top:6px;font-size:13px;color:var(--text)}
.hce-src{font-size:11.5px;color:var(--text-hint);margin-top:8px;overflow-wrap:anywhere}
.hce-stat{display:flex;align-items:baseline;gap:8px;margin-top:6px;flex-wrap:wrap}
.hce-stat-num{font-size:26px;font-weight:800;letter-spacing:-.5px;color:var(--text)}
.hce-stat-label{font-size:12.5px;color:var(--text-muted)}
.hce-rows{list-style:none;margin-top:6px}
.hce-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:7px 0;border-top:1px solid var(--border);flex-wrap:wrap}
.hce-row>div{flex:1 1 200px;min-width:0}
.hce-row-label{font-weight:600;overflow-wrap:anywhere}
.hce-mini{font-size:11px;font-weight:700;background:var(--green-wash);color:var(--green);border-radius:6px;padding:1px 6px;white-space:nowrap}
.hce-mini-warn{background:var(--red-pale);color:var(--red-dark)}
.hce-mini-yes{font-weight:800}
/* Everyone who replied: closed like History; a mark box opens under its line. */
.hce-recent{margin-top:6px}
.hce-row.hce-row-recent>.hce-panel{flex:1 1 100%}
.hce-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:6px}
.hce-tile{display:flex;flex-direction:column;gap:2px;min-width:0}
.hce-notes{margin:8px 0 0 18px;font-size:12px;color:var(--text-muted);line-height:1.5}
.hce-digest{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12.5px;line-height:1.5;background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius);padding:10px 12px;margin-top:6px;max-height:340px;overflow:auto}

/* The bar charts: one baseline, 2px gaps between stacked pieces, 4px round
   tops, columns at most 24px wide, recessive gridlines. */
.hce-legend{display:flex;flex-wrap:wrap;gap:12px;font-size:12px;color:var(--text-muted);margin-top:4px}
.hce-legend span{display:inline-flex;align-items:center;gap:6px}
.hce-sw{display:inline-block;width:10px;height:10px;border-radius:3px}
.hce-sw-first,.hce-seg-first{background:#2f7a4a}
.hce-sw-follow,.hce-seg-follow{background:#c9852a}
.hce-sw-unknown,.hce-seg-unknown{background:#a3aaa4}
.hce-dot-key,.hce-inst{border-radius:50%;background:var(--text);box-shadow:0 0 0 2px var(--surface)}
.hce-dot-key{display:inline-block;width:8px;height:8px}
.hce-chart{position:relative;margin:16px 0 4px;padding-left:32px}
.hce-grid-lines{position:absolute;left:0;right:0;top:18px;height:140px;pointer-events:none}
.hce-grid-lines span{position:absolute;left:0;right:0;height:0;border-top:1px solid var(--border)}
.hce-grid-lines em{position:absolute;left:0;bottom:2px;font-style:normal;font-size:10px;color:var(--text-hint)}
.hce-cols{display:flex;align-items:flex-end;gap:2px;position:relative}
.hce-col{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;cursor:default}
.hce-col-plot{position:relative;height:158px;width:100%;max-width:24px;display:flex;flex-direction:column;justify-content:flex-end}
.hce-stack{position:relative;display:flex;flex-direction:column-reverse;gap:2px;height:140px;width:100%}
.hce-seg{display:block;width:100%;flex:0 0 auto;min-height:2px}
.hce-seg-top{border-radius:4px 4px 0 0}
.hce-col-val{position:absolute;left:50%;transform:translate(-50%,-3px);font-size:10.5px;font-weight:700;color:var(--text);white-space:nowrap;margin-bottom:0}
.hce-inst{position:absolute;left:50%;width:8px;height:8px;margin-left:-4px;margin-bottom:-4px}
.hce-inst-off{background:var(--red-dark)}
.hce-col-day{font-size:10.5px;color:var(--text-muted);margin-top:4px;height:16px;white-space:nowrap}
.hce-col-today .hce-col-day{font-weight:700;color:var(--text)}
.hce-col:hover .hce-seg{filter:brightness(1.08)}
.hce-chart-mini{padding-left:0;margin-top:8px}
.hce-chart-mini .hce-col-plot{height:52px}
.hce-chart-mini .hce-stack{height:52px}
.hce-flags{list-style:none;margin-top:6px;font-size:12.5px;color:var(--amber-dark)}
.hce-flag-icon{display:inline-flex;width:16px;height:16px;border-radius:50%;background:var(--amber-pale);border:1px solid var(--amber);font-weight:800;font-size:11px;align-items:center;justify-content:center;color:var(--amber-dark)}

/* Tables scroll inside their card, never the page. */
.hce-table-wrap{overflow-x:auto;margin-top:8px;-webkit-overflow-scrolling:touch;max-width:100%}
.hce-table{width:100%;border-collapse:collapse;font-size:12.5px;font-variant-numeric:tabular-nums}
.hce-table th,.hce-table td{padding:6px 8px;border-bottom:1px solid var(--border);text-align:right;white-space:nowrap}
.hce-table th[scope="row"],.hce-table thead th:first-child{text-align:left}
.hce-table th[scope="row"]{white-space:normal;min-width:110px;font-weight:600}
.hce-table thead th{font-size:11px;color:var(--text-muted);font-weight:700}
.hce-table td.hce-wrap{white-space:normal;min-width:64px}

/* Phone: bigger tap targets, tighter edges, full-width action rows. */
@media (max-width:768px){
  .coldemail-wrap{padding:8px 14px 28px}
  .hce-title{font-size:18px}
  .hce-head{flex-wrap:wrap}
  .hce-btn,.hce-chip{min-height:44px}
  .hce-pick{min-height:44px}
  .hce-item{padding:12px}
  .hce-actions .hce-btn{flex:1 1 auto}
  .hce-chart{padding-left:26px}
  .hce-col-day{font-size:9.5px}
  .hce-col-val{font-size:9.5px}
  .hce-stat-num{font-size:22px}
  /* Six columns fit a 390px phone: headers wrap, cells sit closer. */
  .hce-table{font-size:12px}
  .hce-table th,.hce-table td{padding:6px 4px}
  .hce-table thead th{white-space:normal;vertical-align:bottom}
  .hce-table th[scope="row"]{min-width:78px}
}
