/* v4 refresh — projects screens. Tokens only (tokens/*.css): no bare hex, weights 400/500. */

/* ══ PROJECTS LIST (design p05; docs/ui-refresh/01-home-workspace.md §2) ════ */
.pj4 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 31px; align-items: start; }
.pj4.has-panel { grid-template-columns: minmax(0, 1fr) 350px; }
.pj4-main { min-width: 0; }

.pj4-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pj4-head-acts { display: flex; gap: 10px; }

/* The live stages as one proportional bar; each label sits under its segment's left edge. */
.pj4-bar { display: flex; gap: 4px; margin-top: 16px; }
.pj4-bar-seg { flex: 1 1 0; min-width: max-content; display: flex; flex-direction: column; gap: 8px; }
.pj4-bar-fill { display: block; height: 6px; border-radius: 3px; }
.pj4-bar-fill.prog { background: var(--brand-blue); }
.pj4-bar-fill.review { background: var(--time-review); }
.pj4-bar-fill.ready { background: var(--anchor); }
.pj4-bar-fill.part { background: var(--time-practice); }
.pj4-bar-seg:nth-child(2) .pj4-bar-fill { animation-delay: 80ms; }
.pj4-bar-seg:nth-child(3) .pj4-bar-fill { animation-delay: 160ms; }
.pj4-bar-seg:nth-child(4) .pj4-bar-fill { animation-delay: 240ms; }
.pj4-bar-l { font-size: var(--text-meta-r); color: var(--ink-3); white-space: nowrap; padding-right: 10px; }
.pj4-bar-n { font-size: var(--text-body); font-weight: var(--weight-medium); color: var(--ink); margin-right: 3px; font-variant-numeric: tabular-nums; }

/* One row of controls: segmented, Group, Filter, then the search filling the rest. */
.pj4-controls { display: flex; align-items: center; gap: 10px; margin: 22px 0 18px; flex-wrap: wrap; }
.pj4-seg button { padding: 0 11px; }
.pj4-drop { font-weight: var(--weight-regular); gap: 8px; color: var(--ink); }
.pj4-drop svg { color: var(--ink-3); }
.pj4-drop.on { border-color: var(--link); color: var(--link); }
.pj4-search { flex: 1 1 120px; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--hair); border-radius: var(--radius-md); background: var(--surface); color: var(--ink-3); cursor: text; }
.pj4-search:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px var(--halo); }
.pj4-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; min-height: 34px;
  font-family: var(--font-sans); font-size: var(--text-body); color: var(--ink); }
.pj4-search input:focus-visible { outline: none; }
.pj4-search input::placeholder { color: var(--ink-3); }

/* The table: a grid, not cards. Selected tints blue; late text turns orange. */
.pj4-row { display: grid; grid-template-columns: 70px minmax(0, 1.5fr) 128px minmax(0, 1.5fr) 44px 56px 24px; gap: 12px;
  align-items: center; min-height: 58px; padding: 0 10px; border-bottom: 1px solid var(--hair); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out); }
.pj4-row:not(.pj4-thead):hover { background: var(--row-hover); }
.pj4-row.sel, .pj4-row.sel:hover { background: var(--blue-tint); border-radius: var(--radius-6); border-bottom-color: transparent; }
.pj4-thead { min-height: 34px; cursor: default; border-bottom: 1px solid var(--rule-head);
  font-size: var(--text-table-head); letter-spacing: var(--tracking-table); text-transform: uppercase; color: var(--ink-3); }
