/* Wave 5 design clean-up (builder D, owner 2026-11-22: "overlapping, not clean, different colours, texts are weird").
   Loaded LAST. Measured by test/ui-check.js (LAYOUT: cut text, text over text, too wide at 390 px, colours outside the
   theme tokens). Rules: one KPI card, text wraps instead of being cut, no colours from the old v6/v10/v14/v20 layers,
   one easing var(--ease). Colours only from theme tokens (js/themes.js). */

/* ---------- 1. one KPI card: screen KPIs (.kpi) and area-header KPIs (.mxk) ----------
   The label wraps to two lines instead of being cut; the figure sizes itself to the card (container units), so
   "Rp 392 jt" always fits; money is shortened by kpiFit/rpC (js/ui.js) with the exact figure in the tooltip. */
.kpi, .mxk { container-type: inline-size; }
.kpi > span.lb, .mxk > span.wl { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; align-items: flex-start !important; line-height: 1.3; overflow-wrap: break-word; }
.kpi > span.lb::before, .mxk > span.wl::before { margin-top: .42em; }
.kpi > b, .mxk > span.wv { font-size: var(--fs-num) !important; white-space: nowrap !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.1 !important; max-width: none; overflow-wrap: normal !important; }
/* a long figure (more than 6 characters, class lv from kpi() / mxKpi()) shrinks with its card; short ones stay 30 px */
.kpi > b.lv, .mxk > span.wv.lv { font-size: clamp(18px, 17cqi, 30px) !important; }
.kpi > span.sub, .mxk > span.wd { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: break-word; }
.mxk { grid-template-rows: auto auto auto; align-content: start; row-gap: 8px; }
.mxk > span.wv { grid-column: 1 / -1 !important; grid-row: 2; }
.mxk > span.wd { grid-column: 1; grid-row: 3; align-self: center; }
.mxk > .wsp { grid-column: 2 !important; grid-row: 3 !important; align-self: end; }

/* ---------- 2. area header (wsh): KPI-only screens, shortcut pills that stay pills ---------- */
.wsh.nom .wsh-r { grid-template-columns: minmax(0, 1fr) !important; }
.wsh-t { align-items: center; align-content: flex-start; align-self: start; }
.wsh-t > button, .wsh-t > a { height: 36px; min-height: 36px; max-height: 36px; align-self: center; }
.wsh.nok:not(.two) > .wsh-t, .wsh.nok.two > .wsh-t { flex-wrap: wrap; }
@media (max-width: 720px) {
  .wsh-r .mxk { flex-basis: min(78%, 250px) !important; }
  .wsh.nom .wsh-r .mxk { flex-basis: min(78%, 250px) !important; }
  .wsh.nok:not(.two) > .wsh-t, .wsh.nok.two > .wsh-t { flex-wrap: nowrap; }
}
.wsh-c .wch b { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }

/* ---------- 3. text wraps, never cut: list rows, follow-ups, calendar chips, funnel stage names ---------- */
:is(.rw2 > b, .rw2 > .sub, .rw2 .sub, .sl-fut b, .sl-fut small, .lnk span, .em .sub, .mk-lane-h small, .sv-lit b, .sv-lit small,
  .sl-na > span, .mfun > div > span:first-child, .tp-late a span, .fname, .plate .pt b, .plate .pt small, .dash .hm-l .plate .pt > a,
  .fnl-c > small, .fnl-dt, .tk-ev, .wch small) {
  white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: break-word; min-width: 0;
}
.fnl-c > small { text-align: center; line-height: 1.25; }
.tk-ev { line-height: 1.3 !important; padding-block: 2px !important; }
/* today in the month grid is an ink cell: its events read as light chips on ink, not navy */
.tk-day.today .tk-ev { background: color-mix(in oklab, var(--pri-ink) 16%, transparent) !important; color: var(--pri-ink) !important; }

