@media (min-width: 761px) {
  .app-content main.workspace:has(> .bid-screen) { max-width: none; padding-inline: 16px; }
}
.bid-screen { min-width: 0; max-width: 100%; }
.bid-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 16px 0; }
.bid-controls .field { margin: 0; gap: 4px; }
.bid-controls .field > span { font-size: 13px; }
.bid-controls select, .bid-search input { min-height: 40px; padding: 7px 10px; }
.bid-search { display: flex; gap: 6px; flex: 1 1 290px; margin: 0; }
.bid-search input { width: 100%; min-width: 0; }
.bid-search .btn { flex: 0 0 auto; white-space: nowrap; }
.bid-scroll { max-height: var(--bid-grid-height, calc(100dvh - 320px)); overflow: auto; border: 1px solid var(--line); border-radius: 8px; overscroll-behavior: contain; scroll-padding-top: var(--bid-head-height, 140px); }
.bid-waiting { min-height: min(320px, var(--bid-grid-height, 320px)); display: grid; place-items: center; background: var(--surface); }
.bid-loading { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 32px 24px; }
.bid-loading > strong { font-size: 18px; }
.bid-spinner { display: inline-block; flex: 0 0 auto; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent-ink); border-radius: 50%; animation: bid-spin .9s linear infinite; }
.bid-loading .bid-spinner { width: 28px; height: 28px; border-width: 3px; }
.bid-refresh-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; font-size: 14px; }
.bid-refresh-status progress { margin-left: auto; width: 140px; height: 8px; accent-color: var(--accent-ink); }
.bid-refresh-issue { border-color: var(--control-line); }
@keyframes bid-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bid-spinner { animation: none; } }
.bid-history-note { padding-left: 10px; border-left: 3px solid var(--control-line); }
.bid-table { width: 100%; min-width: 1370px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 15px; font-variant-numeric: tabular-nums; }
.bid-table :is(th,td) { text-align: left; padding: 10px 8px; vertical-align: middle; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; color: var(--text); }
.bid-table thead { position: sticky; top: 0; z-index: 3; }
.bid-table thead th { background: var(--raised); color: var(--muted); font-size: 13px; font-weight: 600; overflow-wrap: normal; }
.bid-table .bid-summary > :is(th,td) { background: var(--hover); color: var(--text); border-bottom: 2px solid var(--control-line); }
.bid-summary-value + .bid-summary-value, .bid-summary-bucket + .bid-summary-bucket { margin-top: 6px; }
.bid-summary-bid { display: flex; flex-wrap: wrap; gap: 3px 6px; align-items: baseline; }
.bid-summary-bid + .bid-summary-bid { margin-top: 6px; }
.bid-table .bid-summary-bid small { margin: 0; }
/* Keep every figure readable at laptop widths without shrinking the type. */
.bid-table thead th:nth-child(1) { width: 112px; }
.bid-table thead th:nth-child(2) { width: 200px; }
.bid-table thead th:nth-child(3) { width: 94px; }
.bid-table thead th:nth-child(4) { width: 98px; }
.bid-table thead th:nth-child(5), .bid-table thead th:nth-child(9) { width: 98px; }
.bid-table thead th:nth-child(6), .bid-table thead th:nth-child(10) { width: 68px; }
.bid-table thead th:nth-child(7) { width: 64px; }
.bid-table thead th:nth-child(8), .bid-table thead th:nth-child(11) { width: 110px; }
.bid-table thead th:nth-child(12) { width: 120px; }
.bid-table thead th:nth-child(13) { width: 124px; }
.bid-table .bid-period-start { border-left: 2px solid var(--line); }
.bid-table td:last-child .btn { white-space: nowrap; }
.bid-table tbody tr { background: var(--surface); }
.bid-table tbody tr:nth-child(even) { background: var(--raised); }
.bid-table tbody :is(th,td) { background: inherit; }
.bid-table strong { font-size: 16px; font-weight: 600; white-space: nowrap; }
.bid-table small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; font-weight: 400; }
.bid-table .bid-group th { background: var(--hover); font-size: 13px; padding-block: 6px; }
.bid-account-control > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bid-table .bid-expand { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: left; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 16px; font-weight: 600; min-height: 32px; width: 100%; white-space: normal; }
.bid-expand::before { content: "▸ "; color: var(--muted); }
.bid-expand[aria-expanded="true"]::before { content: "▾ "; }
.bid-title, .bid-expand { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bid-child .bid-name { padding-left: 32px; font-weight: 400; }
.bid-child .bid-name::before { content: "↳ "; color: var(--muted); }
.bid-current .btn { margin-top: 5px; min-height: 32px; }
.bid-edit { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.bid-edit input { width: 100%; min-width: 80px; padding: 6px 8px; }
.bid-edit .btn { margin: 0; }
.bid-low strong { color: var(--danger); }
.bid-metric { white-space: nowrap; }
.bid-table .bid-mobile-account { display: none; }
.bid-footer { display: flex; gap: 8px; justify-content: end; align-items: center; margin-top: 12px; }
.bid-footer > span { margin-right: auto; color: var(--muted); font-size: 14px; }
.bid-empty { padding: 28px; }
.bid-dialog { width: min(650px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.bid-dialog::backdrop { background: #0008; }
.bid-dialog-heading { display: flex; gap: 16px; align-items: start; justify-content: space-between; }
.bid-dialog h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.bid-dialog p, .bid-dialog li { line-height: 1.6; }
.bid-account-control { display: flex; align-items: center; gap: 7px; min-height: 32px; cursor: pointer; }
.bid-account-control > span { min-width: 0; }
.bid-account-control input, .bid-page-selection input { margin: 0; cursor: pointer; }
.bid-table td:nth-child(12) strong { white-space: normal; }
.bid-table .bid-metric strong { display: block; white-space: normal; }
.bid-table .bid-row-actions { position: sticky; right: 0; background: inherit; border-left: 1px solid var(--line); z-index: 1; }
.bid-table thead .bid-row-actions { z-index: 4; }
.bid-table thead th.bid-row-actions { background: var(--raised); }
.bid-name-control { display: flex; align-items: center; gap: 7px; }
.bid-account-control input, .bid-page-selection input { width: 17px; height: 17px; flex: 0 0 17px; accent-color: var(--accent-ink); }
.bid-page-selection { display: flex; align-items: center; gap: 6px; margin: 0; min-height: 32px; font-size: 12px; }
.bid-row-actions .btn { display: block; margin: 4px 0; }
.bid-table .bid-details-button { border-color: transparent; background: transparent; color: var(--muted); font-size: 12px; padding: 3px 0; min-height: 25px; }
.bid-action-dialog { width: min(850px, calc(100vw - 24px)); box-sizing: border-box; }
.bid-dialog.bid-action-dialog :is(input,select,textarea) { background: var(--surface); color: var(--text); border: 1px solid var(--control-line); border-radius: 6px; padding: 9px 10px; min-height: 40px; }
.bid-dialog .btn { color: var(--text); background: var(--surface); border-color: var(--control-line); }
.bid-dialog .btn:hover:not(:disabled) { color: var(--text); background: var(--hover); border-color: var(--control-line); }
.bid-dialog .btn.primary { color: var(--accent-ink); background: var(--soft); border-color: var(--control-line); }
.bid-dialog .btn.primary:hover:not(:disabled) { color: var(--accent-ink); background: var(--soft-strong); }
.bid-dialog button.btn:disabled { opacity: 1; color: var(--muted); background: var(--raised); border-color: var(--control-line); cursor: not-allowed; }
.bid-action-dialog .field > span { color: var(--muted); }
.bid-action-dialog textarea::placeholder { color: var(--muted); }
.bid-action-scope { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bid-action-dialog :is(p,li,button) { overflow-wrap: anywhere; }
.bid-action-dialog .bid-dialog-heading .btn { flex-shrink: 0; }
.bid-action-dialog .field { min-width: 0; }
.bid-close-note { border-top: 1px solid var(--line); padding-top: 10px; font-size: 12px; }
.bid-proposal-rationale { max-height: 4.8em; overflow: auto; white-space: pre-wrap; }
.bid-action-dialog p { margin-block: 10px; }
.bid-adjust-controls { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 12px; }
.bid-adjust-controls :is(input,select) { width: 100%; min-width: 0; }
.bid-bot-request { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }
.bid-bot-request textarea { width: 100%; box-sizing: border-box; margin-bottom: 10px; resize: vertical; }
.bid-bot-request h3 { margin: 0; font-size: 16px; }
.bid-plan-scroll { max-height: 45vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.bid-plan-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.bid-plan-table :is(th,td) { padding: 10px; text-align: left; border-bottom: 1px solid var(--line); }
.bid-plan-table thead { position: sticky; top: 0; background: var(--raised); }
.bid-plan-table tbody th { font-weight: 400; max-width: 290px; overflow-wrap: anywhere; }
.bid-plan-table thead th:first-child { width: 56%; }
.bid-plan-results thead th:first-child { width: 40%; }
.bid-plan-name { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.bid-plan-name + .bid-plan-name { margin-top: 4px; -webkit-line-clamp: 2; }
.bid-plan-details { margin-top: 4px; font-weight: 400; }
.bid-plan-details summary { cursor: pointer; color: var(--muted); }
.bid-plan-details p { overflow-wrap: anywhere; }
.bid-dialog .bid-plan-details-toggle { min-height: 28px; padding: 2px 0; border-color: transparent; background: transparent; font-size: inherit; font-weight: 400; }
.bid-plan-detail-row td { background: var(--raised); white-space: normal; }
.bid-plan-table :is(th,td) { overflow-wrap: anywhere; }
.bid-plan-table td:nth-child(2), .bid-plan-table td:nth-child(3) { white-space: nowrap; }
.bid-plan-table small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.bid-action-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.bid-planning { display: flex; gap: 12px; align-items: center; padding: 24px 0; }
@media (max-width: 650px) {
  .bid-action-dialog { padding: 14px; }
  .bid-adjust-controls { gap: 8px; grid-template-columns: 1fr 1fr; }
  .bid-adjust-controls > :last-child { grid-column: 1 / -1; }
  .bid-plan-table :is(th,td) { padding: 8px 6px; }
  .bid-plan-table thead th:first-child { width: 45%; }
  .bid-plan-results { min-width: 560px; }
  .bid-plan-results thead th:first-child { width: 40%; }
  .bid-action-buttons { gap: 8px; }
  .bid-action-buttons .btn { flex: 1 1 130px; }
  .bid-controls { gap: 10px; }
  .bid-controls > .field { flex: 1 1 130px; min-width: 0; }
  .bid-controls select { width: 100%; }
  .bid-search { flex-basis: 100%; }
  .bid-table thead th:nth-child(2) { width: 190px; }
  .bid-table .bid-name { position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--line); }
  .bid-table thead .bid-name { z-index: 4; }

  .bid-table :is(th,td) { padding: 9px 8px; }
  .bid-table .bid-row-actions { position: static; }
}
