/* dealtools
 *
 * Deal-modal extras (title company, buyer's agent, attachment scanner, showing
 * tally), the resource viewer, and the drag-into-a-folder affordances on the
 * resources shelf.
 *
 * icon() emits an SVG with no width or height, and styles.css sets a global
 * svg { width:16px; height:16px }. Anything here that draws its own SVG has to
 * say otherwise or it comes out 16px square. See .dt-spark svg below.
 */

/* ---- Deal modal: the two parties ---- */

.dt-sec { border-top: 1px solid var(--border); padding-top: 12px; }

.dt-party {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 10px;
  background: var(--bg, #fff);
}

.dt-party-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }

.dt-party-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
/* Grid children default to min-width:auto, so a long escrow address pushes the
   phone column off the modal instead of ellipsing. */
.dt-party-grid > label { display: block; min-width: 0; }
.dt-party-grid > label > span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}
.dt-party-grid input { width: 100%; min-width: 0; }

.dt-scan {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  cursor: pointer;
}
.dt-scan input { margin-top: 2px; flex: none; }
.dt-scan > span { display: block; min-width: 0; overflow-wrap: anywhere; }
.dt-scan .dt-note { display: block; margin-top: 2px; }
/* A free mailbox provider quietly narrowing the match is the one thing here
   worth a colour, because it changes what the feature does. */
.dt-scan .dt-note.warn { color: #92400e; }

/* ---- The auto-upload log ---- */

.dt-log { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.dt-log-head {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 8px 11px; background: var(--panel, #f8fafc);
  border-bottom: 1px solid var(--border);
}
.dt-log-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 11px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.dt-log-row:last-child { border-bottom: 0; }
.dt-log-row.skipped { opacity: .72; }
.dt-log-row > span { min-width: 0; overflow-wrap: anywhere; }

/* ---- The showing tally ---- */

.dt-tally-nums { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.dt-big { display: flex; flex-direction: column; line-height: 1.15; }
.dt-big b { font-size: 22px; }
.dt-big span { font-size: 11px; color: var(--muted); }

.dt-spark { margin: 2px 0 4px; overflow-x: auto; }
/* Overrides the 16px global default; the chart sizes itself from its own
   width/height attributes. */
.dt-spark svg { width: auto; height: auto; display: block; }
.dt-bar-all { fill: #cbd5e1; }
.dt-bar-new { fill: #2563eb; }
.dt-axis { stroke: var(--border); stroke-width: 1; }

.dt-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 11px; color: var(--muted); margin-top: 4px;
}
.dt-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.dt-key-new { background: #2563eb; }
.dt-key-all { background: #cbd5e1; }

.dt-people { margin-top: 8px; }
.dt-people summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.dt-person {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.dt-person > * { min-width: 0; overflow-wrap: anywhere; }

/* ---- The pipeline card badge ---- */

.dt-card-tally:empty { display: none; }
.dt-card-tally { margin-top: 6px; }
.dt-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: #eff6ff; color: #1d4ed8;
}
.dt-pill svg { width: 12px; height: 12px; }

/* ---- Resources: dragging into folders ---- */

.res-card[draggable="true"] { cursor: grab; }
.res-card.dragging { opacity: .45; }
.res-card.drop-on, .res-crumbs a.drop-on {
  outline: 2px dashed #2563eb;
  outline-offset: 2px;
  background: #eff6ff;
}
.res-crumbs a.drop-on { border-radius: 5px; padding: 1px 4px; }
.res-hint { margin-top: 14px; }

/* ---- Resource viewer ---- */

.rv-bar {
  display: flex; gap: 10px; align-items: center;
  padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.rv-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.rv-title b { overflow-wrap: anywhere; }
.rv-note { margin: -6px 0 12px; }

.rv-stage { min-height: 60vh; }
.rv-frame {
  width: 100%;
  height: 78vh;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #525659;
}
.rv-img {
  display: flex; justify-content: center; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel, #f8fafc); padding: 14px;
}
.rv-img img { max-width: 100%; height: auto; border-radius: 6px; }
.rv-cant { text-align: left; padding: 22px; }
.rv-cant p { margin: 8px 0 0; }
