/* PSD EMS design tokens — "one family" with pusakaecosystem.com (28 Nov 2026), WCAG 2.1 AA, see DESIGN.md */
/* Plus Jakarta Sans (SIL OFL 1.1, public/fonts/OFL-PlusJakartaSans.txt), self-hosted: the CSP allows only 'self'. */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --vp-narrow: 375px; --vp-medium: 768px; --vp-wide: 1280px;
  --font: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-meta: 0.75rem; --fs-2: 0.875rem; --fs-1: 1rem; --fs-h3: 1.125rem; --fs-h2: 1.25rem; --fs-h1: 1.75rem;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 40px; --s8: 48px;
  --fs-lead: 1.125rem; --fs-section: 1.5rem; --fs-display: clamp(2rem, 1.4rem + 2.4vw, 2.75rem); /* portal (Marketing landing) only */
  --r: 6px; --r-lg: 8px; --hit: 44px; --sidebar: 248px;
  --ease: cubic-bezier(.2, 0, 0, 1); --ease-in: cubic-bezier(.4, 0, 1, 1); --t: 150ms;

  --l0: #F7F4F0; --l1: #FFFFFF; --l2: #FFFFFF; --l3: #FFFFFF; --l1-sub: #FBF9F6;
  --fg: #0F2238; --fg-2: #44566B; --fg-3: #5A6B7E;
  --border: rgba(15, 34, 56, 0.10); --border-2: rgba(15, 34, 56, 0.16); --border-input: rgba(15, 34, 56, 0.42);
  --accent: #1E4A72; --accent-hover: #163A5B; --accent-fg: #FFFFFF; --accent-soft: rgba(30, 74, 114, 0.08); --link: #1E4A72;
  --gold: #B79A60; --brand-red: #B8432F; /* accents as shapes only (active-nav bar, brand rule); never text or buttons */
  --ok: #17663F; --ok-bg: #E7F4EC; --warn: #7A4F00; --warn-bg: #FFF4DA; --bad: #B42318; --bad-bg: #FDECEA; --neutral-bg: #EEF1F5;
  --focus: 0 0 0 2px var(--l1), 0 0 0 4px #2B6CB0;
  --sh-1: 0 1px 2px rgba(15, 34, 56, 0.04); --sh-2: 0 4px 12px rgba(15, 34, 56, 0.06); --sh-3: 0 8px 24px rgba(15, 34, 56, 0.07);
  --scrim: rgba(15, 34, 56, 0.40);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --l0: #0B1622; --l1: #111F2E; --l2: #152638; --l3: #172A3E; --l1-sub: #0F1C2A;
  --fg: #E6EDF5; --fg-2: #B3C0CE; --fg-3: #9AA9BA;
  --border: rgba(230, 237, 245, 0.10); --border-2: rgba(230, 237, 245, 0.16); --border-input: rgba(230, 237, 245, 0.40);
  --accent: #8DBBE8; --accent-hover: #A9CDF0; --accent-fg: #0B1622; --accent-soft: rgba(141, 187, 232, 0.12); --link: #8DBBE8;
  --brand-red: #E07A62;
  --ok: #7ED8A6; --ok-bg: rgba(126, 216, 166, 0.12); --warn: #F2C46B; --warn-bg: rgba(242, 196, 107, 0.12); --bad: #F59A90; --bad-bg: rgba(245, 154, 144, 0.12); --neutral-bg: rgba(230, 237, 245, 0.08);
  --focus: 0 0 0 2px var(--l0), 0 0 0 4px #8DBBE8;
  --sh-1: inset 0 1px 0 rgba(255, 255, 255, 0.04); --sh-2: 0 4px 12px rgba(0, 0, 0, 0.30); --sh-3: 0 8px 24px rgba(0, 0, 0, 0.40);
  --scrim: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; width: 100%; }
body { background: var(--l0); color: var(--fg); font: 400 var(--fs-1)/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h1); line-height: 1.2; }
h2 { font-size: var(--fs-h2); line-height: 1.25; }
h3 { font-size: var(--fs-h3); line-height: 1.25; }
p { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.meta { font-size: var(--fs-meta); line-height: 1.4; color: var(--fg-3); }
.sec { font-size: var(--fs-2); color: var(--fg-2); }
.mono { font-family: var(--mono); font-size: var(--fs-meta); word-break: break-all; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r); }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { box-shadow: none; outline: none; } /* headings focused for screen readers only */
.page > div:empty { display: none; }
.ic { flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--hit); padding: 0 var(--s4); border-radius: var(--r);
  border: 1px solid var(--border-2); background: var(--l1); color: var(--fg); font: 500 var(--fs-2)/1 var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--l1-sub); border-color: var(--border-input); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #0B1622; }
.btn-danger:hover { filter: brightness(0.95); background: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn[aria-busy="true"] { cursor: progress; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: var(--hit); height: var(--hit); padding: 0; position: relative; }
.tip { position: relative; }
.tip::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 100; pointer-events: none;
  background: var(--fg); color: var(--l0); font: 500 var(--fs-meta)/1.4 var(--font); padding: var(--s1) var(--s2); border-radius: var(--r); white-space: nowrap; display: none; }
.tip.tip-left::after { left: auto; right: 0; transform: none; }
.tip:focus-visible::after { display: block; }
@media (hover: hover) { .tip:hover::after { display: block; } }
kbd { font: 500 var(--fs-meta)/1 var(--mono); padding: 4px; border: 1px solid var(--border-2); border-radius: 4px; background: var(--l1-sub); color: var(--fg-2); }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; width: 100%; }
.sidebar { background: var(--l1); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: var(--s3); padding: var(--s5) var(--s5) var(--s4); }
.sidebar > .brand { position: relative; }
.sidebar > .brand::after { content: ""; position: absolute; left: var(--s5); bottom: 0; width: 32px; height: 2px; border-radius: 1px; background: var(--gold); } /* brand rule below the block, never on the logo */
.brand-mark { width: 25px; height: 32px; display: block; flex: none; } /* PSD "P" logo: public/logo.svg (owner artwork, traced to vector) */
.brand-name { font-weight: 600; font-size: var(--fs-2); line-height: 1.2; }
.brand-sub { display: block; font-size: var(--fs-meta); color: var(--fg-3); font-weight: 400; }
.nav { padding: var(--s2) var(--s3) var(--s5); display: flex; flex-direction: column; gap: var(--s1); }
.nav-sec { display: flex; flex-direction: column; gap: var(--s1); }
.nav a[hidden], .nav-sec[hidden], .nav-nohit[hidden] { display: none; }
.nav-search { position: relative; margin: var(--s2) var(--s3) 0; color: var(--fg-3); }
.nav-search svg { position: absolute; left: var(--s3); top: 50%; transform: translateY(-50%); pointer-events: none; }
input[type="search"].nav-search-input { width: 100%; padding-left: calc(var(--s3) * 2 + 16px); }
.nav-nohit { padding: var(--s3) var(--s5) 0; margin: 0; }
.nav-group { font-size: var(--fs-meta); color: var(--fg-3); padding: var(--s4) var(--s3) var(--s1); font-weight: 500; }
.nav a { display: flex; align-items: center; gap: var(--s3); min-height: var(--hit); padding: 0 var(--s3); border-radius: var(--r); color: var(--fg-2); font-size: var(--fs-2); font-weight: 500; }
.nav a:hover { background: var(--accent-soft); color: var(--fg); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--fg); box-shadow: inset 3px 0 0 var(--brand-red); }
.nav .count { margin-left: auto; font-size: var(--fs-meta); font-weight: 600; color: var(--fg); background: var(--neutral-bg); border-radius: 4px; padding: 4px 8px; line-height: 1; }
.acc-link { display: inline-flex; align-items: center; min-height: var(--hit); color: var(--fg); font-weight: 500; }
.sidebar-foot { margin-top: auto; padding: var(--s4) var(--s5); border-top: 1px solid var(--border); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s6); min-height: 64px;
  background: var(--l0); border-bottom: 1px solid var(--border); }
