/* The Plans pages, ported from the media-plans app. The sheet keeps the plan
   workbook's look (black header, grey phases, lavender activity, blue inputs);
   around it, the editor takes the task manager's own colours. */

/* the editor fills the window under the top bar */
body[data-page="plans"]:has(.ed) { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
body[data-page="plans"]:has(.ed) > .ed { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ed .wp-main { flex: 1; min-height: 0; }

/* --- plan page, in the plan workbooks' own look ---
   Calibri 10pt, a black header row, the plan row in light blue, phases as
   grey subtotal rows, line cells grey with the activity in lavender and the
   spend a shade darker, results in green, totals in dark grey. */
.xl { --xl-ink: #111111; --xl-rule: #bfbfbf; max-width: none; background: #fff; 
      font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 13.3px; color: var(--xl-ink); }
.xl a { color: #1155cc; }
.xl-back { margin: 0 0 6px; font-size: 12px; }
.xl-title { font-size: 18.7px; font-weight: 700; margin: 0 0 8px; }
.xl-tags { width: auto; border-collapse: collapse; margin: 0 0 12px; font-size: 13.3px; }
.xl-tags th, .xl-tags td { border: 1px solid var(--xl-rule); padding: 2px 8px; text-transform: none; letter-spacing: 0; font-size: 13.3px; color: var(--xl-ink); }
.xl-tags th { background: #d9ead3; font-weight: 700; }
.xl-tags td { min-width: 60px; }
.xl-note { border: 1px solid var(--xl-rule); background: #fff2cc; padding: 6px 10px; margin: 0 0 10px; }
.xl-sheet { overflow: auto; max-height: calc(100vh - 210px); border: 1px solid var(--xl-rule); }
.xl-grid { border-collapse: collapse; table-layout: fixed; width: max-content; font-size: 13.3px; }
.xl-grid th, .xl-grid td { padding: 1px 5px; height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                           border-bottom: 1px solid var(--xl-rule); color: var(--xl-ink); }
.xl-grid thead th { position: sticky; top: 0; z-index: 2; background: #111111; color: #fff; font-weight: 700;
                    text-transform: none; letter-spacing: 0; font-size: 13.3px; text-align: left; border-bottom: 0; }
.xl-grid .r { text-align: right; font-variant-numeric: tabular-nums; }
.xl-plan td { background: #cfe2f3; font-size: 12px; height: 28px; border-bottom: 0; }
.xl-phase td { background: #999999; color: #000; font-weight: 700; border-bottom: 0; }
.xl-phase td:nth-child(3) { color: #fff; }
.xl-phase td.xl-num { background: #efefef; font-weight: 400; text-align: right; }
.xl-phase td.xl-result, .xl-total td.xl-result { background: #9bbb59; font-weight: 400; }
.xl-line td { background: #e7e6e6; }
.xl-line td.xl-activity { background: #d9d2e9; }
.xl-line td.xl-spend { background: #d3d3d3; color: #000; }
.xl-line td.xl-input { color: #0000ff; }
.xl-line td.xl-lead { background: #d9ead3; }
.xl-line td.xl-team { background: #fff; }
.xl-line td.xl-notes { white-space: normal; }
.xl-line td.xl-team[data-value="Checked"], .xl-line td.xl-team[data-value="Fixed"] { color: #17803d; }
.xl-gone td { color: #8a8a8a !important; text-decoration: line-through; }
.xl-gone td.xl-team { text-decoration: none; }
.xl-total td { background: #808080; color: #000; font-weight: 700; border-bottom: 0; }
.xl-total td:nth-child(3) { color: #fff; }
.xl-hint { font-size: 12px; margin: 8px 0; }
.xl-side { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; margin-top: 14px; }
.xl-small { width: auto; border-collapse: collapse; font-size: 13.3px; }
.xl-small th { background: #999999; color: #fff; font-weight: 700; text-transform: none; letter-spacing: 0;
               font-size: 13.3px; text-align: left; padding: 1px 8px; border: 0; }
.xl-small td { background: #e7e6e6; padding: 1px 8px; border-bottom: 1px solid var(--xl-rule); color: var(--xl-ink); white-space: nowrap; }
.xl-small td.xl-activity { background: #d9d2e9; }
.xl-small td.xl-spend { background: #d3d3d3; }
.xl-small .r { text-align: right; font-variant-numeric: tabular-nums; }

/* --- working plan: the spreadsheet in the workbook look --- */
.wp { padding: 10px 14px 0; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wp-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.wp-back { font-size: 12px; white-space: nowrap; }
.wp-title { flex: 1; font: 700 18.7px Calibri, Carlito, "Segoe UI", Arial, sans-serif; color: #111; border: 1px solid transparent;
            padding: 2px 4px; background: transparent; min-width: 0; }
.wp-title:hover, .wp-title:focus { border-color: #bfbfbf; background: #fff; outline: none; }
.wp-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.wp-bar .xl-tags { margin: 0 8px 0 0; }
.wp-bar .xl-tags input, .wp-bar .xl-tags select { font: inherit; border: 0; background: transparent; width: 110px; padding: 0; }
.wp-bar .xl-tags select { width: 150px; }
.wp-gap { flex: 1; }
/* A link styled as this button keeps white text: the plan pages colour
   their links blue (.xl a), which would otherwise win. */
.wp-primary, .xl a.wp-primary { background: #111; color: #fff; border-color: #111; }
.wp-primary:hover, .xl a.wp-primary:hover { color: #fff; background: #333; text-decoration: none; }
.wp-danger:hover { color: var(--bad); border-color: var(--bad); }
.wp-history { margin-bottom: 8px; max-height: 220px; overflow: auto; }
.wp-history button { font-size: 11px; padding: 1px 8px; }
.wp-sheetwrap { min-width: 0; }
.wp-totals { display: flex; flex-wrap: wrap; gap: 0; background: #808080; color: #000; margin-top: 0; }
.wp-totals span { padding: 3px 10px; border-right: 1px solid #9a9a9a; white-space: nowrap; }
.wp-totals span b:first-child { color: #fff; margin-right: 4px; }
.wp-hint { font-size: 12px; color: #555; margin: 6px 0 10px; }

.wp .jexcel { font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 13.3px; color: #111; }
.wp .jexcel > thead > tr > td { background: #111111; color: #fff; font-weight: 700; border-color: #333; text-align: left; }
.wp .jexcel > thead > tr > td.selected { background: #333; color: #fff; }
.wp .jexcel > tbody > tr > td { border-color: #d0d0d0; }
.wp .jexcel > tbody > tr > td.xl-line { background: #e7e6e6; border-bottom-color: #bfbfbf; }
.wp .jexcel > tbody > tr > td.xl-line.xl-act { background: #d9d2e9; }
.wp .jexcel > tbody > tr > td.xl-line.xl-spend { background: #d3d3d3; color: #000; }
.wp .jexcel > tbody > tr > td.xl-line.xl-lead { background: #d9ead3; }
.wp .jexcel > tbody > tr > td.xl-w { color: #0000ff; }
.wp .jexcel > tbody > tr > td.xl-phase { background: #999999; color: #000; font-weight: 700; }
.wp .jexcel > tbody > tr > td.xl-phase.xl-act { color: #fff; }
.wp .jexcel > tbody > tr > td.xl-phase.xl-lid { background: #efefef; font-weight: 400; }
.wp .jexcel > tbody > tr > td.xl-phase.xl-lead { background: #9bbb59; font-weight: 400; }
.wp .jexcel > tbody > tr > td.xl-line.xl-calc { background: #dfe6ee; color: #333; }
.wp .jexcel > tbody > tr > td.readonly { color: inherit; }
.wp .jexcel > tbody > tr > td.xl-line.xl-calc.xl-w { color: #0000ff; }
.wp .jexcel_content { box-shadow: none; border: 1px solid #bfbfbf; }
.xl-titlebar { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.xl-titlebar .xl-title { flex: 1; min-width: 0; }

/* plan page outline: the 1-4 buttons, the +/- gutter, platform group rows */
.xl-grid th.xl-levels { padding: 0 3px; white-space: nowrap; overflow: visible; }
.xl-levels button { font: 700 10px Calibri, Arial, sans-serif; padding: 0 4px; margin: 0 1px 0 0; border: 1px solid #555;
                    background: #333; color: #fff; border-radius: 2px; line-height: 14px; cursor: pointer; }
.xl-levels button:hover { background: #fff; color: #111; }
.xl-grid td.xl-ol { background: #fff !important; border-bottom-color: transparent; text-align: center; padding: 0; }
.xl-tog { font: 700 11px/12px Arial, sans-serif; width: 15px; height: 15px; padding: 0; border: 1px solid #8a8a8a;
          background: #fff; color: #333; border-radius: 2px; cursor: pointer; }
.xl-tog:hover { border-color: #111; color: #111; }
.xl-group td { background: #cfe2f3; font-weight: 700; color: #111; border-bottom: 0; }
.xl-group td.xl-num { font-weight: 400; text-align: right; }
.xl-group td:nth-child(3) { padding-left: 14px; }
.xl-group td.xl-result { background: #9bbb59; font-weight: 400; }
.xl-grid tr[hidden] { display: none; }
/* the team's columns, edited in place */
.xl-line td.xl-edit { padding: 0; }
.xl-edit select, .xl-edit input, .xl-edit textarea { font: inherit; color: inherit; width: 100%; border: 0; background: transparent;
  padding: 1px 5px; height: 20px; box-sizing: border-box; }
.xl-edit textarea { resize: none; overflow: hidden; display: block; min-height: 20px; line-height: 17px; }
.xl-edit select:focus, .xl-edit input:focus, .xl-edit textarea:focus { outline: 2px solid #1f6feb; outline-offset: -2px; background: #fff; }
.xl-line td.xl-edit.xl-saved { background: #eaf7ee; }
.xl-line td.xl-edit.xl-error { background: #fdeceb; }
.xl-line td.xl-team[data-value="Checked"] select, .xl-line td.xl-team[data-value="Fixed"] select { color: #17803d; }
.wp-levels { display: inline-flex; gap: 2px; margin-right: 6px; }
.wp-levels button { padding: 2px 7px; font-weight: 700; }
.wp-levels button.on { background: #111; color: #fff; border-color: #111; }
.wp .jexcel > tbody > tr > td.xl-group { background: #cfe2f3; font-weight: 700; color: #111; }
.wp .jexcel > tbody > tr > td.xl-group.xl-lead { background: #9bbb59; font-weight: 400; }

/* in-page questions and notes for the editor, instead of browser pop-ups */
.wp-dialog { border: 1px solid #bfbfbf; border-radius: 6px; padding: 16px 18px; max-width: 420px;
             font: 13.3px Calibri, Carlito, "Segoe UI", Arial, sans-serif; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.wp-dialog::backdrop { background: rgba(17,17,17,.25); }
.wp-dialog-text { margin: 0 0 14px; font-size: 14px; }
.wp-dialog-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.wp-danger-fill { background: #b42318 !important; border-color: #b42318 !important; color: #fff !important; }
.wp-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #111; color: #fff;
            padding: 8px 14px; border-radius: 6px; display: flex; gap: 12px; align-items: center; z-index: 50;
            font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw; }
.wp-toast[hidden] { display: none; }
.wp-toast button { background: transparent; color: #8ab4ff; border: 0; font-weight: 700; padding: 0; cursor: pointer; }
.wp-rename { position: fixed; z-index: 60; font: 700 13.3px Calibri, Carlito, "Segoe UI", Arial, sans-serif;
             border: 2px solid #1f6feb; padding: 0 4px; box-sizing: border-box; background: #fff; color: #111; }
.xl-failed { border-color: var(--bad) !important; }
/* dragging rows and columns in the editor */
.wp-drop { position: fixed; z-index: 70; background: #1f6feb; pointer-events: none; border-radius: 2px; }
.wp .jexcel tbody td.jexcel_row, .wp .jexcel thead td[data-x] { cursor: grab; }
.wp .jexcel thead td[data-x="0"], .wp .jexcel thead td[data-x="1"] { cursor: default; }
body.wp-dragging, body.wp-dragging * { cursor: grabbing !important; user-select: none; }

/* budget model: typed inputs in the workbooks' blue, worked-out cells shaded */
.wp .jexcel > tbody > tr > td.xl-line.xl-input { color: #0000ff; background: #fff; }
.wp .jexcel > tbody > tr > td.xl-line.xl-calc { background: #d9dde3; color: #333; font-style: normal; }
.wp .jexcel > tbody > tr > td.xl-calc { cursor: not-allowed; }
.wp-bar .xl-tags #d-budget { width: 96px; color: #0000ff; font-weight: 700; }
.wp-totals span.wp-off, .wp-totals span.wp-off b { color: #b42318; }

/* review findings, on the cells and in the panel */
.wp .jexcel > tbody > tr > td.xl-flag-error { box-shadow: inset 0 0 0 2px #b42318; }
.wp .jexcel > tbody > tr > td.xl-flag-warning { box-shadow: inset 0 0 0 2px #d97706; }
.wp .jexcel > tbody > tr > td.xl-flag-info { box-shadow: inset 0 0 0 2px #1f6feb; }
.wp-review { font-weight: 700; }
/* the review sits to the right of the sheet, the same height */
.wp-main { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.wp-main .wp-sheetwrap { flex: 1; min-width: 0; }
.wp-reviewpanel { flex: 0 0 340px; width: 340px; border: 1px solid #bfbfbf; background: #fff;
                  display: flex; flex-direction: column; overflow: hidden;
                  font: 13px Calibri, Carlito, "Segoe UI", Arial, sans-serif; }
.wp-reviewpanel[hidden] { display: none; }
@media (max-width: 900px) { .wp-main { flex-direction: column; } .wp-reviewpanel { width: auto; flex-basis: auto; } }
.wp-reviewhead { background: #111; color: #fff; padding: 4px 10px; display: flex; gap: 10px; align-items: center; }
.wp-reviewlist { flex: 1; overflow: auto; min-height: 0; }
.wp-reviewhead { flex-wrap: wrap; row-gap: 3px; }
.wp-reviewpanel li { flex-direction: column; gap: 1px; }
.wp-reviewpanel .where { min-width: 0; font-size: 12px; }
.wp-reviewpanel .src { margin-left: 0; align-self: flex-start; }
.wp-reviewlist summary { padding: 3px 10px; font-weight: 700; cursor: pointer; background: #f2f4f7; border-bottom: 1px solid #e3e6ea;
                         border-left: 4px solid transparent; }
.wp-reviewlist details.sev-error > summary { border-left-color: #b42318; }
.wp-reviewlist details.sev-warning > summary { border-left-color: #d97706; }
.wp-reviewlist details.sev-info > summary { border-left-color: #1f6feb; }
.wp-reviewlist summary .n { font-weight: 400; color: #555; margin-left: 4px; }
.wp-reviewhead .sev { font-size: 12px; padding: 0 7px; border-radius: 9px; }
.wp-reviewhead .sev.error { background: #b42318; }
.wp-reviewhead .sev.warning { background: #d97706; }
.wp-reviewhead .sev.info { background: #1f6feb; }
.wp-ai { font-size: 12px; color: #c9d6ff; }
.wp-ai-run { animation: wp-pulse 1.2s ease-in-out infinite; }
.wp-ai-off { color: #bbb; }
@keyframes wp-pulse { 50% { opacity: .45; } }
.wp-close { margin-left: auto; background: transparent; color: #fff; border: 0; font-size: 16px; padding: 0 4px; }
.wp-reviewpanel ul { list-style: none; margin: 0; padding: 0; }
.wp-reviewpanel li { display: flex; gap: 10px; padding: 3px 10px; border-bottom: 1px solid #eee; cursor: pointer; border-left: 4px solid transparent; }
.wp-reviewpanel li:hover { background: #f4f6f8; }
.wp-reviewpanel li.sev-error { border-left-color: #b42318; }
.wp-reviewpanel li.sev-warning { border-left-color: #d97706; }
.wp-reviewpanel li.sev-info { border-left-color: #1f6feb; }
.wp-reviewpanel .where { min-width: 150px; color: #555; white-space: nowrap; }
.wp-reviewpanel .fix { color: #17803d; }
.wp-reviewpanel .src { margin-left: auto; font-size: 11px; color: #6b4fbb; border: 1px solid #c9bdf0; border-radius: 8px; padding: 0 6px; height: 16px; }
.wp-clean { margin: 6px 10px; color: #17803d; }

/* fees and tax, under the totals */
.wp-fees { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; background: #e7e6e6; padding: 4px 10px;
           border-top: 1px solid #bfbfbf; font: 13px Calibri, Carlito, "Segoe UI", Arial, sans-serif; }
.wp-fees label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.wp-fees input[type=checkbox] { margin: 0; }
.wp-feein { font: inherit; color: #0000ff; border: 1px solid #bfbfbf; padding: 0 3px; height: 20px; text-align: right; }
.wp-feein:disabled, .wp-fees select:disabled { color: #999; background: #f2f2f2; }
.wp-fees select { font: inherit; height: 20px; }
.wp-fees em { font-style: normal; font-weight: 700; }
.wp-feehead { font-weight: 700; }
.wp-feenet, .wp-feetotal { white-space: nowrap; }
.wp-feetotal { margin-left: auto; background: #808080; color: #fff; padding: 1px 8px; }

/* save state: a small round light by the title */
.wp-head { align-items: center; }
.wp-savedot { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid #9aa0a6; background: #fff;
              position: relative; flex: 0 0 auto; cursor: default; }
.wp-savedot:hover { border-color: #9aa0a6; }
.wp-savedot[data-state="unsaved"] { background: #e8eaed; }
.wp-savedot[data-state="saving"] { border-color: #d0d4d9; border-top-color: #1f6feb; animation: wp-spin .7s linear infinite; }
.wp-savedot[data-state="saved"] { background: #17803d; border-color: #17803d; }
.wp-savedot[data-state="saved"]::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
              border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.wp-savedot[data-state="error"] { background: #b42318; border-color: #b42318; cursor: pointer; }
.wp-savedot[data-state="error"]::after { content: "!"; position: absolute; inset: 0; color: #fff; font: 700 12px/16px Arial, sans-serif; }
@keyframes wp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wp-savedot[data-state="saving"] { animation: none; border-color: #1f6feb; } }

/* how it works, folded by the title */
.wp-helpbtn { font-size: 12px; padding: 2px 9px; border-radius: 12px; white-space: nowrap; }
.wp-helpbtn.on { background: #111; color: #fff; border-color: #111; }
.wp-help { font-size: 12px; color: #444; background: #f6f7f9; border: 1px solid #e3e6ea; border-radius: 6px;
           padding: 6px 10px; margin: 0 0 8px; line-height: 1.5; }
.wp-totals-top { margin-bottom: 6px; }

/* ===== The EAB task manager's design, around the sheet =====
   Tokens and components from cammann44/ih (eab-task-manager,
   monitor/web/static/monitor-web.css), scoped to pages with body.eab. The
   sheet keeps the plan workbook look. */
.ed, .mp-plan, .wp-dialog, .wp-toast {
  --e-bg: var(--bg); --e-surface: var(--surface); --e-soft: var(--surface-soft); --e-neutral: var(--neutral);
  --e-border: var(--border); --e-border-strong: var(--border-strong); --e-row: var(--row);
  --e-text: var(--text); --e-muted: var(--muted); --e-faint: var(--faint); --e-dim: var(--dim);
  --e-accent: var(--accent); --e-accent-dark: var(--accent-dark); --e-accent-soft: var(--accent-soft);
  --e-teal: var(--accent); --e-teal-soft: var(--accent-soft);
  --e-good: var(--good); --e-good-soft: var(--good-soft); --e-warn: var(--warn); --e-warn-soft: var(--warn-soft);
  --e-bad: var(--bad); --e-bad-soft: var(--bad-soft); --e-shadow: var(--shadow);
  --e-card-shadow: 0 1px 2px var(--shadow);
  --e-font: var(--font);
}

.ed { font-family: var(--e-font); color: var(--e-text); background: transparent; padding: 14px 24px 0; }
.ed .wp-head { gap: 12px; margin-bottom: 10px; }
.ed .wp-title { font: 700 22px var(--e-font); letter-spacing: -0.015em; color: var(--e-text); border-radius: 8px; padding: 2px 6px; margin-left: -6px; }
.ed .wp-title:hover, .ed .wp-title:focus { border-color: var(--e-border-strong); background: var(--e-surface); }

/* buttons, as .btn there */
.ed .btn { border: 1px solid var(--e-border-strong); font: 500 13px var(--e-font); padding: 7px 12px; border-radius: 8px;
           background: var(--e-surface); color: var(--e-text); cursor: pointer; white-space: nowrap; text-decoration: none;
           display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
.ed .btn:hover { border-color: var(--e-accent); color: var(--e-accent); text-decoration: none; }
.ed .btn.sm { font-size: 12.5px; padding: 5px 11px; }
.ed .btn.primary { border-color: var(--e-accent); font-weight: 600; background: var(--e-accent-soft); color: var(--e-accent); }
.ed .btn.solid, .ed a.btn.solid { border-color: var(--e-accent); font-weight: 600; background: var(--e-accent); color: #fff; }
.ed .btn.solid:hover, .ed a.btn.solid:hover { background: var(--e-accent-dark); border-color: var(--e-accent-dark); color: #fff; }
.ed .btn.ghost { color: var(--e-muted); border-color: transparent; background: transparent; }
.ed .btn.ghost:hover { background: var(--e-neutral); color: var(--e-text); border-color: transparent; }
.ed .btn.wp-danger:hover { color: var(--e-bad); background: var(--e-bad-soft); }
.ed .btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ed .chip-btn { border: 1px solid var(--e-border-strong); font: 500 12.5px var(--e-font); padding: 5px 11px; border-radius: 999px;
                background: var(--e-surface); color: var(--e-text); cursor: pointer; white-space: nowrap; }
.ed .chip-btn.soft { border-color: var(--e-accent); font-weight: 600; background: var(--e-accent-soft); color: var(--e-accent); }
.ed .chip-btn.on, .ed .wp-helpbtn.on { border-color: var(--e-accent); background: var(--e-accent); color: #fff; }

/* the toolbar */
.ed .wp-bar { gap: 10px; margin-bottom: 10px; align-items: flex-end; }
.ed .ed-group { display: flex; gap: 6px; }
.ed .ed-fields { display: flex; gap: 8px; margin-right: 4px; }
.ed .ed-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--e-faint); }
.ed .ed-field input, .ed .ed-field select { font: 500 13px var(--e-font); color: var(--e-text); padding: 5px 9px; border: 1px solid var(--e-border-strong);
                                            border-radius: 8px; background: var(--e-surface); width: 110px; height: 31px; }
.ed .ed-field select { width: 170px; }
.ed .ed-field input:focus, .ed .ed-field select:focus { outline: 2px solid var(--e-accent-soft); border-color: var(--e-accent); }
.ed .ed-budget input { width: 130px; color: #0000ff; font-weight: 700; }
.ed .seg { display: flex; background: var(--e-neutral); border: none; padding: 2px; border-radius: 8px; gap: 2px; }
.ed .seg button { border: none; font: 600 12px var(--e-font); padding: 5px 11px; border-radius: 6px; background: transparent; color: var(--e-muted); cursor: pointer; }
.ed .seg button.on { background: var(--e-surface); color: var(--e-text); box-shadow: 0 1px 2px var(--e-shadow); }
.ed .wp-levels button.on { background: var(--e-surface); color: var(--e-text); border-color: transparent; }

/* the help, as a soft card */
.ed .wp-help { background: var(--e-surface); border: 1px solid var(--e-border); border-radius: 12px; padding: 12px 16px; color: var(--e-muted);
               font-size: 12.5px; line-height: 1.6; }

/* totals: a card of small labelled figures */
.ed .wp-totals { background: var(--e-surface); color: var(--e-text); border: 1px solid var(--e-border); border-radius: 12px;
                 padding: 8px 6px; gap: 0; margin-bottom: 10px; }
.ed .wp-totals span { display: flex; flex-direction: column; gap: 1px; padding: 0 14px; border-right: 1px solid var(--e-row); font-weight: 600; font-size: 13px; }
.ed .wp-totals span:last-child { border-right: 0; }
.ed .wp-totals span b:first-child { color: var(--e-faint); font-size: 11px; font-weight: 600; margin: 0; }
/* off: a pale red pill with dark red text, readable at a glance */
.ed .wp-totals span.wp-off { background: var(--e-bad-soft); color: var(--e-bad); border-radius: 8px; border-right-color: transparent; }
.ed .wp-totals span.wp-off b { background: transparent; color: var(--e-bad); }

/* the sheet's frame */
.ed .jexcel_content { border-color: var(--e-border-strong); border-radius: 10px; }

/* fees and tax: a card with ticks and small boxes */
.ed .wp-fees { background: var(--e-surface); border: 1px solid var(--e-border); border-radius: 12px; padding: 8px 14px;
               margin: 10px 0 12px; font: 13px var(--e-font); gap: 6px 16px; }
.ed .wp-feehead { font-size: 11px; font-weight: 600; color: var(--e-faint); text-transform: uppercase; letter-spacing: .04em; }
.ed .wp-fees input[type=checkbox] { accent-color: var(--e-accent); width: 15px; height: 15px; }
.ed .wp-feein, .ed .wp-fees select { font: 13px var(--e-font); border: 1px solid var(--e-border-strong); border-radius: 6px; height: 26px; padding: 0 6px; background: var(--e-surface); }
.ed .wp-feein:disabled, .ed .wp-fees select:disabled { background: var(--e-bg); color: var(--e-dim); border-color: var(--e-border); }
.ed .wp-fees em { color: var(--e-text); }
.ed .wp-feenet { color: var(--e-muted); }
.ed .wp-feetotal { background: var(--e-accent-soft); color: var(--e-accent); border-radius: 999px; padding: 3px 12px; font-weight: 600; }

/* Claude review and history: cards beside and above the sheet */
.ed .wp-reviewpanel, .ed .card { background: var(--e-surface); border: 1px solid var(--e-border); border-radius: 12px; font-family: var(--e-font); }
.ed .wp-reviewhead { background: var(--e-surface); color: var(--e-text); border-bottom: 1px solid var(--e-border); padding: 10px 12px; gap: 6px; }
.ed .wp-reviewhead b { font-size: 14px; font-weight: 600; margin-right: 4px; }
.ed .wp-reviewhead .sev { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.ed .wp-reviewhead .sev.error { background: var(--e-bad-soft); color: var(--e-bad); }
.ed .wp-reviewhead .sev.warning { background: var(--e-warn-soft); color: var(--e-warn); }
.ed .wp-reviewhead .sev.info { background: var(--e-accent-soft); color: var(--e-accent); }
.ed .wp-ai { color: var(--e-muted); flex-basis: 100%; font-size: 12px; }
.ed .wp-ai-off { color: var(--e-faint); }
.ed .wp-close { color: var(--e-faint); border-radius: 6px; }
.ed .wp-close:hover { background: var(--e-neutral); color: var(--e-text); }
.ed .wp-reviewlist summary { background: var(--e-soft); border-bottom: 1px solid var(--e-row); font-weight: 600; font-size: 12.5px; padding: 6px 12px; }
.ed .wp-reviewlist summary .n { color: var(--e-faint); }
.ed .wp-reviewpanel li { padding: 7px 12px; border-bottom: 1px solid var(--e-row); }
.ed .wp-reviewpanel li:hover { background: var(--e-soft); }
.ed .wp-reviewpanel .where { color: var(--e-faint); font-weight: 600; }
.ed .wp-reviewpanel .fix { color: var(--e-good); }
.ed .wp-reviewpanel .src { color: #7c3aed; border-color: #ddd0fb; background: #f5f0ff; }
.ed .wp-history { padding: 4px 0; margin-bottom: 10px; }
.ed .wp-history .xl-small { width: 100%; font-family: var(--e-font); }
.ed .wp-history .xl-small th { background: transparent; color: var(--e-faint); font-size: 11px; border-bottom: 1px solid var(--e-border); }
.ed .wp-history .xl-small td { background: transparent; border-bottom: 1px solid var(--e-row); }
.ed .wp-history button { font: 600 12px var(--e-font); padding: 3px 10px; border-radius: 8px; border: 1px solid var(--e-accent); background: var(--e-accent-soft); color: var(--e-accent); }
.ed .wp-reviewhead { position: relative; padding-right: 34px; }
.ed .wp-close { position: absolute; top: 7px; right: 8px; margin: 0; }
.ed .seg { background: var(--e-surface); border: 1px solid var(--e-border-strong); padding: 2px; }
.ed .seg button.on { background: var(--e-accent-soft); color: var(--e-accent); box-shadow: none; }

/* compact toolbar: icon buttons, narrow fields, one row */
.ed .wp-bar { flex-wrap: nowrap; gap: 8px; }
.ed .btn.icon { padding: 5px 7px; gap: 0; }
.ed .btn.icon svg { display: block; }
.ed .ed-client input { width: 62px; text-transform: uppercase; }
.ed .ed-budget input { width: 112px; }
.ed .ed-status select { width: 112px; font-size: 12.5px; padding: 4px 6px; }
.ed .ed-field input, .ed .ed-field select { height: 30px; }
@media (max-width: 1250px) { .ed .wp-bar { flex-wrap: wrap; } }

/* Excel's outline buttons, at the sheet's top left */
.ed .wp-outline { display: flex; gap: 3px; margin: 0 0 4px 2px; }
.ed .wp-outline button { width: 22px; height: 20px; padding: 0; font: 600 11px var(--e-font); color: var(--e-muted);
                         background: var(--e-surface); border: 1px solid var(--e-border-strong); border-radius: 4px; cursor: pointer; }
.ed .wp-outline button:hover { border-color: var(--e-accent); color: var(--e-accent); }
.ed .wp-outline button.on { background: var(--e-accent); border-color: var(--e-accent); color: #fff; }

/* totals with fees and tax folded beside them */
.ed .wp-sumrow { display: flex; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.ed .wp-sumrow .wp-totals { flex: 1; margin: 0; min-width: 0; }
.ed .wp-feetoggle { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; position: relative;
                    padding: 6px 30px 6px 14px; border: 1px solid var(--e-border); border-radius: 12px; background: var(--e-surface);
                    font-family: var(--e-font); cursor: pointer; text-align: left; }
.ed .wp-feetoggle .lbl { font-size: 11px; font-weight: 600; color: var(--e-faint); }
.ed .wp-feetoggle .val { font-size: 13px; font-weight: 600; color: var(--e-accent); }
.ed .wp-feetoggle .caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--e-faint); transition: transform .15s; }
.ed .wp-feetoggle:hover { border-color: var(--e-accent); }
.ed .wp-feetoggle.on { border-color: var(--e-accent); background: var(--e-accent-soft); }
.ed .wp-feetoggle.on .caret { transform: translateY(-50%) rotate(180deg); }
.ed .wp-fees { margin: 0 0 10px; }
.ed .wp-fees[hidden] { display: none; }
/* the fees and tax card opens from a cog */
.ed .wp-feetoggle { padding-right: 52px; }
.ed .wp-feetoggle .cog { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
                         display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--e-border-strong);
                         color: var(--e-muted); background: var(--e-surface); transition: transform .25s, color .15s, border-color .15s; }
.ed .wp-feetoggle:hover .cog { color: var(--e-accent); border-color: var(--e-accent); }
.ed .wp-feetoggle.on .cog { color: #fff; background: var(--e-accent); border-color: var(--e-accent); transform: translateY(-50%) rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .ed .wp-feetoggle .cog { transition: none; } }

/* every pixel to the sheet: labels beside their boxes, single-line cards */
.ed { padding-top: 8px; }
.ed .wp-head { margin-bottom: 6px; gap: 10px; }
.ed .wp-title { font-size: 19px; padding: 0 6px; }
.ed .wp-savedot { width: 18px; height: 18px; }
.ed .wp-bar { margin-bottom: 6px; align-items: center; }
.ed .ed-field { flex-direction: row; align-items: center; gap: 6px; font-size: 12px; }
.ed .ed-field span { white-space: nowrap; }
.ed .ed-field input, .ed .ed-field select { height: 28px; }
.ed .wp-sumrow { margin-bottom: 6px; }
.ed .wp-totals { padding: 4px 4px; }
.ed .wp-totals span { flex-direction: row; align-items: baseline; gap: 6px; padding: 2px 12px; }
.ed .wp-feetoggle { flex-direction: row; align-items: center; gap: 8px; padding-top: 4px; padding-bottom: 4px; }
.ed .wp-feetoggle .lbl { font-size: 12px; }
.ed .wp-feetoggle .cog { width: 26px; height: 26px; }
.ed .wp-fees { padding: 6px 14px; margin-bottom: 6px; }
.ed .wp-outline { margin-bottom: 3px; }
.ed .wp-outline button { height: 18px; }
.ed .wp-totals { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; align-items: center; }
.ed .wp-totals::-webkit-scrollbar { display: none; }
.ed .wp-totals span { padding: 2px 9px; white-space: nowrap; font-size: 12.5px; }
.ed .wp-totals span b:first-child { font-size: 11px; }
/* a smaller tick, centred in the 18px light */
.ed .wp-savedot[data-state="saved"]::after { left: 50%; top: 45%; width: 3px; height: 6px; border-width: 0 1.5px 1.5px 0;
                                             transform: translate(-50%, -50%) rotate(45deg); }

/* Row numbers, LID and Activity pinned with sticky positioning: they move
   with the scroll itself, so nothing lags or shakes. Offsets come from pin(). */
.wp .jexcel > thead > tr > td:first-child,
.wp .jexcel > tbody > tr > td:first-child,
.wp .jexcel > tfoot > tr > td:first-child { position: sticky; left: 0; z-index: 3; }
.wp .jexcel > tbody > tr > td[data-x="0"], .wp .jexcel > tfoot > tr > td:nth-child(2) { position: sticky; left: var(--pin0, 50px); z-index: 2; }
.wp .jexcel > tbody > tr > td[data-x="1"], .wp .jexcel > tfoot > tr > td:nth-child(3) { position: sticky; left: var(--pin1, 106px); z-index: 2;
                                              box-shadow: 2px 0 0 #bfbfbf; }
.wp .jexcel > thead > tr > td[data-x="0"] { position: sticky; left: var(--pin0, 50px); z-index: 5; }
.wp .jexcel > thead > tr > td[data-x="1"] { position: sticky; left: var(--pin1, 106px); z-index: 5; box-shadow: 2px 0 0 #333; }
.wp .jexcel > thead > tr > td:first-child { z-index: 6; }
/* pinned cells need a fill of their own; the plan's own colours win */
.wp .jexcel > tbody > tr > td:where(:first-child, [data-x="0"], [data-x="1"]) { background-color: #fff; }
.wp .jexcel > tbody > tr > td.jexcel_row { background-color: #f3f3f3; }

/* fees and tax at the foot of the sheet, as the Staffordshire workbook */
.wp .jexcel > tfoot > tr > td { font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 13.3px; height: 22px;
                                padding: 2px 4px; border-color: #d0d0d0; white-space: nowrap; }
.wp .jexcel > tfoot > tr.xl-ffee > td { background: #deeaf6; color: #111; }
.wp .jexcel > tfoot > tr.xl-ftotal > td { background: #7f7f7f; color: #fff; font-weight: 700; }
.wp .jexcel > tfoot > tr > td:first-child { background: #f3f3f3 !important; color: transparent; }
.wp .jexcel > tfoot > tr > td:not(:nth-child(2)):not(:nth-child(3)) { text-align: right; }
.wp .jexcel > tfoot > tr.xl-ffee > td:nth-child(4) { color: #0000ff; }

/* fields without labels: client, currency; status at the top right */
.ed .ed-plain { font: 500 13px var(--e-font); color: var(--e-text); height: 28px; padding: 3px 8px; border: 1px solid var(--e-border-strong);
                border-radius: 8px; background: var(--e-surface); }
.ed .ed-plain:focus { outline: 2px solid var(--e-accent-soft); border-color: var(--e-accent); }
.ed input.ed-client { width: 62px; text-transform: uppercase; }
.ed input.ed-client::placeholder { text-transform: none; color: var(--e-faint); }
.ed select.ed-currency { width: 70px; padding-right: 2px; }
.ed .ed-fields { align-items: center; gap: 6px; }
.ed .wp-head select.ed-status { width: 104px; height: 26px; font-size: 12.5px; }

/* name and toolbar on one row */
.ed .wp-bar { flex-wrap: wrap; row-gap: 6px; }
.ed .wp-bar .wp-title { flex: 0 1 260px; min-width: 150px; font-size: 16px; font-weight: 700; height: 30px; margin: 0;
                        padding: 0 8px; border: 1px solid transparent; border-radius: 8px; text-overflow: ellipsis;
                        white-space: nowrap; overflow: hidden; }
.ed .wp-bar .wp-title:hover { border-color: var(--e-border-strong); background: var(--e-surface); }
.ed .wp-bar .wp-title:focus { flex-basis: 420px; border-color: var(--e-accent); background: var(--e-surface); }
.ed .wp-bar .wp-savedot { flex: 0 0 18px; }
.ed .wp-bar select.ed-status { width: 96px; height: 28px; }
.ed .wp-helpbtn.on { background: var(--e-accent-soft); color: var(--e-accent); }
.ed .wp-review svg { margin-right: 2px; }
.ed .wp-bar { flex-wrap: nowrap; gap: 6px; }
.ed .wp-bar .wp-title { flex: 1 1 260px; min-width: 120px; max-width: 300px; }
.ed .ed-group { gap: 4px; }
.ed .ed-group .btn.sm:not(.icon) { padding: 5px 9px; }
.ed .wp-bar .wp-gap { flex: 1 1 0; min-width: 4px; }
@media (max-width: 1240px) { .ed .wp-bar { flex-wrap: wrap; } }

/* the edit buttons share the outline strip above the sheet, at its size */
.ed .wp-outline { align-items: center; }
.ed .wp-outline .wp-sep { width: 1px; height: 14px; background: var(--e-border-strong); margin: 0 4px; }
.ed .wp-tools { display: flex; gap: 3px; }
.ed .wp-tools .wp-mini { height: 20px; padding: 0 7px; font: 600 11px var(--e-font); color: var(--e-muted); background: var(--e-surface);
                         border: 1px solid var(--e-border-strong); border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; }
.ed .wp-tools .wp-mini:hover { border-color: var(--e-accent); color: var(--e-accent); }
.ed .wp-tools .wp-mini.icon { width: 22px; padding: 0; justify-content: center; }
.ed .wp-tools + .wp-tools { margin-left: 6px; }
/* the name gets the room they left */
.ed .wp-bar .wp-title { flex: 1 1 520px; max-width: 640px; }
.ed .wp-tools .wp-mini:not(.icon) { width: auto; }
.ed .wp-bar .wp-title { max-width: 820px; }
.ed .wp-bar .wp-title { flex-grow: 20; }

/* ===== Hybrid v3, as the EOC (eoc.hybrid.co) wears it =====
   From the eoc project's static/hybrid-v3.css and base.html: navy top bar,
   Hanken Grotesk, #f4f6f9 page, white cards with a soft shadow, navy
   primary buttons, teal focus. Same token names as the EAB block above, so
   every component follows. */

/* cards: a soft lift, as the EOC's */
.ed .wp-totals, .ed .wp-feetoggle, .ed .wp-fees, .ed .wp-reviewpanel, .ed .card, .ed .wp-help { box-shadow: var(--e-card-shadow); }
/* buttons: navy primary, white outlined, bold as the EOC's */
.ed .btn { font-weight: 700; border-radius: 9px; }
.ed .btn:hover { background: var(--e-soft); border-color: var(--e-border-strong); color: var(--e-accent); }
.ed .btn.primary { background: var(--e-accent); border-color: var(--e-accent); color: #fff; }
.ed .btn.primary:hover { background: var(--e-accent-dark); color: #fff; }
.ed .btn.solid, .ed a.btn.solid { background: var(--e-accent); border-color: var(--e-accent); }
.ed .btn.solid:hover, .ed a.btn.solid:hover { background: var(--e-accent-dark); border-color: var(--e-accent-dark); }
/* focus in teal */
.ed .ed-plain:focus, .ed .ed-field input:focus, .ed .ed-field select:focus, .ed .wp-feein:focus, .ed .wp-bar .wp-title:focus {
  outline: 2px solid var(--e-teal); outline-offset: 1px; border-color: var(--e-teal); }
.ed .ed-plain, .ed .ed-field input, .ed .ed-field select { color: var(--e-accent); }
.ed .ed-budget input, .ed #d-budget { color: #0000ff; }
/* outline 1-4 and the small tools: navy when on */
.ed .wp-outline button.on { background: var(--e-accent); border-color: var(--e-accent); }
.ed .wp-feetoggle .val { color: var(--e-accent); font-weight: 800; }
.ed .wp-feetoggle.on .cog { background: var(--e-teal); border-color: var(--e-teal); }
/* How it works sits by Refresh in the top bar */
/* no gap before Review: the name takes the spare width */
.ed .wp-bar .wp-title { max-width: none; }
.ed .wp-bar .wp-gap { display: none; }

/* fees panel: three tidy columns, every amount right-aligned */
.ed .wp-fees { display: block; padding: 10px 14px; }
.ed .fz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 230px; gap: 0 28px; align-items: start; }
.ed .fz h4 { margin: 0 0 4px; font: 700 10.5px var(--e-font); letter-spacing: .08em; text-transform: uppercase; color: var(--e-muted); }
.ed .fz-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 110px; align-items: center; gap: 8px; min-height: 32px;
              border-bottom: 1px solid var(--e-row); }
.ed .fz-row:last-child { border-bottom: 0; }
.ed .fz-row label { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ed .fz-row.off label span, .ed .fz-row.off .fz-amt { color: var(--e-faint); }
.ed .fz-ctl { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ed .fz-ctl select { height: 26px; border-radius: 6px; max-width: 170px; }
.ed .fz-in { display: inline-flex; align-items: center; border: 1px solid var(--e-border-strong); border-radius: 6px; background: var(--e-surface); height: 26px; overflow: hidden; }
.ed .fz-in i { font-style: normal; color: var(--e-muted); padding: 0 6px; font-size: 12px; background: var(--e-soft); align-self: stretch; display: flex; align-items: center; }
.ed .fz-in input.wp-feein { border: 0; height: 24px; width: 64px; border-radius: 0; text-align: right; }
.ed .fz-row.off .fz-in { background: var(--e-bg); }
.ed .fz-amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.ed .fz-sum { margin: 0; padding: 6px 12px; background: var(--e-soft); border: 1px solid var(--e-border); border-radius: 10px; display: grid; gap: 2px; }
.ed .fz-sum div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.ed .fz-sum dt { color: var(--e-muted); font-weight: 600; }
.ed .fz-sum dd { margin: 0; font-weight: 700; }
.ed .fz-sum .fz-total { border-top: 1px solid var(--e-border-strong); margin-top: 2px; padding-top: 6px; }
.ed .fz-sum .fz-total dt, .ed .fz-sum .fz-total dd { color: var(--e-accent); font-weight: 800; font-size: 14px; }
@media (max-width: 1100px) { .ed .fz { grid-template-columns: 1fr; gap: 10px; } }

/* wrap text: rows grow to show long text; the edit box grows over the rows below */
.wp .jexcel > tbody > tr > td { vertical-align: top; }
.wp .jexcel > tbody > tr > td.editor { overflow: visible; z-index: 30; }
/* the pinned columns are already positioned (sticky); the rest need it for the box */
.wp .jexcel > tbody > tr > td.editor:not([data-x="0"]):not([data-x="1"]) { position: relative; }
.wp .jexcel > tbody > tr > td.editor > textarea {
  position: absolute; left: -1px; top: -1px; width: calc(100% + 2px); min-width: 240px; min-height: max(calc(100% + 2px), 68px);
  max-height: 260px; overflow-y: auto; resize: none; padding: 2px 4px; line-height: 1.35;
  font: 13.3px Calibri, Carlito, "Segoe UI", Arial, sans-serif; color: #111; background: #fff;
  border: 2px solid #0e8a7d; box-shadow: 0 6px 18px rgba(15, 36, 64, .18); outline: none; white-space: pre-wrap; z-index: 30; }
/* incl. fees toggle by the budget */
.ed .ed-incl { height: 28px; padding: 0 9px; border: 1px solid var(--e-border-strong); border-radius: 8px; background: var(--e-surface);
               color: var(--e-muted); font: 700 12px var(--e-font); cursor: pointer; white-space: nowrap; }
.ed .ed-incl:hover { border-color: var(--e-accent); color: var(--e-accent); }
.ed .ed-incl.on { background: var(--e-accent); border-color: var(--e-accent); color: #fff; }
/* a VAT cell left blank shows its channel's rate, greyed */
.wp .jexcel > tbody > tr > td.xl-derived { color: #8a94a3; font-style: italic; }

/* wrap text off: one line per row, long text cut with an ellipsis */
.wp.wp-nowrap .jexcel > tbody > tr > td { white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
.wp.wp-nowrap .jexcel > tbody > tr > td.editor { overflow: visible; }
.ed .wp-tools .wp-mini.on { background: var(--e-accent); border-color: var(--e-accent); color: #fff; }

/* Compare in the top bar, beside Refresh */
/* Balance, inside the weighting warning */
.ed .wp-balance { margin-left: 6px; height: 20px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--e-bad);
                  background: #fff; color: var(--e-bad); font: 700 11.5px var(--e-font); cursor: pointer; }
.ed .wp-balance:hover { background: var(--e-bad); color: #fff; }

/* block plan: phases by month */
.ed .wp-blocks { padding: 0; margin: 0 0 6px; overflow: hidden; }
.ed .wp-blocks[hidden] { display: none; }
.ed .bk-scroll { max-height: 280px; overflow: auto; }
.ed table.bk { border-collapse: separate; border-spacing: 0; font: 12.5px var(--e-font); min-width: 100%; }
.ed .bk th, .ed .bk td { padding: 4px 8px; white-space: nowrap; border-bottom: 1px solid var(--e-row); text-align: right; font-variant-numeric: tabular-nums; }
.ed .bk thead th { position: sticky; top: 0; background: var(--e-soft); color: var(--e-muted); font-size: 11px; font-weight: 700; z-index: 2; }
.ed .bk .bk-name { position: sticky; left: 0; background: var(--e-surface); text-align: left; min-width: 240px; max-width: 320px;
                    overflow: hidden; text-overflow: ellipsis; z-index: 1; font-weight: 600; color: var(--e-text); }
.ed .bk thead .bk-name { background: var(--e-soft); z-index: 3; }
.ed .bk-phase { cursor: pointer; }
.ed .bk-phase:hover .bk-name { color: var(--e-accent); }
.ed .bk-caret { display: inline-block; width: 14px; color: var(--e-muted); }
.ed .bk-line .bk-name { font-weight: 400; padding-left: 26px; cursor: pointer; }
.ed .bk-plat { margin-left: 8px; color: var(--e-faint); font-size: 11.5px; }
.ed .bk td.on { font-weight: 700; border-radius: 0; }
.ed .bk .bk-total { font-weight: 800; color: var(--e-accent); background: var(--e-soft); }
.ed .bk tfoot th, .ed .bk tfoot td { position: sticky; bottom: 0; background: var(--e-soft); font-weight: 800; border-top: 1px solid var(--e-border-strong); }
.ed .bk-empty { margin: 10px 14px; color: var(--e-muted); }

/* compare dialog */
.wp-compare { max-width: 860px; width: 92vw; }
.wp-compare h3 { margin: 0 0 6px; font-size: 17px; }
.wp-compare h4 { margin: 14px 0 6px; font-size: 13px; }
.wp-compare h4 span { color: #64748b; font-weight: 500; }
.wp-compare .cmp-note { margin: 0 0 10px; color: #64748b; }
.wp-compare .cmp-sum { display: flex; gap: 10px; margin-bottom: 6px; }
.wp-compare .cmp-sum div { flex: 1; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 12px; display: grid; }
.wp-compare .cmp-sum span { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.wp-compare .cmp-sum b { font-size: 18px; color: #0f2440; }
.wp-compare .cmp-sum i { font-style: normal; color: #94a3b8; font-size: 12px; }
.wp-compare .cmp-same { color: #047857; font-weight: 600; }
.wp-compare .cmp-body { max-height: 65vh; overflow: auto; margin-bottom: 12px; }
.wp-compare table.cmp { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wp-compare .cmp th { text-align: left; color: #64748b; font-size: 11px; border-bottom: 1px solid #e2e8f0; padding: 4px 6px; background: transparent; }
.wp-compare .cmp td { padding: 4px 6px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
/* panels above the sheet keep their height; the sheet takes what is left */
.ed .wp-blocks, .ed .wp-fees, .ed .wp-help, .ed .wp-history, .ed .wp-sumrow, .ed .wp-bar { flex-shrink: 0; }

/* fees panel: amounts beside their settings, a clear split between fees and tax */
.ed .fz { grid-template-columns: max-content max-content minmax(220px, 260px); gap: 0; justify-content: start; }
.ed .fz-col { padding: 0 28px; }
.ed .fz-col:first-child { padding-left: 0; }
.ed .fz-col + .fz-col { border-left: 1px solid var(--e-border); }
.ed .fz-row { grid-template-columns: 116px 230px 96px; gap: 10px; }
.ed .fz-amt { text-align: right; }
.ed .fz-sum { margin-left: 28px; }
.ed .fz-ontop { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--e-accent); padding: 2px 0 6px;
                border-bottom: 1px solid var(--e-border); margin-bottom: 4px; cursor: pointer; }
.ed .fz-ontop input { accent-color: var(--e-accent); width: 15px; height: 15px; margin: 0; }
@media (max-width: 1300px) { .ed .fz { grid-template-columns: 1fr; } .ed .fz-col { padding: 0; border: 0 !important; } .ed .fz-sum { margin: 8px 0 0; } }
.ed .fz-row { grid-template-columns: 112px 196px 88px; gap: 8px; }

/* block plan in the workbook's colours, not the page chrome: black header,
   grey phase rows with white names, lavender line names, green live months */
.ed .wp-blocks table.bk { font: 13.3px Calibri, Carlito, "Segoe UI", Arial, sans-serif; color: #111; }
.ed .bk th, .ed .bk td { border-bottom: 1px solid #d0d0d0; border-right: 1px solid #d0d0d0; padding: 2px 8px; }
.ed .bk thead th, .ed .bk thead .bk-name { background: #111111; color: #fff; font-size: 13.3px; border-color: #333; }
.ed .bk thead .bk-total { background: #111111; color: #fff; }
.ed .bk-phase th, .ed .bk-phase td { background: #999999; color: #000; font-weight: 700; border-bottom-color: #8a8a8a; }
.ed .bk-phase .bk-name { color: #fff; background: #999999; }
.ed .bk-phase .bk-caret { color: #fff; }
.ed .bk-phase:hover .bk-name { color: #fff; text-decoration: underline; }
.ed .bk-phase td.on { background: #9bbb59; color: #000; }
.ed .bk-line th, .ed .bk-line td { background: #e7e6e6; border-bottom-color: #bfbfbf; }
.ed .bk-line .bk-name { background: #d9d2e9; color: #111; }
.ed .bk-line td.on { background: #d9ead3; color: #000; font-weight: 400; }
.ed .bk-plat { color: #555; }
.ed .bk .bk-total, .ed .bk-phase .bk-total, .ed .bk-line .bk-total { background: #d3d3d3; color: #000; font-weight: 700; }
.ed .bk tfoot th, .ed .bk tfoot td, .ed .bk tfoot .bk-total { background: #808080; color: #000; font-weight: 700; border-top: 0; border-color: #9a9a9a; }
.ed .bk tfoot .bk-name { color: #fff; background: #808080; }
.ed .bk-scroll { border: 1px solid #bfbfbf; }

/* status colours: Ready is orange, Approved green, Draft plain */
.ed select.ed-status[data-status="Ready"] { background-color: #fff1e0; color: #b45309; border-color: #f5a04a; font-weight: 700; }
.ed select.ed-status[data-status="Approved"] { background-color: #eaf7ee; color: #17803d; border-color: #9fd6b0; font-weight: 700; }
.pill.ready { color: #b45309; border-color: #f5c48f; background: #fff1e0; }

/* the intelligence hub button beside the status, and its partner picker */
.ed .wp-ih { height: 28px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--e-border, #d5dbe3); background: #fff;
  font: 700 12px var(--e-font, inherit); color: #5b6675; cursor: pointer; white-space: nowrap; }
.ed .wp-ih[data-state="sent"] { color: #17803d; border-color: #9fd6b0; background: #eaf7ee; }
.ed .wp-ih[data-state="error"] { color: #b42318; border-color: #f2b8b5; background: #fdeceb; }
.ed .wp-ih[data-state="waiting"] { color: #b45309; border-color: #f5c48f; background: #fff7ed; }
.wp-ihpick { width: 440px; }
.wp-ihpick .wp-dialog-input { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.wp-ihpick .ih-results { list-style: none; margin: 0 0 12px; padding: 0; max-height: 280px; overflow: auto; border: 1px solid #e3e7ed; border-radius: 6px; }
.wp-ihpick .ih-results li + li { border-top: 1px solid #eef1f5; }
.wp-ihpick .ih-results button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  padding: 7px 10px; border: 0; background: #fff; font: inherit; cursor: pointer; }
.wp-ihpick .ih-results button:hover, .wp-ihpick .ih-results button:focus { background: #f2f7ff; outline: none; }
.wp-ihpick .ih-results small { color: #6b7280; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wp-ihpick .ih-note { padding: 8px 10px; color: #6b7280; }
/* empty months stay white so the live (green) months read as blocks */
.ed .bk-phase td:not(.on):not(.bk-total), .ed .bk-line td:not(.on):not(.bk-total) { background: #fff; }
/* no grey in the block plan: phase rows, totals and the footer are white */
.ed .bk-phase th, .ed .bk-phase .bk-name { background: #fff; color: #111; }
.ed .bk-phase .bk-caret { color: #555; }
.ed .bk-phase:hover .bk-name { color: #111; }
.ed .bk-phase td:not(.on), .ed .bk-line td:not(.on) { background: #fff; }
.ed .bk .bk-total, .ed .bk-phase .bk-total, .ed .bk-line .bk-total { background: #fff; color: #111; }
.ed .bk tfoot th, .ed .bk tfoot td, .ed .bk tfoot .bk-total, .ed .bk tfoot .bk-name { background: #fff; color: #111; border-top: 2px solid #111; }

/* the read-only plan page inside the task manager's frame */
.xl.mp-plan { padding: 14px 24px 24px; }
