* {
    box-sizing: border-box;
}
:root {
    --color-bg: #fff;
    --color-bg-secondary: #fff;
    --color-bg-tertiary: #f5f5f5;
    --color-bg-code: #e0e0e0;
    --color-bg-code-alt: #f0f0f0;
    --color-text: #000;
    --color-text-muted: #666;
    --color-border: #000;
    --color-border-light: #ccc;
    --color-border-mid: #999;
    --color-hover: #e0e0e0;
    --color-accent: #007AFF;
}
body.theme-dark {
    --color-bg: #0d0d0d;
    --color-bg-secondary: #1a1a1a;
    --color-bg-tertiary: #2d2d2d;
    --color-bg-code: #3a3a3a;
    --color-bg-code-alt: #333;
    --color-text: #e8e8e8;
    --color-text-muted: #a0a0a0;
    --color-border: #444;
    --color-border-light: #333;
    --color-border-mid: #555;
    --color-hover: #333;
    --color-accent: #5eb3ff;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 16px;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
}
.container {
    max-width: 800px;
    margin: 0 auto;
}
h1 {
    font-size: 28px;
    margin: 0 0 16px 0;
    color: var(--color-text);
}
.input-section {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
}
.help-doc-trigger {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
}
.help-doc-trigger:hover {
    background: var(--color-text);
    color: var(--color-bg);
}
.doc-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.doc-overlay.show {
    display: flex;
}
.doc-panel {
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    max-width: 900px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.doc-header {
    padding: 16px 20px;
    border-bottom: 2px solid var(--color-border);
    font-weight: 700;
    font-size: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.doc-close {
    width: 36px;
    height: 36px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}
.doc-close:hover {
    background: var(--color-text);
    color: var(--color-bg);
}
.edit-password-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.edit-password-overlay.show {
    display: flex;
}
.edit-password-panel {
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.edit-password-header {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--color-text);
}
.edit-password-body {
    color: var(--color-text);
}
.edit-password-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    box-sizing: border-box;
    margin-bottom: 8px;
}
.edit-password-input:focus {
    outline: none;
    border-color: var(--color-border-mid);
}
.edit-password-error {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0 0 12px 0;
    min-height: 18px;
}
.edit-password-error.has-error {
    color: #c00;
}
.edit-password-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.edit-password-change-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: var(--color-text-muted);
    cursor: pointer;
    text-decoration: underline;
}
.edit-password-change-link:hover {
    color: var(--color-accent);
}
.edit-password-row {
    margin-bottom: 12px;
}
.edit-password-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-text);
}
.edit-password-row input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    box-sizing: border-box;
}
.launch-password-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    z-index: 10002;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
body.launch-locked .launch-password-overlay {
    display: flex !important;
}
body.launch-locked { overflow: hidden; }
body.launch-checking .container,
body.launch-locked .container {
    visibility: hidden;
}
.launch-password-panel {
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.launch-password-header {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--color-text);
}
.launch-password-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    box-sizing: border-box;
}
.launch-password-input:focus {
    outline: none;
    border-color: var(--color-border-mid);
}
.launch-auth-fields {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border-light);
}
.launch-auth-fields.show {
    display: block;
}
.launch-auth-fields input {
    width: 100%;
    padding: 10px 12px;
    margin-top: 8px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    box-sizing: border-box;
}
.launch-auth-btn {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-text);
    color: var(--color-bg);
    font-weight: 700;
    cursor: pointer;
}
.launch-auth-status {
    margin-top: 8px;
    min-height: 18px;
    font-size: 12px;
    color: var(--color-text-muted);
}
.doc-body {
    overflow-y: auto;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
}
.doc-body h2 {
    font-size: 18px;
    margin: 20px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border-light);
}
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { font-size: 15px; margin: 14px 0 8px 0; }
.doc-body p { margin: 0 0 10px 0; }
.doc-body ul, .doc-body ol { margin: 8px 0 12px 0; padding-left: 24px; }
.doc-body li { margin-bottom: 4px; }
.doc-body code {
    background: var(--color-bg-code-alt);
    color: var(--color-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}
.doc-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}
.doc-body th, .doc-body td {
    border: 1px solid var(--color-border-light);
    padding: 8px 10px;
    text-align: left;
}
.doc-body th { background: var(--color-bg-tertiary); font-weight: 600; }
.input-row {
    display: flex;
    gap: 8px;
}
.command-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0 2px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    position: relative;
}
.command-input-wrap:focus-within {
    border-color: var(--color-border-mid);
}
#cmdInput {
    flex: 1 1 0;
    min-width: 2em;
    padding: 14px 14px;
    font-size: 16px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--color-text);
}
#cmdInput::placeholder {
    color: var(--color-text-muted);
}
.suggestion-hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--color-text);
    min-height: 18px;
}
.suggestion-hint.tappable {
    cursor: pointer;
    min-height: 44px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    text-decoration: underline;
    user-select: none;
}
.suggestion-hint.tappable:active {
    opacity: 0.85;
}
.suggestion-hint strong {
    color: var(--color-text);
}
#runBtn {
    padding: 14px 24px;
    font-size: 16px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