.topbar .spacer { flex: 1; }
.scope { display: flex; align-items: center; gap: var(--s2); }
.scope { min-width: 0; }
.scope label { font-size: var(--fs-2); color: var(--fg-2); white-space: nowrap; }
.frame-head a { font-size: var(--fs-2); font-weight: 500; display: inline-flex; align-items: center; min-height: var(--hit); padding: 0 var(--s2); margin: calc(var(--s3) * -1) calc(var(--s2) * -1); }
.split .detail-body { grid-template-columns: 1fr; }
.signout { margin-top: var(--s3); width: 100%; justify-content: flex-start; padding: 0 var(--s2); }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--r); overflow: hidden; }
.seg button { min-height: var(--hit); min-width: var(--hit); border: 0; background: var(--l1); color: var(--fg-2); font: 500 var(--fs-2)/1 var(--font); cursor: pointer; padding: 0 var(--s3); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--fg); }
.seg button + button { border-left: 1px solid var(--border-2); }
.user { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-2); color: var(--fg-2); }
.auth-note { margin: 0; padding: var(--s2) var(--s3); border-left: 3px solid var(--gold); background: var(--l1-sub); font-size: var(--fs-2); color: var(--fg-2); } /* login: session scope note (0.12.0) */
.real-data .demo-bar { display: none; } /* Absensi: real data, owner exception */
.demo-bar { padding: var(--s2) var(--s6); font-size: var(--fs-meta); color: var(--warn); background: var(--warn-bg); border-bottom: 1px solid var(--border); display: flex; gap: var(--s2); align-items: center; }
.menu-btn { display: none; }
.nav-scrim { display: none; }

.page { width: 100%; max-width: var(--vp-wide); margin: 0 auto; padding: var(--s6) var(--s6) var(--s8); display: flex; flex-direction: column; gap: var(--s5); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.page-head .lead { margin-top: var(--s2); color: var(--fg-2); font-size: var(--fs-2); max-width: 70ch; }
.page-head .actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.crumbs { font-size: var(--fs-2); color: var(--fg-3); display: flex; align-items: center; gap: var(--s1); margin-bottom: var(--s2); }

/* ---------- surfaces ---------- */
.frame { background: var(--l1); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.frame-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.frame-body { padding: var(--s5); }
.notice { display: flex; gap: var(--s3); padding: var(--s4) var(--s5); border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--l1); border-radius: var(--r-lg); font-size: var(--fs-2); color: var(--fg-2); }
.notice strong { color: var(--fg); font-weight: 600; display: block; margin-bottom: var(--s1); }
.notice.warn { border-left-color: var(--warn); }
.notice.bad { border-left-color: var(--bad); }

/* ---------- toolbar / table ---------- */
.toolbar { display: flex; align-items: flex-end; gap: var(--s2); flex-wrap: wrap; }
.searchbox { display: flex; flex-direction: column; gap: var(--s1); flex: 1 1 280px; max-width: 420px; }
.searchbox label { font-size: var(--fs-2); color: var(--fg-2); font-weight: 500; }
.searchbox .field { position: relative; }
.searchbox .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fg-3); }
.searchbox input { padding-left: 36px; padding-right: 44px; }
.searchbox kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: var(--s1); min-height: var(--hit); padding: 0 0 0 var(--s3); border: 1px solid var(--border-2); border-radius: var(--r); background: var(--l1); font-size: var(--fs-2); color: var(--fg); }
.chip button { border: 0; background: transparent; color: var(--fg-2); width: var(--hit); height: var(--hit); display: grid; place-items: center; cursor: pointer; border-radius: 4px; }
.chip button:hover { background: var(--accent-soft); }
.linkbtn { border: 0; background: none; color: var(--link); font: 500 var(--fs-2)/1 var(--font); cursor: pointer; min-height: var(--hit); padding: 0 var(--s2); }
.linkbtn:hover { text-decoration: underline; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
thead th { position: sticky; top: 0; background: var(--l1-sub); text-align: left; font-weight: 500; color: var(--fg-2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; }
thead th[aria-sort] .sort { color: var(--fg-3); margin-left: var(--s1); }
tbody td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--accent-soft); }
tr.rowlink td:first-child a { font-weight: 500; }
td.chev { width: 40px; color: var(--fg-3); text-align: right; }
.empty-cell { padding: var(--s8) var(--s5) !important; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); max-width: 52ch; margin: 0 auto; }
.empty .ic { color: var(--fg-3); }
.empty h3 { font-size: var(--fs-1); }
.empty p { color: var(--fg-2); font-size: var(--fs-2); }
.empty .btn { margin-top: var(--s2); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--border); font-size: var(--fs-2); color: var(--fg-2); flex-wrap: wrap; }
.pager .btns { display: flex; gap: var(--s2); }
.pager .btn[disabled] { color: var(--fg-3); background: var(--l1-sub); cursor: not-allowed; }

