/*
 * planning.css -- the Project split view.
 *
 * Ported from ProjectSplitView.dc.html, the design's own final assembly, not
 * from a description of it. Sizes, weights and structure follow that file.
 *
 * The frame is a fixed two-pane box: the left third is the project form AND
 * the money column -- global budget 1, labour split 4, unallocated 5, Create
 * project pinned to the bottom -- and it does not scroll. The right two thirds
 * scrolls on its own. Below 1000px they stack and the page scrolls, because a
 * one-third column at 375px is a gutter, not a panel.
 *
 * Colours come from app.css tokens, which hold the same artboard values. The
 * one deviation is --muted, darkened from #7A7970 for contrast at 9-10px.
 */

.split-head { display: flex; align-items: baseline; gap: 12px; flex: 0 0 auto; padding: 8px var(--gutter) 7px; border-bottom: 1px solid var(--hairline); }
.split-head .name { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.split-head .what { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.split { display: flex; flex-direction: column; background: var(--card); min-width: 0; }

.split-left {
  box-sizing: border-box;
  min-width: 0;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}
.split-right {
  box-sizing: border-box;
  background: var(--card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

@media (min-width: 1000px) {
  /* No height calc. The parent chain is already locked to the viewport by
     html.is-full, so this just has to fill what it is given and let the two
     panes scroll inside it. A calc() here would be a second, competing answer
     to the same question, and it would drift the moment the chrome changed. */
  .split { flex-direction: row; flex: 1 1 auto; min-height: 0; min-width: 0; }
  .split-left { flex: 0 0 33.333%; max-width: 33.333%; border-bottom: none; border-right: 1px solid var(--hairline); overflow-y: auto; }
  .split-right {
  flex: 1 1 auto; min-width: 0; padding: 14px 16px;
  /* Always-visible scrollbar. `scroll` not `auto` so the gutter is there even
     when the content happens to fit -- the column must not change width the
     moment a month is opened. */
  overflow-y: scroll;
  scrollbar-width: auto;
  scrollbar-color: var(--muted-2) var(--surface-2);
}
.split-right::-webkit-scrollbar { width: 12px; }
.split-right::-webkit-scrollbar-track { background: var(--surface-2); border-left: 1px solid var(--rule); }
.split-right::-webkit-scrollbar-thumb { background: var(--muted-2); border: 3px solid var(--surface-2); }
.split-right::-webkit-scrollbar-thumb:hover { background: var(--ink); }
}

/* Below the breakpoint the two stack and the page scrolls normally, which is
   the right behaviour on a phone -- a one-third column at 375px is a gutter. */
@media (max-width: 999px) {
  html.is-full, html.is-full body { height: auto; overflow: visible; }
  html.is-full main { overflow: visible; }
}

/* --- form fields, per the artboard's .row-label / .ix-field ---------------- */

.row-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 1px; }
.ix-field { border: none; border-bottom: 1px solid var(--rule); background: transparent; width: 100%; box-sizing: border-box; padding: 3px 0; margin: 0; color: var(--ink); font-family: var(--sans); font-size: 14px; min-height: 28px; }
.ix-field:focus { outline: none; border-bottom-color: var(--ink); }
.ix-field.mono { font-family: var(--mono); }
.ix-field.big { font-size: 19px; font-weight: 700; font-family: var(--serif); }
.ix-hint { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.ix-count { font-family: var(--mono); font-size: 9px; color: var(--faint); display: block; text-align: right; margin-top: 0; }
.f-two { display: flex; gap: 14px; }
.f-two > * { flex: 1 1 0; min-width: 0; }
.f-inline { display: flex; align-items: baseline; gap: 5px; }
.f-inline .ix-field { max-width: 60px; }
.f-unit { display: flex; align-items: center; gap: 6px; }
.f-unit .ix-field { flex: 1 1 auto; }
.f-unit span { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.chk { display: flex; align-items: center; gap: 7px; background: none; border: none; padding: 0; cursor: pointer; font: inherit; text-align: left; align-self: flex-start; min-height: 24px; }
.chk-box { width: 14px; height: 14px; border: 1px solid var(--ink); display: flex; align-items: center; justify-content: center; box-sizing: border-box; flex: 0 0 auto; background: var(--card); }
.chk-box.on::after { content: ""; width: 8px; height: 8px; background: var(--ink); }
.chk-label { font-size: 12px; font-weight: 600; }
.chk.sm .chk-box { width: 12px; height: 12px; }
.chk.sm .chk-box.on::after { width: 6px; height: 6px; }
.chk.sm .chk-label { font-size: 11px; }

.vat-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; gap: 10px; }
.vat-figure { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.vat-figure.off { color: var(--faint); }

/* --- 4 · labour split: bleeds past the panel padding, as drawn ------------ */

.ls-panel { background: var(--panel); padding: 11px 18px; display: flex; flex-direction: column; gap: 3px; margin: 4px -18px 0; }
.ls-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.ls-head .ls-cap { flex: 0 0 auto; }
.ls-head .ls-big { flex: 1 1 auto; margin-bottom: 0; }
.ls-head .ls-add { flex: 0 0 auto; margin-top: 0; }
.ls-cap { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--panel-label); }
.ls-big { font-family: var(--serif); font-size: 23px; color: var(--panel-figure); line-height: 1.1; margin-bottom: 0; }
.ls-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--panel-rule); }
.ls-select { background: transparent; border: none; color: var(--panel-figure); font-family: var(--mono); font-size: 13px; width: auto; flex: 0 0 auto; padding: 0; min-height: 26px; }
.ls-select option { color: var(--ink); }
.ls-pct { width: 46px; padding-right: 2px; background: transparent; border: none; color: var(--panel-dim); text-align: right; font-family: var(--mono); font-size: 13px; padding: 0; min-height: 26px; }
.ls-sign { font-family: var(--mono); font-size: 13px; color: var(--panel-dim); }
.ls-amt { flex: 1; text-align: right; font-family: var(--mono); font-size: 13px; color: var(--panel-figure); }
.ls-x { background: none; border: none; color: #6e6d93; font-size: 15px; cursor: pointer; padding: 0 3px; min-width: 28px; min-height: 28px; line-height: 1; }
.ls-warn {
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--mono); font-size: 11px; line-height: 1.35;
  color: #e8776b; border-top: 1px solid var(--panel-rule);
  margin-top: 4px; padding-top: 5px;
}
.ls-warn span:last-child { white-space: nowrap; font-weight: 700; }
.ls-big.bad { color: #e8776b; }
.ls-add { background: none; border: none; color: var(--panel-label); font-family: var(--mono); font-size: 11px; text-decoration: underline; cursor: pointer; text-align: left; margin-top: 0; padding: 2px 0; min-height: 24px; }

.unalloc { font-family: var(--mono); border-top: 1px solid var(--hairline); font-size: 11px; display: flex; justify-content: space-between; margin: 0 -18px; padding: 6px 18px; color: var(--muted-2); }
.unalloc.off { color: var(--alarm); }

.create { margin-top: auto; margin-bottom: 2px; background: var(--ink); color: var(--panel-figure); border: 1px solid var(--ink); padding: 8px; font-family: var(--sans); font-size: 13px; font-weight: 700; text-align: center; cursor: pointer; min-height: 36px; }

/* --- right column cards --------------------------------------------------- */

.card2 { background: var(--card); border: 1px solid var(--hairline); padding: 10px 13px; display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; min-width: 0; max-width: 100%; }
.card2-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card2-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.card2-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.card2-meta.warn { color: var(--alarm); }

.ec-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ec-table th, .ec-table td { border: 1px solid var(--hairline); padding: 0; }
.ec-table th { background: #f1f0ea; font-family: var(--mono); font-size: 9px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-2); text-align: left; padding: 6px 8px; font-weight: 700; }
.ec-table th .opt { text-transform: none; font-weight: 400; color: var(--faint); }
.ec-field { border: none; background: transparent; width: 100%; box-sizing: border-box; padding: 4px 8px; margin: 0; color: var(--ink); font-family: var(--sans); font-size: 12px; min-height: 26px; }
.ec-field.mono { font-family: var(--mono); }
.ec-field.right { text-align: right; }
.ec-field:focus { outline: none; background: var(--field-focus); }
.ec-unit { display: flex; align-items: center; }
.ec-unit > span { font-family: var(--mono); font-size: 11px; color: var(--muted); padding-right: 6px; }
.ec-calc { font-family: var(--mono); text-align: right; font-size: 12px; color: var(--muted-2); padding: 6px 8px; }
.ec-x { background: none; border: none; color: var(--faint); font-size: 14px; cursor: pointer; width: 100%; min-height: 30px; }
.ec-add {
  background: none; border: none; width: 100%; text-align: left;
  padding: 4px 8px; font-family: var(--mono); font-size: 11px;
  /* The labour panel's purple, darkened for white: --accent-purple, not the
     panel's own #8A8AC8, which is right on #14142B and far too thin on paper. */
  color: var(--accent-purple); cursor: pointer; min-height: 28px;
}
.ec-add:hover { color: var(--panel); }
.ec-total td { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 5px 8px; }
.ec-total td.lbl { font-family: var(--sans); }
.ec-total td.num { text-align: right; }
.ec-total td.dim { color: var(--muted-2); }

/* --- hours planning ------------------------------------------------------- */

.hp { background: var(--card); border: 1px solid var(--hairline); max-width: 100%; min-width: 0; flex-shrink: 0; }
.hp-trigger { padding: 11px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; cursor: pointer; }
.hp-trigger.open { border-bottom: 1px solid var(--hairline); }
.hp-trigger:hover { background: var(--field-focus); }
.hp-left { display: flex; align-items: flex-start; gap: 16px; min-width: 0; flex: 1 1 auto; }
.hp-idx { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 12px; flex: 0 0 12px; }

/* 12px for the step number + the 10px gap beside it: the controls hang off the
   word, not off the digit. One number, derived, so it cannot drift. */
.hp-ctrlwrap { margin-left: 22px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hp-ctrlstack { display: flex; align-items: center; gap: 6px; }
/* 32 + 6 + 32: exactly as wide as the two buttons above it. */
.hp-template {
  width: 70px; box-sizing: border-box;
  border: 1px solid var(--ink); background: var(--card); color: var(--ink);
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  padding: 7px 4px; cursor: pointer; text-align: center; min-height: 32px;
}
.hp-template:hover { background: var(--field-focus); }
.hp-name { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.hp-iconbtn { width: 32px; height: 32px; border: 1px solid var(--ink); background: var(--card); display: flex; align-items: center; justify-content: center; box-sizing: border-box; cursor: pointer; padding: 0; }

.hp-strip {
  display: flex; flex-direction: column; gap: 3px; padding: 2px;
  /* min-width: 0 or the 53-week strip refuses to shrink and pushes the whole
     right pane wider than the window. max-width alone does not do it: a flex
     item's floor is its content unless you say otherwise. */
  overflow-x: auto; min-width: 0; flex: 1 1 auto;
  scrollbar-width: thin;
}
.hp-weeks { display: flex; }
.hp-week { display: flex; flex-direction: column; gap: 1px; margin-right: 3px; }
.hp-bar { height: 3px; background: #ecece6; }
.hp-bar > div { height: 100%; }

.hp-totals { display: flex; align-items: center; gap: 14px; align-self: flex-end; flex: 0 0 auto; }
.hp-tstack { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.hp-person { font-family: var(--mono); font-size: 12px; font-weight: 700; white-space: nowrap; }
.hp-person.paul { color: var(--paul); }
.hp-person.juan { color: var(--juan); }
.hp-rule { width: 100%; height: 1px; background: var(--ink); margin: 3px 0 2px; }
.hp-grand { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.hp-grand .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hp-grand .val { font-family: var(--mono); font-size: 19px; font-weight: 700; }
.hp-caret { font-family: var(--mono); font-size: 14px; color: var(--muted-2); display: inline-block; }

.hp-kinds { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e4e3dc; flex-wrap: nowrap; }
.hp-kindrow {
  display: flex; align-items: center; gap: 10px;
  /* Never wrap: the chips scroll sideways and the button beside them stays
     put. A control that moves to a second line when the list grows is a
     control you have to go looking for. The arrows exist for exactly this. */
  flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; overflow-x: auto;
  scrollbar-width: none;
}
.hp-kindrow::-webkit-scrollbar { display: none; }
.hp-kindrow > * { flex: 0 0 auto; }
.hp-kindcap { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.rc-chip { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--ink); cursor: pointer; background: var(--card); }
.rc-chip.armed { box-shadow: inset 0 0 0 2px var(--ink); }
.rc-swatch { width: 14px; height: 14px; flex: 0 0 auto; border: 1px solid var(--ink); display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.rc-chip .lbl { font-size: 12px; font-weight: 600; }
.rc-chip .rate { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.hp-page { background: none; border: none; font-family: var(--mono); font-size: 14px; cursor: pointer; color: var(--ink); padding: 4px 6px; min-height: 32px; }
.hp-page[disabled] { color: var(--faint); cursor: default; }
.hp-addkind { border: 1px solid var(--ink); background: var(--card); padding: 8px 14px; font-family: var(--sans); font-size: 12px; font-weight: 600; cursor: pointer; min-height: 38px; flex: 0 0 auto; white-space: nowrap; }

.hp-body { padding: 14px; }
.hp-card { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid #e4e3dc; }
.hp-cardtrigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 4px 20px 4px 4px; cursor: pointer; }
.hp-cardtrigger:hover { background: var(--field-focus); }
.hp-cardleft { display: flex; align-items: flex-start; gap: 10px; }
.hp-month {
  display: flex; flex-direction: column; align-items: center;
  /* FIXED, not min-width: "September 2026" is wider than "May 2027", so a
     min-width let the longer labels shove the 2px rule rightwards and every
     month row drew its rule at a different x. A fixed box puts them all on one
     grid line. */
  width: 132px; flex: 0 0 132px;
}
.hp-monthlbl { font-family: var(--mono); font-size: 12px; color: var(--faint); white-space: nowrap; text-align: center; }
.hp-vrule { width: 2px; background: var(--ink); align-self: stretch; }
.hp-navbig { background: none; border: none; font-family: var(--mono); font-size: 30px; line-height: 1; cursor: pointer; color: var(--ink); padding: 0 4px; }
.hp-navbig[disabled] { color: var(--faint); cursor: default; }
.hp-mrow { display: flex; align-items: flex-start; gap: 6px; }
.hp-minit { font-family: var(--mono); font-size: 9px; font-weight: 700; width: 12px; padding-top: 2px; }
.hp-mcost { font-family: var(--mono); font-size: 9px; opacity: 0.55; padding-top: 2px; white-space: nowrap; }
.hp-mcubes { display: flex; gap: 1px; }

.rc-mini { width: 8px; height: 8px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; }
.rc-mini.empty { border: 1px solid #d8d7ce; background: var(--card); }
.rc-mini.filled { border: 1px solid transparent; }
.rc-mini.hol { background: #dad9d0; border: 1px solid #dad9d0; }

/* --- the detail grid ------------------------------------------------------ */

.hg-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hg { display: flex; flex-direction: column; gap: 2px; min-width: max-content; }
.hg-dates { display: flex; padding-left: 68px; }
.hg-div { width: 13px; flex: 0 0 13px; display: flex; justify-content: center; }
.hg-div > div { width: 2px; height: 100%; background: var(--ink); }
.hg-dates .hg-div { height: 24px; }
.hg-col { width: 26px; flex: 0 0 26px; text-align: center; }
.hg-dow { font-family: var(--mono); font-size: 8px; color: var(--faint); }
.hg-date { font-family: var(--mono); font-size: 9px; font-weight: 700; }
.hg-prow { display: flex; align-items: center; padding: 6px 0; }
.hg-plabel { width: 68px; flex: 0 0 68px; }
.hg-plabel span { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--ink); border-bottom: 2px solid currentColor; padding-bottom: 2px; }
.hg-plabel.paul span { border-bottom-color: var(--paul); }
.hg-plabel.juan span { border-bottom-color: var(--juan); }
.hg-prow .hg-div { height: 90px; }
.hg-cell { width: 26px; flex: 0 0 26px; display: flex; align-items: center; justify-content: center; height: 90px; }
.hg-cell.holiday { background: repeating-linear-gradient(45deg, #dad9d0, #dad9d0 3px, var(--paper) 3px, var(--paper) 6px); }
.hg-stack { display: flex; flex-direction: column-reverse; gap: 2px; }
.rc-sub { width: 18px; height: 18px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: 0; }
.rc-sub.empty { border: 1px solid #d8d7ce; background: var(--card); cursor: pointer; }
.rc-sub.empty:hover { border-color: var(--ink); }
.rc-sub.filled { border: 1px solid transparent; cursor: pointer; }
.rc-sub:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }

/* --- journal -------------------------------------------------------------- */

.jr-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.jr-btn { border: 1px solid var(--ink); padding: 7px 14px; font-family: var(--sans); font-size: 12px; font-weight: 600; cursor: pointer; min-height: 36px; }
.jr-btn.solid { background: var(--ink); color: var(--panel-figure); }
.jr-btn.hollow { background: var(--card); color: var(--ink); }
.jr-btn[disabled] { opacity: 0.45; cursor: default; }
.jr-list { border-top: 1px solid #e4e3dc; padding-top: 7px; display: flex; flex-direction: column; gap: 3px; }
.jr-head { display: flex; align-items: baseline; gap: 10px; cursor: pointer; padding: 4px 0; background: none; border: none; width: 100%; text-align: left; font: inherit; min-height: 32px; }
.jr-date { font-family: var(--mono); font-size: 10px; color: var(--faint); white-space: nowrap; }
.jr-prev { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-body { padding: 0 0 4px 18px; font-size: 13px; line-height: 1.5; margin: 0; }

/* --- the template dialog -------------------------------------------------- */

dialog.tpl {
  border: 1px solid var(--hairline);
  background: var(--card);
  color: var(--ink);
  padding: 0;
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
dialog.tpl::backdrop { background: rgba(20, 20, 43, 0.45); }

.tpl-head {
  flex: 0 0 auto;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.tpl-title { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.tpl-sub { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); }

.tpl-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 16px;
}
.tpl-lead { font-size: 13px; line-height: 1.6; color: var(--body); margin: 0; max-width: 72ch; }
.tpl-note { font-family: var(--mono); font-size: 11px; line-height: 1.5;
  color: var(--muted-2); margin: 6px 0 0; max-width: 72ch; }

.tpl-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-chips .rc-chip { font: inherit; }

.tpl-grid { display: flex; gap: 26px; flex-wrap: wrap; }
.tpl-week { display: flex; flex-direction: column; gap: 3px; }
.tpl-wklabel { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.tpl-row { display: flex; align-items: center; gap: 4px; }
/* Between people only -- not under the weekday header, and not after the last
   one. Two members' blocks in one column read as one stack without it. */
.tpl-mrow { padding: 5px 0; }
.tpl-mrow + .tpl-mrow { border-top: 1px solid var(--hairline); }
.tpl-name { width: 62px; flex: 0 0 62px; }
.tpl-name span { font-family: var(--mono); font-size: 10px; font-weight: 700;
  border-bottom: 2px solid currentColor; padding-bottom: 2px; }
.tpl-name.paul span { border-bottom-color: var(--paul); }
.tpl-name.juan span { border-bottom-color: var(--juan); }
.tpl-col { width: 26px; flex: 0 0 26px; display: flex; justify-content: center; }
.tpl-dow { font-family: var(--mono); font-size: 8px; color: var(--faint); }
.tpl-stack { flex-direction: column-reverse; gap: 2px; align-items: center; }

.tpl-repeat { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

.tpl-foot {
  flex: 0 0 auto;
  padding: 12px 18px;
  border-top: 1px solid var(--hairline);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--surface-2);
}
.tpl-apply, .tpl-cancel {
  border: 1px solid var(--ink); padding: 9px 16px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  cursor: pointer; min-height: 40px;
}
.tpl-apply { background: var(--ink); color: var(--panel-figure); }
.tpl-cancel { background: var(--card); color: var(--ink); }

.hp-template.on { background: var(--ink); color: var(--panel-figure); }