/* ---------- 4. phone top bar: the screen title gets its own full-width row under the icons (never "Pelan…") ---------- */
@media (max-width: 720px) {
  .main > header.top:not(.hero) { flex-wrap: wrap; justify-content: flex-end; }
  .main > header.top:not(.hero) > .test-mark { order: 1; margin-right: auto; }
  .main > header.top:not(.hero) > .ibtn { order: 2; }
  .main > header.top:not(.hero) > .ttl { order: 3; flex: 1 0 100%; }
  .main > header.top:not(.hero) > .top-acts { order: 9; }
  header.top .ttl h3, header.top .ttl .ttl-sub { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: break-word; }
  header.top .ttl h3 { font-size: 30px !important; }
}

/* ---------- 5. leftovers that paint their own colours ---------- */
/* v14: the dashboard (.hm) swapped every accent for a sporty green; the theme's own series again */
:root .hm, :root[data-theme] .hm { --d-fin: inherit !important; --d-ops: inherit !important; --d-svc: inherit !important; --d-sal: inherit !important; --d-mkt: inherit !important; --d-cmp: inherit !important; --d-hr: inherit !important; --d-ppl: inherit !important; --c2: inherit !important; --c3: inherit !important; --c4: inherit !important; }
/* v6: file-type badges were red/blue/green gradients with a coloured glow: a quiet outlined tag */
.fk, .fk[class*="k-"] { --kc: var(--ink-3) !important; background: var(--panel-sunk) !important; color: var(--ink-2) !important; box-shadow: inset 0 0 0 1px var(--line) !important; border-radius: 10px !important; font-weight: 700 !important; }
:root:not([data-motion="low"]) .frow:hover .fk { transform: translateY(-2px) !important; box-shadow: inset 0 0 0 1px var(--line-2) !important; transition: transform 150ms var(--ease) !important; }
/* the map credit line: ink text, no flag icon */
.leaflet-control-attribution, .leaflet-control-attribution a { color: var(--ink-3) !important; background: color-mix(in oklab, var(--panel) 86%, transparent) !important; }
.leaflet-control-attribution svg { display: none !important; }

/* ---------- 6. Files: the folder fan (owner reference REFERENCE-files-3d-folder-fan.jpg; js/deck.js FAN, js/v_docs.js) ----------
   bar (search + counts) / the fan / below: key dates left, the picked folder right (recent activity + files).
   Folders are calm cards (panel + hairline); the one in the middle is filled with the accent token (--live: ink on Monokrom,
   lime on Lime) with its name and a % / count chip. Names are horizontal and wrap; side folders show only icon and count. */
.docs.dz { display: grid; gap: 20px; align-content: start; }
.dz-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dz .fsearch { flex: 1 1 320px; max-width: 520px; height: 44px; margin: 0; padding: 0 8px 0 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); box-shadow: none; transition: border-color 150ms var(--ease); }
.dz .fsearch:focus-within { background: var(--panel); border-color: var(--ink); box-shadow: none; }
.dz .fsearch input { font-size: var(--fs-body); }
.dz .fsearch kbd { background: var(--panel-sunk); color: var(--ink-3); border-radius: 999px; padding: 4px 9px; font-size: var(--fs-micro); }
.dz-k { font-size: var(--fs-micro); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.dz-fan { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-card); padding: 8px 0 16px; overflow: hidden; }
.dz-hint { margin: 8px 0 0; padding: 0 20px; text-align: center; font-size: var(--fs-micro); color: var(--ink-3); }

.fan { --w: 168px; --step: 74px; --rot: 52; --gap: 92; --names: one; position: relative; transition: opacity 250ms var(--ease); }
.fan.dim { opacity: .45; }
.fan-v { display: flex; align-items: center; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain;
  perspective: 1100px; perspective-origin: 50% 40%; padding: 34px 0 30px; outline: 0; cursor: grab; -webkit-tap-highlight-color: transparent; }
.fan-v::-webkit-scrollbar { display: none; }
.fan-v.drag { cursor: grabbing; user-select: none; }
.fan-v:focus-visible .ff.on .ff-in { outline: 2px solid var(--ink); outline-offset: 3px; }
.fan-pad { flex: 0 0 calc(50% - var(--w) / 2); height: 1px; }
.ff { position: relative; flex: 0 0 var(--w); width: var(--w); height: calc(var(--w) * 1.14); transform-style: preserve-3d; will-change: transform; cursor: pointer; }
.ff + .ff { margin-left: calc(var(--step) - var(--w)); }
.ff-in { position: absolute; inset: 16px 0 0; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); box-shadow: var(--sh-card);
  transition: background-color 250ms var(--ease), color 250ms var(--ease), border-color 250ms var(--ease), box-shadow 250ms var(--ease); }