/* ---------- status ---------- */
.status { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-2); color: var(--fg-2); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); flex: none; }
.status.ok::before { background: var(--ok); } .status.ok { color: var(--ok); }
.status.warn::before { background: var(--warn); } .status.warn { color: var(--warn); }
.status.bad::before { background: var(--bad); } .status.bad { color: var(--bad); }
.status.info::before { background: var(--accent); } .status.info { color: var(--fg); }
.tag { font-size: var(--fs-meta); font-weight: 600; color: var(--fg-2); letter-spacing: 0.02em; }
td .tag { font-size: var(--fs-2); }
td.mono { font-size: var(--fs-2); }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); }
.kpi { padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s2); text-decoration: none; color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--border-input); }
.kpi .label { font-size: var(--fs-2); color: var(--fg-2); }
.kpi .value { font-size: var(--fs-h1); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s4); align-items: start; }
.bars { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s2); }
.bars .yaxis { display: flex; flex-direction: column; justify-content: space-between; font-size: var(--fs-meta); color: var(--fg-3); height: 180px; text-align: right; font-variant-numeric: tabular-nums; }
.bars .cols { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: var(--s1); height: 180px; align-items: end;
  background: linear-gradient(var(--border), var(--border)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--border), var(--border)) 0 50% / 100% 1px no-repeat, linear-gradient(var(--border), var(--border)) 0 100% / 100% 1px no-repeat; }
.bars .col { background: var(--accent); border-radius: 2px 2px 0 0; min-height: 0; }
.bars .xaxis { grid-column: 2; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: var(--s1); font-size: var(--fs-meta); color: var(--fg-3); }
.bars .xaxis span { text-align: center; white-space: nowrap; overflow: visible; }
@media (max-width: 767.98px) { .bars .xaxis span:nth-child(4n+3) { visibility: hidden; } }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s5); border-bottom: 1px solid var(--border); font-size: var(--fs-2); }
.feed li:last-child { border-bottom: 0; }

/* ---------- split pane (Data Inbox) ---------- */
.split { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: 560px; }
.split-list { border-right: 1px solid var(--border); }
.split-list ul { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s1) var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); cursor: pointer; text-align: left; width: 100%; background: none; border-left: 3px solid transparent; color: inherit; font: inherit; }
.item:hover { background: var(--accent-soft); }
.item[aria-selected="true"] { background: var(--accent-soft); border-left-color: var(--accent); }
.item .t { font-size: var(--fs-2); font-weight: 500; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .when { font-size: var(--fs-meta); color: var(--fg-3); }
.item .m { font-size: var(--fs-meta); color: var(--fg-3); grid-column: 1 / -1; display: flex; gap: var(--s2); align-items: center; }
.item .m .status { font-size: var(--fs-meta); }
.split-detail { min-width: 0; }
.detail-head { padding: var(--s5); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s2); }
.detail-head .row { display: flex; gap: var(--s4); flex-wrap: wrap; align-items: center; font-size: var(--fs-2); color: var(--fg-2); }
.detail-body { padding: var(--s5); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); }
.detail-body > * { min-width: 0; }
.placeholder { display: grid; place-items: center; height: 100%; min-height: 320px; color: var(--fg-3); font-size: var(--fs-2); padding: var(--s5); text-align: center; }
.src { font: 400 var(--fs-2)/1.6 var(--mono); background: var(--l1-sub); border: 1px solid var(--border); border-radius: var(--r); padding: var(--s2) 0; margin: 0; overflow-x: auto; counter-reset: ln; }
.src span { display: block; padding: 0 var(--s3) 0 0; white-space: pre-wrap; word-break: break-word; }
.src span::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 3ch; margin-right: var(--s3); text-align: right; color: var(--fg-3); user-select: none; }
.src span.hl { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.kv { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); gap: var(--s2) var(--s4); font-size: var(--fs-2); margin: 0; }
.kv dt { color: var(--fg-2); }
.kv dd { margin: 0; color: var(--fg); overflow-wrap: anywhere; }
.section-title { font-size: var(--fs-2); font-weight: 600; margin-bottom: var(--s3); color: var(--fg); }
.warns { list-style: none; margin: 0 0 var(--s4); padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.warns li { display: flex; gap: var(--s2); font-size: var(--fs-2); color: var(--warn); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: var(--s4); }
.fld { display: flex; flex-direction: column; gap: var(--s2); }
.fld > label, .fld > .lbl { font-size: var(--fs-2); font-weight: 500; color: var(--fg); }
.fld .opt { font-weight: 400; color: var(--fg-3); }
.fld .help { font-size: var(--fs-meta); color: var(--fg-3); }
.fld .src-ref { font-size: var(--fs-meta); color: var(--fg-3); }
.fld .err { font-size: var(--fs-meta); color: var(--bad); display: flex; gap: var(--s1); align-items: center; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="tel"], input[type="file"], input[type="date"], input[type="month"], input[type="time"], select, textarea {
  width: 100%; min-height: var(--hit); padding: var(--s2) var(--s3); font: 400 var(--fs-1)/1.4 var(--font); color: var(--fg);
  background: var(--l1); border: 1px solid var(--border-input); border-radius: var(--r); }
textarea { min-height: 200px; resize: vertical; font-family: var(--mono); font-size: var(--fs-2); line-height: 1.6; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); }
[aria-invalid="true"] { border-color: var(--bad) !important; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: var(--fs-2); font-weight: 500; margin-bottom: var(--s2); padding: 0; }
.radios { display: flex; gap: var(--s2); flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--hit); padding: 0 var(--s3); border: 1px solid var(--border-2); border-radius: var(--r); font-size: var(--fs-2); cursor: pointer; background: var(--l1); }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio input { accent-color: var(--accent); margin: 0; }
.form-actions { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; }
.form-error { font-size: var(--fs-2); color: var(--bad); display: flex; gap: var(--s2); align-items: flex-start; }
.form-error .linkbtn { color: var(--bad); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s5) var(--s4); }
.auth-card { width: 100%; max-width: 400px; padding: var(--s6); display: flex; flex-direction: column; gap: var(--s5); }
.auth-card header { display: flex; flex-direction: column; gap: var(--s3); }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }

/* ---------- stage stepper ---------- */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s1); overflow-x: auto; }
.stepper li { flex: 1 0 auto; min-width: 96px; padding: var(--s2) var(--s3); font-size: var(--fs-2); color: var(--fg-3); border-top: 3px solid var(--border-2); }
.stepper li.done { color: var(--fg-2); border-top-color: var(--accent); }
.stepper li.current { color: var(--fg); font-weight: 600; border-top-color: var(--accent); }
.bad-text { color: var(--bad); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); margin: 2px 0 0; flex: none; }
.err[hidden] { display: none; }
p.err { font-size: var(--fs-meta); color: var(--bad); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--border); padding: 0 var(--s5); overflow-x: auto; scroll-snap-type: x mandatory; }
.tabs button { min-height: var(--hit); padding: 0 var(--s3); border: 0; background: none; color: var(--fg-2); font: 500 var(--fs-2)/1 var(--font); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; scroll-snap-align: start; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }

/* ---------- inbox (approvals) ---------- */
.qrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s4); align-items: center; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.qrow:last-child { border-bottom: 0; }
.qrow .t { font-weight: 500; font-size: var(--fs-1); }
.qrow .m { font-size: var(--fs-2); color: var(--fg-2); display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s1); }
.qrow .acts { display: flex; gap: var(--s2); }
.qrow.pending { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- overlays ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 200; animation: fade var(--t) var(--ease); }
.sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--l3); border-left: 1px solid var(--border-2); box-shadow: var(--sh-3); z-index: 201;
  display: flex; flex-direction: column; animation: slide 200ms var(--ease); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s3) var(--s3) var(--s5); border-bottom: 1px solid var(--border); }
.sheet-body { padding: var(--s5); overflow-y: auto; flex: 1; }
.sheet-foot { padding: var(--s4) var(--s5); border-top: 1px solid var(--border); }
.dialog { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px)); background: var(--l3); border: 1px solid var(--border-2);
  border-radius: var(--r-lg); box-shadow: var(--sh-3); z-index: 301; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.dialog-scrim { z-index: 300; }
.toast { position: fixed; bottom: var(--s5); left: 50%; transform: translateX(-50%); z-index: 400; background: var(--fg); color: var(--l0); padding: var(--s3) var(--s4); border-radius: var(--r); font-size: var(--fs-2); box-shadow: var(--sh-2); max-width: calc(100vw - 32px); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

/* ---------- skeleton ---------- */
.sk { background: var(--neutral-bg); animation: sk 1s var(--ease) infinite alternate; border-radius: 4px; height: 16px; }
@keyframes sk { from { opacity: 1; } to { opacity: .5; } } /* functional loop: content is loading */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
  .spinner { animation: none; border-right-color: currentColor; opacity: .6; } /* aria-busy + label still convey work */
}

/* ---------- medium ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .detail-body { grid-template-columns: 1fr; }
}
/* ---------- narrow ---------- */
@media (max-width: 767.98px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 201; transform: translateX(-100%); transition: transform 200ms var(--ease-in), visibility 0s 200ms; visibility: hidden; }
  .app.nav-open .sidebar { transform: none; visibility: visible; box-shadow: var(--sh-3); transition: transform 200ms var(--ease); }
  .app.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 200; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: var(--s2) var(--s4); gap: var(--s2); }
  .topbar .scope label, .user .name { display: none; }
  .topbar .scope { flex: 1; }
  .topbar .scope select { width: 100%; }
  .topbar .spacer, .topbar .signout-top { display: none; }
  .demo-bar { padding: var(--s2) var(--s4); }
  .page { padding: var(--s5) var(--s4) var(--s8); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: var(--fs-h2); }
  .split { grid-template-columns: 1fr; }
  .split-list { border-right: 0; max-height: none; }
  .split-detail { display: none; }
  .searchbox { max-width: none; flex-basis: 100%; }
  .searchbox label.vis-wide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .grid2 { grid-template-columns: 1fr; }
  .table-wrap table { min-width: 680px; }
  .table-wrap td:first-child { min-width: 176px; } /* the table scrolls inside its frame, never the page */
  .att-hist .table-wrap table { min-width: 0; } /* 3 short columns fit a 375 px phone */
  .att-hist .table-wrap td:first-child { min-width: 0; }
  .qrow { grid-template-columns: 1fr; }
  .page-head .actions { width: 100%; }
}

/* 0.5.0 briefings */
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.notice.ok { border-left-color: var(--ok); }
.page-head h1 { overflow-wrap: anywhere; }
textarea.prose { font-family: var(--font); font-size: var(--fs-1); min-height: 120px; }
[hidden] { display: none !important; }

/* ---------- Portal (Marketing landing pattern) ---------- */
.skip { position: absolute; left: var(--s4); top: -100px; z-index: 300; padding: var(--s2) var(--s4); background: var(--l1); border: 1px solid var(--border-2); border-radius: var(--r); }
.skip:focus { top: var(--s2); }
.portal { min-height: 100vh; display: flex; flex-direction: column; }
.portal main { flex: 1; outline: none; }
.p-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--s5); }
.p-header { background: var(--l1); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.p-header-in { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 64px; }
.p-brand { padding: 0; color: var(--fg); text-decoration: none; }
.p-header-act { display: flex; align-items: center; gap: var(--s2); }
.portal .demo-bar { padding: var(--s2) 0; }
.portal .demo-bar .p-wrap { display: flex; gap: var(--s2); align-items: center; }
.p-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--s7); align-items: center; padding: var(--s8) 0 var(--s7); }
.p-eyebrow { margin: 0 0 var(--s3); font-size: var(--fs-2); font-weight: 500; color: var(--accent); }
.p-hero h1 { font-size: var(--fs-display); line-height: 1.12; letter-spacing: -0.02em; max-width: 18ch; }
.p-lead { margin: var(--s4) 0 0; font-size: var(--fs-lead); line-height: 1.55; color: var(--fg-2); max-width: 56ch; }
.p-cta { margin-top: var(--s6); }
.p-cta-main { min-height: 48px; padding: 0 var(--s5); font-size: var(--fs-1); }
.p-note { margin: var(--s4) 0 0; }
.p-flow { margin: 0; padding: var(--s5); box-shadow: var(--sh-2); }
.p-flow-title { font-size: var(--fs-2); font-weight: 600; color: var(--fg-2); margin-bottom: var(--s4); }
.p-flow-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); position: relative; }
.p-flow-list li { display: grid; grid-template-columns: 36px 1fr; gap: var(--s3); align-items: center; padding: var(--s2) 0; position: relative; }
.p-flow-list li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 46px; bottom: -10px; width: 2px; background: var(--border-2); }
.p-flow-list strong { display: block; font-weight: 600; font-size: var(--fs-2); }
.p-flow-ic, .p-card-ic, .p-check { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); }
.p-section { padding: var(--s7) 0; border-top: 1px solid var(--border); }
.p-section-head { margin-bottom: var(--s5); display: grid; gap: var(--s2); }
.p-section-head h2 { font-size: var(--fs-section); letter-spacing: -0.015em; }
.p-section-head p { margin: 0; max-width: 64ch; }
.p-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.p-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.p-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.p-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s6); }
.p-card { padding: var(--s5); display: grid; gap: var(--s2); align-content: start; }
.p-card h3 { font-size: var(--fs-1); }
.p-card p, .p-checks p { margin: 0; font-size: var(--fs-2); }
.p-card-ic { margin-bottom: var(--s2); }
.p-ent-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.p-checks li { display: grid; grid-template-columns: 36px 1fr; gap: var(--s3); align-items: start; }
.p-checks h3 { font-size: var(--fs-1); margin-bottom: var(--s1); }
.p-check { color: var(--ok); background: var(--ok-bg); }
.p-start { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s6); flex-wrap: wrap; }
.p-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: var(--s4); max-width: 640px; }
.p-steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); align-items: baseline; }
.p-steps li::before { content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-2); font-size: var(--fs-2); font-weight: 600; color: var(--fg-2); }
.p-steps p { margin: 0; }
.p-footer { border-top: 1px solid var(--border); background: var(--l1); padding: var(--s5) 0; font-size: var(--fs-2); }
.p-footer-in { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }

@media (max-width: 1023.98px) {
  .p-hero { grid-template-columns: 1fr; gap: var(--s6); padding-top: var(--s7); }
  .p-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .p-wrap { padding: 0 var(--s4); }
  .p-header .brand-name { display: none; } /* logo only, so ID/EN, theme and Masuk fit */
  .p-header-in { gap: var(--s2); }
  .p-header-act .p-cta-link { padding: 0 var(--s3); }
  .p-card { padding: var(--s4); grid-template-columns: 36px 1fr; column-gap: var(--s3); row-gap: var(--s1); align-items: center; }
  .p-card-ic { margin: 0; grid-row: span 1; }
  .p-card > p, .p-card > .p-ent-top { grid-column: 1 / -1; }
  .p-card > h3 { grid-column: 2; }
  .p-card > .p-ent-top + h3 { grid-column: 1 / -1; } /* entity cards have no icon */
  .p-grid-3, .p-grid-4, .p-grid-2 { grid-template-columns: 1fr; }
  .p-hero { padding: var(--s6) 0; }
  .p-section { padding: var(--s6) 0; }
  .p-cta-main { width: 100%; }
}
.auth-foot .seg { flex: none; }

/* ---------- 0.7.0 Dunia PSD (Dashboard pattern), characters, meetings, quests ---------- */
.world-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; margin-bottom: var(--s5); }
.world-frame { padding: var(--s3); overflow: hidden; background: linear-gradient(var(--l1), var(--l1-sub)); }
.world-svg { display: block; width: 100%; height: auto; }
.world-svg a:focus-visible { outline: none; }
.world-svg a:focus-visible .w-label rect { stroke: var(--brand-red); stroke-width: 3; }
.world-svg .w-site { cursor: pointer; }
.world-svg .w-site:hover .w-label rect { fill: var(--accent); }
.world-legend { margin: var(--s2) var(--s3) var(--s1); }
.world-side { display: grid; gap: var(--s4); }
.char-card { display: grid; grid-template-columns: 72px 1fr; gap: var(--s4); align-items: center; padding: var(--s4) var(--s5); }
.char-mini { display: grid; place-items: center; background: var(--accent-soft); border-radius: var(--r-lg); height: 88px; }
.quest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.quest-list li { display: grid; grid-template-columns: 20px 1fr auto; gap: var(--s2); align-items: start; font-size: var(--fs-2); }
.quest-list li > :last-child:not(div) { align-self: center; }
.q-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--accent); }
.q-dot.warn { background: var(--warn); } .q-dot.bad { background: var(--bad); }
.q-ic { color: var(--fg-3); display: inline-grid; place-items: center; height: 22px; }
.w-ents { list-style: none; margin: 0; padding: var(--s3) var(--s5) var(--s5); display: grid; gap: var(--s3); }
.w-ents li { display: grid; grid-template-columns: 48px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--s3); align-items: baseline; }
.sway { animation: sway 4s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .sway { animation: none; } }
.char-preview { display: grid; place-items: center; height: 180px; background: var(--accent-soft); border-radius: var(--r-lg); }
.char-group { display: grid; gap: var(--s2); }
.char-group legend { font-weight: 500; font-size: var(--fs-2); margin-bottom: var(--s2); }
.char-opts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.char-opt { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--hit); padding: 0 var(--s3); border: 1px solid var(--border-2); border-radius: var(--r); font-size: var(--fs-2); cursor: pointer; background: var(--l1); }
.char-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.char-opt input { accent-color: var(--accent); }
.swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border-2); }
.person-opt { padding: 4px var(--s3) 4px var(--s2); }
.faces { display: inline-flex; align-items: center; gap: 2px; }
.faces .avatar { background: var(--accent-soft); border-radius: 50%; }
.who { display: inline-flex; align-items: center; gap: var(--s2); }
.mt-helpers { display: flex; gap: var(--s2); flex-wrap: wrap; }
.qa-form { margin-bottom: var(--s4); padding-bottom: var(--s4); border-bottom: 1px solid var(--border); }
@media (max-width: 1100px) { .world-grid { grid-template-columns: 1fr; } }
@media (max-width: 767.98px) {
  .w-ents li { grid-template-columns: 48px 1fr; }
  .w-ents li > :nth-child(n+3) { grid-column: 2; }
  .world-frame { padding: var(--s1); }
}

/* ---------- 0.8.0 entity hub (Dashboard) and PIN (Form) ---------- */
.hub-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s5); align-items: start; }
.hub-main, .hub-side { display: grid; gap: var(--s5); }
.hub-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.pin-card { max-width: 440px; display: grid; gap: var(--s4); }
.pin-badge { display: flex; gap: var(--s3); align-items: baseline; }
.pin-input { font-family: var(--mono); font-size: 1.25rem; letter-spacing: 0.4em; max-width: 220px; }
.note-list, .link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.note-top { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.note-body { margin: var(--s1) 0 0; white-space: pre-wrap; color: var(--fg-2); font-size: var(--fs-2); }
.link-list li { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; }
.link-list a .ic { vertical-align: -2px; }
.rem-acts { display: inline-flex; gap: 2px; }
.rem-acts .btn { width: var(--hit); padding: 0; }
@media (max-width: 1100px) {
  .hub-grid { display: flex; flex-direction: column; }
  .hub-main, .hub-side { display: contents; }
  .hub-o1 { order: 1; } .hub-o2 { order: 2; } .hub-o3 { order: 3; } .hub-o4 { order: 4; } .hub-o5 { order: 5; } .hub-o6 { order: 6; }
}
@media (max-width: 767.98px) { .link-list li { grid-template-columns: 1fr auto; } .link-list li > .tag { grid-column: 1 / -1; } }

.mail-st { display: flex; align-items: center; gap: 2px; }
.mail-st.sent { color: var(--ok); } .mail-st.failed { color: var(--bad); }

/* ---------- Core Team desks (0.10.0) ---------- */
.ct-desks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.ct-desk { padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s2); }
.ct-desk-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.ct-desk h2 { margin: 0; font-size: var(--fs-1); font-weight: 600; }
.ct-desk .sec { margin: 0; font-size: var(--fs-2); flex: 1; }
.ct-desk .meta { margin: 0; }
.ct-desk .btn { align-self: flex-start; margin-top: var(--s2); }
.ct-cover { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1); }
.page-head .ct-ent { width: auto; min-width: 96px; min-height: var(--hit); }
.ct-detail { display: grid; gap: var(--s5); max-width: 860px; }
.ct-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ct-outcome { border-left: 3px solid var(--ok); }
.ct-act { display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; }
.ct-act .form-actions { align-self: stretch; }
.ct-hash { padding-top: 0; }
.ct-hist { list-style: none; margin: 0; padding: var(--s4) var(--s5); display: grid; gap: var(--s3); }
.ct-hist li { display: grid; gap: var(--s1); padding-left: var(--s4); border-left: 2px solid var(--border); }
.ct-hist-a { font-weight: 600; font-size: var(--fs-2); }
.ct-withdraw { justify-content: flex-start; }
@media (max-width: 1100px) { .ct-desks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .ct-desks { grid-template-columns: 1fr; } }