#runBtn:active {
    background: var(--color-hover);
}
.help-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-right: 32px;
}
.help-toggle {
    color: var(--color-text);
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
}
.help-quick-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    min-width: 0;
}
.help-quick-links span {
    color: var(--color-text-muted);
    cursor: pointer;
}
.help-quick-links span:hover {
    color: var(--color-accent);
}
.kpi-inline-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    font-size: 13px;
    color: var(--color-text-muted);
}
.top-kpi-row {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.top-kpi-row .kpi-inline-wrap {
    margin-left: 0;
    flex: 1 1 auto;
    min-width: 0;
}
.kpi-inline-item {
    text-decoration: none !important;
    cursor: default !important;
    user-select: none;
}
.kpi-inline-item .kpi-label {
    color: var(--color-text-muted);
    margin-right: 4px;
}
.kpi-inline-item .kpi-value {
    color: var(--color-text);
    font-weight: 600;
}
.kpi-inline-item-editable .kpi-value-editable,
.kpi-value-editable[data-kpi-key] {
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}
.kpi-inline-item-editable .kpi-value-editable:hover,
.kpi-value-editable[data-kpi-key]:hover {
    opacity: 0.85;
}
.kpi-value-edit-input {
    width: 3.2em;
    padding: 1px 4px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.kpi-inline-item .kpi-value.kpi-value-low {
    color: #c0392b;
}
.kpi-inline-item .kpi-value.kpi-tt-met {
    color: #000;
}
body.theme-dark .kpi-inline-item .kpi-value.kpi-tt-met {
    color: var(--color-text);
}
.kpi-trend-btn {
    font-size: 11px;
    line-height: 1.2;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
    cursor: pointer;
    flex-shrink: 0;
}
.kpi-trend-btn:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.daily-kpi-panel {
    max-width: min(96vw, 980px);
}
.daily-kpi-panel .daily-kpi-table-wrap {
    overflow-x: visible;
    margin-top: 12px;
    max-height: 50vh;
    overflow-y: auto;
}
.daily-kpi-panel table.daily-kpi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: auto;
}
.daily-kpi-panel table.daily-kpi-table th,
.daily-kpi-panel table.daily-kpi-table td {
    border: 1px solid var(--color-border);
    padding: 6px 7px;
    text-align: right;
    white-space: nowrap;
}
.daily-kpi-panel table.daily-kpi-table th:first-child,
.daily-kpi-panel table.daily-kpi-table td:first-child {
    text-align: left;
}
.daily-kpi-panel table.daily-kpi-table .daily-kpi-metric {
    font-weight: 600;
}
.daily-kpi-panel table.daily-kpi-table .daily-kpi-metric.kpi-value-low {
    color: #c0392b;
}
.daily-kpi-panel table.daily-kpi-table .daily-kpi-metric.kpi-tt-met {
    color: #000;
}
body.theme-dark .daily-kpi-panel table.daily-kpi-table .daily-kpi-metric.kpi-tt-met {
    color: var(--color-text);
}
.daily-kpi-panel .kpi-spark-row td {
    vertical-align: bottom;
    height: 44px;
}
.daily-kpi-panel .kpi-spark {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 2px;
    height: 36px;
}
.daily-kpi-panel .kpi-spark-bar {
    width: 5px;
    min-height: 2px;
    border-radius: 1px;
    background: var(--color-accent);
    opacity: 0.85;
}
.daily-kpi-panel .daily-kpi-status {
    font-size: 12px;
    margin-top: 8px;
    color: var(--color-text-muted);
}
.daily-kpi-panel .daily-kpi-status.ok { color: #27ae60; }
.daily-kpi-panel .daily-kpi-status.err { color: #c0392b; }
.daily-kpi-panel .daily-kpi-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
.daily-kpi-panel .daily-kpi-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.daily-kpi-panel .daily-kpi-toolbar-label {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 600;
}
.daily-kpi-panel .daily-kpi-view-toggle {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.daily-kpi-panel .daily-kpi-view-btn {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
    cursor: pointer;
}
.daily-kpi-panel .daily-kpi-view-btn:hover {
    color: var(--color-text);
    border-color: var(--color-accent);
}
.daily-kpi-panel .daily-kpi-view-btn.is-active {
    color: var(--color-text);
    border-color: var(--color-accent);
    background: var(--color-bg);
    font-weight: 600;
}
.matches-threshold-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--color-text);
}
.matches-threshold-wrap .threshold-btn {
    font-size: inherit;
    color: var(--color-text);
    cursor: pointer;
    text-decoration: underline;
}
.matches-threshold-wrap .threshold-btn:hover {
    color: var(--color-text);
}
.matches-threshold-wrap .threshold-btn.active {
    font-weight: 600;
}
.uploads-table.matches-table thead th .threshold-btn {
    cursor: pointer;
    text-decoration: underline;
    color: var(--color-text);
}
.uploads-table.matches-table thead th .threshold-btn.active {
    font-weight: 600;
}
.uploads-table-wrap.matches-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
    -webkit-overflow-scrolling: touch;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-secondary);
}
.uploads-table.matches-table {
    min-width: 900px;
    margin-top: 0;
    table-layout: fixed;
    width: 100%;
}
/* All-companies + matches tables: keep columns aligned & prevent wrap. */
.uploads-table.matches-table th.col-company,
.uploads-table.matches-table td.col-company {
    width: 224px;
    max-width: 224px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.uploads-table.matches-table th.col-r,
.uploads-table.matches-table td.col-r {
    width: 78px;
}
.uploads-table.matches-table th.col-supply,
.uploads-table.matches-table td.col-supply,
.uploads-table.matches-table th.col-demand,
.uploads-table.matches-table td.col-demand {
    width: 170px;
    white-space: nowrap;
}
.uploads-table.matches-table th.col-bwork,
.uploads-table.matches-table td.col-bwork,
.uploads-table.matches-table th.col-swork,
.uploads-table.matches-table td.col-swork {
    width: 160px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.uploads-table.matches-table th.col-view,
.uploads-table.matches-table td.col-view {
    width: 72px;
    white-space: nowrap;
}
.uploads-table.matches-table td.matches-company-r-cell {
    white-space: nowrap;
    vertical-align: middle;
}
.uploads-table.matches-table td.matches-company-r-cell .log-review-days {
    white-space: nowrap;
}

/* All companies table: fit within viewport (no horizontal scroll). */
.uploads-table-wrap.matches-table-wrap.all-companies-wrap {
    overflow-x: hidden;
    border: none;
    border-radius: 0;
    background: transparent;
    margin-top: 6px;
}
.uploads-table.matches-table.all-companies-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}
.uploads-table.matches-table.all-companies-table th,
.uploads-table.matches-table.all-companies-table td {
    padding-left: 8px;
    padding-right: 8px;
}
.uploads-table.matches-table.all-companies-table th.col-company,
.uploads-table.matches-table.all-companies-table td.col-company {
    width: 18%;
    max-width: none;
}
.uploads-table.matches-table.all-companies-table th.col-rating,
.uploads-table.matches-table.all-companies-table td.col-rating {
    width: 11%;
    white-space: nowrap;
}
.uploads-table.matches-table.all-companies-table th.col-dscore,
.uploads-table.matches-table.all-companies-table td.col-dscore {
    white-space: nowrap;
    width: 4.5rem;
    text-align: right;
}
.uploads-table.matches-table.all-companies-table th.col-r,
.uploads-table.matches-table.all-companies-table td.col-r {
    width: 7%;
}
.uploads-table.matches-table.all-companies-table th.col-bwork,
.uploads-table.matches-table.all-companies-table td.col-bwork,
.uploads-table.matches-table.all-companies-table th.col-swork,
.uploads-table.matches-table.all-companies-table td.col-swork {
    width: 13%;
    max-width: none;
}
.uploads-table.matches-table.all-companies-table th.col-supply,
.uploads-table.matches-table.all-companies-table td.col-supply,
.uploads-table.matches-table.all-companies-table th.col-demand,
.uploads-table.matches-table.all-companies-table td.col-demand {
    width: 15%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.uploads-table.matches-table.all-companies-table th.col-view,
.uploads-table.matches-table.all-companies-table td.col-view {
    width: 8%;
}
.matches-drating-group {
    margin-bottom: 20px;
}
.matches-drating-title {
    font-weight: 700;
    font-size: 15px;
    margin: 14px 0 8px 0;
    color: var(--color-text);
}
/* ===== Matches overview: summary, filters, richer rows ===== */
.matches-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 8px;
}
.matches-stat {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.matches-stat-total { background: var(--color-accent); color: #fff; }
.matches-stat-cross { background: rgba(13, 122, 13, 0.14); color: #0d7a0d; }
body.theme-dark .matches-stat-cross { background: rgba(46, 204, 46, 0.16); color: #2ecc2e; }
.matches-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.matches-filter-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 200px;
    min-width: 160px;
    max-width: 380px;
    padding: 5px 10px;
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    background: var(--color-bg-secondary);
}
.matches-filter-search:focus-within { border-color: var(--color-accent); }
.matches-filter-icon { color: var(--color-text-muted); font-size: 15px; line-height: 1; }
.matches-filter-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}
.matches-filter-input::placeholder { color: var(--color-text-muted); }
.matches-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--color-border-light);
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.matches-chip:hover { border-color: var(--color-text-muted); }
.matches-chip.active { border-color: var(--color-accent); color: var(--color-accent); background: rgba(0, 122, 255, 0.08); }
.matches-filter-count { color: var(--color-text-muted); font-size: 12.5px; }
/* Table columns */
.uploads-table.matches-table th.col-match-side,
.uploads-table.matches-table td.col-match-side { width: 210px; }
.uploads-table.matches-table th.col-match-actions,
.uploads-table.matches-table td.col-match-actions { width: 110px; white-space: nowrap; }
.match-side-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.match-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border-mid);
    flex: 0 0 auto;
}
.match-dot.live { background: #1f9d55; }
.match-dot.red-hot { background: #e0281e; }
.match-fund { font-weight: 700; }
.match-px { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.match-px.match-ask { color: #c0392b; }
.match-px.match-bid { color: #0d6b0d; }
body.theme-dark .match-px.match-ask { color: #ff8a80; }
body.theme-dark .match-px.match-bid { color: #66d17a; }
.match-sz { color: var(--color-text-muted); font-weight: 600; }
.match-spread {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.match-spread-cross { background: rgba(13, 122, 13, 0.16); color: #0d7a0d; }
.match-spread-tight { background: rgba(0, 122, 255, 0.12); color: #007AFF; }
.match-spread-gap { background: var(--color-bg-tertiary); color: var(--color-text-muted); }
body.theme-dark .match-spread-cross { background: rgba(46, 204, 46, 0.18); color: #2ecc2e; }
body.theme-dark .match-spread-tight { background: rgba(94, 179, 255, 0.16); color: #5eb3ff; }
.match-size-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.match-score { display: flex; align-items: center; gap: 6px; }
.match-score-bar {
    position: relative;
    width: 46px;
    height: 6px;
    border-radius: 999px;
    background: var(--color-border-light);
    overflow: hidden;
    flex: 0 0 auto;
}
.match-score-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--color-accent); border-radius: 999px; }
.match-score-num { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; }
.match-copy-btn {
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 3px 9px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.match-copy-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.uploads-table.matches-table tr.match-row:hover > td { background: var(--color-bg-tertiary); }
/* ===== All companies — coverage overview ===== */
.allcos-overview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}
.allcos-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    border: 1px solid transparent;
    white-space: nowrap;
}
.allcos-chip b { color: var(--color-text); font-weight: 800; }
.allcos-chip-total { background: var(--color-accent); color: #fff; }
.allcos-chip-total b { color: #fff; }
.allcos-chip-rating { border-color: var(--color-border-light); }
.allcos-chip-flag {
    cursor: pointer;
    border-color: var(--color-border-light);
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.allcos-chip-flag:hover { border-color: var(--color-text-muted); }
.allcos-chip-review.active {
    background: rgba(198, 93, 0, 0.14);
    color: #c65d00;
    border-color: #c65d00;
}
.allcos-chip-unassigned.active {
    background: rgba(139, 0, 255, 0.12);
    color: #8B00FF;
    border-color: #8B00FF;
}
.allcos-chip-review.active b,
.allcos-chip-unassigned.active b { color: inherit; }
body.theme-dark .allcos-chip-review.active {
    color: #f0a35a; border-color: #f0a35a; background: rgba(240, 163, 90, 0.14);
}
body.theme-dark .allcos-chip-unassigned.active {
    color: #b366ff; border-color: #b366ff; background: rgba(179, 102, 255, 0.16);
}
.allcos-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.allcos-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 420px;
    padding: 6px 10px;
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    transition: border-color 0.12s ease;
}
.allcos-search:focus-within { border-color: var(--color-accent); }
.allcos-search-icon { color: var(--color-text-muted); font-size: 15px; line-height: 1; }
.allcos-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}
.allcos-search-input::placeholder { color: var(--color-text-muted); }
.allcos-view-toggle { color: var(--color-text); font-size: 14px; }
.allcos-filter-count { color: var(--color-text-muted); font-size: 12.5px; }
/* Rank + D-score columns */
.uploads-table.matches-table.all-companies-table th.col-rank,
.uploads-table.matches-table.all-companies-table td.col-rank {
    width: 2.6rem;
    text-align: right;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}
.allcos-dscore-val { font-weight: 700; }
/* Ranked table has an extra rank column: let Company absorb remaining width so nothing overflows. */
.all-companies-ranked th.col-company,
.all-companies-ranked td.col-company { width: auto; max-width: none; }
.all-companies-ranked th.col-rating,
.all-companies-ranked td.col-rating { width: 9%; }
.all-companies-ranked th.col-r,
.all-companies-ranked td.col-r { width: 3.2rem; }
.all-companies-ranked th.col-bwork,
.all-companies-ranked td.col-bwork,
.all-companies-ranked th.col-swork,
.all-companies-ranked td.col-swork { width: 12%; }
.all-companies-ranked th.col-supply,
.all-companies-ranked td.col-supply,
.all-companies-ranked th.col-demand,
.all-companies-ranked td.col-demand { width: 15%; }
.all-companies-ranked th.col-view,
.all-companies-ranked td.col-view { width: 5.5%; }
.allcos-rating-pill {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}
/* Row emphasis + stale marker */
.uploads-table.matches-table.all-companies-table tr.allcos-row:hover > td {
    background: var(--color-bg-tertiary);
}
tr.allcos-row.allcos-row-stale td.col-company {
    box-shadow: inset 3px 0 0 #c65d00;
}
body.theme-dark tr.allcos-row.allcos-row-stale td.col-company {
    box-shadow: inset 3px 0 0 #f0a35a;
}
/* Per-group coverage stats */
.matches-drating-count { color: var(--color-text-muted); font-weight: 500; margin-left: 4px; }
.matches-drating-stat {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}
.matches-drating-stat.stat-review { background: rgba(198, 93, 0, 0.12); color: #c65d00; }
.matches-drating-stat.stat-unassigned { background: rgba(139, 0, 255, 0.10); color: #8B00FF; }
body.theme-dark .matches-drating-stat.stat-review { color: #f0a35a; background: rgba(240, 163, 90, 0.14); }
body.theme-dark .matches-drating-stat.stat-unassigned { color: #b366ff; background: rgba(179, 102, 255, 0.16); }
.gear-wrap { position: relative; display: inline-flex; align-items: center; }
.gear-trigger {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: var(--color-text);
}
.gear-trigger:hover { color: var(--color-accent); }
.gear-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 180px;
    padding: 6px 0;
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}
.gear-dropdown.show { display: block; }
.gear-item {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.gear-item:hover { background: var(--color-hover); }
.help-box {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text);
}
.help-box.show {
    display: block;
}
.help-box code {
    background: var(--color-bg-code);
    color: var(--color-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}
.result-section {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    display: none;
    color: var(--color-text);
}
.result-section.show {
    display: block;
}
.result-header {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--color-text);
}
.result-header .header-muted {
    font-weight: 400;
    font-size: 14px;
    color: var(--color-text-muted);
}
.pipe-result-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pipe-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
    cursor: pointer;
    flex-shrink: 0;
}
.pipe-expand-btn:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.pipe-expand-btn.is-active {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: var(--color-bg);
}
.pipe-expand-icon {
    display: block;
}
.pipe-view .pipe-section-block {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid var(--color-border);
}
.pipe-view .pipe-section-block:first-of-type {
    margin-top: 12px;
    padding-top: 12px;
}
body.pipe-expanded .container {
    max-width: min(96vw, 1440px);
}
body.pipe-expanded #resultSection.pipe-expanded {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: 8px;
}
body.pipe-expanded .home-hot-leads-section,
body.pipe-expanded .deals-list-section {
    display: none;
}
body.pipe-expanded .pipe-view-expanded .pipe-section-block {
    border-top: none;
    margin-top: 20px;
    padding-top: 0;
}
body.pipe-expanded .pipe-view-expanded .pipe-section-block + .pipe-section-block {
    border-top: 1px solid var(--color-border-light);
    padding-top: 16px;
    margin-top: 20px;
}
body.pipe-expanded .pipe-view-expanded .view-conversations-section {
    overflow-x: visible;
}
body.pipe-expanded .pipe-view-expanded .uploads-table.getting-signed-table {
    min-width: 100%;
    width: 100%;
    table-layout: auto;
}
body.pipe-expanded .pipe-view-expanded .getting-signed-table .getting-signed-action-cell {
    max-width: none;
}
body.pipe-expanded .pipe-view-expanded .getting-signed-table th:last-child,
body.pipe-expanded .pipe-view-expanded .getting-signed-table td:last-child {
    width: auto;
    min-width: 76px;
}
.header-review-days { font-weight: 600; font-size: 14px; }
.header-review-days.header-review-green { color: #0a7a0a; }
.header-review-days.header-review-yellow { color: #b8860b; }
.header-review-days.header-review-orange { color: #c65d00; }
.header-review-days.header-review-red { color: #c00; }
body.theme-dark .header-review-days.header-review-green { color: #4ade4a; }
body.theme-dark .header-review-days.header-review-yellow { color: #eab308; }
body.theme-dark .header-review-days.header-review-orange { color: #f97316; }
body.theme-dark .header-review-days.header-review-red { color: #f66; }
.rvw-header-divider {
    border-top: 1px solid var(--color-border);
    margin: 0 0 12px 0;
}
.rvw-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 2px;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-light);
    line-height: 1.4;
}
.rvw-toolbar .rvw-label {
    color: var(--color-text-muted);
    font-weight: 400;
    margin-right: 4px;
}
.rvw-toolbar .rvw-sep {
    color: var(--color-border-mid);
    margin: 0 4px;
    user-select: none;
}
@media (max-width: 480px) {
    .rvw-toolbar { gap: 8px 6px; font-size: 13px; }
    .rvw-toolbar .rvw-sep { margin: 0 2px; }
    .rvw-toolbar select { padding: 2px 4px; font-size: 13px; max-width: 100%; }
    .input-section { padding: 12px; }
    .help-row { padding-right: 28px; gap: 6px; }
    .help-quick-links { gap: 8px; font-size: 13px; }
}
.rvw-toolbar .view-reload-link {
    font-size: 14px;
    font-weight: 400;
    margin-left: 0;
}
.rvw-toolbar select {
    padding: 2px 6px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
}
.rvw-toolbar .rvw-current {
    font-weight: 600;
    color: var(--color-text);
}
.columns {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
/* Buy-side (Demand) left, sell-side (Supply) right when shown together. */
.columns .column.demand {
    order: 0;
}
.columns .column.supply {
    order: 1;
}
.column {
    flex: 1;
    min-width: 280px;
}
.name-details-columns {
    flex-wrap: nowrap;
    align-items: flex-start;
}
.name-details-columns .column--company-info {
    flex: 1 1 33%;
    max-width: 33%;
    min-width: 200px;
}
.name-details-columns .column--tracking-dates {
    flex: 2 1 66%;
    max-width: 66%;
    min-width: 280px;
}
.company-info-block {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg);
}
.tracking-dates-block .tracking-date-row {
    align-items: center;
    gap: 8px;
    border-left: 3px solid transparent;
    padding-left: 8px;
}
/* Buyside first, sellside second (see renderTrackingDatesInner) — orange/green accent line. C. A. gets no line (kept at the bottom, unclassified). */
.tracking-date-row.tracking-date-row-buyside { border-left-color: #c65d00; }
.tracking-date-row.tracking-date-row-sellside { border-left-color: #0d6b0d; }
body.theme-dark .tracking-date-row.tracking-date-row-buyside { border-left-color: #f97316; }
body.theme-dark .tracking-date-row.tracking-date-row-sellside { border-left-color: #2ecc2e; }
.tracking-date-row .tracking-date-main {
    display: flex;
    flex: 1;
    align-items: baseline;
    min-width: 0;
    gap: 12px;
}
.tracking-date-row .tracking-date-label {
    flex: 0 0 9.75rem;
    max-width: 9.75rem;
}
.tracking-date-row .tag-row-date-value {
    flex: 1;
    min-width: 0;
}
.tracking-ping-history {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
}
.tracking-ping-latest,
.tracking-ping-prior {
    white-space: nowrap;
}
.tracking-ping-sep {
    color: var(--color-text-muted);
    white-space: pre;
}
.tracking-date-row .tracking-date-actions {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
@media (max-width: 768px) {
    .name-details-columns {
        flex-wrap: wrap;
    }
    .name-details-columns .column--company-info,
    .name-details-columns .column--tracking-dates {
        flex: 1 1 100%;
        max-width: 100%;
    }
}
.column-header {
    font-weight: 600;
    font-size: 16px;
    color: var(--color-text);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-border);
}
.column.demand .column-header {
    border-bottom-color: var(--color-border);
}
.best-block {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 12px;
    margin-bottom: 12px;
    color: var(--color-text);
}
.best-block-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}
.tracking-sort-btn {
    cursor: pointer;
    margin-left: 8px;
    font-size: 12px;
    text-decoration: underline;
    user-select: none;
}
.tracking-sort-btn:hover {
    color: var(--color-accent);
}
.tracking-sort-btn.active {
    text-decoration: none;
    font-weight: 700;
}
.best-block-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--color-border-mid);
    color: var(--color-text);
}
.best-block-row:last-child {
    border-bottom: none;
}
.lr-field-value-editable {
    cursor: pointer;
}
.best-block-row.lr-cnotes-row {
    flex-wrap: wrap;
    align-items: flex-start;
}
.lr-cnotes-display {
    color: #E6D4A8;
    font-weight: 600;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: right;
    max-width: 75%;
    flex: 1;
    min-width: 0;
}
.lr-field-edit-input.lr-cnotes-edit {
    max-width: 100%;
    min-height: 80px;
    min-width: 0;
    width: 100%;
    color: #E6D4A8;
    font-family: inherit;
    font-weight: 600;
    resize: vertical;
    line-height: 1.35;
}
/* Light theme: warmer gold-brown, a bit more chroma than plain gray-brown */
body:not(.theme-dark) .lr-cnotes-display,
body:not(.theme-dark) .lr-field-edit-input.lr-cnotes-edit {
    color: #7A6238;
}
.names-field-value-editable {
    cursor: pointer;
}
.names-field-value-editable:hover {
    text-decoration: underline;
    color: var(--color-accent);
}
.names-field-edit-input {
    width: 100%;
    max-width: 200px;
    padding: 2px 6px;
    font-size: 14px;
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
    box-sizing: border-box;
}
.names-field-edit-input:focus {
    outline: none;
    border-color: var(--color-accent);
}
.lr-field-edit-input {
    width: 100%;
    max-width: 140px;
    padding: 2px 6px;
    font-size: 14px;
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
    box-sizing: border-box;
}
.lr-field-edit-input:focus {
    outline: none;
    border-color: var(--color-accent);
}
.deal-lead-editable {
    cursor: pointer;
}
.lead-notes-label {
    color: #e86a00;
    font-weight: 600;
}
body.theme-dark .lead-notes-label {
    color: #f97316;
}
.deal-lead-edit-input {
    min-width: 60px;
    max-width: 180px;
    padding: 2px 6px;
    font-size: 14px;
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
    box-sizing: border-box;
}
.deal-lead-edit-input:focus {
    outline: none;
    border-color: var(--color-accent);
}
.demand-rating-display:hover {
    opacity: 0.85;
}
.demand-rating-select {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 4px;
}
.copy-btn {
    margin-top: 8px;
    padding: 8px 16px;
    font-size: 14px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
}
.copy-btn:hover {
    background: var(--color-hover);
}
.names-date-calendar-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 2px 4px;
    font-size: 14px;
    line-height: 1;
}
.names-date-calendar-btn:hover {
    color: var(--color-text);
}
.tracking-date-calendar-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.tracking-date-picker-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}
.tracking-date-row.tracking-date-row-saving {
    opacity: 0.65;
}
.tracking-date-row.tracking-date-row-saved {
    background: rgba(40, 167, 69, 0.08);
    border-radius: 4px;
    transition: background 0.3s ease;
}
body.theme-dark .tracking-date-row.tracking-date-row-saved {
    background: rgba(46, 204, 46, 0.1);
}
.copy-link {
    margin-top: 8px;
    font-size: 14px;
    cursor: pointer;
    color: var(--color-link, #0066cc);
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
}
.copy-link:hover {
    color: var(--color-link-hover, #004499);
}
.record-line {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
}
.record-line[id^="view-record-"] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 2px;
}
.record-line-toggle-pad {
    flex: 1 1 24px;
    align-self: stretch;
    min-height: 1.4em;
    min-width: 24px;
    cursor: pointer;
}
.record-line.recent-log-focused .record-line-toggle-pad {
    background: rgba(0, 122, 255, 0.06);
}
body.theme-dark .record-line.recent-log-focused .record-line-toggle-pad {
    background: rgba(94, 179, 255, 0.08);
}
.record-line:last-child {
    border-bottom: none;
}
.record-actions {
    margin-left: 8px;
    font-size: 12px;
    color: var(--color-text);
}
.record-action {
    color: var(--color-text);
    text-decoration: underline;
    cursor: pointer;
}
.record-action:hover {
    text-decoration: underline;
}
.record-action + .record-action {
    margin-left: 8px;
}
.view-record-delete,
.view-record-modify {
    display: inline-block;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    text-decoration: none;
}
.view-record-modify { margin-left: 6px; }
.view-record-delete { margin-left: 6px; }
.record-actions .view-record-delete { margin-left: 6px; }
.view-record-delete {
    color: #999;
}
.view-record-delete:hover {
    color: var(--color-text);
}
body.theme-dark .view-record-delete {
    color: #666;
}
.view-record-modify {
    color: #aaa;
}
.view-record-modify:hover {
    color: var(--color-text);
}
body.theme-dark .view-record-modify {
    color: #777;
}
.view-record-copy {
    color: #aaa;
    margin-left: 6px;
    display: inline-block;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    text-decoration: none;
}
.view-record-copy:hover {
    color: var(--color-text);
}
body.theme-dark .view-record-copy {
    color: #777;
}
.record-actions.lead-record-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
}
.record-actions.lead-record-actions .call-log-wrap,
.record-actions.lead-record-actions .delete-x-wrap {
    display: inline-flex;
    align-items: center;
}
.record-actions.lead-record-actions .view-record-call,
.record-actions.lead-record-actions .view-record-copy,
.record-actions.lead-record-actions .view-record-modify,
.record-actions.lead-record-actions .view-record-delete,
.record-actions.lead-record-actions .recent-log-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-left: 0;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    background: #f5f5f5;
    color: #999;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
}
.record-actions.lead-record-actions .view-record-call:hover,
.record-actions.lead-record-actions .view-record-copy:hover,
.record-actions.lead-record-actions .view-record-modify:hover,
.record-actions.lead-record-actions .view-record-delete:hover,
.record-actions.lead-record-actions .recent-log-delete:hover {
    border-color: #d0d0d0;
    background: #ececec;
    color: #555;
    text-decoration: none;
}
body.theme-dark .record-actions.lead-record-actions .view-record-call,
body.theme-dark .record-actions.lead-record-actions .view-record-copy,
body.theme-dark .record-actions.lead-record-actions .view-record-modify,
body.theme-dark .record-actions.lead-record-actions .view-record-delete,
body.theme-dark .record-actions.lead-record-actions .recent-log-delete {
    border-color: #606060;
    background: #3a3a3a;
    color: #c4c4c4;
}
body.theme-dark .record-actions.lead-record-actions .view-record-call:hover,
body.theme-dark .record-actions.lead-record-actions .view-record-copy:hover,
body.theme-dark .record-actions.lead-record-actions .view-record-modify:hover,
body.theme-dark .record-actions.lead-record-actions .view-record-delete:hover,
body.theme-dark .record-actions.lead-record-actions .recent-log-delete:hover {
    border-color: #888;
    background: #484848;
    color: var(--color-text);
}
.call-bump-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 4px;
    padding: 0;
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    vertical-align: middle;
    border-radius: 4px;
}
.call-bump-btn:hover {
    color: #555;
    background: rgba(0,0,0,0.06);
}
body.theme-dark .call-bump-btn {
    color: #666;
}
body.theme-dark .call-bump-btn:hover {
    color: #aaa;
    background: rgba(255,255,255,0.08);
}
.call-bump-btn svg {
    width: 14px;
    height: 14px;
}
.call-show-q {
    display: inline;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    margin-right: 6px;
}
.call-show-q:hover {
    color: #555;
}
body.theme-dark .call-show-q {
    color: #666;
}
body.theme-dark .call-show-q:hover {
    color: #aaa;
}
.call-copy-c {
    display: inline;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    margin-right: 6px;
}
.call-copy-c:hover {
    color: #555;
}
body.theme-dark .call-copy-c {
    color: #666;
}
body.theme-dark .call-copy-c:hover {
    color: #aaa;
}
.call-important-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
    flex-shrink: 0;
    background: #e0e0e0;
}
.call-important-dot.important {
    background: #e91e8c;
}
body.theme-dark .call-important-dot {
    background: #555;
}
body.theme-dark .call-important-dot.important {
    background: #e91e8c;
}
.call-important-dot:hover {
    opacity: 0.9;
}
.convo-move-signed-btn {
    display: inline-block;
    margin-left: 4px;
    padding: 0 3px;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    vertical-align: middle;
}
.convo-move-signed-btn:hover {
    color: #0d5c0d;
}
body.theme-dark .convo-move-signed-btn {
    color: #777;
}
body.theme-dark .convo-move-signed-btn:hover {
    color: #5cb85c;
}
.view-record-call {
    display: inline-block;
    margin-left: 4px;
    color: #aaa;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}
.view-record-call:hover {
    color: var(--color-text);
}
body.theme-dark .view-record-call {
    color: #777;
}
.view-record-tag {
    display: inline-block;
    margin-left: 4px;
    color: #aaa;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}
.view-record-tag:hover {
    color: var(--color-text);
}
body.theme-dark .view-record-tag {
    color: #777;
}
.tag-confirm-btn {
    font-size: 11px;
    color: #888;
    cursor: pointer;
    user-select: none;
    margin-left: 4px;
}
body.theme-dark .tag-confirm-btn {
    color: #666;
}
.tag-confirm-btn:hover {
    color: var(--color-text-muted);
}
.call-log-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}
.call-dl-emails {
    color: #0066cc;
    font-weight: 600;
}
body.theme-dark .call-dl-emails {
    color: #5eb3ff;
}
.call-log-confirm-btn {
    font-size: 11px;
    color: #888;
    cursor: pointer;
    user-select: none;
    text-decoration: underline;
}
body.theme-dark .call-log-confirm-btn {
    color: #666;
}
.call-log-confirm-btn:hover {
    color: var(--color-text-muted);
}
.call-logged-msg {
    font-size: 12px;
    color: var(--color-text-muted);
    font-style: italic;
}
.recent-log-delete {
    display: inline-block;
    margin-left: 8px;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    line-height: 1;
}
body.theme-dark .recent-log-delete {
    color: #666;
}
.recent-log-delete:hover {
    color: var(--color-text);
}
.record-line.recent-log-focused {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
.view-rh-brain-matches .view-rh-kbd-row.recent-log-focused {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}
tr.pipe-row.recent-log-focused {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}
tr.pipe-row.recent-log-focused > td {
    background: var(--color-bg-tertiary);
}
/* Keyboard focus highlight for show all companies rows */
.uploads-table.matches-table.all-companies-table tr.recent-log-focused {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}
.uploads-table.matches-table.all-companies-table tr.recent-log-focused > td {
    background: var(--color-bg-tertiary);
}
.delete-x-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}
.delete-confirm-btn {
    font-size: 11px;
    color: #888;
    cursor: pointer;
    user-select: none;
    text-decoration: underline;
}
body.theme-dark .delete-confirm-btn {
    color: #666;
}
.delete-confirm-btn:hover {
    color: var(--color-text-muted);
}
.record-deleted {
    font-size: 12px;
    color: var(--color-text-muted);
    font-style: italic;
}
.view-reload-link {
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
    margin-left: 12px;
    text-decoration: underline;
}
.view-reload-link:hover {
    text-decoration: underline;
}
.view-live-filter-bar {
    margin-bottom: 10px;
    font-size: 13px;
}
.view-live-filter-bar .view-live-filter-btn {
    margin-left: 0;
    text-decoration: none;
    color: var(--color-text);
}
.view-live-filter-bar .view-live-filter-btn:hover {
    text-decoration: none;
}
.view-live-filter-btn.view-live-filter-active {
    color: #0a7a0a;
}
body.theme-dark .view-live-filter-btn.view-live-filter-active {
    color: #4ade4a;
}
.view-live-filter-bar .view-hot-filter-btn {
    margin-left: 10px;
    text-decoration: none;
    color: var(--color-text);
}
.view-live-filter-bar .view-hot-filter-btn:hover {
    text-decoration: none;
}
.view-hot-filter-btn.view-hot-filter-active {
    color: #c62828;
    font-weight: 600;
}
body.theme-dark .view-hot-filter-btn.view-hot-filter-active {
    color: #ff5252;
}
.view-live-filter-bar .view-live-hot-filter-btn {
    margin-left: 10px;
    text-decoration: none;
    color: var(--color-text);
}
.view-live-filter-bar .view-live-hot-filter-btn:hover {
    text-decoration: none;
}
.view-live-hot-filter-btn.view-live-hot-filter-active {
    color: #b45309;
    font-weight: 600;
}
body.theme-dark .view-live-hot-filter-btn.view-live-hot-filter-active {
    color: #eab308;
}
.view-live-filter-bar .view-cold-filter-btn {
    margin-left: 10px;
    text-decoration: none;
    color: var(--color-text);
}
.view-live-filter-bar .view-cold-filter-btn:hover {
    text-decoration: none;
}
.view-cold-filter-btn.view-cold-filter-active {
    color: #1976d2;
    font-weight: 600;
}
body.theme-dark .view-cold-filter-btn.view-cold-filter-active {
    color: #64b5f6;
}
.view-full-list-section.hot-only-filter .record-line[id^="view-record-"]:not([data-red-hot="true"]) {
    display: none;
}
.view-full-list-section.live-hot-filter .record-line[id^="view-record-"]:not([data-live="true"]) {
    display: none;
}
.view-live-filter-bar .view-side-filter-btn {
    margin-left: 10px;
    text-decoration: none;
    color: var(--color-text-muted);
    cursor: pointer;
    user-select: none;
}
.view-live-filter-bar .view-side-filter-btn:hover {
    color: var(--color-text);
}
.view-live-filter-bar .view-side-filter-btn.view-side-filter-active {
    color: var(--color-text);
    font-weight: 600;
    text-decoration: underline;
}
.view-full-list-section.live-only-filter .record-line[id^="view-record-"]:not([data-live="true"][data-red-hot="false"]) {
    display: none;
}
.view-full-list-section.cold-only-filter .record-line[id^="view-record-"]:not([data-live="false"]) {
    display: none;
}
.view-live-filter-bar .view-sd-matches-btn {
    margin-left: 10px;
    text-decoration: none;
    color: #1565c0;
}
.view-live-filter-bar .view-sd-matches-btn:hover {
    text-decoration: underline;
}
body.theme-dark .view-live-filter-bar .view-sd-matches-btn {
    color: #64b5f6;
}
.view-rh-brain-matches { margin-top: 8px; }
.view-rh-match-section-title { font-size: 14px; font-weight: 600; margin: 16px 0 8px; }
.view-rh-match-row { display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--color-border-light); padding: 10px 0; }
.view-rh-match-left { flex: 1; min-width: 0; }
.view-rh-match-right { flex: 1.1; min-width: 0; }
.view-rh-match-ul { margin: 0; padding-left: 18px; }
.view-rh-match-ul li { margin: 4px 0; font-size: 13px; }
.view-rh-temp { font-size: 11px; color: var(--color-text-muted); }
.view-rh-noprice { color: var(--color-text-muted); font-style: italic; }
.view-rh-novar { color: #b45309; font-size: 12px; }
/* Only hide real Supply/Demand columns (recent logs layout), not unrelated `.column.*` elsewhere. */
.view-full-list-section.side-filter-supply .columns .column.demand {
    display: none;
}
.view-full-list-section.side-filter-demand .columns .column.supply {
    display: none;
}
.recent-demand-r0-separator {
    margin: 16px 0 12px;
    padding: 10px 0 0;
    border-top: 2px solid var(--color-border);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}
.recent-reviewed-count {
    font-weight: 700;
    color: var(--color-text);
}
.pps-ev {
    color: #b45309;
    font-weight: 700;
}
body.theme-dark .pps-ev {
    color: #eab308;
}
.fund-name {
    color: var(--color-accent);
    font-weight: 600;
}
.call-dl {
    font-weight: 700;
    color: #0d5c0d;
}
body.theme-dark .call-dl {
    color: #2ecc2e;
}
.call-date-display {
    color: #0066cc;
}
.call-date-display.call-date-today {
    color: #0d7a0d;
}
.call-date-display.call-date-yesterday,
.call-date-display.call-date-prior {
    color: #c00;
}
body.theme-dark .call-date-display {
    color: #5eb3ff;
}
body.theme-dark .call-date-display.call-date-today {
    color: #2ecc2e;
}
body.theme-dark .call-date-display.call-date-yesterday,
body.theme-dark .call-date-display.call-date-prior {
    color: #ff6b6b;
}
.call-meta .call-date-added {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.95em;
}
.call-line.call-section-start {
    border-top: 2px solid var(--color-border);
    margin-top: 2px;
}
/* ===== Calls to-do: toolbar (quick add + filter + counts) ===== */
.call-main-header {
    margin-bottom: 2px;
}
.call-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 6px;
}
.call-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    background: var(--color-bg-tertiary);
    transition: border-color 0.12s ease;
}
.call-add:focus-within {
    border-color: var(--color-accent);
}
.call-add-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}
.call-add-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    padding: 4px 2px;
}
.call-add-input::placeholder { color: var(--color-text-muted); }
.call-add-btn {
    flex-shrink: 0;
    border: 1px solid var(--color-accent);
    border-radius: 7px;
    padding: 6px 16px;
    background: var(--color-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.12s ease;
}
.call-add-btn:hover { opacity: 0.9; }
.call-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.call-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 160px;
    padding: 5px 10px;
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    transition: border-color 0.12s ease;
}
.call-filter:focus-within { border-color: var(--color-accent); }
.call-filter-icon { color: var(--color-text-muted); font-size: 15px; line-height: 1; }
.call-filter-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}
.call-filter-input::placeholder { color: var(--color-text-muted); }
.call-counts {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.call-stat {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.call-stat-overdue { background: rgba(204, 0, 0, 0.12); color: #c00; }
body.theme-dark .call-stat-overdue { background: rgba(255, 107, 107, 0.16); color: #ff6b6b; }
.call-stat-today { background: rgba(13, 122, 13, 0.12); color: #0d7a0d; }
body.theme-dark .call-stat-today { background: rgba(46, 204, 46, 0.16); color: #2ecc2e; }
.call-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.7;
}
.call-hint kbd {
    display: inline-block;
    padding: 0 5px;
    border: 1px solid var(--color-border-light);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-family: inherit;
    font-size: 11px;
    line-height: 1.5;
}
.call-empty {
    margin-top: 10px;
}
/* ===== Calls to-do: date groups ===== */
.call-groups { margin-top: 6px; }
.call-group { margin-top: 16px; }
.call-group:first-child { margin-top: 6px; }
.call-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0 3px 10px;
    margin-bottom: 2px;
    border-left: 3px solid var(--color-border-mid);
}
.call-group-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}
.call-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
}
.call-group-important .call-group-head { border-left-color: #e91e8c; }
.call-group-important .call-group-title { color: #e91e8c; }
.call-group-overdue .call-group-head { border-left-color: #c00; }
.call-group-overdue .call-group-title { color: #c00; }
.call-group-today .call-group-head { border-left-color: #0d7a0d; }
.call-group-today .call-group-title { color: #0d7a0d; }
.call-group-tomorrow .call-group-head { border-left-color: #0066cc; }
.call-group-tomorrow .call-group-title { color: #0066cc; }
body.theme-dark .call-group-overdue .call-group-head { border-left-color: #ff6b6b; }
body.theme-dark .call-group-overdue .call-group-title { color: #ff6b6b; }
body.theme-dark .call-group-today .call-group-head { border-left-color: #2ecc2e; }
body.theme-dark .call-group-today .call-group-title { color: #2ecc2e; }
body.theme-dark .call-group-tomorrow .call-group-head { border-left-color: #5eb3ff; }
body.theme-dark .call-group-tomorrow .call-group-title { color: #5eb3ff; }
/* ===== Calls to-do: row polish ===== */
.call-line {
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.12s ease;
}
.call-line:hover { background: var(--color-bg-tertiary); }
.call-list .call-line:last-child { border-bottom: none; }
.last-round-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--color-border);
    display: flex;
    flex-direction: column;
}
.last-round-section > .last-round-header {
    order: 0;
}
.last-round-section > .view-sd-leads-wrap {
    order: 1;
    width: 100%;
}
.last-round-section > .view-add-log-bar {
    order: 3;
    width: 100%;
}
/** VIEW — issuer: same lead order as show (leads first). */
.view-result-sd-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.view-result-sd-wrap > .view-sd-leads-wrap {
    order: 1;
    width: 100%;
}
.last-round-header {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--color-text);
}
.last-round-section .record-line {
    font-size: 16px;
    line-height: 1.5;
    padding: 6px 0;
}
.calc-result {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    color: var(--color-text);
}
.calc-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-mid);
    color: var(--color-text);
}
.calc-row:last-child {
    border-bottom: none;
}
.disclaimer {
    font-size: 11px;
    color: var(--color-text);
    margin-top: 8px;
}
/* Hide disclaimer text on-screen; keep in Copy output */
.disclaimer { display: none; }
.success-msg {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}
.error-msg {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}
.crm-copy {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
    font-family: monospace;
    border: 1px solid var(--color-border);
}
.loading {
    text-align: center;
    padding: 20px;
    color: var(--color-text);
}
.confirm-msg {
    padding: 12px 0;
    line-height: 1.5;
    color: var(--color-text);
}
.confirm-msg p {
    margin: 0 0 12px 0;
    color: var(--color-text);
}
.suggestion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.suggestion-btn {
    padding: 10px 16px;
    font-size: 14px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
}
.suggestion-btn:hover {
    background: var(--color-hover);
}
.names-dup-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.names-dup-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.names-dup-select-btn {
    flex: 1 1 auto;
    text-align: left;
}
.names-dup-delete-hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--color-text-muted);
}
.last-command {
    margin-top: 8px;
    font-size: 12px;
    color: var(--color-text);
    min-height: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.last-command span {
    font-style: italic;
}
.quick-call-inline {
    display: none;
    align-items: center;
    gap: 6px;
}
.quick-call-inline.show {
    display: inline-flex;
}
.quick-call-inline .quick-call-input {
    min-width: 280px;
    width: 320px;
    padding: 2px 0 4px 0;
    margin: 0 4px;
    font-size: 14px;
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    background: transparent;
    color: var(--color-text);
}
.quick-call-inline .quick-call-input::placeholder {
    color: var(--color-text-muted);
}
.quick-call-inline .quick-call-input:focus {
    outline: none;
    border-bottom-color: var(--color-border-mid);
}
.quick-call-inline .quick-call-log-link {
    cursor: pointer;
    text-decoration: underline;
    color: var(--color-text-muted);
}
.quick-call-inline .quick-call-log-link:hover {
    color: var(--color-text);
}
.quick-call-feedback {
    font-size: 12px;
    color: var(--color-text-muted);
    font-style: italic;
}
.quick-call-feedback.success {
    color: #28a745;
}
/* Homepage Red Hot panel — same shell as result/recent logs (outside command card). */
.home-hot-leads-section {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    color: var(--color-text);
}
.home-hot-leads-header {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.home-hot-leads-sub {
    font-weight: 400;
    font-size: 14px;
    color: var(--color-text-muted);
}
.home-hot-leads-reload-btn {
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    padding: 7px 12px;
}
.home-hot-leads-reload-btn:hover,
.home-hot-leads-reload-btn:focus {
    background: var(--color-text);
    color: var(--color-bg);
    outline: none;
}
.home-hot-leads-reload-btn[aria-disabled="true"] {
    cursor: default;
    opacity: 0.65;
}
.home-hot-leads-loading {
    font-size: 14px;
    color: var(--color-text-muted);
    font-style: italic;
}
.home-hot-leads-list {
    margin-top: 4px;
}
.home-hot-leads-columns {
    margin-top: 4px;
}
.main-buttons {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.main-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}
.main-btn:hover {
    background: var(--color-hover);
}
.main-btn.todo {
    border-color: var(--color-border);
    color: var(--color-text);
}
.main-btn.todo:hover {
    background: var(--color-hover);
}
.deals-list-section {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    color: var(--color-text);
}
.deals-list-section.show {
    display: block;
}
.deals-list-header {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--color-text);
}
.deal-card {
    background: var(--color-bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    border-left: 4px solid var(--color-border);
    border: 1px solid var(--color-border);
    border-left-width: 4px;
}
.deal-card.demand {
    border-left-color: var(--color-border);
}
.deal-card-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--color-text);
}
.deal-card-row:last-child {
    margin-bottom: 0;
}
.deal-card-label {
    font-weight: 600;
    color: var(--color-text);
}
.deal-card-value {
    color: var(--color-text);
}
.deal-card-buttons {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}
.deal-btn {
    padding: 6px 12px;
    font-size: 13px;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    text-decoration: underline;
}
.deal-btn:hover {
    background: var(--color-hover);
}
.deal-btn-modify {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}
.deal-btn-modify:hover {
    background: var(--color-hover);
}
.deal-btn-delete {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}
.deal-btn-delete:hover {
    background: var(--color-hover);
}
.deal-edit-form {
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 12px;
}
.deal-edit-row {
    margin-bottom: 8px;
}
.deal-edit-row label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}
.deal-edit-row input,
.deal-edit-row select,
.deal-edit-row textarea {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
}
.deal-edit-buttons {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}
.deal-btn-save {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}
.deal-btn-save:hover {
    background: var(--color-hover);
}
.deal-btn-cancel {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}
.deal-btn-cancel:hover {
    background: var(--color-hover);
}
.names-overview-table table {
    border: 1px solid var(--color-border);
}
.names-overview-table th {
    background: var(--color-bg-tertiary);
    font-weight: 600;
    white-space: nowrap;
}
.names-overview-table td {
    white-space: nowrap;
}
.names-overview-table tr:hover {
    background: var(--color-bg-tertiary);
}
.names-overview-table tr {
    cursor: pointer;
}
.theme-toggle {
    font-size: 8pt;
    color: var(--color-text-muted);
    cursor: pointer;
    text-decoration: underline;
    user-select: none;
}
.theme-toggle:hover {
    color: var(--color-text);
}
.top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.offline-status {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--color-border-light);
    border-radius: 999px;
    padding: 4px 9px;
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}
.offline-status.is-ready {
    color: #0d6b0d;
}
.offline-status.is-offline {
    color: #9a5a00;
    border-color: #9a5a00;
}
.work-timer {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--color-border-light);
    border-radius: 999px;
    padding: 4px 11px 4px 9px;
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.work-timer:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.work-timer:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
.work-timer .work-timer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border-mid);
    flex-shrink: 0;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.work-timer .work-timer-time {
    min-width: 52px;
    text-align: right;
}
.work-timer.is-running {
    border-color: #1f9d55;
    color: #1f9d55;
    background: rgba(31, 157, 85, 0.10);
}
.work-timer.is-running:hover {
    border-color: #1f9d55;
    color: #1f9d55;
}
.work-timer.is-running .work-timer-dot {
    background: #1f9d55;
    box-shadow: 0 0 0 0 rgba(31, 157, 85, 0.55);
    animation: work-timer-pulse 1.6s ease-out infinite;
}
.work-timer.is-busy {
    opacity: 0.6;
    pointer-events: none;
}
body.theme-dark .work-timer.is-running {
    color: #4ade80;
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.12);
}
body.theme-dark .work-timer.is-running .work-timer-dot {
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
}
@keyframes work-timer-pulse {
    0% { box-shadow: 0 0 0 0 rgba(31, 157, 85, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(31, 157, 85, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31, 157, 85, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .work-timer.is-running .work-timer-dot {
        animation: none;
    }
}
.work-timer-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.work-timer-log-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.work-timer-log-btn:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.work-timer-panel {
    max-width: min(96vw, 620px);
}
.work-timer-log-intro {
    color: var(--color-text-muted);
    font-size: 13px;
}
.work-timer-log-add {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    background: var(--color-bg-tertiary);
}
.work-timer-log-add-label {
    font-weight: 600;
    font-size: 13px;
}
.work-timer-log-date,
.work-timer-log-min {
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 5px 8px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-size: 13px;
    font-family: inherit;
}
.work-timer-log-min {
    width: 84px;
    text-align: right;
}
.work-timer-log-unit {
    color: var(--color-text-muted);
    font-size: 12px;
}
.work-timer-log-save {
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    padding: 5px 12px;
    background: var(--color-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.work-timer-log-save:hover {
    opacity: 0.9;
}
.work-timer-log-status {
    min-height: 18px;
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 4px 0;
}
.work-timer-log-status.ok {
    color: #1f9d55;
}
.work-timer-log-status.err {
    color: #c0392b;
}
.work-timer-log-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 13px;
}
.work-timer-log-table th,
.work-timer-log-table td {
    border: 1px solid var(--color-border-light);
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
}
.work-timer-log-table th {
    background: var(--color-bg-tertiary);
    font-weight: 600;
}
.work-timer-log-total {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.work-timer-log-edit {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.work-timer-log-date-sub {
    color: var(--color-text-muted);
    font-size: 11px;
    margin-top: 2px;
}
.work-timer-log-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(31, 157, 85, 0.15);
    color: #1f9d55;
    vertical-align: middle;
}
.work-timer-log-badge.is-today {
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
}
.work-timer-blocks-toggle {
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 5px 10px;
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.work-timer-blocks-toggle:hover,
.work-timer-blocks-toggle.is-open {
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.work-timer-blocks-row > td {
    background: var(--color-bg-tertiary);
    padding: 0;
}
.work-timer-blocks-inner {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.work-timer-blocks-loading,
.work-timer-blocks-empty {
    padding: 8px 12px;
    color: var(--color-text-muted);
    font-size: 13px;
}
.work-timer-block {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.work-timer-block-label {
    color: var(--color-text-muted);
    font-size: 12px;
}
.work-timer-block-time {
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 4px 8px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-size: 13px;
    font-family: inherit;
}
.work-timer-block-dur {
    min-width: 56px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 13px;
}
.work-timer-block-del {
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 4px 10px;
    background: var(--color-bg-secondary);
    color: #c0392b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.work-timer-block-del:hover {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}
.work-timer-block-add {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--color-border-light);
}
.work-timer-adjust-row {
    align-items: center;
}
.work-timer-adjust-amount {
    min-width: 64px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 13px;
}
.work-timer-adjust-amount.is-pos { color: #1f9d55; }
.work-timer-adjust-amount.is-neg { color: #c0392b; }
.work-timer-blocks-total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border-light);
    font-size: 13px;
    color: var(--color-text);
}
.work-timer-blocks-total strong {
    font-variant-numeric: tabular-nums;
}
.work-timer-blocks-total-sub {
    color: var(--color-text-muted);
    font-size: 12px;
}
/* Today-first quick editor */
.wt-today-card {
    margin: 12px 0 14px;
    padding: 16px 18px;
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    background: var(--color-bg-tertiary);
}
.wt-today-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.wt-today-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
}
.wt-today-date {
    font-size: 13px;
    color: var(--color-text-muted);
}
.wt-today-total {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.1;
    margin: 8px 0 4px;
    color: var(--color-accent);
    font-variant-numeric: tabular-nums;
}
.wt-today-note {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}
.wt-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    margin: 10px 0 4px;
    border-radius: 999px;
    background: var(--color-border-light);
    outline: none;
    cursor: pointer;
}
.wt-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 3px solid var(--color-bg-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}
.wt-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 3px solid var(--color-bg-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}
.wt-slider:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}
.wt-slider-scale {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    margin-bottom: 12px;
}
.wt-quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.wt-quick-btn {
    border: 1px solid var(--color-border-light);
    border-radius: 999px;
    padding: 6px 12px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.wt-quick-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.wt-quick-btn.wt-quick-plus {
    color: #1f9d55;
}
.wt-quick-btn.wt-quick-plus:hover {
    border-color: #1f9d55;
    background: rgba(31, 157, 85, 0.12);
}
.wt-today-exact {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px dashed var(--color-border-light);
}
.wt-today-exact-label {
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 600;
}
.wt-today-blocks {
    margin-top: 12px;
}
.wt-today-blocks .work-timer-blocks-row {
    margin-top: 8px;
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    background: var(--color-bg-secondary);
}
/* Day timeline (7:30 AM – 7:30 PM) */
.wt-day-timeline {
    margin: 10px 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    background: var(--color-bg-secondary);
}
.wt-timeline-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}
.wt-timeline-range {
    font-weight: 400;
    color: var(--color-text-muted);
    margin-left: 6px;
}
.wt-timeline-track {
    display: flex;
    width: 100%;
    height: 22px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--color-border-light);
    background: rgba(128, 128, 128, 0.12);
}
.wt-timeline-seg {
    height: 100%;
    min-width: 1px;
    transition: opacity 0.15s ease;
}
.wt-timeline-seg.is-worked {
    background: linear-gradient(180deg, #2ecc71 0%, #1f9d55 100%);
}
.wt-timeline-seg.is-idle {
    background: rgba(128, 128, 128, 0.18);
}
body.theme-dark .wt-timeline-seg.is-idle {
    background: rgba(255, 255, 255, 0.08);
}
.wt-timeline-seg.is-worked:hover {
    opacity: 0.85;
}
.wt-timeline-axis {
    position: relative;
    height: 16px;
    margin-top: 5px;
    font-size: 10px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}
.wt-timeline-tick {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}
.wt-timeline-tick.is-start {
    transform: translateX(0);
}
.wt-timeline-tick.is-end {
    transform: translateX(-100%);
}
.wt-timeline-legend {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--color-text-muted);
}
.wt-timeline-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.wt-timeline-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid var(--color-border-light);
}
.wt-timeline-swatch.is-worked {
    background: linear-gradient(180deg, #2ecc71 0%, #1f9d55 100%);
    border-color: #1f9d55;
}
.wt-timeline-swatch.is-idle {
    background: rgba(128, 128, 128, 0.18);
}
.work-timer-blocks-inner .wt-day-timeline {
    margin-top: 0;
    margin-bottom: 12px;
}
.wt-prior-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 0;
    padding: 8px 14px;
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease;
}
.wt-prior-toggle:hover,
.wt-prior-toggle.is-open {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.wt-prior-caret {
    display: inline-block;
    font-size: 11px;
    transition: transform 0.15s ease;
}
.wt-prior-toggle.is-open .wt-prior-caret {
    transform: rotate(90deg);
}
.wt-prior-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
}
.wt-prior-wrap {
    margin-top: 10px;
}
body.theme-dark #resultContent th,
body.theme-dark #resultContent td {
    border-color: var(--color-border-light) !important;
    color: var(--color-text) !important;
}
body.theme-dark #resultContent th {
    background: var(--color-bg-tertiary) !important;
}
body.theme-dark #resultContent tr:hover td {
    background: var(--color-bg-tertiary) !important;
}
body.theme-dark #resultContent div[style*="background:#f5f5f5"],
body.theme-dark #resultContent div[style*="background: #f5f5f5"] {
    background: var(--color-bg-tertiary) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}
body.theme-dark #resultContent input[type="text"],
body.theme-dark #resultContent input[type="date"],
body.theme-dark #resultContent select {
    background: var(--color-bg-secondary) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}
/* Log form: field-by-field entry */
.command-row-wrap {
    position: relative;
}
.log-form-row {
    display: none;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
}
.log-form-row.show {
    display: flex;
}
.command-row-wrap .input-row.hide-for-log {
    display: flex;
}
.command-row-wrap.log-mode .input-row.hide-for-log {
    display: none;
}
.command-row-wrap.log-mode .log-form-row {
    display: flex;
}
.log-form-row .log-static {
    font-weight: 600;
    color: var(--color-text);
    margin-right: 2px;
}
.log-form-row .log-field {
    padding: 10px 12px;
    font-size: 15px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    outline: none;
    min-width: 0;
}
.log-form-row .log-field::placeholder {
    color: var(--color-text-muted);
}
.log-form-row .log-field:focus {
    border-color: var(--color-border-mid);
}
.log-form-row .log-field.log-field-asset { width: 120px; }
.log-form-row .log-field.log-field-side { width: 95px; }
.log-form-row .log-field.log-field-fund { width: 140px; }
.log-form-row .log-field.log-field-price { width: 90px; }
.log-form-row .log-field.log-field-size { width: 65px; }
.log-form-row .log-field.log-field-structure { width: 75px; }
.log-form-row .log-field.log-field-notes { flex: 1; min-width: 100px; }
.log-form-row .log-at {
    color: var(--color-text);
    font-weight: 600;
    padding: 0 2px;
}
.log-form-row .log-comma {
    color: var(--color-text-muted);
    font-size: 14px;
}
.log-form-row .log-run-btn {
    padding: 10px 20px;
    font-size: 15px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.log-form-row .log-run-btn:hover {
    background: var(--color-hover);
}
.command-format-hint {
    margin-top: 6px;
    font-size: 13px;
    min-height: 14px;
    line-height: 1.3;
}
.command-format-hint .command-format-rest {
    color: var(--color-text-muted);
}
.command-format-hint .command-format-options {
    color: var(--color-text);
}
.tags-report-card {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    cursor: pointer;
}
.tags-report-card:hover {
    border-color: var(--color-border-mid);
}
.tags-report-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 10px;
    display: block;
}
.recent-log-company-link {
    color: #0066cc;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}
body.theme-dark .recent-log-company-link {
    color: #5eb3ff;
}
.recent-log-company-link:hover {
    text-decoration: underline;
}
.recent-log-live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
    flex-shrink: 0;
    background: #e8e8e8;
}
.recent-log-live-dot.live {
    background: #00e676;
}
body.theme-dark .recent-log-live-dot {
    background: #b5b5b5;
}
body.theme-dark .recent-log-live-dot.live {
    background: #00ff88;
}
.recent-log-live-dot.red-hot.live {
    box-shadow: 0 0 0 3px #ff1744;
}
body.theme-dark .recent-log-live-dot.red-hot.live {
    box-shadow: 0 0 0 3px #ff5252;
}
.recent-log-live-dot:hover {
    opacity: 0.85;
}
.log-review-days { font-size: 14px; font-weight: 600; }
/* Clients table R#: red under tier cadence, blue at/above threshold */
.log-review-days.client-review-badge.client-review-cool { color: #007AFF; }
.log-review-days.client-review-badge.client-review-overdue { color: #c00; }
body.theme-dark .log-review-days.client-review-badge.client-review-cool { color: #5eb3ff; }
body.theme-dark .log-review-days.client-review-badge.client-review-overdue { color: #f66; }
/* R0 — reviewed today (0 business days) */
.log-review-days.review-r0 { color: #007AFF; }
.log-review-days.review-r02 { color: #0a7a0a; }
.log-review-days.review-r34 { color: #b8860b; }
.log-review-days.review-r5plus { color: #c65d00; }
.log-review-days.review-nr { color: #8B00FF; }
/* Convo + Getting Signed: custom review colors */
.log-review-days.convo-review.review-r0 { color: #007AFF; }
.log-review-days.convo-review.review-r01 { color: #0a7a0a; }
.log-review-days.convo-review.review-r24 { color: #c65d00; }
.log-review-days.convo-review.review-r5plus { color: #c00; }
.log-review-days.log-review-clickable { cursor: pointer; }
.log-review-days.log-review-clickable:hover { text-decoration: underline; }
/* Lead list rows use .last-round-section .record-line (16px); keep R#/NR same size as line text. */
.record-line .log-review-days { font-size: inherit; }
.record-line .log-date { font-size: 12px; }
.deal-card .deal-card-value .log-date { font-size: 12px; }
.deal-card .deal-card-value .log-review-days { font-size: 14px; }
body.theme-dark .log-review-days.review-r0 { color: #5eb3ff; }
body.theme-dark .log-review-days.review-r02 { color: #4ade4a; }
body.theme-dark .log-review-days.review-r34 { color: #eab308; }
body.theme-dark .log-review-days.review-r5plus { color: #f97316; }
body.theme-dark .log-review-days.review-nr { color: #b366ff; }
body.theme-dark .log-review-days.convo-review.review-r0 { color: #5eb3ff; }
body.theme-dark .log-review-days.convo-review.review-r01 { color: #4ade4a; }
body.theme-dark .log-review-days.convo-review.review-r24 { color: #f97316; }
body.theme-dark .log-review-days.convo-review.review-r5plus { color: #f66; }
.record-line .recent-log-live-dot-wrap {
    display: inline-flex;
    align-items: center;
}
.uploads-panel { max-width: 900px; }
.uploads-panel .uploads-field { margin-bottom: 14px; }
.uploads-panel label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.uploads-table-wrap { overflow-x: auto; margin-bottom: 12px; border: 2px solid var(--color-border); border-radius: 8px; background: var(--color-bg-secondary); }
.uploads-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.uploads-table th, .uploads-table td { border: none; border-bottom: 1px solid var(--color-border-light); padding: 6px 8px; text-align: left; vertical-align: middle; }
.uploads-table thead th { border-top: 1px solid var(--color-border-light); }
.uploads-table th { background: var(--color-bg-tertiary); font-weight: 600; }
.uploads-table td input { width: 100%; min-width: 0; padding: 6px 8px; font-size: 13px; border: 1px solid var(--color-border-light); border-radius: 4px; background: var(--color-bg); color: var(--color-text); box-sizing: border-box; }
.uploads-table td input:focus { outline: none; border-color: var(--color-border-mid); }
.uploads-table .col-ct { width: 110px; }
.uploads-table .col-macro { width: 110px; }
.uploads-table .col-combo-pps { width: 72px; }
.uploads-table .col-combo-ev { width: 72px; }
.uploads-table .col-combo-lrdate { width: 110px; }
.uploads-table .col-company { min-width: 180px; }
.uploads-table .col-supply-details { min-width: 200px; }
.uploads-table .col-bid { min-width: 120px; }
.uploads-table .col-bid-details { min-width: 180px; }
.uploads-table .col-bid-date { width: 110px; }
#upSlTable tbody { counter-reset: row; }
#upSlTable tbody tr { counter-increment: row; }
#upSlTable .col-row-num { width: 2.5em; min-width: 2.5em; text-align: right; vertical-align: top; color: var(--color-text-muted); font-size: 12px; }
#upSlTable .col-row-num::before { content: counter(row); }
#upSlTable .col-sl-comment { min-width: 280px; }
#upSlTable .col-sl-comment textarea { width: 100%; min-width: 200px; min-height: 4em; max-height: 20em; padding: 6px 8px; font-size: 13px; border: 1px solid var(--color-border-light); border-radius: 4px; background: var(--color-bg); color: var(--color-text); box-sizing: border-box; resize: vertical; font-family: inherit; }
#upSlTable .col-sl-comment textarea:focus { outline: none; border-color: var(--color-border-mid); }
#upBaTable tbody { counter-reset: row; }
#upBaTable tbody tr { counter-increment: row; }
#upBaTable .col-row-num { width: 2.5em; min-width: 2.5em; text-align: right; vertical-align: top; color: var(--color-text-muted); font-size: 12px; }
#upBaTable .col-row-num::before { content: counter(row); }
#lrUploadTable tbody { counter-reset: row; }
#lrUploadTable tbody tr { counter-increment: row; }
#lrUploadTable .col-row-num { width: 2.5em; min-width: 2.5em; text-align: right; vertical-align: top; color: var(--color-text-muted); font-size: 12px; }
#lrUploadTable .col-row-num::before { content: counter(row); }
#upBaTable .col-details { min-width: 280px; }
#upBaTable .col-details textarea { width: 100%; min-width: 200px; min-height: 4em; max-height: 20em; padding: 6px 8px; font-size: 13px; border: 1px solid var(--color-border-light); border-radius: 4px; background: var(--color-bg); color: var(--color-text); box-sizing: border-box; resize: vertical; font-family: inherit; }
#upBaTable .col-details textarea:focus { outline: none; border-color: var(--color-border-mid); }
.dl-badge { padding: 2px 8px; border-radius: 4px; font-weight: 600; color: #fff; }
.dl-badge.dl-kzb { background: #1b5e20; }
.dl-badge.dl-nzw { background: #e65100; }
.dl-badge.dl-ncz { background: #0d47a1; }
.getting-signed-table .sortable-th { cursor: pointer; text-decoration: underline; }
.getting-signed-table .sortable-th:hover { color: var(--color-accent); }
.getting-signed-table .getting-signed-action-cell { cursor: pointer; white-space: normal; max-width: 280px; }
.getting-signed-table .getting-signed-action-cell .action-text { display: block; color: var(--color-text); }
.getting-signed-table .getting-signed-action-cell:hover .action-text { text-decoration: underline; color: var(--color-accent); }
/* Getting Signed row actions (S / c / ×) should not wrap */
.getting-signed-table th:last-child,
.getting-signed-table td:last-child {
    white-space: nowrap;
    width: 76px;
}
/* Conversations: keep Buyer/Seller on one line; allow horizontal scroll if needed */
.view-conversations-section { overflow-x: auto; }
.view-conversations-section .uploads-table.getting-signed-table { min-width: 760px; }
.view-conversations-section .uploads-table.getting-signed-table th:nth-child(2),
.view-conversations-section .uploads-table.getting-signed-table td:nth-child(2),
.view-conversations-section .uploads-table.getting-signed-table th:nth-child(3),
.view-conversations-section .uploads-table.getting-signed-table td:nth-child(3) {
    white-space: nowrap;
}
.view-conversations-section .uploads-table.getting-signed-table th:nth-child(4),
.view-conversations-section .uploads-table.getting-signed-table td:nth-child(4) {
    white-space: nowrap;
    width: 60px;
}
.view-conversations-section .uploads-table.getting-signed-table th:nth-child(6),
.view-conversations-section .uploads-table.getting-signed-table td:nth-child(6) {
    white-space: nowrap;
    width: 76px;
}
.getting-signed-table .status-docs { color: #0d5c0d; font-weight: 600; }
.getting-signed-table .status-intro { color: #e65100; font-weight: 600; }
.getting-signed-table .status-fee { color: #0d47a1; font-weight: 600; }
/* PIPE Signed — status colors (match Airtable single-select order) */
.getting-signed-table tr.pipe-signed-row .status-signed-leads { color: #9a8b5a; font-weight: 600; }
.getting-signed-table tr.pipe-signed-row .status-signed-advancing { color: #2a9d8f; font-weight: 600; }
.getting-signed-table tr.pipe-signed-row .status-signed-fee { color: #d4895c; font-weight: 600; }
.getting-signed-table tr.pipe-signed-row .status-signed-intro { color: #4a90c8; font-weight: 600; }
.getting-signed-table tr.pipe-signed-row .status-signed-docs { color: #c04a12; font-weight: 600; }
.getting-signed-table tr.pipe-signed-row .status-signed-rofr { color: #c9a100; font-weight: 600; }
.getting-signed-table tr.pipe-signed-row .status-signed-invoicing { color: #c2187a; font-weight: 600; }
.getting-signed-table tr.pipe-signed-row .status-signed-paid { color: #1b5e20; font-weight: 600; }
body.theme-dark .getting-signed-table tr.pipe-signed-row .status-signed-leads { color: #d4c896; }
body.theme-dark .getting-signed-table tr.pipe-signed-row .status-signed-advancing { color: #5ee0d5; }
body.theme-dark .getting-signed-table tr.pipe-signed-row .status-signed-fee { color: #f0b080; }
body.theme-dark .getting-signed-table tr.pipe-signed-row .status-signed-intro { color: #7eb8ea; }
body.theme-dark .getting-signed-table tr.pipe-signed-row .status-signed-docs { color: #ff8c5a; }
body.theme-dark .getting-signed-table tr.pipe-signed-row .status-signed-rofr { color: #ffd54a; }
body.theme-dark .getting-signed-table tr.pipe-signed-row .status-signed-invoicing { color: #f48fb1; }
body.theme-dark .getting-signed-table tr.pipe-signed-row .status-signed-paid { color: #69f0ae; }
.getting-signed-table .getting-signed-status-cell { cursor: pointer; }
.getting-signed-table .getting-signed-status-cell:hover .status-text { text-decoration: underline; }
.getting-signed-table .getting-signed-status-select { min-width: 140px; padding: 4px 8px; font-size: 13px; border: 1px solid var(--color-border); border-radius: 4px; background: var(--color-bg); color: var(--color-text); }
.getting-signed-table .getting-signed-dl-select { min-width: 100px; padding: 4px 8px; font-size: 13px; border: 1px solid var(--color-border); border-radius: 4px; background: var(--color-bg); color: var(--color-text); }
.getting-signed-table .getting-signed-action-input { width: 100%; min-width: 120px; padding: 4px 6px; font-size: 13px; border: 1px solid var(--color-accent); border-radius: 4px; background: var(--color-bg); color: var(--color-text); box-sizing: border-box; }
.getting-signed-table .getting-signed-action-input:focus { outline: none; border-color: var(--color-accent); }
.getting-signed-table .getting-signed-editable-cell { cursor: pointer; white-space: normal; }
.getting-signed-table .getting-signed-editable-cell:hover .editable-cell-text { text-decoration: underline; color: var(--color-accent); }
.getting-signed-table .getting-signed-dl-cell { cursor: pointer; }
.getting-signed-table .getting-signed-dl-cell:hover .editable-cell-text { text-decoration: underline; color: var(--color-accent); }
.uploads-panel .uploads-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.uploads-panel .uploads-run { margin-top: 16px; }
.uploads-progress { margin: 12px 0; font-size: 14px; color: var(--color-text-muted); }
.uploads-progress-inline { display: inline-block; margin-left: 8px; font-size: 14px; color: var(--color-text-muted); vertical-align: middle; }
.lr-upload-log { max-height: 280px; overflow-y: auto; margin-top: 8px; padding: 8px; background: var(--color-bg-tertiary); border: 1px solid var(--color-border-light); border-radius: 8px; font-size: 13px; }
.lr-log-line { padding: 2px 0; }
.lr-log-updated { color: #0d6b0d; }
.lr-log-created { color: #0066cc; }
body.theme-dark .lr-log-created { color: #5eb3ff; }
.lr-log-skipped { color: var(--color-text-muted); }
.lr-log-error { color: #c00; }
.lr-summary-section { margin-top: 12px; }
.lr-summary-section h4 { font-size: 14px; margin: 0 0 6px 0; color: var(--color-text); }
.lr-summary-list { margin: 0; padding-left: 20px; max-height: 200px; overflow-y: auto; }
.record-size { font-weight: 700; }
.tags-report-row-value {
    font-size: inherit;
}
.tags-report-row-date {
    font-size: 11px;
    color: var(--color-text-muted);
}
.view-add-log-bar { color: var(--color-text-muted); }
.view-add-log-btn { cursor: pointer; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--color-border-light); font-size: 12px; }
.view-add-convo-btn { cursor: pointer; font-size: 12px; color: var(--color-text-muted); padding: 2px 6px; border-radius: 3px; border: 1px solid var(--color-border-light); display: inline-block; }
.view-add-convo-btn:hover { color: var(--color-text); background: var(--color-bg-elevated); }
.view-add-log-btn:hover { background: var(--color-hover); color: var(--color-text); }
.view-add-log-form { margin-top: 12px; padding: 12px; background: var(--color-bg-tertiary); border: 1px solid var(--color-border-light); border-radius: 8px; font-size: 13px; }
.view-add-log-form .deal-edit-row { margin-bottom: 8px; }
.view-add-log-form .deal-edit-row label { display: inline-block; min-width: 72px; margin-right: 8px; }
.view-add-log-form .deal-edit-row input, .view-add-log-form .deal-edit-row select { padding: 4px 8px; font-size: 13px; max-width: 200px; }
.view-add-log-form .view-add-log-form-btns { margin-top: 10px; }

.client-form,
.client-card,
.client-latest-note {
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    background: var(--color-bg-secondary);
    padding: 12px;
    margin: 12px 0;
}
.client-form-title {
    font-weight: 700;
    margin-bottom: 8px;
}
.client-form-grid,
.client-mini-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}
.client-form input,
.client-form textarea,
.client-card input,
.client-card textarea,
.client-card select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
    font-size: 13px;
}
.client-card textarea {
    resize: vertical;
}
.client-card label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}
.client-card label input,
.client-card label textarea {
    margin-top: 4px;
    font-weight: 400;
}
.clients-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
    color: var(--color-text-muted);
    font-size: 12px;
}
.clients-summary-row span,
.client-pill {
    border: 1px solid var(--color-border-light);
    border-radius: 999px;
    padding: 2px 8px;
    background: var(--color-bg-tertiary);
}
.clients-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
}
.clients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 520px;
}
.clients-tier-group-row {
    cursor: default;
}
.clients-tier-group-row:hover {
    background: transparent;
}
.clients-tier-group-header {
    font-weight: 700;
    font-size: 13px;
    color: var(--color-text);
    background: var(--color-bg-tertiary);
    padding: 10px 8px;
    border-top: 2px solid var(--color-border-light);
}
.clients-tier-group-row:first-child .clients-tier-group-header {
    border-top: none;
}
.client-tier-display {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--color-text-muted);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}
.client-tier-display--assigned {
    color: var(--muted, #888);
    font-size: 0.9em;
}
.client-tier-display:hover {
    color: var(--color-text);
    background: var(--color-hover);
}
.clients-table-tier .client-tier-select {
    max-width: 7.5rem;
}
.clients-table-tier {
    white-space: nowrap;
    width: 7rem;
    vertical-align: middle;
}
.client-tier-select {
    width: 100%;
    max-width: 7.5rem;
    padding: 4px 6px;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.client-tier-select:disabled {
    opacity: 0.6;
    cursor: wait;
}
.client-card label .client-tier-select {
    margin-top: 4px;
    max-width: none;
}
.clients-table th,
.clients-table td {
    padding: 8px;
    border: 1px solid var(--color-border-light);
    text-align: left;
    vertical-align: top;
}
.clients-table th {
    background: var(--color-bg-tertiary);
    font-weight: 700;
}
.clients-table th.clients-table-r-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.clients-table th.clients-table-r-sort:hover {
    text-decoration: underline;
}
.clients-table th.clients-table-r-sort.sort-asc::after {
    content: ' ▲';
    font-size: 0.75em;
}
.clients-table th.clients-table-r-sort.sort-desc::after {
    content: ' ▼';
    font-size: 0.75em;
}
.clients-table tbody tr {
    cursor: pointer;
}
.clients-table tbody tr:hover {
    background: var(--color-hover);
}
.clients-table-name {
    font-weight: 700;
    text-decoration: underline;
}
.client-page-note,
.client-muted,
.client-empty {
    color: var(--color-text-muted);
    font-size: 12px;
}
.client-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    align-items: start;
}
.client-card {
    margin: 0;
}
.client-left-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.client-card-wide {
    grid-column: 1 / -1;
}
.client-list-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
}
.client-list-row:last-of-type {
    border-bottom: none;
}
.client-portfolio-line {
    flex: 1 1 auto;
    min-width: 0;
}
.client-portfolio-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-right: 8px;
}
.client-portfolio-prices {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    vertical-align: middle;
}
.client-price-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--color-border-light);
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    background: var(--color-bg-tertiary);
}
.client-price-supply {
    color: #0d6b0d;
}
.client-price-demand {
    color: #0066cc;
}
.client-portfolio-notes {
    margin-top: 4px;
}
.client-mini-btn {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: 1px solid var(--color-border-light);
    border-radius: 50%;
    background: var(--color-bg);
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
}
.client-mini-btn:hover {
    color: #c00;
    border-color: #c00;
}
.client-edit-btn:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.client-add-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 4px 9px;
    border: 1px solid var(--color-border-light);
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.client-add-toggle:hover {
    color: var(--color-text);
    background: var(--color-hover);
}
.client-mini-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border-light);
}
.client-collapsible-form[hidden] {
    display: none !important;
}
.client-convo-form {
    grid-template-columns: minmax(120px, 160px) minmax(160px, 220px) 1fr;
}
.client-convo-form textarea,
.client-convo-form button,
.client-convo-form input[type="text"] {
    grid-column: 1 / -1;
}
.client-convo-form.client-edit-form textarea,
.client-convo-form.client-edit-form button,
.client-convo-form.client-edit-form input[type="text"] {
    grid-column: auto;
}
.client-auto-log-preview {
    grid-column: 1 / -1;
    min-height: 16px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}
.client-latest-note {
    color: var(--color-text);
}
/* ===== CRM expansion: banner, status, tasks, activity, edit ===== */
.client-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    margin: 10px 0 12px;
    padding: 10px 14px;
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    background: var(--color-bg-tertiary);
    font-size: 13px;
}
.client-banner-item { color: var(--color-text); }
.client-banner-item strong { font-weight: 700; }
.client-banner-latest {
    flex: 1 1 240px;
    min-width: 0;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.client-status-pill {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-light);
}
.client-status-prospect { background: rgba(0, 122, 255, 0.12); color: #007AFF; border-color: transparent; }
.client-status-active { background: rgba(13, 122, 13, 0.14); color: #0d7a0d; border-color: transparent; }
.client-status-dormant { background: rgba(198, 93, 0, 0.14); color: #c65d00; border-color: transparent; }
.client-status-cold { background: var(--color-bg-tertiary); color: var(--color-text-muted); }
body.theme-dark .client-status-prospect { color: #5eb3ff; background: rgba(94, 179, 255, 0.16); }
body.theme-dark .client-status-active { color: #2ecc2e; background: rgba(46, 204, 46, 0.16); }
body.theme-dark .client-status-dormant { color: #f0a35a; background: rgba(240, 163, 90, 0.16); }
.client-count-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--color-accent);
    color: #fff;
    vertical-align: middle;
}
/* Tasks */
.client-tasks-card .client-task-row {
    align-items: center;
    gap: 8px;
}
.client-task-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 0;
}
.client-task-check input { flex: 0 0 auto; }
.client-task-title { font-weight: 600; }
.client-task-done .client-task-title {
    text-decoration: line-through;
    color: var(--color-text-muted);
    font-weight: 500;
}
.client-task-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
}
.client-task-due {
    color: var(--color-text-muted);
    font-size: 12px;
    white-space: nowrap;
}
.client-task-due.is-overdue { color: #c00; font-weight: 700; }
.client-task-due.is-soon { color: #c65d00; font-weight: 600; }
body.theme-dark .client-task-due.is-overdue { color: #ff6b6b; }
body.theme-dark .client-task-due.is-soon { color: #f0a35a; }
.client-task-is-overdue { box-shadow: inset 3px 0 0 #c00; padding-left: 8px; }
body.theme-dark .client-task-is-overdue { box-shadow: inset 3px 0 0 #ff6b6b; }
.client-task-overdue-tag {
    display: inline-block;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(204, 0, 0, 0.14);
    color: #c00;
}
body.theme-dark .client-task-overdue-tag { color: #ff6b6b; background: rgba(255, 107, 107, 0.18); }
.client-task-count { font-weight: 700; }
.client-task-form { grid-template-columns: 1fr; }
.client-tasks-done {
    margin-top: 10px;
    font-size: 12px;
}
.client-tasks-done summary {
    cursor: pointer;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}
/* Activity type pills */
.client-activity-pill {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    vertical-align: middle;
}
.client-activity-call { background: rgba(13, 122, 13, 0.14); color: #0d7a0d; }
.client-activity-email { background: rgba(0, 122, 255, 0.12); color: #007AFF; }
.client-activity-meeting { background: rgba(139, 0, 255, 0.12); color: #8B00FF; }
.client-activity-note { background: var(--color-bg-tertiary); color: var(--color-text-muted); }
body.theme-dark .client-activity-call { color: #2ecc2e; background: rgba(46, 204, 46, 0.16); }
body.theme-dark .client-activity-email { color: #5eb3ff; background: rgba(94, 179, 255, 0.16); }
body.theme-dark .client-activity-meeting { color: #b366ff; background: rgba(179, 102, 255, 0.18); }
.client-convo-body { flex: 1 1 auto; min-width: 0; }
.client-convo-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.client-convo-summary { margin-top: 2px; }
.client-convo-next {
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}
.client-next-label { font-weight: 700; color: var(--color-text); }
.client-inline-link {
    border: none;
    background: none;
    color: var(--color-accent);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 0 2px;
}
.client-inline-link:hover { text-decoration: underline; }
.client-row-actions {
    display: inline-flex;
    align-items: flex-start;
    gap: 4px;
    flex: 0 0 auto;
}
.client-primary-star { color: #e8a400; font-size: 13px; }
.client-check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text);
}
.client-danger-btn {
    display: block;
    margin-top: 10px;
    padding: 6px 12px;
    border: 1px solid #c00;
    border-radius: 7px;
    background: transparent;
    color: #c00;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.client-danger-btn:hover { background: #c00; color: #fff; }
.client-edit-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
}
.client-edit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.revenue-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}
.revenue-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
}
.revenue-toolbar input {
    width: 92px;
    padding: 6px 8px;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
}
.revenue-save-status {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}
.revenue-save-status.has-error {
    color: #c00;
}
.revenue-table {
    min-width: 980px;
}
.revenue-table tbody tr {
    cursor: default;
}
.revenue-table input[type="text"],
.revenue-table input[type="date"] {
    width: 100%;
    min-width: 90px;
    padding: 6px 8px;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
    font-size: 13px;
}
.revenue-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
}
.revenue-table tfoot td {
    background: var(--color-bg-tertiary);
    font-weight: 700;
}
.revenue-row-total {
    font-weight: 700;
    white-space: nowrap;
}
.revenue-date-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}
.revenue-save-row {
    margin-top: 0;
    white-space: nowrap;
}

.revenue-team-row td {
    background: var(--color-bg-tertiary);
}
.revenue-team-row input[disabled] {
    color: var(--color-text);
    font-weight: 700;
    opacity: 1;
}
.revenue-summary-row {
    display: block;
    margin: 10px 0;
    color: var(--color-text-muted);
    font-size: 13px;
}
.revenue-summary-line {
    padding: 3px 0;
    line-height: 1.35;
}
.revenue-summary-line strong {
    color: var(--color-text);
}
.revenue-summary-line span {
    color: var(--color-text-muted);
    margin-left: 8px;
}
.revenue-team-calc-line {
    font-weight: 700;
}
.revenue-footer-paid td {
    color: #0d6b0d;
}
.revenue-footer-unpaid td {
    color: #9a5a00;
}

@media (max-width: 640px) {
    .client-convo-form {
        grid-template-columns: 1fr;
    }
    .client-list-row {
        align-items: flex-start;
    }
}

/* ===================== Suggestions ("Sugg") page ===================== */
.sugg-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.sugg-stale-label {
    font-size: 13px;
    color: var(--color-text);
}
.sugg-stale-label input {
    width: 56px;
    padding: 3px 6px;
    margin: 0 4px;
    font-size: 13px;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
}
.sugg-summary {
    font-size: 13px;
    color: var(--color-text-muted);
}
.sugg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.sugg-chip {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--color-border-light);
    border-radius: 999px;
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
    cursor: pointer;
}
.sugg-chip:hover {
    border-color: var(--color-border-mid);
}
.sugg-chip.active {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(0, 122, 255, 0.08);
}
.sugg-chip-hot.active {
    border-color: #dc3545;
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
}
.sugg-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sugg-card {
    border: 1px solid var(--color-border-light);
    border-left: 3px solid var(--color-border-mid);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--color-bg-secondary);
}
.sugg-card--sell { border-left-color: #0d6b0d; }
.sugg-card--buy { border-left-color: #c65d00; }
.sugg-card--cross { border-left-color: var(--color-accent); }
body.theme-dark .sugg-card--sell { border-left-color: #2ecc2e; }
body.theme-dark .sugg-card--buy { border-left-color: #f97316; }
.sugg-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.sugg-rank {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
}
.sugg-type-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--color-border-light);
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}
.sugg-type-cross { border-color: var(--color-accent); color: var(--color-accent); }
.sugg-type-review { border-color: #b52e9e; color: #b52e9e; }
.sugg-type-source { border-color: #0d6b0d; color: #0d6b0d; }
.sugg-type-outreach { border-color: #c65d00; color: #c65d00; }
body.theme-dark .sugg-type-source { border-color: #2ecc2e; color: #2ecc2e; }
body.theme-dark .sugg-type-outreach { border-color: #f97316; color: #f97316; }
.sugg-heat-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    background: var(--color-border-mid);
}
.sugg-heat-dot.live { background: #1e9e1e; }
.sugg-heat-dot.hot { background: #1e9e1e; box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.85); }
.sugg-company {
    font-weight: 700;
    color: var(--color-accent);
    cursor: pointer;
}
.sugg-company:hover { text-decoration: underline; }
.sugg-rating {
    font-size: 12px;
    font-weight: 600;
}
.sugg-prio {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 999px;
}
.sugg-prio-high { background: rgba(220, 53, 69, 0.14); color: #dc3545; }
.sugg-prio-med { background: rgba(154, 90, 0, 0.14); color: #9a5a00; }
.sugg-prio-low { background: var(--color-bg-tertiary); color: var(--color-text-muted); }
.sugg-reason {
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--color-text);
    margin-bottom: 8px;
}
.sugg-reason strong { color: var(--color-text); }
.sugg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.sugg-tag-btn,
.sugg-action-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--color-border-light);
    background: var(--color-bg-secondary);
    color: var(--color-text);
}
.sugg-tag-btn {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.sugg-tag-btn:hover,
.sugg-action-btn:hover {
    background: var(--color-hover);
}
.sugg-tag-btn.done {
    border-color: #0d6b0d;
    color: #0d6b0d;
    background: rgba(13, 107, 13, 0.08);
    cursor: default;
}
.sugg-tag-btn.failed {
    border-color: #dc3545;
    color: #dc3545;
}
.sugg-tag-btn:disabled {
    opacity: 0.7;
    cursor: default;
}