.ff-tab { position: absolute; top: 4px; left: 0; width: 46%; height: 24px; border-radius: 12px 12px 0 0; background: var(--panel-sunk); border: 1px solid var(--line); border-bottom: 0;
  transition: background-color 250ms var(--ease), border-color 250ms var(--ease); }
.ff-pp { position: absolute; top: 0; right: 14px; width: 52%; height: 40px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: inset 0 9px 0 -7px var(--line), inset 0 16px 0 -14px var(--line); transform: translateZ(-1px); }
.ff-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-3); transition: color 250ms var(--ease); }
.ff-top .i { width: 18px; height: 18px; stroke-width: 1.5; }
.ff-top b { font-size: var(--fs-body); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); transition: color 250ms var(--ease); }
.ff-name { font-size: var(--fs-body); font-weight: 600; line-height: 1.25; overflow-wrap: break-word; opacity: 0; transition: opacity 250ms var(--ease); }
.ff-chip { align-self: flex-start; margin-top: auto; padding: 4px 10px; border-radius: 999px; font-size: var(--fs-micro); font-weight: 700; font-variant-numeric: tabular-nums;
  background: color-mix(in oklab, var(--live-ink) 14%, transparent); color: var(--live-ink); opacity: 0; transition: opacity 250ms var(--ease); }