.pj4-thead .r, .pj4-due { text-align: right; }
.pj4-no { font-size: var(--text-row); font-weight: var(--weight-medium); color: var(--ink); font-variant-numeric: tabular-nums; }
.pj4-proj { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pj4-client { display: flex; align-items: center; gap: 6px; font-size: var(--text-body); font-weight: var(--weight-medium); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj4-desc { font-size: var(--text-label); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj4-stage-cell { min-width: 0; }
.pj4-stage { height: 24px; padding: 0 10px; gap: 4px; display: inline-flex; align-items: center; max-width: 100%;
  font-family: var(--font-sans); cursor: default; }
button.pj4-stage { cursor: pointer; }
button.pj4-stage svg { opacity: 0.7; flex: none; }
button.pj4-stage:hover { filter: brightness(0.97); }
.pj4-next { font-size: var(--text-meta-r); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pj4-lead { display: inline-flex; padding: 0; border: 0; background: none; border-radius: 50%; }
button.pj4-lead { cursor: pointer; }
.pj4-av { width: 24px; height: 24px; font-size: 9.5px; }
.pj4-none { color: var(--ink-3); font-size: var(--text-meta-r); }
.pj4-due { font-size: var(--text-body); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pj4-next.late-text, .pj4-due.late-text { color: var(--late); }
.pj4-group { display: flex; align-items: baseline; gap: 8px; padding: 18px 10px 8px; border-bottom: 1px solid var(--hair);
  font-size: var(--text-meta-r); font-weight: var(--weight-medium); color: var(--ink-2); }
.pj4-group-n { color: var(--ink-3); font-weight: var(--weight-regular); font-family: var(--font-technical); }
.pj4-table .empty-state { margin-top: 14px; }
.pj4-foot { margin: 16px 0 0; font-size: var(--text-meta-r); color: var(--ink-3); }
.pj4-foot kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border: 1px solid var(--hair); border-radius: 4px; background: var(--surface); font-family: var(--font-sans); font-size: 11px; color: var(--ink-2); }

/* The row's ⋯ (§12): quiet until the row is hovered, focused or selected. */
.pj4-dots { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 28px; padding: 0; border: 0;
  border-radius: var(--radius-6); background: none; color: var(--ink-3); cursor: pointer; opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out); }
.pj4-row:hover .pj4-dots, .pj4-row.sel .pj4-dots, .pj4-dots:focus-visible { opacity: 1; }
.pj4-dots:hover { color: var(--link); background: var(--surface); }
@media (hover: none) { .pj4-dots { opacity: 1; } }

/* Group and Filter menus. */
.pj4-menu { position: fixed; z-index: 1000; max-height: min(70vh, 520px); overflow-y: auto; min-width: 220px; }
.pj4-menu button { justify-content: space-between; gap: 16px; }
.pj4-menu button.on { font-weight: var(--weight-medium); }
.pj4-menu button.on::after { content: '✓'; color: var(--link); }
.pj4-menu-h { padding: 6px 12px 2px; font-size: var(--text-label); color: var(--ink-3); }

/* The preview: the selected project, on the Ground colour, full height on the right. */
.pj4-panel { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  margin: 0 -56px -130px 0; padding: 4px 26px 40px; background: var(--rail-bg); border-left: 1px solid var(--hair); }   /* starts under the search/bell row (23/10) */
.pj4-panel[hidden] { display: none; }
.pj4-pv { animation: v4-fade var(--dur-fast) var(--ease-out) both; }
.pj4-pv-top { display: flex; align-items: center; justify-content: space-between; }
.pj4-pv-no { font-size: var(--text-meta-r); font-weight: var(--weight-medium); color: var(--anchor); }
.pj4-pv-x { width: 30px; min-height: 30px; border-color: transparent; background: transparent; color: var(--ink-3); margin-right: -6px; }
.pj4-pv-client { margin: 4px 0 0; font-size: calc(var(--text-section) + 2px); font-weight: var(--weight-medium); letter-spacing: -0.01em; color: var(--ink); line-height: 1.2; }
.pj4-pv-sub { margin-top: 6px; font-size: var(--text-meta-r); color: var(--ink-3); }
.pj4-pv-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.pj4-pv-alert { margin-bottom: 18px; }
.pj4-kv { margin: 0; border-bottom: 1px solid var(--hair); }
.pj4-kv > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; padding: 11px 0; border-top: 1px solid var(--hair); }
.pj4-kv dt { font-size: var(--text-meta-r); color: var(--ink-3); }
.pj4-kv dd { margin: 0; font-size: var(--text-body); color: var(--ink); line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.pj4-kv dd.pj4-wait { color: var(--ink-3); }

@media (min-width: 761px) and (max-width: 1180px) {
  .pj4-panel { margin: 0 -30px -112px 0; padding-top: 4px; }
}
@media (max-width: 1180px) and (min-width: 761px) {
  .pj4.has-panel { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
}
@media (max-width: 900px) {
  .pj4-row { grid-template-columns: 60px minmax(0, 1.5fr) 128px minmax(0, 1.3fr) 56px 24px; }
  .pj4-row > :nth-child(5) { display: none; }
}
/* A phone: two lines a row — number, client and stage; then what is next and when. */
@media (max-width: 760px) {
  /* v4.8.0: the project tabs scroll inside their own row on a phone — the page never scrolls sideways (W2). */
  .pd-tabs, .pd4-tabs { overflow-x: auto; scrollbar-width: none; }
  .pd4-tabs .pd-tab { flex: none; }
  .pj4-head-acts #meeting { display: none; }
  .pj4-bar-l { font-size: var(--text-label); }
  .pj4-seg { width: 100%; overflow-x: auto; }
  .pj4-seg button { flex: 1 0 auto; min-height: 36px; }
  .pj4-drop, .pj4-search { min-height: 44px; }
  .pj4-search { flex-basis: 100%; }
  .pj4-thead { display: none !important; }
  .pj4-row { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "no proj stage" "no next due";
    gap: 4px 10px; padding: 10px 6px; min-height: 64px; }
  .pj4-row > :nth-child(5), .pj4-dots { display: none; }
  .pj4-no { grid-area: no; align-self: start; padding-top: 1px; }
  .pj4-proj { grid-area: proj; }
  .pj4-stage-cell { grid-area: stage; justify-self: end; }
  .pj4-next { grid-area: next; color: var(--ink-2); }
  .pj4-due { grid-area: due; font-size: var(--text-meta-r); }
  .pj4-foot .pj4-keys { display: none; }
}

/* ══ THE PROJECT MENUS (p47–p48; 03-help-menus-dialogs.md §11–§13) ═════════ */
.pmenu { position: fixed; z-index: 100000; min-width: 0; max-width: calc(100vw - 16px); }
.pmenu button { gap: 10px; min-height: 33px; padding: 0 10px; }
.pmenu button.is-off { color: var(--ink-3); cursor: default; }
.pmenu button.is-off:hover { background: none; }
.pmenu button.is-now, .pmenu button.is-now:hover { background: var(--blue-tint); font-weight: var(--weight-medium); color: var(--ink); }
.pmenu button.is-end { color: var(--ink); }
.pmenu .pmenu-l { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmenu .pmenu-hint { flex: none; font-size: var(--text-label); font-weight: var(--weight-regular); color: var(--ink-3); }
.pmenu .pmenu-ico { flex: none; display: inline-flex; color: var(--ink-2); }
.pmenu .pmenu-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.pmenu .pmenu-dot.past { background: var(--hair-strong); }
.pmenu .pmenu-dot.now { background: var(--link); }
.pmenu .pmenu-dot.soft { background: var(--time-practice); }
.pmenu-h { padding: 4px 10px 6px; font-size: var(--text-label); color: var(--ink-3); }
.pmenu-f { margin: 6px -6px 0; padding: 8px 16px 4px; border-top: 1px solid var(--hair); font-size: var(--text-label); line-height: 1.4; color: var(--ink-3); }
.pmenu hr { margin: 6px 0; }

/* ══ THE PROJECT RECORD (design p07; 01-home-workspace.md §3) ═══════════════ */
.pd4 { display: flex; flex-direction: column; gap: 0; }
.pd4-crumbs { margin-bottom: 14px; }
.pd4-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px solid var(--hair); }
.pd4-head-l { min-width: 0; flex: 1 1 420px; }
.pd4-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin: 0;
  font-size: calc(var(--text-page) + 4px); font-weight: var(--weight-medium); letter-spacing: var(--tracking-title); line-height: 1.15; color: var(--ink); }
.pd4-no { color: var(--anchor); font-variant-numeric: tabular-nums; }
.pd4-client { min-width: 0; }
.pd4-stage { height: 26px; padding: 0 10px; gap: 4px; display: inline-flex; align-items: center; border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: var(--text-meta-r); letter-spacing: 0; align-self: center; }
button.pd4-stage { cursor: pointer; }
button.pd4-stage svg { opacity: 0.7; }
.pd4-meta { margin-top: 10px; font-size: var(--text-body); color: var(--ink-2); line-height: 1.45; }
.pd4-sep { color: var(--ink-3); }
.pd4-lead { padding: 0; border: 0; background: none; font: inherit; font-weight: var(--weight-medium); color: var(--ink); cursor: pointer; }
.pd4-lead:hover { color: var(--link); }

/* Change it where it is shown (v4.19.4, Karan 28/10/2026): a value that edits
   in place — the lead, checker, client, site and deadline. Quiet until pointed
   at (a dotted underline and a pencil), never a new button; on a touch screen,
   with no hover, the underline stays faintly on so it still reads as a control. */
.pd4-edit { display: inline; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
  border-radius: var(--radius-sm); text-decoration: underline dotted transparent; text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-fast) var(--ease-out); }
.pd4-edit::after { content: '\270E'; display: inline-block; text-decoration: none; margin-left: 5px; font-size: 0.85em; font-weight: var(--weight-regular); color: var(--ink-3);
  opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.pd4-edit:hover, .pd4-edit:focus-visible { text-decoration-color: var(--ink-3); }
.pd4-edit:hover::after, .pd4-edit:focus-visible::after { opacity: 1; }
.pd4-edit.is-empty { color: var(--ink-2); }
.pd4-figs .pd4-edit { font-variant-numeric: tabular-nums; }
@media (hover: none) { .pd4-edit { text-decoration-color: var(--hair-strong); } }

/* The in-place popovers (views/inline-edit.js): the people picker rides the
   .menu-v4 menu; the address and date editors are a small form card. */
.pinl { position: fixed; z-index: 100000; max-width: calc(100vw - 16px); box-sizing: border-box; }
.pinl.pinl-form { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-12); box-shadow: var(--shadow-float); padding: 10px 12px 12px; }
.pinl.is-busy { opacity: 0.75; }
.pinl .pmenu-h { padding: 2px 2px 8px; }
.pinl.pmenu .pmenu-h { padding: 4px 10px 6px; }
.pinl .f-input { width: 100%; box-sizing: border-box; }
.pinl .pinl-q { margin: 0 0 6px; }
.pinl-list { max-height: 264px; overflow-y: auto; }
.pinl-list button.is-act { background: var(--segment-track); }
.pinl-none { margin: 6px 10px 8px; font-size: var(--text-label); color: var(--ink-3); }
.pinl-note { margin: 8px 2px 0; font-size: var(--text-label); line-height: 1.4; color: var(--ink-3); }
.pinl-acts { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pinl-fill { flex: 1; }
.pinl-rm { font-size: var(--text-meta-r); }
.pinl-err { margin: 8px 4px 0; font-size: var(--text-label); color: var(--ink-3); }
.pinl-err.bad { color: var(--status-error); }
@media (max-width: 760px) {
  .pinl .f-input { min-height: 44px; font-size: 16px; }   /* 16px: iOS zooms into anything smaller */
  .pinl.pmenu button, .pinl-acts .btn { min-height: 44px; }
}
.pd4-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd4-more { color: var(--ink); font-size: 16px; letter-spacing: 0.04em; }
.pd4-link { padding: 0; border: 0; background: none; font: inherit; font-size: inherit; color: var(--link); cursor: pointer; }
.pd4-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* The four figures: a ruled strip with no inner borders (p07). */
.pd4-figs { border-top: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px 0 18px; border-bottom: 1px solid var(--hair); }
.pd4-figs > .fig { border-left: 0; padding: 14px 16px 0 0; }
.pd4-figs .fig-value { font-variant-numeric: tabular-nums; }
.pd4-figs .fig-value.pd4-muted { color: var(--ink-3); }
.pd4-figs .fig-note { font-size: var(--text-label); }
.pd4-fig[role="button"] { cursor: pointer; }
.pd4-fig[role="button"]:hover .fig-value { color: var(--link); }
.pd4-figs .secret-dots { letter-spacing: 0.1em; color: var(--ink-3); }

.pd4-alert { margin-top: 18px; align-items: center; }
.pd4-alert .alert-text { min-width: 0; }
.pd4-alert::before { margin-top: 0; align-self: flex-start; margin-top: 7px; }
.pd4-alert-acts { display: flex; gap: 8px; flex: none; }

.pd4-tabs { margin-top: 26px; }
.pd4-tabs .pd-tab .n { margin-left: 4px; color: var(--ink-3); font-weight: var(--weight-regular); }

/* Overview: two columns (~64/36). */
.pd4-ov { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr); gap: 36px; align-items: start; padding-top: 24px; }
.pd4-ov[hidden] { display: none; }
.pd4-ov-l, .pd4-ov-r { display: flex; flex-direction: column; gap: 30px; min-width: 0; }
.pd4-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.pd4-sec-h h2, .pd4-sec-h h3 { margin: 0; font-size: var(--text-row); font-weight: var(--weight-medium); color: var(--ink); letter-spacing: -0.005em; }
.pd4-sec-h .pd4-link { font-size: var(--text-meta-r); }
.pd4-sec-meta { margin-left: 8px; font-size: var(--text-meta-r); font-weight: var(--weight-regular); color: var(--ink-3); }
.pd4-none { margin: 10px 0 0; font-size: var(--text-meta-r); color: var(--ink-3); }
.pd4-note-line { margin: 0; font-size: var(--text-meta-r); color: var(--ink-2); }
.pd4-note-line b { font-weight: var(--weight-medium); color: var(--ink); }

/* Instructions table (v4.20.6). The table sits in the Overview's left column,
   558–700px wide on a 1100–1440 screen — too narrow for seven fixed columns
   (scope was squeezed to 20px and the headers ran into each other). The table
   now sizes to ITS OWN width (a container): wide enough, one line per
   instruction; narrower, scope gets the whole first line and status, fee,
   hours and invoiced share the second. Every cell has a named area, so the
   money and ⋯ columns never shift the others. */
#instr-list { container: instr / inline-size; }
.pd4-it { display: grid; column-gap: 12px; row-gap: 6px; align-items: center;
  grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "n scope scope" "n st hrs"; }
.pd4-it.money { grid-template-columns: 40px minmax(120px, 1.2fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas: "n scope scope scope scope" "n st fee hrs inv"; }
.pd4-it.has-more { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 32px;
  grid-template-areas: "n scope scope more" "n st hrs more"; }
.pd4-it.money.has-more { grid-template-columns: 40px minmax(120px, 1.2fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr) 32px;
  grid-template-areas: "n scope scope scope scope more" "n st fee hrs inv more"; }
.pd4-c-n { grid-area: n; align-self: start; }
.pd4-it-row .pd4-c-n { padding-top: 1px; }
.pd4-c-scope { grid-area: scope; min-width: 0; }
.pd4-c-st { grid-area: st; min-width: 0; }
.pd4-c-fee { grid-area: fee; min-width: 0; }
.pd4-c-hrs { grid-area: hrs; min-width: 0; }
.pd4-c-inv { grid-area: inv; min-width: 0; }
.pd4-c-more { grid-area: more; }
.pd4-c-st .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd4-it-h > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Room for one line: scope takes what the fixed columns leave (never under 220px). */
@container instr (min-width: 600px) {
  .pd4-it { row-gap: 0; grid-template-columns: 40px minmax(220px, 1fr) 136px 112px; grid-template-areas: "n scope st hrs"; }
  .pd4-it.has-more { grid-template-columns: 40px minmax(220px, 1fr) 136px 112px 32px; grid-template-areas: "n scope st hrs more"; }
  .pd4-c-n, .pd4-it-row .pd4-c-n { align-self: center; padding-top: 0; }
}
@container instr (min-width: 820px) {
  .pd4-it.money { row-gap: 0; grid-template-columns: 40px minmax(220px, 1fr) 136px 96px 112px 96px; grid-template-areas: "n scope st fee hrs inv"; }
  .pd4-it.money.has-more { grid-template-columns: 40px minmax(220px, 1fr) 136px 96px 112px 96px 32px; grid-template-areas: "n scope st fee hrs inv more"; }
}
.pd4-it .r { text-align: right; }
.pd4-it-h { padding-bottom: 8px; border-bottom: 1px solid var(--rule-head);
  font-size: var(--text-table-head); letter-spacing: var(--tracking-table); text-transform: uppercase; color: var(--ink-3); }
.pd4-it-row { min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: var(--text-body); color: var(--ink); }
.pd4-it-row.is-edit { cursor: pointer; }
.pd4-it-row.is-edit:hover { background: var(--row-hover); }
.pd4-it-n { font-weight: var(--weight-medium); color: var(--anchor); font-variant-numeric: tabular-nums; }
.pd4-it-scope { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd4-it-scope > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd4-it-sub { font-size: var(--text-label); color: var(--ink-3); }
.pd4-it-of { color: var(--ink-3); }
.pd4-it-row .r { font-variant-numeric: tabular-nums; }
.pd4-it-empty { padding: 14px 0 16px; border-bottom: 1px solid var(--hair); }
.pd4-it-empty-t { font-size: var(--text-body); font-weight: var(--weight-medium); color: var(--ink); }
.pd4-it-empty-s { margin-top: 3px; font-size: var(--text-meta-r); color: var(--ink-3); }
/* v4.20.0: the row menu (⋯) — Edit instruction, Set / Revise the fee, Fee history. */
.pd4-it-more { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); cursor: pointer;
  font: inherit; font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.pd4-it-more:hover, .pd4-it-more:focus-visible { background: var(--nav-hover); color: var(--ink); }
.pd4-it-rev { display: block; font-size: var(--text-label); color: var(--ink-3); }
/* Fee history (a view panel). */
.ifee-log { list-style: none; margin: 0; padding: 0; }
.ifee-log-row { padding: 12px 0; border-bottom: 1px solid var(--hair); display: flex; flex-direction: column; gap: 3px; }
.ifee-log-top { display: flex; justify-content: space-between; gap: 12px; font-size: var(--text-body); color: var(--ink); }
.ifee-log-top b { font-weight: var(--weight-medium); }
.ifee-log-chg { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ifee-log-meta { font-size: var(--text-label); color: var(--ink-3); }
.ifee-log-why { font-size: var(--text-meta-r); color: var(--ink-2); }
.ifee-log-doc { font-size: var(--text-meta-r); color: var(--link); }
.ifee-log-none { margin: 0; font-size: var(--text-meta-r); color: var(--ink-3); }

/* Golden thread: seven links, a 3px bar over each. */
.pd4-gt { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.pd4-gt-seg { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 0 0 4px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; }
.pd4-gt-bar { display: block; height: 3px; border-radius: 2px; margin-bottom: 6px; background: var(--hair); }
.pd4-gt-bar.on { background: var(--brand-blue); }
.pd4-gt-bar.brk { background: var(--brand-orange); }
.pd4-gt-seg:nth-child(2) .pd4-gt-bar { animation-delay: 60ms; }
.pd4-gt-seg:nth-child(3) .pd4-gt-bar { animation-delay: 120ms; }
.pd4-gt-seg:nth-child(4) .pd4-gt-bar { animation-delay: 180ms; }
.pd4-gt-seg:nth-child(5) .pd4-gt-bar { animation-delay: 240ms; }
.pd4-gt-seg:nth-child(6) .pd4-gt-bar { animation-delay: 300ms; }
.pd4-gt-seg:nth-child(7) .pd4-gt-bar { animation-delay: 360ms; }
.pd4-gt-l { font-size: var(--text-meta-r); font-weight: var(--weight-medium); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd4-gt-v { font-size: var(--text-meta-r); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd4-gt-v.off { color: var(--ink-3); }
.pd4-gt-v.brk { color: var(--late); }
.pd4-gt-seg:hover .pd4-gt-l { color: var(--link); }

/* Activity. */
.pd4-acts-list { border-top: 1px solid var(--hair); }
.pd4-act { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 6px; align-items: center; min-height: 42px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.pd4-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hair-strong); }
.pd4-dot.ok { background: var(--status-ok-ui); }
.pd4-dot.attn { background: var(--brand-orange); }
.pd4-act-t { font-size: var(--text-body); color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.pd4-act-d { font-size: var(--text-meta-r); color: var(--ink-3); white-space: nowrap; }
.pd4-note-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pd4-note-form[hidden] { display: none; }
.pd4-note-form textarea { width: 100%; resize: vertical; font-family: var(--font-sans); }
.pd4-note-acts { display: flex; gap: 8px; }

/* Site visits. */
.pd4-visit { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; min-height: 42px;
  padding: 8px 0; border: 0; border-bottom: 1px solid var(--hair); background: none; text-align: left; cursor: pointer; font: inherit; }
.pd4-visit:hover { background: var(--row-hover); }
.pd4-visit-d { font-size: var(--text-meta-r); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pd4-visit-t { font-size: var(--text-body); color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd4-visit-s { font-size: var(--text-label); color: var(--ink-3); }
.pd4-blue { color: var(--link); }

/* Next up. */
#pd-next { border-top: 1px solid var(--hair); }
.pd4-next { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.pd4-next-t { min-width: 0; }
.pd4-next-title { font-size: var(--text-body); font-weight: var(--weight-medium); color: var(--ink); }
.pd4-next-sub { margin-top: 2px; font-size: var(--text-meta-r); color: var(--ink-2); }
.pd4-next-btn { flex: none; min-height: 32px; }

/* Details. */
.pd4-kv { margin: 0; border-top: 1px solid var(--hair); }
.pd4-kv > div { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.pd4-kv dt { font-size: var(--text-meta-r); color: var(--ink-3); padding-top: 1px; }
.pd4-kv dd { margin: 0; font-size: var(--text-body); color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.pd4-dd-sub { margin-top: 2px; font-size: var(--text-label); color: var(--ink-3); }
.pd4-dd-links { display: flex; gap: 14px; margin-top: 6px; font-size: var(--text-meta-r); }

/* Documents tab. */
.pd4-docs { display: flex; flex-direction: column; gap: 24px; padding-top: 24px; }
.pd4-docs[hidden] { display: none; }
.pd4-instr-filter { align-self: flex-start; }
.pd4-instr-filter .instr-chip.active { background: var(--surface); color: var(--ink); font-weight: var(--weight-medium); box-shadow: 0 1px 2px rgba(12, 17, 57, 0.10); }
.pd4-regs { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 36px; }
.pd4-reg-h { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid var(--rule-head); }
.pd4-reg-h h3 { margin: 0; font-size: var(--text-body); font-weight: var(--weight-medium); color: var(--ink); }
.pd4-changes { margin-top: 30px; }

@media (max-width: 1100px) {
  .pd4-ov { grid-template-columns: minmax(0, 1fr); }
  .pd4-ov-r { order: -1; }
}
@media (max-width: 760px) {
  .pd4-title { font-size: var(--text-page); }
  .pd4-acts { width: 100%; }
  .pd4-acts .btn { min-height: 44px; }
  .pd4-acts #act-time { flex: 1; }
  .pd4-alert { flex-wrap: wrap; }
  .pd4-gt { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
  /* One column: scope, then status under it; fee, hours and invoiced stay on the project's Finance tab. */
  .pd4-it, .pd4-it.money { row-gap: 4px; grid-template-columns: 34px minmax(0, 1fr); grid-template-areas: "n scope" "n st"; }
  .pd4-it.has-more, .pd4-it.money.has-more { grid-template-columns: 34px minmax(0, 1fr) 44px; grid-template-areas: "n scope more" "n st more"; }
  .pd4-c-fee, .pd4-c-hrs, .pd4-c-inv { display: none; }
  .pd4-it-h .pd4-c-st { display: none; }
  .pd4-it.pd4-it-h { grid-template-areas: "n scope more"; }
  .pd4-it.pd4-it-h:not(.has-more) { grid-template-areas: "n scope"; }
  .pd4-c-n, .pd4-it-row .pd4-c-n { align-self: start; padding-top: 1px; }
  .pd4-it-more { width: 44px; height: 44px; }
  .pd4-regs { grid-template-columns: minmax(0, 1fr); }
  .pd4-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Add instruction — redesign (Karan 26/10/2026) ─────────────────────────────
   The draft opens full width inside the Instructions table (page 3): while it is
   open the overview is one column, so the draft has the page's width (W2). */
.pd4-ov.is-drafting { grid-template-columns: minmax(0, 1fr); }
.pd4-ov.is-drafting .pd4-ov-r { order: 1; }
.icd { margin: 12px 0 18px; border: 1px solid var(--ink); border-radius: var(--radius-12); background: var(--surface); overflow: hidden; }
.icd-enter { animation: icd-open var(--dur-slow) var(--ease-out); transform-origin: top; }
.icd-leave { animation: icd-close var(--dur-collapse) var(--ease-out) forwards; }
@keyframes icd-open { from { opacity: 0; clip-path: inset(0 0 100% 0 round 12px); } to { opacity: 1; clip-path: inset(0 0 0 0 round 12px); } }
@keyframes icd-close { from { opacity: 1; } to { opacity: 0; clip-path: inset(0 0 100% 0 round 12px); } }
@media (prefers-reduced-motion: reduce) { .icd-enter, .icd-leave { animation: none; } }
.icd-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--hair); }
.icd-n { font-weight: var(--weight-medium); color: var(--anchor); font-variant-numeric: tabular-nums; }
.icd-desc { min-width: 0; width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--hair-strong); border-radius: var(--radius-6);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--text-body); }
.icd-desc:focus { border-color: var(--link); box-shadow: 0 0 0 3px var(--halo); outline: none; }
.icd-pill { padding: 1px 9px; border: 1px solid var(--ink-3); border-radius: 999px; font-size: var(--text-label); color: var(--ink-2); }
.icd-saved { font-size: var(--text-label); color: var(--ink-3); white-space: nowrap; min-width: 84px; }
.icd-body { display: grid; grid-template-columns: minmax(262px, 300px) minmax(0, 1fr); }
.icd-left { display: flex; flex-direction: column; gap: 16px; padding: 16px 14px; border-right: 1px solid var(--hair); min-width: 0; }
.icd-right { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--ground); min-width: 0; }
.icd-card { border: 1px solid var(--hair); border-radius: var(--radius-10); background: var(--surface); min-width: 0; }
.icd-fee { padding: 12px 12px 6px; }
.icd-fee.is-later .fcx { opacity: 0.55; }
.icd-later { margin: 0 0 10px; padding: 9px 11px; border-radius: var(--radius-6); background: var(--status-hold-bg); font-size: var(--text-meta-r); color: var(--ink-2); }
.icd-below { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(220px, 1fr); }
.icd-past { padding: 12px; border-right: 1px solid var(--hair); min-width: 0; }
.icd-ftc { padding: 12px; min-width: 0; }
.icd-f { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.icd-l { font-size: var(--text-meta-r); font-weight: var(--weight-medium); color: var(--ink); }
.icd-lh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.icd-opt { font-size: var(--text-label); color: var(--ink-3); }
.icd-src legend { margin-bottom: 4px; }
.icd-radio { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; padding: 3px 0; }
.icd-radio input { margin: 2px 0 0; accent-color: var(--ink); }
.icd-radio.is-off { cursor: default; opacity: 0.6; }
.icd-rt { display: block; font-size: var(--text-meta-r); color: var(--ink); }
.icd-rs { display: block; font-size: var(--text-label); color: var(--ink-3); }
.icd-enq { font-size: var(--text-label); margin: 0 0 4px 22px; width: calc(100% - 22px); }
.icd-src-ro { font-size: var(--text-meta-r); color: var(--ink-2); }
.icd-link { padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-label); color: var(--link); cursor: pointer; text-align: left; }
.icd-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.icd-by { padding: 11px 12px; border: 1px solid var(--hair); border-radius: var(--radius-10); font-size: var(--text-meta-r); color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.icd-by-none { color: var(--ink-3); display: block; }
.icd-by-h { display: flex; justify-content: space-between; gap: 8px; }
.icd-by-h span { font-size: var(--text-label); color: var(--ink-3); white-space: nowrap; }
.icd-by-h b, .icd-pick-a b { font-weight: var(--weight-medium); }
.icd-by-s { font-size: var(--text-label); color: var(--ink-2); }
.icd-by-b { line-height: 1.55; overflow-wrap: anywhere; }
.icd-ask { background: var(--status-hold-bg); color: inherit; padding: 0 1px; }
.icd-pick { display: flex; flex-direction: column; border: 1px solid var(--hair); border-radius: var(--radius-10); max-height: 260px; overflow: auto; }
.icd-pick-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--hair); background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.icd-pick-row:hover, .icd-pick-row:focus-visible { background: var(--row-hover); }
.icd-pick-a { display: flex; justify-content: space-between; gap: 8px; font-size: var(--text-meta-r); }
.icd-pick-a span, .icd-pick-s { font-size: var(--text-label); color: var(--ink-3); }
.icd-pick-none { color: var(--ink-3); font-size: var(--text-label); border-bottom: 0; }
.icd-none { margin: 0; padding: 10px; font-size: var(--text-label); color: var(--ink-3); }
.icd-ld { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.icd-ld .f-select, .icd-ld .f-input { padding-left: 10px; padding-right: 8px; font-size: var(--text-meta-r); }
.icd-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--hair); }
.icd-sum { font-size: var(--text-meta-r); color: var(--ink-2); }
.icd-sum b { font-size: var(--text-row); font-weight: var(--weight-medium); color: var(--ink); }
.icd-foot-r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.icd-discard { padding: 0 4px; border: 0; background: none; font: inherit; font-size: var(--text-meta-r); color: var(--ink-2); cursor: pointer; min-height: 36px; }
.icd-discard:hover { color: var(--ink); }
.icd-confirm:disabled, .icd-letter:disabled { opacity: 0.5; cursor: not-allowed; }
.icd-err { margin: 0; padding: 0 14px 12px; font-size: var(--text-meta-r); color: var(--status-error); }

/* Past projects like this + fee to the client (page 3). */
.icd-past-h { font-size: var(--text-meta-r); color: var(--ink); margin-bottom: 10px; }
.icd-past-h b, .icd-ftc-h b { font-weight: var(--weight-medium); }
.icd-past-h span { color: var(--ink-3); }
.icd-past-msg { margin: 0; font-size: var(--text-label); color: var(--ink-3); }
.icd-range { position: relative; height: 14px; margin: 4px 0 8px; }
.icd-range::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--hair); }
.icd-range-band { position: absolute; top: 5px; height: 4px; border-radius: 2px; background: var(--tint-blue-2); }
.icd-range-med { position: absolute; top: 0; width: 2px; height: 14px; margin-left: -1px; background: var(--anchor); }
.icd-range-dot { position: absolute; top: 0; width: 14px; height: 14px; margin-left: -7px; box-sizing: border-box; border: 2px solid var(--link); border-radius: 50%; background: var(--surface); }
.icd-range-dot::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--link); }
.icd-past-s { margin: 0 0 10px; font-size: var(--text-label); line-height: 1.5; color: var(--ink-2); }
.icd-past-s b { font-weight: var(--weight-medium); color: var(--ink); }
.icd-under, .icd-under b { color: var(--status-overdue-ink); }
.icd-past-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 48px 48px 44px; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--hair); font-size: var(--text-label); color: var(--ink); font-variant-numeric: tabular-nums; }
.icd-past-row:last-child { border-bottom: 0; }
.icd-past-row .r { text-align: right; }
.icd-past-row b { font-weight: var(--weight-medium); }
.icd-past-var { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icd-past-th { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.icd-over { color: var(--status-overdue-ink); }
.icd-ok { color: var(--status-ok-ui); }
.icd-ftc-h { display: flex; justify-content: space-between; gap: 8px; font-size: var(--text-meta-r); color: var(--ink); margin-bottom: 10px; }
.icd-ftc-h span { font-size: var(--text-label); color: var(--ink-3); }
.icd-ftc-in { display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--hair-strong); border-radius: var(--radius-6); }
.icd-ftc-in:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px var(--halo); }
.icd-ftc-in span { color: var(--ink-3); font-size: var(--text-meta-r); }
.icd-ftc-in input { flex: 1; min-width: 0; border: 0; padding: 9px 0; background: transparent; color: var(--link); font: inherit; font-size: var(--text-row); font-variant-numeric: tabular-nums; outline: none; }
.icd-ftc-note, .icd-ftc-gap { margin: 8px 0 0; font-size: var(--text-label); line-height: 1.5; color: var(--ink-3); }
.icd-ftc-gap { color: var(--ink-2); }
.icd-ftc-gap.is-below { color: var(--status-overdue-ink); }
.icd-ftc-r { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.icd-ftc-reset { margin-top: 8px; }

/* The fee calculator component (views/fee-calculator.js). */
.fcx { min-width: 0; }
.fcx-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; }
.fcx-title { font-size: var(--text-meta-r); font-weight: var(--weight-medium); color: var(--ink); }
.fcx-rate { font-size: var(--text-label); color: var(--ink-3); }
.fcx-search { position: relative; flex: 1 1 220px; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--hair-strong); border-radius: var(--radius-6); background: var(--surface); }
.fcx-search:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px var(--halo); }
.fcx-search-ic { color: var(--ink-3); display: inline-flex; flex: none; }
.fcx-q { flex: 1; min-width: 0; border: 0; padding: 8px 0; background: transparent; color: var(--ink); font: inherit; font-size: var(--text-meta-r); outline: none; }
/* The box carries the focus ring (:focus-within), so the bare input inside it does not draw a second. */
.fcx-search .fcx-q:focus-visible, .icd-ftc-in input:focus-visible { outline: none; }
.fcx-ai { white-space: nowrap; }
.fcx-ainote { margin: 0 0 8px; font-size: var(--text-label); color: var(--ink-2); }
.fcx-drop { position: absolute; z-index: 40; top: calc(100% + 4px); left: -1px; width: 440px; max-width: calc(100vw - 32px); border: 1px solid var(--hair); border-radius: var(--radius-10);
  background: var(--surface); box-shadow: 0 10px 30px rgba(12, 17, 57, 0.14); overflow: hidden; }
.fcx-d-h { padding: 9px 12px 5px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.fcx-d-h2 { border-top: 1px solid var(--hair); margin-top: 4px; }
.fcx-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; cursor: pointer; }
.fcx-opt.on, .fcx-opt:hover { background: var(--tint-blue); }
.fcx-o-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fcx-o-name { font-size: var(--text-meta-r); color: var(--ink); }
.fcx-o-name b { font-weight: var(--weight-medium); color: var(--link); }
.fcx-o-meta { font-size: var(--text-label); color: var(--ink-3); }
.fcx-o-right { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: var(--text-label); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fcx-o-fee { color: var(--ink); }
.fcx-subpill, .fcx-tag, .fcx-oneoff { padding: 1px 6px; border-radius: 4px; background: var(--tint-blue-2); font-size: 10.5px; color: var(--link); }
.fcx-oneoff { background: var(--status-hold-bg); color: var(--ink-2); }
.fcx-d-foot { padding: 9px 12px; border-top: 1px solid var(--hair); font-size: var(--text-label); color: var(--ink-2); }
.fcx-d-link { padding: 0; border: 0; background: none; font: inherit; font-weight: var(--weight-medium); color: var(--link); cursor: pointer; }
.fcx-d-link.on { text-decoration: underline; text-underline-offset: 3px; }
.fcx-d-keys { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px 12px; border-top: 1px solid var(--hair); font-size: 10.5px; color: var(--ink-3); background: var(--surface-sunk-soft, var(--surface)); }
.fcx-d-keys kbd { padding: 0 5px; border: 1px solid var(--hair-strong); border-radius: 4px; font: inherit; color: var(--ink-2); background: var(--surface); }
.fcx-addf { padding: 4px 12px 12px; }
.fcx-addf-lead { margin: 0 0 8px; font-size: var(--text-label); color: var(--ink-2); }
.fcx-addf-lead b { font-weight: var(--weight-medium); color: var(--ink); }
.fcx-addf-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 72px minmax(0, 0.9fr); gap: 8px; }
.fcx-addf-grid label { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-label); color: var(--ink-2); min-width: 0; }
.fcx-addf-grid .f-input, .fcx-addf-grid .f-select { padding: 7px 8px; font-size: var(--text-meta-r); }
.fcx-af-std { color: var(--link); }
.fcx-addf-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fcx-addf-foot .btn { flex: none; white-space: nowrap; padding: 6px 12px; min-height: 0; font-size: var(--text-meta-r); }
.fcx-addf-note { flex: 1 1 0; min-width: 150px; font-size: var(--text-label); line-height: 1.45; color: var(--ink-3); }
.fcx-err { color: var(--status-error); }
.fcx-grid { display: grid; grid-template-columns: minmax(0, 1fr) 52px 56px 56px 64px 18px; gap: 8px; align-items: center; }
.fcx-th { padding: 6px 0; border-bottom: 1px solid var(--hair); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.fcx-th .r { text-align: right; }
.fcx-row { padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: var(--text-meta-r); color: var(--ink); }
.fcx-row.is-drag { opacity: 0.5; }
.fcx-item { display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 4px; min-width: 0; }
.fcx-rev .fcx-item, .fcx-item:not(:has(.fcx-handle)) { grid-template-columns: minmax(0, 1fr); }
.fcx-handle { grid-row: span 2; color: var(--ink-3); cursor: grab; font-size: 11px; line-height: 1.6; }
.fcx-iname { overflow-wrap: anywhere; }
.fcx-isub { font-size: var(--text-label); color: var(--ink-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fcx-std { width: 52px; padding: 1px 4px; border: 1px solid var(--hair-strong); border-radius: 4px; background: var(--surface); color: var(--link); font: inherit; font-size: var(--text-label); }
.fcx-c { display: block; text-align: right; }
.fcx-in { width: 100%; box-sizing: border-box; height: 30px; padding: 0 6px; text-align: right; border: 1px solid var(--hair-strong); border-radius: var(--radius-6);
  background: var(--surface); color: var(--link); font: inherit; font-size: var(--text-meta-r); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.fcx-in::-webkit-outer-spin-button, .fcx-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fcx-in:focus { border-color: var(--link); box-shadow: 0 0 0 3px var(--halo); outline: none; }
.fcx-in:disabled { color: var(--ink-3); background: var(--surface); }
.fcx-pct { position: relative; }
.fcx-pct .fcx-in { padding-right: 16px; }
.fcx-pct span { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: var(--text-label); color: var(--link); pointer-events: none; }
.fcx-dash { color: var(--ink-3); }
.fcx-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fcx-fee { font-weight: var(--weight-medium); }
.fcx-muted { color: var(--ink-3); font-weight: var(--weight-regular); }
.fcx-x-c { text-align: right; }
.fcx-x { padding: 0; border: 0; background: none; font: inherit; font-size: 15px; line-height: 1; color: var(--ink-3); cursor: pointer; }
.fcx-x:hover { color: var(--ink); }
.fcx-empty { padding: 18px 0; border-bottom: 1px solid var(--hair); font-size: var(--text-label); color: var(--ink-3); }
.fcx-seg { display: inline-flex; padding: 2px; border-radius: var(--radius-6); background: var(--surface-sunk); }
.fcx-seg button { padding: 2px 8px; border: 0; border-radius: 4px; background: transparent; font: inherit; font-size: 11px; color: var(--ink-3); cursor: pointer; }
.fcx-seg button.on { background: var(--surface); color: var(--ink); font-weight: var(--weight-medium); box-shadow: 0 1px 2px rgba(12, 17, 57, 0.10); }
.fcx-suggest { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 0 9px 10px; border-bottom: 1px solid var(--hair); background: var(--tint-blue); font-size: var(--text-label); color: var(--ink-2); }
.fcx-suggest-l b { font-weight: var(--weight-medium); color: var(--ink); }
.fcx-chip { display: inline-flex; gap: 4px; align-items: baseline; padding: 4px 10px; border: 1px dashed var(--link); border-radius: 999px; background: var(--surface); font: inherit; font-size: var(--text-label); color: var(--link); cursor: pointer; }
.fcx-chip b { font-weight: var(--weight-medium); }
.fcx-chip span { color: var(--ink-3); }
.fcx-chip:hover { background: var(--tint-blue-2); }
.fcx-total { padding: 12px 0 8px; }
.fcx-total-l { display: flex; align-items: baseline; gap: 12px; }
.fcx-caps { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.fcx-how { padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-label); color: var(--link); cursor: pointer; }
.fcx-total-n { font-size: var(--text-row); font-weight: var(--weight-medium); color: var(--ink); }
.fcx-total .fcx-total-n:nth-of-type(2) { font-size: 17px; }
.fcx-howtxt { margin: 0 0 8px; font-size: var(--text-label); line-height: 1.55; color: var(--ink-2); max-width: 90ch; }

/* The quick modal (page 4). */
.icq { display: flex; flex-direction: column; gap: 14px; }
.icq-l { font-size: var(--text-meta-r); font-weight: var(--weight-medium); color: var(--ink); }
.icq-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 3px; border-radius: var(--radius-10); background: var(--surface-sunk); }
.icq-seg button { min-height: 36px; border: 0; border-radius: var(--radius-6); background: transparent; font: inherit; font-size: var(--text-meta-r); color: var(--ink-2); cursor: pointer; }
.icq-seg button.on { background: var(--surface); color: var(--ink); font-weight: var(--weight-medium); box-shadow: 0 1px 2px rgba(12, 17, 57, 0.10); }
.icq-seg button:disabled { opacity: 0.5; cursor: not-allowed; }
.icq-card { border: 1px solid var(--hair); border-radius: var(--radius-10); overflow: hidden; }
.icq-card-h { display: flex; align-items: baseline; gap: 10px; padding: 11px 13px; background: var(--ground); border-bottom: 1px solid var(--hair); font-size: var(--text-label); color: var(--ink-3); }
.icq-card-h b { font-size: var(--text-row); font-weight: var(--weight-medium); color: var(--ink); }
.icq-card-h span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icq-tag { padding: 2px 7px; border-radius: 4px; background: var(--tint-blue-2); color: var(--link); white-space: nowrap; }
.icq-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px 64px; gap: 10px; padding: 9px 13px; border-bottom: 1px solid var(--hair); font-size: var(--text-meta-r); color: var(--ink); font-variant-numeric: tabular-nums; }
.icq-row span:nth-child(n+2) { text-align: right; }
.icq-row:last-child { border-bottom: 0; }
.icq-tot { font-weight: var(--weight-medium); font-size: var(--text-body); }
.icq-int { font-size: 10.5px; color: var(--ink-3); }
.icq-none, .icq-later { margin: 0; font-size: var(--text-meta-r); color: var(--ink-3); }
.icq-f { display: flex; flex-direction: column; gap: 6px; }
.icq-lh { display: flex; justify-content: space-between; }
.icq-opt { font-size: var(--text-label); color: var(--ink-3); }
.icq-ld { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.icq-open { padding: 0; border: 0; background: none; font: inherit; color: var(--link); cursor: pointer; }

/* Finance tab: fees by instruction (decision 3). */
.pd-ifees { margin-top: 24px; }
.pd-ifee { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--hair); font-size: var(--text-body); color: var(--ink); }
.pd-ifee-d { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-ifee-s { font-size: var(--text-label); color: var(--ink-3); }
.pd-ifee-s.is-below { color: var(--status-overdue-ink); }
.pd-ifee-f { font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .icd-below { grid-template-columns: minmax(0, 1fr); }
  .icd-past { border-right: 0; border-bottom: 1px solid var(--hair); }
}
@media (max-width: 760px) {
  .icd-head { grid-template-columns: 30px minmax(0, 1fr) auto; row-gap: 6px; }
  .icd-desc { grid-column: 2 / -1; }
  .icd-pill { grid-column: 2; justify-self: start; }
  .icd-saved { grid-column: 3; min-width: 0; }
  .icd-body { grid-template-columns: minmax(0, 1fr); }
  .icd-left { border-right: 0; border-bottom: 1px solid var(--hair); }
  .icd-right { padding: 10px; }
  .icd-foot { flex-direction: column; align-items: stretch; }
  .icd-foot-r { justify-content: flex-end; }
  .icd-foot-r .btn { min-height: 44px; }
  .fcx-grid { grid-template-columns: minmax(0, 1fr) 44px 46px 58px 18px; gap: 6px; }
  .fcx-grid > :nth-child(4) { display: none; }
  .fcx-drop { left: -1px; right: -1px; width: auto; max-width: none; }
  .fcx-addf-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .icd-past-row { grid-template-columns: 50px minmax(0, 1fr) 42px 42px 38px; gap: 6px; }
  .icq-seg button { font-size: var(--text-label); }
  .icq-ld { grid-template-columns: minmax(0, 1fr); }
  .icq-dialog .tf-foot { flex-wrap: wrap; }
  .icq-dialog .tf-note { flex: 1 0 100%; }
}