/* ---------- Portal motion accents (0.10.1): aura, stepping workflow, entity line, reveal. Transform/opacity only. ---------- */
.p-band { position: relative; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--border); }
.p-band .p-hero { padding-bottom: var(--s6); }
.p-aura { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.p-blob { position: absolute; border-radius: 50%; filter: blur(64px); will-change: transform; }
.p-blob-a { width: 520px; height: 520px; right: -120px; top: -180px; background: var(--accent); opacity: 0.10; animation: p-drift-a 22s var(--ease) infinite alternate; }
.p-blob-b { width: 420px; height: 420px; left: -160px; bottom: -220px; background: var(--gold); opacity: 0.16; animation: p-drift-b 26s var(--ease) infinite alternate; }
.p-grid-dots { position: absolute; inset: 0; background-image: radial-gradient(var(--border-2) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 0%, transparent 75%); mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 0%, transparent 75%); opacity: 0.7; }
[data-theme="dark"] .p-blob-a { opacity: 0.16; } [data-theme="dark"] .p-blob-b { opacity: 0.10; }
@keyframes p-drift-a { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-90px, 70px, 0) scale(1.12); } }
@keyframes p-drift-b { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(110px, -60px, 0) scale(0.92); } }

/* hero entrance */
.p-hero-copy > * { animation: p-up 520ms var(--ease) both; }
.p-hero-copy > :nth-child(2) { animation-delay: 60ms; } .p-hero-copy > :nth-child(3) { animation-delay: 120ms; }
.p-hero-copy > :nth-child(4) { animation-delay: 180ms; } .p-hero-copy > :nth-child(5) { animation-delay: 240ms; }
.p-flow { animation: p-up 640ms 160ms var(--ease) both; }
@keyframes p-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* workflow card: a ring steps through the five stages, a light runs down each connector */
.p-flow-title { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.p-live { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-meta); font-weight: 600; color: var(--ok); }
.p-live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.p-live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: p-ping 1.8s var(--ease) infinite; }
@keyframes p-ping { from { transform: scale(1); opacity: 0.6; } to { transform: scale(2.6); opacity: 0; } }
.p-flow-ic { position: relative; }
.p-flow-ic::before { content: ""; position: absolute; inset: -4px; border-radius: calc(var(--r) + 3px); border: 2px solid var(--accent); opacity: 0; transform: scale(0.85); animation: p-ring 7.5s var(--ease) infinite; }
.p-flow-list li::before { content: ""; position: absolute; left: 14px; top: 46px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); opacity: 0; animation: p-run 7.5s var(--ease) infinite; z-index: 1; }
.p-flow-list li:last-child::before { display: none; }
.p-st2 .p-flow-ic::before, .p-st2::before { animation-delay: 1.5s; } .p-st3 .p-flow-ic::before, .p-st3::before { animation-delay: 3s; }
.p-st4 .p-flow-ic::before, .p-st4::before { animation-delay: 4.5s; } .p-st5 .p-flow-ic::before { animation-delay: 6s; }
@keyframes p-ring { 0% { opacity: 0; transform: scale(0.85); } 4% { opacity: 1; transform: scale(1); } 16% { opacity: 1; transform: scale(1); } 22%, 100% { opacity: 0; transform: scale(1.08); } }
@keyframes p-run { 0%, 12% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 22% { opacity: 1; transform: translateY(16px); } 25%, 100% { opacity: 0; transform: translateY(18px); } }

/* entity line: one group, four entities, a light travelling across */
.p-chain { display: flex; align-items: center; gap: var(--s5); padding: 0 0 var(--s7); flex-wrap: wrap; }
.p-chain-label { font-size: var(--fs-2); font-weight: 600; color: var(--fg-2); }
.p-chain-line { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex: 1; min-width: 260px; max-width: 560px; justify-content: space-between; overflow: hidden; }
.p-chain-line::before { content: ""; position: absolute; left: 6px; right: 6px; top: 6px; height: 1px; background: var(--border-2); }
.p-chain-run { position: absolute; top: 5px; left: 0; width: 64px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: p-across 6s var(--ease) infinite; }
@keyframes p-across { from { transform: translateX(-64px); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } to { transform: translateX(560px); opacity: 0; } }
.p-chain-line li { position: relative; display: grid; justify-items: center; gap: var(--s2); }
.p-chain-line li:first-child { justify-items: start; } .p-chain-line li:last-child { justify-items: end; }
.p-node { width: 13px; height: 13px; border-radius: 50%; background: var(--l1); border: 2px solid var(--accent); }
.p-node-code { font-size: var(--fs-meta); font-weight: 600; letter-spacing: 0.04em; color: var(--fg); }

/* card lift */
.p-card { transition: transform 200ms var(--ease), box-shadow 200ms var(--ease); }
@media (hover: hover) { .p-card:hover { transform: translateY(-2px); box-shadow: var(--sh-3); } }

/* reveal on scroll (only when JS enabled it and motion is allowed) */
.p-anim .p-rv { opacity: 0; transform: translateY(14px); transition: opacity 480ms var(--ease), transform 480ms var(--ease); }
.p-anim .p-rv.in { opacity: 1; transform: none; }
.p-anim .p-card.p-rv.in:hover { transform: translateY(-2px); transition-delay: 0s; }
@media print { .p-anim .p-rv { opacity: 1; transform: none; } .p-aura { display: none; } }

@media (max-width: 767.98px) {
  .p-blob-a { width: 340px; height: 340px; right: -140px; top: -120px; }
  .p-blob-b { display: none; }
  .p-chain { gap: var(--s3); padding-bottom: var(--s6); }
  .p-chain-line { min-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .p-blob, .p-hero-copy > *, .p-flow, .p-live-dot::after, .p-flow-ic::before, .p-flow-list li::before, .p-chain-run { animation: none !important; }
  .p-chain-run, .p-flow-list li::before { display: none; }
  .p-card { transition: none; } .p-card:hover { transform: none; }
}
.p-band + .p-wrap > .p-section:first-child { border-top: 0; }

/* ---------- Workspaces (0.11.0): one company or the Core Team at a time ---------- */
.ws-chip { margin: var(--s3) var(--s4) 0; display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--r);
  background: var(--l1-sub); font-size: var(--fs-2); color: var(--fg); min-width: 0; }