.ff.named .ff-name { opacity: 1; }
.ff:not(.named) .ff-name, .ff:not(.on) .ff-chip { visibility: hidden; }
.ff.on .ff-in { background: var(--live); color: var(--live-ink); border-color: transparent; box-shadow: var(--sh-hover); }
.ff.on .ff-tab { background: var(--live); border-color: transparent; }
.ff.on .ff-top, .ff.on .ff-top b { color: var(--live-ink); }
.ff.on .ff-chip { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .ff:not(.on):hover .ff-in { border-color: var(--line-2); box-shadow: var(--sh-hover); } }
.fan-ctl { display: flex; align-items: center; justify-content: center; gap: 12px; }
.fan-b { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); transition: border-color 150ms var(--ease); }
.fan-b:hover { border-color: var(--ink); }
.fan-idx { min-width: 56px; text-align: center; font-size: var(--fs-micro); font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fan-idx b { color: var(--ink); }

.dz-low { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.dz-low.one { grid-template-columns: minmax(0, 1fr); }
.dz-dates { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-card); padding: 20px; display: grid; gap: 14px; }
.dz-h h4 { margin: 0; font-size: var(--fs-micro); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.dz-h p { margin: 4px 0 0; font-size: var(--fs-body); color: var(--ink-3); }
.dz-l { list-style: none; margin: 0; padding: 0; display: grid; }
.dz-r { display: grid; grid-template-columns: minmax(84px, 104px) minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.dz-r:first-child { border-top: 0; padding-top: 0; }
.dz-when, .dz-what { display: grid; gap: 2px; min-width: 0; }
.dz-when b, .dz-what b { font-size: var(--fs-body); font-weight: 600; overflow-wrap: break-word; }
.dz-when small, .dz-what small { font-size: var(--fs-micro); color: var(--ink-3); overflow-wrap: break-word; }
.dz-r.late .dz-when b { color: var(--warn); }
.dz-0, .fp-0 { margin: 0; font-size: var(--fs-body); color: var(--ink-3); }

.dz .fpanel { border-radius: var(--r-card); box-shadow: var(--sh-card); background: var(--panel); }
.dz .fp-h { flex-wrap: wrap; padding: 16px 20px; }
.dz .fp-i, .dz .fp-i.lk { background: var(--panel-sunk) !important; color: var(--ink) !important; box-shadow: none !important; border: 1px solid var(--line); }
.dz .fp-t b, .dz .fp-t small { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
.dz .fp-t b { font-size: var(--fs-body); font-weight: 700; }
.fp-chip { padding: 4px 10px; border-radius: 999px; background: var(--panel-sunk); color: var(--ink-2); font-size: var(--fs-micro); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fp-cols { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); }
.fp-rec { padding: 16px 20px; border-right: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.fp-fl { min-width: 0; display: grid; align-content: start; }
.fp-fl > .fp-sh { padding: 16px 20px 8px; }
.fp-sh { margin: 0; font-size: var(--fs-micro); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.fp-tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.fp-tl li { display: grid; grid-template-columns: 8px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; }
.fp-tl li > i { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--ink); }
.fp-tl li:not(:first-child) > i { background: var(--c-soft); }
.fp-tl li > span { display: grid; gap: 1px; min-width: 0; }
.fp-tl b { font-size: var(--fs-body); font-weight: 600; }
.fp-tl span > span { font-size: var(--fs-body); color: var(--ink-2); overflow-wrap: anywhere; }
.fp-tl time { grid-column: 2; font-size: var(--fs-micro); color: var(--ink-3); }
.dz .fm b, .dz .fname { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

@media (max-width: 980px) {
  .dz-low, .fp-cols { grid-template-columns: minmax(0, 1fr); }
  .dz-low > .fpanel { order: -1; }
  .fp-rec { border-right: 0; border-bottom: 1px solid var(--line); }
}
/* phone: a swipe carousel with the same feel; folders side by side, a little turned, every name showing */
@media (max-width: 720px) {
  .fan { --w: 148px; --step: 160px; --rot: 22; --gap: 0; --names: all; }
  .fan-v { padding: 26px 0 22px; perspective: 900px; }
  .ff:not(.named) .ff-name { visibility: visible; }
  .ff .ff-name { opacity: 1; }
  .dz .fsearch { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .ff-in, .ff-tab, .ff-name, .ff-chip, .fan { transition: none !important; } }
:root[data-motion="low"] :is(.ff-in, .ff-tab, .ff-name, .ff-chip, .fan) { transition: none !important; }
/* x_fp.css (finance pack tables) also uses the class .fp-t: in the Files panel header it is the title block, not a table */
.fpanel .fp-h > .fp-t { display: grid; width: auto; flex: 1 1 200px; border-collapse: separate; font-size: inherit; }

/* ---------- 7. round 2 (measured + screenshots) ---------- */
/* phone: screens that draw their own big heading (Home) keep the small title in the icon row */
@media (max-width: 720px) {
  .main:has(> #page > :first-child > .u-head:first-child) > header.top:not(.hero) > .ttl, .main:has(> #page > .u-head:first-child) > header.top:not(.hero) > .ttl { order: 1; flex: 1 1 0; }
  .main:has(> #page > :first-child > .u-head:first-child) > header.top:not(.hero) > .test-mark, .main:has(> #page > .u-head:first-child) > header.top:not(.hero) > .test-mark { margin-right: 0; }
}
/* people chips and pills in list rows wrap instead of being cut or running into the next column */
.who > span:last-child, .row .who > span:last-child, .tbl .who > span:last-child { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: break-word; }
.row .who, .tbl .who { overflow: visible !important; }
:is(.row, .tbl, td, .arow) .pill { white-space: normal; height: auto; min-height: 23px; padding-block: 3px; line-height: 1.3; max-width: 100%; text-align: left; }
.row > span, .row .lg-only > span { min-width: 0; }
/* the area donut: the centre total and its label fit inside the ring */
.mdn .mch text.tot { font-size: 18px !important; font-weight: 700; }
.mdn .mch text.totl { font-size: 7px !important; }
/* HR clock button: "in" is also the input class (.in), so the state is restated; one calm ink circle, the second state outlined */
.hr-big, .hr-big.in, .hr-big.out, .hr-big.done { width: min(220px, 70vw) !important; height: auto !important; aspect-ratio: 1; padding: 0 !important; border-radius: 50% !important;
  display: grid !important; place-content: center; justify-items: center; gap: 8px; font-size: 22px !important; font-weight: 700; line-height: 1.1;
  box-shadow: var(--sh-card) !important; transition: transform 150ms var(--ease), box-shadow 150ms var(--ease) !important; }
.hr-big, .hr-big.out { background: var(--pri) !important; color: var(--pri-ink) !important; border: 0 !important; }
.hr-big.in { background: var(--panel) !important; color: var(--ink) !important; border: 1px solid var(--line-2) !important; }
.hr-big.done { background: var(--panel-sunk) !important; color: var(--ink-3) !important; border: 1px solid var(--line) !important; opacity: 1; }
.hr-big.busy { animation: none !important; opacity: .7; }

/* ---------- 8. round 3 ---------- */
/* figure rows (forecast months, quotes, stock figures): the figure sizes itself to its column and the row reflows */
.fig-row { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)) !important; }
/* (a size container has no width of its own, so only figures in a grid of columns get one; flex rows keep their own sizes) */
.fig-row > .fig { container-type: inline-size; }
.fig-row > .fig b { font-size: clamp(14px, 15cqi, 30px) !important; white-space: nowrap; }
.fig > span { white-space: normal; overflow-wrap: break-word; }
/* red is kept for overspend: an overdue column title is a warning */
.s2-fc.late h4 { color: var(--warn) !important; }
.s2-fd > span:first-child > * { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: break-word; min-width: 0; }
.s2-fd > span:first-child { flex: 1 1 auto; }
/* home KPI footers: the change and "vs 30 days ago" wrap together inside the card */
.dash .kc-f { flex-wrap: wrap; row-gap: 2px; min-width: 0; }
.dash .kc-f .u-delta { white-space: normal !important; }
/* budget status pill, date fields, filter chips in tool rows: inside their row */
.fin-bud-p { min-width: 0; }
.fin-bud-p .pill { white-space: nowrap; justify-self: end; }
/* (at phone width the tool row is a sideways strip, see meteam.css; on wider screens it wraps) */
@media (min-width: 721px) { .btools { flex-wrap: wrap; min-width: 0; } .btools > .fin-date { flex-wrap: wrap; max-width: 100%; } .btools > .fin-date .in { min-width: 0; max-width: 100%; } }
@media (max-width: 720px) { .btools > .fin-date { flex: none; } }
.plate .pt small, .plate .pt small > span { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; min-width: 0; }

/* marketing lane: the "Buat … untuk slot ini" button wraps inside its lane */
.mk-emp .btn { white-space: normal; height: auto; min-height: 36px; padding-block: 8px; max-width: 100%; line-height: 1.25; text-align: center; }
.mk-emp .btn > span { white-space: normal; }
/* red is kept for overspend: a late count in an area KPI reads ink with an orange dot */
.mxk[data-t="err"] { --wt: var(--warn-fill); }
.mxk[data-t="err"] .wv { color: var(--ink) !important; }

/* phone tool rows: the pill container wraps all its chips and the row scrolls sideways (chips never stick out of their pill) */
@media (max-width: 720px) { .btools .chips.scroll { width: max-content !important; max-width: none !important; flex: none; } }
/* home bullet chart labels wrap */
.ckbl-l, .ckbl-l small { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: break-word; }
/* budget rows: the status pill sits under the percentage inside its column */
@media (min-width: 721px) { .fin-bud { grid-template-columns: minmax(100px, 1.1fr) minmax(60px, 1.2fr) 124px max-content; } }
/* a settings row that holds a label row: one hairline and one padding, not two (governance cards, Settings > Departemen) */
.set-r > .set-l-row { padding: 0; border-top: 0; }
/* round 4 (other roles): home lists, deadline titles, project tags on task cards, team attendance rows */
.dn2-l li span, .ckdl-t > span, .ckdl-t small, .tk-card .tk3-pj { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: break-word; min-width: 0; }
.ckdl-t small { margin-left: 0; display: inline; }
.hr-p { flex-wrap: wrap; row-gap: 6px; }
.hr-p > .who { min-width: 0; flex: 1 1 160px; }
.hr-p > .hr-ps { flex: 1 1 auto; min-width: 0; }
.hr-ps small { white-space: normal; overflow-wrap: break-word; }
/* home "Setelah itu" list: titles wrap */
.hm-next-l li > a > span { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: break-word; min-width: 0; }
