/* Collateral — per-task dashboard + builder styles (2026-07-06, restyle of
 * dc-dashboard.css). Kept OUT of collateral.css (Agent B) to avoid contention
 * with the list page. Orange brand accents via the shared tokens
 * (ui/css/styles.css). Class prefixes: .cold-* dashboard, .colb-* builder/palette.
 * Self-contained buttons/inputs (.col-btn / .col-input) so this module never
 * depends on the old design-collateral stylesheet being loaded. */

/* -- shared buttons + inputs (self-contained) --------------------------------- */
.col-btn {
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  border: 1px solid transparent;
}
.col-btn--primary { background: var(--color-accent-light, #f5a623); color: #fff; }
.col-btn--primary:hover:not(:disabled) { background: var(--color-accent-dark, #d4791a); }
.col-btn--primary:disabled { opacity: 0.6; cursor: default; }
.col-btn--ghost { background: #fff; border-color: #cbd5e1; color: #334155; }
.col-btn--ghost:hover { background: #f8fafc; }
.col-input {
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
}
.col-input:focus {
  outline: none;
  border-color: var(--color-accent-light, #f5a623);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.12);
}

/* -- dashboard shell ---------------------------------------------------------- */
.cold-wrap { display: block; width: 100%; box-sizing: border-box; }
.cold-wrap * { box-sizing: border-box; }

.cold-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
}
.cold-back-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}
.cold-back-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.cold-back-btn svg { width: 18px; height: 18px; }
.cold-title-group { flex: 1 1 auto; min-width: 0; }
.cold-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  word-break: break-word;
}
.cold-subline { font-size: 13px; color: #64748b; }
.cold-edit-btn {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  border: 1px solid var(--color-accent-dark, #d4791a);
  background: var(--color-accent-light, #f5a623);
  color: #fff;
}
.cold-edit-btn:hover { background: var(--color-accent-dark, #d4791a); }

.cold-loading,
.cold-empty {
  padding: 32px 24px;
  text-align: center;
  color: #64748b;
}
.cold-empty-title { font-size: 15px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.cold-empty-sub { font-size: 13px; color: #94a3b8; }
.cold-error {
  padding: 16px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: 10px;
  color: #991b1b;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

/* -- layout grid -------------------------------------------------------------- */
.cold-canvas { display: block; }
.cold-section { margin: 8px 0 4px; }
.cold-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-accent-light, #f5a623);
}
.cold-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 0 16px;
}
.cold-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* -- card --------------------------------------------------------------------- */
.cold-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px;
}
.cold-card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  margin: 0 0 10px;
}
.cold-muted { font-size: 13px; color: #94a3b8; }
.cold-notice {
  margin-top: 8px;
  font-size: 12px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 6px 8px;
}
.cold-btn-sm { padding: 6px 12px; font-size: 12px; }

/* -- notes card --------------------------------------------------------------- */
.cold-notes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cold-note {
  position: relative;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 8px 28px 8px 10px;
  background: #f8fafc;
}
.cold-note-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.cold-note-author { font-size: 12px; font-weight: 700; color: #334155; }
.cold-note-date { font-size: 11px; color: #94a3b8; }
.cold-note-body { font-size: 13px; color: #0f172a; word-break: break-word; }
.cold-note-body p { margin: 0 0 6px; }
.cold-note-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}
.cold-note-del:hover { color: #991b1b; background: #fef2f2; }
.cold-note-add { display: flex; flex-direction: column; gap: 8px; }
.cold-note-editor {
  min-height: 60px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}
.cold-note-editor:empty:before {
  content: attr(data-ph);
  color: #94a3b8;
}
.cold-note-editor:focus { outline: none; border-color: var(--color-accent-light, #f5a623); }
.cold-note-add .col-btn { align-self: flex-start; }

/* -- files card --------------------------------------------------------------- */
.cold-files { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cold-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 6px 28px 6px 8px;
  background: #f8fafc;
}
.cold-file-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  flex: 0 0 auto;
}
.cold-file-icon { font-size: 20px; flex: 0 0 auto; }
.cold-file-name {
  font-size: 13px;
  color: var(--color-accent-dark, #d4791a);
  word-break: break-all;
  text-decoration: none;
}
.cold-file-name:hover { text-decoration: underline; }
.cold-file-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cold-file-url { flex: 2 1 180px; }
.cold-file-nm { flex: 1 1 120px; }

/* upload drop target */
.cold-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  padding: 16px 12px;
  margin-bottom: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cold-dropzone:hover { border-color: var(--color-accent-light, #f5a623); background: #fff7ed; }
.cold-dropzone.is-drag { border-color: var(--color-accent-dark, #d4791a); background: #fff7ed; }
.cold-dropzone.is-uploading { opacity: 0.7; cursor: progress; }
.cold-dropzone-text { font-size: 12px; font-weight: 600; color: #64748b; }

/* -- team card (flat list of assigned teammates) ------------------------------ */
.cold-team-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cold-team-member {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 8px 28px 8px 10px;
  background: #f8fafc;
}
.cold-team-name { flex: 1 1 auto; font-size: 13px; color: #0f172a; word-break: break-word; }
.cold-team-add { align-self: flex-start; }
.cold-team-select { width: 100%; }

/* -- status timeline card ----------------------------------------------------- */
.cold-timeline { display: flex; flex-direction: column; gap: 0; }
.cold-tl-node {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0 6px 4px;
}
.cold-tl-node:not(:last-child):before {
  content: '';
  position: absolute;
  left: 9px;
  top: 20px;
  bottom: -6px;
  width: 2px;
  background: #e2e8f0;
}
.cold-tl-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 3px;
  box-shadow: 0 0 0 3px #fff;
  z-index: 1;
}
.cold-tl-node.is-current .cold-tl-name { font-weight: 800; color: #0f172a; }
.cold-tl-node.is-current { background: rgba(245, 166, 35, 0.08); border-radius: 8px; }
.cold-tl-clickable { cursor: pointer; border-radius: 8px; transition: background 0.12s; }
.cold-tl-clickable:hover { background: rgba(245, 166, 35, 0.12); }
.cold-tl-clickable:focus-visible { outline: 2px solid var(--color-accent-light, #f5a623); outline-offset: 1px; }
.cold-tl-node.is-busy { opacity: 0.55; cursor: progress; }
.cold-tl-label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cold-tl-name { font-size: 13px; color: #334155; }

/* -- ＋ Add-status node (per-item, front-facing) -- */
.cold-tl-add { padding-top: 8px; align-items: center; }
.cold-tl-addbtn {
  appearance: none;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cold-tl-addbtn:hover { background: rgba(245, 166, 35, 0.12); border-color: var(--color-accent-light, #f5a623); color: #0f172a; }
.cold-tl-addbtn:focus-visible { outline: 2px solid var(--color-accent-light, #f5a623); outline-offset: 1px; }
.cold-tl-addform { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.cold-tl-addcolor {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.cold-tl-addlabel { flex: 1 1 120px; min-width: 100px; }
.cold-tl-emptyhint { margin-top: 8px; }

/* -- request materials card --------------------------------------------------- */
.cold-req-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cold-req {
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cold-req-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cold-req-name { font-size: 13px; font-weight: 600; color: #334155; }
.cold-req-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 2px 8px;
  color: #475569;
  background: #e2e8f0;
}
.cold-req-status.is-active { color: #92400e; background: #fef3c7; }
.cold-req-status.is-completed { color: #166534; background: #dcfce7; }
.cold-req-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cold-req-token { font-size: 11px; color: #64748b; font-family: ui-monospace, Menlo, monospace; }
.cold-req-date { font-size: 11px; color: #94a3b8; margin-left: auto; }
.cold-req-copy {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent-dark, #d4791a);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
}
.cold-req-copy:hover { border-color: var(--color-accent-light, #f5a623); background: #fff7ed; }
.cold-req-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* -- portal approval card ----------------------------------------------------- */
.cold-portal-state { margin-bottom: 10px; }
.cold-portal-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  color: #475569;
  background: #e2e8f0;
}
.cold-portal-pill.is-none { color: #64748b; background: #f1f5f9; }
.cold-portal-pill.is-awaiting-approval { color: #92400e; background: #fef3c7; }
.cold-portal-pill.is-approved { color: #166534; background: #dcfce7; }
.cold-portal-pill.is-changes-requested { color: #991b1b; background: #fee2e2; }
.cold-portal-note { margin-top: 10px; font-size: 11px; color: #94a3b8; line-height: 1.4; }
.cold-card > .col-btn + .col-btn { margin-top: 8px; }
.cold-edit-approval-btn { margin-top: 8px; }

/* -- saving tag --------------------------------------------------------------- */
.cold-saving-tag { font-size: 12px; color: #94a3b8; }
.cold-saving-tag.is-saving { color: var(--color-accent-dark, #d4791a); }
.cold-saving-tag.is-error { color: #991b1b; }

/* -- client preview cards (read-only CRM preview) ----------------------------- */
/* media gallery */
.cold-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.cold-gallery-item { margin: 0; }
.cold-gallery-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  cursor: zoom-in;
  background: #f8fafc;
  transition: border-color 0.12s, transform 0.12s;
}
.cold-gallery-thumb:hover { border-color: var(--color-accent-light, #f5a623); transform: scale(1.02); }
.cold-gallery-file {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
  grid-column: 1 / -1;
}

/* description */
.cold-desc { font-size: 13px; color: #0f172a; line-height: 1.5; word-break: break-word; }
.cold-desc p { margin: 0 0 6px; }
.cold-desc-note { padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.cold-desc-note:last-child { border-bottom: none; }

/* item details */
.cold-details { display: flex; flex-direction: column; gap: 6px; }
.cold-detail-row { display: flex; gap: 10px; align-items: baseline; }
.cold-detail-label {
  flex: 0 0 84px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}
.cold-detail-value { flex: 1 1 auto; font-size: 13px; color: #0f172a; word-break: break-word; }

/* approval actions (disabled preview) */
.cold-approve-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cold-approve-btn[disabled],
.cold-change-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.cold-approve-note { margin-top: 8px; font-size: 11px; color: #94a3b8; line-height: 1.4; }

/* -- dashboard view tabs (Dashboard | Client Preview) ------------------------- */
.cold-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.cold-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #64748b;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.cold-tab:hover { color: #0f172a; }
.cold-tab.active {
  color: #0f172a;
  border-bottom-color: var(--color-accent-light, #f5a623);
  font-weight: 600;
}

/* -- Gridstack (viewer, static) ----------------------------------------------- */
.cold-canvas .grid-stack { background: transparent; }
.cold-canvas .grid-stack-item-content {
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
.cold-canvas .grid-stack-item-content > .cold-card { flex: 1 1 auto; }
.cold-section--grid {
  margin: 0;
  display: flex;
  align-items: center;
  height: 100%;
  width: 100%;
}
.cold-section--grid .cold-section-title { width: 100%; }

/* editing surface (builder owns the canvas) */
.cold-canvas.cold-editing {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 10px;
  background: #f8fafc;
}

/* -- builder: palette (rendered in the swapped sidebar or inline) ------------- */
.colb-palette { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.colb-palette-inline {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 12px;
}
.colb-palette-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.colb-block {
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--color-accent-light, #f5a623);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
}
.colb-block:hover { background: #fff7ed; border-color: var(--color-accent-light, #f5a623); }
.colb-block-name { font-size: 13px; font-weight: 700; color: #334155; }
.colb-block-hint { font-size: 11px; color: #94a3b8; }
.colb-palette-foot { font-size: 11px; color: #94a3b8; padding-top: 4px; }

/* -- builder: toolbar --------------------------------------------------------- */
.colb-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 0 0 14px;
  border: 1px solid var(--color-accent-light, #f5a623);
  border-radius: 10px;
  background: #fff7ed;
}
.colb-hint { flex: 1 1 auto; font-size: 12px; color: #7c5a1e; }

/* -- builder tabs (Edit Page | Edit Client Section) --------------------------- */
.colb-tabs { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.colb-tab {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #64748b;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.colb-tab:hover { border-color: var(--color-accent-light, #f5a623); color: #0f172a; }
.colb-tab.active {
  background: var(--color-accent-light, #f5a623);
  border-color: var(--color-accent-dark, #d4791a);
  color: #fff;
}

/* -- builder grid + widget chrome --------------------------------------------- */
.colb-grid { min-height: 220px; }
.colb-grid .grid-stack-item-content {
  inset: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.colb-item-section-w .grid-stack-item-content { background: #f1f5f9; border-left: 3px solid #94a3b8; }
.colb-item-card-w .grid-stack-item-content { border-left: 3px solid var(--color-accent-light, #f5a623); }
.colb-widget-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
  cursor: grab;
  flex: 0 0 auto;
}
.colb-widget-head:active { cursor: grabbing; }
.colb-widget-kind {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  background: #eef2f7;
  border-radius: 4px;
  padding: 2px 6px;
}
.colb-widget-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  padding: 4px 8px;
  cursor: text;
}
.colb-widget-remove {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}
.colb-widget-remove:hover { color: #991b1b; background: #fef2f2; }
.colb-widget-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 8px;
  opacity: 0.9;
  pointer-events: none;
}
.colb-widget-body .cold-card { border: none; padding: 0; }
.colb-grid-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 28px 12px;
}

/* -- notes card: chat-bubble / messaging look --------------------------------- */
.cold-note {
  border-color: #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.cold-note-author { color: var(--color-accent-dark, #d4791a); }

/* -- Materials card: AI summary + notes --------------------------------------- */
.cold-materials-summary {
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.cold-materials-summary-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #92400e;
  margin-bottom: 6px;
}
.cold-materials-summary-body {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.cold-materials-summary-body + .cold-materials-summary-body { margin-top: 8px; }
.cold-materials-notes { margin-bottom: 12px; }
.cold-materials-notes-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  margin-bottom: 6px;
}
.cold-materials-quill { margin-bottom: 4px; }

/* -- type-aware file previews (Materials + Final Deliverable) ------------------ */
.cold-file--image,
.cold-file--video,
.cold-file--audio,
.cold-file--pdf {
  flex-direction: column;
  align-items: stretch;
}
.cold-file-media {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}
.cold-file--image .cold-file-thumb {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
}
.cold-file-video {
  width: 100%;
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  background: #000;
}
.cold-file-audio { width: 100%; }
.cold-file-pdf {
  width: 100%;
  height: 220px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

/* -- Final Deliverable card --------------------------------------------------- */
.cold-final-card { border-color: var(--color-accent-light, #f5a623); }
.cold-final-slot { margin-bottom: 10px; }
.cold-final-meta { font-size: 11px; color: #94a3b8; margin-top: 6px; }

/* -- Send to Client Portal card (whole-card shading) -------------------------- */
.cold-portalcard { transition: background 0.15s, border-color 0.15s; }
.cold-portalcard.is-none { background: #f8fafc; border-color: #e2e8f0; }
.cold-portalcard.is-awaiting-approval {
  background: #fffbeb;
  border-color: #fcd34d;
  border-left: 4px solid #f59e0b;
}
.cold-portalcard.is-approved {
  background: #f0fdf4;
  border-color: #86efac;
  border-left: 4px solid #16a34a;
}
.cold-portalcard.is-changes-requested {
  background: #fef2f2;
  border-color: #fca5a5;
  border-left: 4px solid #dc2626;
}
.cold-portal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cold-portal-approved {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #166534;
}
.cold-portal-crs { margin-top: 10px; }
.cold-portal-crs-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #991b1b;
  margin-bottom: 6px;
}
.cold-portal-cr {
  border: 1px solid #fecaca;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.cold-portal-cr-body { font-size: 13px; color: #0f172a; white-space: pre-wrap; word-break: break-word; }
.cold-portal-cr-date { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* -- mobile ------------------------------------------------------------------- */
@media (max-width: 720px) {
  .cold-cols { grid-template-columns: 1fr; }
  .cold-gallery { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .cold-file-pdf { height: 180px; }
  .cold-file-video { max-height: 200px; }

  /* Builder toolbar: tabs on their own row, Save/Done/hint wrap below. */
  .colb-toolbar { flex-wrap: wrap; }
  .colb-tabs { order: -1; width: 100%; }
  .colb-tab { flex: 1 1 auto; text-align: center; padding: 8px 10px; }

  /* Keep widget headers comfortably tappable. */
  .colb-widget-head { min-height: 40px; }
  .colb-widget-remove { width: 32px; height: 32px; }

  /* Inline palette fallback (no sidebar): scroll the blocks horizontally so a
     long palette never gets cut off. */
  .colb-palette-inline {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 10px;
  }
  .colb-palette-inline .colb-palette-title,
  .colb-palette-inline .colb-palette-foot { display: none; }
  .colb-palette-inline .colb-block { flex: 0 0 auto; min-width: 140px; }

  /* Both the static viewer grid and the editor grid collapse to 1 column via
     Gridstack columnOpts (breakpoint 700). Allow horizontal scroll as a safety
     net so content is never cut off if a wide widget survives. */
  .cold-canvas .grid-stack,
  .colb-grid { overflow-x: auto; }
}

/* ── #134 dark mode overrides ─────────────────────────────── */
/* .col-btn / .col-input are re-declared at the top of this file with the same
   selectors as collateral.css, and the overrides there are prefixed with
   html[data-theme="dark"], so they outrank these copies whatever the load
   order. They are deliberately not repeated. */

/* text tiers */
html[data-theme="dark"] .cold-title,
html[data-theme="dark"] .cold-note-body,
html[data-theme="dark"] .cold-team-name,
html[data-theme="dark"] .cold-desc,
html[data-theme="dark"] .cold-detail-value,
html[data-theme="dark"] .cold-portal-cr-body,
html[data-theme="dark"] .cold-tl-node.is-current .cold-tl-name,
html[data-theme="dark"] .cold-tab:hover,
html[data-theme="dark"] .cold-tab.active,
html[data-theme="dark"] .colb-tab:hover { color: #e2e8f0; }

html[data-theme="dark"] .cold-empty-title,
html[data-theme="dark"] .cold-tl-name,
html[data-theme="dark"] .cold-req-name,
html[data-theme="dark"] .colb-block-name,
html[data-theme="dark"] .cold-materials-summary-body { color: #cbd5e1; }

html[data-theme="dark"] .cold-subline,
html[data-theme="dark"] .cold-loading,
html[data-theme="dark"] .cold-empty,
html[data-theme="dark"] .cold-section-title,
html[data-theme="dark"] .cold-card-title,
html[data-theme="dark"] .cold-dropzone-text,
html[data-theme="dark"] .cold-req-token,
html[data-theme="dark"] .cold-detail-label,
html[data-theme="dark"] .cold-materials-notes-title,
html[data-theme="dark"] .cold-tab,
html[data-theme="dark"] .colb-palette-title,
html[data-theme="dark"] .colb-tab,
html[data-theme="dark"] .colb-widget-kind { color: #94a3b8; }

html[data-theme="dark"] .cold-empty-sub,
html[data-theme="dark"] .cold-muted,
html[data-theme="dark"] .cold-note-date,
html[data-theme="dark"] .cold-req-date,
html[data-theme="dark"] .cold-portal-note,
html[data-theme="dark"] .cold-approve-note,
html[data-theme="dark"] .cold-saving-tag,
html[data-theme="dark"] .cold-final-meta,
html[data-theme="dark"] .cold-portal-cr-date,
html[data-theme="dark"] .colb-block-hint,
html[data-theme="dark"] .colb-palette-foot,
html[data-theme="dark"] .colb-grid-empty { color: #94a3b8; }

/* top bar */
html[data-theme="dark"] .cold-back-btn {
  border-color: #334155;
  background: #1e293b;
  color: #cbd5e1;
}
html[data-theme="dark"] .cold-back-btn:hover { background: #334155; border-color: #475569; }
html[data-theme="dark"] .cold-edit-btn { color: #0b1220; }

/* error + notice */
html[data-theme="dark"] .cold-error {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}
html[data-theme="dark"] .cold-notice {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.30);
}
html[data-theme="dark"] .cold-saving-tag.is-error,
html[data-theme="dark"] .cold-portal-crs-title { color: #fca5a5; }

/* cards + inset panels */
html[data-theme="dark"] .cold-card,
html[data-theme="dark"] .colb-grid .grid-stack-item-content,
html[data-theme="dark"] .colb-block,
html[data-theme="dark"] .cold-file-pdf {
  border-color: #334155;
  background: #1e293b;
}
html[data-theme="dark"] .cold-portal-cr {
  border-color: rgba(248, 113, 113, 0.30);
  background: #1e293b;
}

html[data-theme="dark"] .cold-file,
html[data-theme="dark"] .cold-team-member,
html[data-theme="dark"] .cold-req,
html[data-theme="dark"] .cold-gallery-file {
  border-color: rgba(148, 163, 184, 0.14);
  background: #273449;
}

/* notes — the chat-bubble block later in the file is the one that wins */
html[data-theme="dark"] .cold-note {
  border-color: #334155;
  background: #273449;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .cold-note-del { color: #94a3b8; }
html[data-theme="dark"] .cold-note-del:hover,
html[data-theme="dark"] .colb-widget-remove:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
}
html[data-theme="dark"] .cold-note-editor {
  border-color: #334155;
  color: #e2e8f0;
  background: #0f172a;
}
html[data-theme="dark"] .cold-note-editor:empty:before { color: #64748b; }

/* dropzone */
html[data-theme="dark"] .cold-dropzone {
  border-color: #475569;
  background: rgba(148, 163, 184, 0.06);
}
html[data-theme="dark"] .cold-dropzone:hover,
html[data-theme="dark"] .cold-dropzone.is-drag { background: rgba(245, 166, 35, 0.12); }

/* timeline */
html[data-theme="dark"] .cold-tl-node:not(:last-child):before { background: #334155; }
/* The dot halo punches a hole in the connector line, so it must match the card. */
html[data-theme="dark"] .cold-tl-dot { box-shadow: 0 0 0 3px #1e293b; }
html[data-theme="dark"] .cold-tl-node.is-current { background: rgba(245, 166, 35, 0.12); }
html[data-theme="dark"] .cold-tl-clickable:hover { background: rgba(245, 166, 35, 0.18); }
html[data-theme="dark"] .cold-tl-addbtn {
  border-color: #475569;
  background: rgba(148, 163, 184, 0.08);
  color: #cbd5e1;
}
html[data-theme="dark"] .cold-tl-addbtn:hover {
  background: rgba(245, 166, 35, 0.18);
  color: #e2e8f0;
}
html[data-theme="dark"] .cold-tl-addcolor { border-color: #334155; }

/* request-materials + portal pills */
html[data-theme="dark"] .cold-req-status,
html[data-theme="dark"] .cold-portal-pill {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.18);
}
html[data-theme="dark"] .cold-portal-pill.is-none {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}
html[data-theme="dark"] .cold-req-status.is-active,
html[data-theme="dark"] .cold-portal-pill.is-awaiting-approval {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.18);
}
html[data-theme="dark"] .cold-req-status.is-completed,
html[data-theme="dark"] .cold-portal-pill.is-approved {
  color: #86efac;
  background: rgba(34, 197, 94, 0.18);
}
html[data-theme="dark"] .cold-portal-pill.is-changes-requested {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
}
html[data-theme="dark"] .cold-req-copy {
  background: #1e293b;
  border-color: #334155;
}
html[data-theme="dark"] .cold-req-copy:hover { background: rgba(245, 166, 35, 0.16); }

/* portal card shading — keep each state hue, drop the fill to a tint */
html[data-theme="dark"] .cold-portalcard.is-none {
  background: #273449;
  border-color: #334155;
}
html[data-theme="dark"] .cold-portalcard.is-awaiting-approval {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.34);
  border-left-color: #fbbf24;
}
html[data-theme="dark"] .cold-portalcard.is-approved {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(74, 222, 128, 0.34);
  border-left-color: #4ade80;
}
html[data-theme="dark"] .cold-portalcard.is-changes-requested {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.34);
  border-left-color: #f87171;
}
html[data-theme="dark"] .cold-portal-approved { color: #86efac; }

/* gallery + description */
html[data-theme="dark"] .cold-gallery-thumb {
  border-color: #334155;
  background: #273449;
}
html[data-theme="dark"] .cold-desc-note { border-bottom-color: rgba(148, 163, 184, 0.14); }

/* view tabs */
html[data-theme="dark"] .cold-tabs { border-bottom-color: #334155; }

/* builder */
html[data-theme="dark"] .cold-canvas.cold-editing,
html[data-theme="dark"] .colb-palette-inline {
  border-color: #475569;
  background: rgba(148, 163, 184, 0.06);
}
html[data-theme="dark"] .colb-block:hover { background: rgba(245, 166, 35, 0.14); }
html[data-theme="dark"] .colb-toolbar { background: rgba(245, 166, 35, 0.12); }
html[data-theme="dark"] .colb-hint { color: #fcd34d; }
html[data-theme="dark"] .colb-tab {
  background: #1e293b;
  border-color: #334155;
}
html[data-theme="dark"] .colb-tab.active { color: #0b1220; }
html[data-theme="dark"] .colb-item-section-w .grid-stack-item-content {
  background: #273449;
  border-left-color: #64748b;
}
html[data-theme="dark"] .colb-widget-head {
  background: #273449;
  border-bottom-color: rgba(148, 163, 184, 0.14);
}
html[data-theme="dark"] .colb-widget-kind { background: rgba(148, 163, 184, 0.16); }
html[data-theme="dark"] .colb-widget-remove { color: #94a3b8; }

/* materials AI summary */
html[data-theme="dark"] .cold-materials-summary {
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.10);
}
html[data-theme="dark"] .cold-materials-summary-title { color: #fcd34d; }