.ws-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-chip.core { box-shadow: inset 3px 0 0 var(--gold); }
.topbar .scope select:disabled { opacity: 1; }

/* ---------- Absensi (0.12.0): employee check-in (3 Form, mobile-first) and HR board (1 List) ---------- */
.att-status { padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.att-status-top { display: flex; flex-direction: column; gap: var(--s1); }
.att-times { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin: 0; }
.att-times dt { font-size: var(--fs-2); color: var(--fg-2); }
.att-times dd { margin: 0; font-size: var(--fs-h3); font-weight: 600; }
.att-times dd.att-warn { font-size: var(--fs-2); }
.att-warn { display: flex; align-items: center; gap: var(--s1); color: var(--warn); font-size: var(--fs-2); font-weight: 600; }
.warn-text { color: var(--warn); }
.att-form { display: flex; flex-direction: column; gap: var(--s4); }
.att-modes { border: 0; margin: 0; padding: 0; min-width: 0; }
.att-modes legend { font-size: var(--fs-2); font-weight: 600; margin-bottom: var(--s2); padding: 0; }
.att-mode { flex: 1 1 140px; align-items: flex-start; padding: var(--s3); }
.att-mode > span { display: flex; flex-direction: column; gap: 2px; }
.att-label { font-size: var(--fs-2); font-weight: 600; }
.att-cam { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); }
.att-video { width: 100%; max-width: 320px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-lg); background: var(--fg); transform: scaleX(-1); }
.att-cam-done { display: flex; align-items: center; gap: var(--s3); }
.att-selfie { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-lg); border: 1px solid var(--border); }
.att-submit { min-height: 52px; font-size: var(--fs-1); width: 100%; justify-content: center; }
.att-progress:empty { display: none; }
.att-result { display: flex; flex-direction: column; gap: var(--s2); }
.att-big strong { font-size: var(--fs-h3); color: var(--warn); }
.att-slot:empty { display: none; }
.att-ln { display: flex; flex-direction: column; gap: var(--s3); }
.att-hist { display: flex; flex-direction: column; gap: var(--s3); }
.att-privacy { max-width: 65ch; }
.att-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.att-badge { margin-top: var(--s1); padding: var(--s1) var(--s2); border-left: 3px solid var(--gold); background: var(--l1-sub); font-size: var(--fs-meta); color: var(--fg-2); }
.att-acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.att-photos { display: flex; gap: var(--s3); flex-wrap: wrap; }
.att-photos figure { margin: 0; display: flex; flex-direction: column; gap: var(--s1); }
.att-photos img { width: 160px; height: 213px; object-fit: cover; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--l1-sub); }
.att-detail { display: flex; flex-direction: column; gap: var(--s4); }
.att-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--s3); }
.att-site { display: flex; flex-direction: column; gap: var(--s2); }
.att-site .mono { margin-right: var(--s2); }
.att-site-acts { justify-content: flex-start; flex-wrap: wrap; }
@media (max-width: 767.98px) {
  .att-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .att-times { grid-template-columns: 1fr 1fr; }
}

/* ---------- Social listening & Search Console (0.13.0) ---------- */
.sl-toolbar { display: flex; gap: var(--s3); flex-wrap: wrap; }
.sl-filter { min-height: var(--hit); min-width: 180px; }
.sl-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 60ch; }
.sl-preview { padding: var(--s3) var(--s4); border: 1px dashed var(--border-2); border-radius: var(--r); background: var(--l1-sub); }
.sl-analysis { display: grid; gap: var(--s2); }
.sl-row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.sl-qform { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.sl-links { display: grid; gap: var(--s3); }
.sl-link-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.sl-link-row .sl-ext { display: inline-flex; align-items: center; gap: var(--s1); min-height: var(--hit); padding: 0 var(--s4); border: 1px solid var(--border-2); border-radius: var(--r); background: var(--l1); text-decoration: none; }
.sl-ext { overflow-wrap: anywhere; }
.sl-detail { display: grid; gap: var(--s5); max-width: 980px; }
.sl-summary { margin: var(--s2) 0; font-size: var(--fs-1); line-height: 1.55; white-space: pre-wrap; }
.sl-grid { gap: var(--s4); }
.sl-crit { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
.sl-crit th, .sl-crit td { padding: var(--s2) 0; border-bottom: 1px solid var(--border); text-align: left; font-weight: 400; }
.sl-crit td { text-align: right; }
.sl-match { margin-left: var(--s2); color: var(--ok); }
@media (max-width: 767.98px) { .sl-qform { grid-template-columns: 1fr; } .sl-grid { grid-template-columns: 1fr; } }

/* ---------- World: selectable sites (0.13.0) ---------- */
.world-svg .w-site { cursor: pointer; outline: none; }
.world-svg .w-site:focus-visible image:first-of-type, .world-svg .w-site[aria-pressed="true"] image:first-of-type { filter: drop-shadow(0 0 3px var(--accent)); }
.w-info { display: grid; gap: var(--s1); margin: 0 0 var(--s3); padding: 0; list-style: none; font-size: var(--fs-2); color: var(--fg-2); }
.att-imp-acts { justify-content: flex-start; }
.att-import-out { white-space: pre-wrap; padding: var(--s3); }
.att-imp-link { margin: var(--s3) 0; }
.att-imp-h { margin: var(--s5) 0 var(--s2); }

/* ---------- Project portfolio (0.14.0) ---------- */
.pf-bar { height: 6px; border-radius: 3px; background: var(--neutral-bg); overflow: hidden; min-width: 80px; }
.pf-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.pf-cell { min-width: 120px; } .pf-cell .num { display: block; margin-bottom: var(--s1); }
.pf-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.pf-mini-top { display: flex; justify-content: space-between; gap: var(--s2); align-items: baseline; margin-bottom: var(--s1); font-size: var(--fs-2); }
.pf-big { display: grid; gap: var(--s2); max-width: 420px; } .pf-big .num { font-size: var(--fs-h1); font-weight: 600; }
.pf-big .pf-bar { height: 10px; border-radius: 5px; }
.pf-detail { display: grid; gap: var(--s5); max-width: 900px; }
.pf-items { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: var(--s2); }
.pf-items .radio { min-height: var(--hit); align-items: center; }
.pf-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--s3); }
@media (max-width: 767.98px) { .pf-add { grid-template-columns: 1fr; } }
/* ---------- Connected systems (0.14.0) ---------- */
.detail-head-flat { padding: 0; border: 0; }
.break { word-break: break-all; }
.store-sum { display: grid; gap: var(--s3); }
.store-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.hub-connected { display: grid; gap: var(--s4); }
.hub-store { display: grid; gap: var(--s3); border-top: 1px solid var(--border); padding-top: var(--s4); }
.store-sum .table-wrap table { min-width: 0; } /* two short columns fit a 375 px card */
.store-sum .table-wrap td:first-child { min-width: 0; }
.store-sum thead th { white-space: normal; }

