/* sold.css - Mark as sold (sold-ui.js on Ready), the Sold proposals screen, and New run's start from a sold proposal. */

.pill-sold { color: var(--ok-text); background: var(--ok-bg); }
.pill-sold::before { content: none; }
.pill-sold { padding: 3px 10px; }

/* ---------- Ready ---------- */
.sold-section .section-h h2 { display: flex; align-items: center; gap: 10px; }
.sold-section .sold-lede { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; line-height: 1.55; max-width: 72ch; }
.sold-section .sold-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sold-section .sold-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sold-section .sold-hint { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.sold-section .sold-hint .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.sold-section .sold-hint strong { color: var(--ink-2); font-weight: 600; }
.sold-section .sold-table td, .sold-section .sold-table th { font-size: 13px; }
.sold-section .sold-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sold-section .sold-table .muted { color: var(--muted); }
.sold-section .sold-total td { font-weight: 700; color: var(--ink); background: var(--surface-2); }
.sold-section .sold-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 18px; }
@media (max-width: 900px) { .sold-section .sold-grid { grid-template-columns: minmax(0, 1fr); } }
.sold-section h3 { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.sold-section h3:not(:first-child) { margin-top: 16px; }
.sold-section .sold-files, .sold-section .sold-drafts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sold-section .sold-file { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; background: var(--surface); transition: border-color var(--dur-2) var(--ease); }
.sold-section .sold-file:hover { border-color: var(--navy); }
.sold-section .sold-file > .ic { width: 18px; height: 18px; flex: none; color: var(--muted); }
.sold-section .sold-file span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sold-section .sold-file strong { font-size: 13px; font-weight: 600; }
.sold-section .sold-file small, .sold-section .sold-draft small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sold-section .sold-draft { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.sold-section .sd-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 100%; }
.sold-section .sold-draft small { white-space: normal; }
.sold-section .sd-main strong { font-size: 13px; }
.sold-section .sd-actions { display: flex; gap: 6px; flex: none; }
.sold-section .sold-history ul { margin: 8px 0 0 24px; padding-left: 16px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* ---------- The dialog ---------- */
.sold-dialog .sd-intro { margin: 0 0 14px; color: var(--ink-2); font-size: 13.5px; }
.sold-dialog .note { margin-bottom: 14px; }
.sold-dialog .sd-lines { display: flex; flex-direction: column; gap: 12px; }
.sold-dialog .sd-line { border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.sold-dialog .sd-line.is-open { border-color: var(--warn); background: var(--warn-bg); }
.sold-dialog .sd-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sold-dialog .sd-head strong { font-size: 14px; }
.sold-dialog .sd-status { font-size: 12px; font-weight: 600; color: var(--ok-text); }
.sold-dialog .is-open .sd-status { color: var(--warn-text); }
.sold-dialog select { width: 100%; }
.sold-dialog .sd-suggest { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.sold-dialog .sd-date { margin-top: 16px; max-width: 240px; }
.sd-foot { display: flex; align-items: center; gap: 10px; width: 100%; justify-content: flex-end; }
.sd-foot .sd-count { margin-right: auto; font-size: 12.5px; color: var(--muted); }

/* ---------- Sold proposals screen ---------- */
.sold-screen .sold-search { max-width: 420px; margin-bottom: 18px; }
.sold-screen .sold-clients { display: flex; flex-direction: column; gap: 14px; }
.sold-screen .sold-client { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--sh-1); }
.sold-screen .sold-client h2 { font-size: 16px; margin: 0 0 10px; }
.sold-screen .sold-years { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sold-screen .sold-year { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.sold-screen .sold-year:first-child { border-top: 0; }
.sold-screen .sy-year { font-size: 18px; font-weight: 700; color: var(--navy); min-width: 56px; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .sold-screen .sy-year { color: var(--ink); }
.sold-screen .sy-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-2); }
.sold-screen .sy-main small { color: var(--muted); font-size: 12px; }
.sold-screen .sy-actions { display: flex; gap: 8px; flex: none; }

/* ---------- New run: start from a sold proposal ---------- */
.sold-start { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--ok); background: var(--ok-bg); border-radius: var(--r-md); margin: 0 0 16px; }
.sold-start .ic { width: 18px; height: 18px; color: var(--ok-text); flex: none; }
.sold-start span { flex: 1; font-size: 13px; color: var(--ink); line-height: 1.5; }
.sold-pick-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.sold-pick-list button { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); cursor: pointer; color: var(--ink); font: inherit; }
.sold-pick-list button:hover, .sold-pick-list button:focus-visible { border-color: var(--navy); }
.sold-pick-list strong { font-size: 14px; }
.sold-pick-list small { font-size: 12px; color: var(--muted); }
.runs-row-flags .pill-sold { margin-right: 6px; }
#sold-slot > .section:last-child { margin-bottom: 26px; }  /* the only child of its slot: keep the gap before the next section */
.sold-section .sold-history .sv-files { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; margin-left: 10px; }
.sold-section .sold-history .sv-files a { color: var(--info-text); }
.sold-section .note + .sold-actions { margin-top: 12px; }
.sold-section .sold-foot .note { margin-bottom: 12px; }
.sold-section .section-h { flex-wrap: wrap; row-gap: 6px; }
.sold-section .section-h h2 { white-space: nowrap; }
.sold-section .section-h .sold-share { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.sold-section .section-h .sold-share .section-note { white-space: nowrap; }
@media (max-width: 600px) {  /* a phone: the sharing note wraps under the heading instead of pushing Share off screen */
  .sold-section .section-h .sold-share { flex-wrap: wrap; margin-left: 0; max-width: 100%; }
  .sold-section .section-h .sold-share .section-note { white-space: normal; }
}