/* ---------- 0.15.0 activity, KPI, finance, Core Team region map ---------- */
.act-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.act-feed li { display: grid; gap: 2px; padding-left: var(--s3); border-left: 2px solid var(--border-2); min-width: 0; overflow-wrap: anywhere; }
.act-feed.compact li { font-size: var(--fs-2); }
.act-detail { font-size: var(--fs-2); }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--s4); }
.kpi-card .frame-body { display: grid; gap: var(--s4); }
.kpi-row { display: grid; gap: var(--s1); font-size: var(--fs-2); }
.kpi-assign { display: grid; gap: var(--s3); }
label.kpi-assign-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); align-items: center; gap: var(--s3); margin: 0; }
@media (max-width: 700px) { label.kpi-assign-row { grid-template-columns: 1fr; gap: var(--s1); } }
.kpi-hist { margin-top: var(--s4); }
.fin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.fin-m { display: grid; gap: var(--s1); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r); min-width: 0; }
.fin-m small { color: var(--fg-2); font-size: var(--fs-meta); }
.fin-m b { font-size: var(--fs-1); overflow-wrap: anywhere; }
.fin-m.neg b, .rg-counts .neg { color: var(--bad); }
.rg-map { display: grid; grid-template-columns: 1fr 0.9fr 1fr; grid-template-areas: "PAP CORE FAN" "RAM CORE PAM"; gap: var(--s3); padding: var(--s3); background: var(--l1-sub); border: 1px solid var(--border); border-radius: var(--r-lg); }
.rg-area { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s4); min-width: 0; text-align: left; background: var(--l1); border: 1px solid var(--border-2); border-radius: var(--r-lg); color: var(--fg); font: inherit; cursor: pointer; }
.rg-area:hover { border-color: var(--accent); }
.rg-area img { align-self: center; width: 128px; height: 128px; }
.rg-area.core { justify-content: center; }
.rg-area.locked img { opacity: 0.5; }
.rg-counts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1) var(--s3); font-size: var(--fs-2); color: var(--fg-2); width: 100%; }
.rg-counts b { color: var(--fg); }
.rg-go { display: inline-flex; align-items: center; gap: var(--s1); margin-top: auto; font-size: var(--fs-2); font-weight: 600; color: var(--accent); }
.rg-extra { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: var(--s3); margin-top: var(--s3); }
@media (max-width: 700px) {
  .rg-map { grid-template-columns: 1fr 1fr; grid-template-areas: "CORE CORE" "PAP FAN" "RAM PAM"; gap: var(--s2); padding: var(--s2); }
  .rg-area { padding: var(--s3); }
  .rg-area img { width: 88px; height: 88px; }
  .rg-counts { grid-template-columns: 1fr; }
}

/* Standalone attendance site absen.pusakaecosystem.com (owner, 29 Nov 2026): no sidebar, phone-first. */
.app.absen-site { display: block; }
.as-top { padding: var(--s2) var(--s4); }
.as-brand { padding: 0; text-decoration: none; color: inherit; }
.as-page { max-width: 720px; }
@media (max-width: 480px) { .as-out { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
/* ---------- 0.16.0 project symbols, map editor, asset catalogue ---------- */
.sym-pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.sym-pick legend { font-weight: 500; font-size: var(--fs-2); margin-bottom: var(--s1); padding: 0; }
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s2); }
.sym-card { display: grid; justify-items: center; gap: var(--s1); padding: var(--s2); min-height: var(--hit); border: 1px solid var(--border-2); border-radius: var(--r); cursor: pointer; text-align: center; font-size: var(--fs-meta); color: var(--fg-2); background: var(--l1); }
.sym-card:hover { border-color: var(--accent); }
.sym-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--fg); font-weight: 600; }
.sym-card:has(input:focus-visible) { box-shadow: var(--focus); }
.sym-card img { width: 72px; height: 72px; }
.sym-dd { display: flex; align-items: center; gap: var(--s2); }
.w-edit-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.world-frame.arranging { box-shadow: inset 0 0 0 2px var(--accent); }
.world-svg.editing { touch-action: none; }
.world-svg.editing .w-site[data-site="project"] { cursor: grab; }
.w-edit-status { margin: 0; padding: var(--s3) var(--s4); border-top: 1px solid var(--border); }
.w-tray { list-style: none; margin: 0; padding: var(--s3) var(--s4); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--s2); border-top: 1px solid var(--border); }
.w-tray li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s1); min-width: 0; }
.w-tray-item { flex: 1; display: flex; align-items: center; gap: var(--s2); min-width: 0; min-height: var(--hit); padding: var(--s1) var(--s2); border: 1px dashed var(--border-input); border-radius: var(--r); background: var(--l1); color: var(--fg); font: inherit; text-align: left; cursor: grab; touch-action: none; }
.w-tray-item:hover { border-color: var(--accent); }
.w-tray-item span { display: grid; min-width: 0; font-size: var(--fs-2); }
.w-tray-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-tray-item img { width: 56px; height: 56px; flex: none; pointer-events: none; }
.cat-palette { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.cat-chip { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-meta); color: var(--fg-2); }
.cat-swatch { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--border-2); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.cat-item { margin: 0; display: grid; justify-items: center; align-content: start; gap: var(--s2); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r); background: var(--l1-sub); text-align: center; min-width: 0; }
.cat-item img { max-width: 100%; height: auto; }
.cat-item figcaption { display: grid; gap: 2px; font-size: var(--fs-2); justify-items: center; }
.cat-tag { color: var(--accent); }
.cat-item.wide { grid-column: span 2; }
.w-edit-status { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.sprite { background-repeat: no-repeat; background-position: 0 0; animation-name: sprite-run; animation-timing-function: steps(var(--n)); animation-iteration-count: infinite; max-width: 100%; }
.sprite-stack { position: relative; width: 128px; height: 160px; }
.sprite-stack .sprite { position: absolute; inset: 0; }
@keyframes sprite-run { from { background-position-x: 0; } to { background-position-x: calc(-1 * var(--fw)); } }
@media (prefers-reduced-motion: reduce) { .sprite { animation: none; } }
