/* Rekatur brand tokens, shared with rekatur.com. Change these to re-skin for a client. */
:root {
  --paper: #F6F8FB; --surface: #FBFCFD; --ink: #0B1B2B; --slate: #56677A; --line: #DCE4EE;
  --navy: #0C447C; --blue: #185FA5; --sky: #DCEAF8; --tile: #185FA5;
  --green: #1D9E75; --green-deep: #0F6E56; --on-green: #FFFFFF;
  --danger: #B42318; --danger-bg: #FEECEB; --warn-bg: #FFF6E0; --warn-ink: #7A4B00;
  --font: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --glass: rgba(251, 252, 253, .62); --glass-strong: rgba(251, 252, 253, .82); --glass-line: rgba(255, 255, 255, .7); --sea-a: rgba(24, 95, 165, .26); --sea-b: rgba(29, 158, 117, .24); --sea-c: rgba(181, 212, 244, .55);
  --r: 14px; --gutter: clamp(16px, 5vw, 48px); --max: 1080px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #071A2E; --surface: #0B2440; --ink: #EAF2FB; --slate: #9DB2C8; --line: #1C3A5C;
    --navy: #FFFFFF; --blue: #B5D4F4; --sky: #12355A; --tile: #B5D4F4;
    --green: #5DCAA5; --green-deep: #9FE1CB; --on-green: #062A20;
    --danger: #FF9C94; --danger-bg: #3A1512; --warn-bg: #3A2A08; --warn-ink: #FFD98A;
    --glass: rgba(11, 36, 64, .55); --glass-strong: rgba(11, 36, 64, .84); --glass-line: rgba(181, 212, 244, .16); --sea-a: rgba(24, 95, 165, .38); --sea-b: rgba(29, 158, 117, .20); --sea-c: rgba(18, 53, 90, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #071A2E; --surface: #0B2440; --ink: #EAF2FB; --slate: #9DB2C8; --line: #1C3A5C;
  --navy: #FFFFFF; --blue: #B5D4F4; --sky: #12355A; --tile: #B5D4F4;
  --green: #5DCAA5; --green-deep: #9FE1CB; --on-green: #062A20;
  --danger: #FF9C94; --danger-bg: #3A1512; --warn-bg: #3A2A08; --warn-ink: #FFD98A;
  --glass: rgba(11, 36, 64, .55); --glass-strong: rgba(11, 36, 64, .84); --glass-line: rgba(181, 212, 244, .16); --sea-a: rgba(24, 95, 165, .38); --sea-b: rgba(29, 158, 117, .20); --sea-c: rgba(18, 53, 90, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); }
h1, h2, h3 { color: var(--navy); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--slate); }
.small { font-size: .875rem; }
pre { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; margin: 0; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { max-width: var(--max); margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 800; letter-spacing: -0.01em; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a, .nav button { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 8px; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button:hover { background: var(--sky); }
.nav a[aria-current="page"] { color: var(--blue); font-weight: 700; }
.nav .btn { color: var(--on-green); }
.nav .btn:hover { background: var(--green-deep); }
.top .menu-btn { display: none; margin-left: auto; }
@media (max-width: 720px) {
  .top .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px var(--gutter) 16px; }
  .nav.open { display: flex; }
}

/* layout */
main { flex: 1; }
.page { max-width: var(--max); margin: 0 auto; padding: 40px var(--gutter) 64px; }
.narrow { max-width: 460px; }
.mid { max-width: 760px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
footer { border-top: 1px solid var(--line); color: var(--slate); font-size: .875rem; }
footer .page { padding-top: 24px; padding-bottom: 28px; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.card + .card { margin-top: 16px; }
.grid > .card, .split > .card { margin-top: 0; }
.hero { padding: 64px 0 24px; }
.hero p { font-size: 1.15rem; color: var(--slate); max-width: 40em; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--sky); color: var(--blue); letter-spacing: .02em; }
.badge.green { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green-deep); }
.badge.grey { background: var(--line); color: var(--slate); }
.badge.red { background: var(--danger-bg); color: var(--danger); }
.notice { padding: 12px 16px; border-radius: var(--r); background: var(--sky); color: var(--ink); margin-bottom: 16px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice.ok { background: color-mix(in srgb, var(--green) 16%, var(--surface)); }
.notice.err { background: var(--danger-bg); color: var(--danger); }

/* forms */
label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.hint { font-size: .82rem; color: var(--slate); margin-top: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 8px; border: 1px solid transparent; background: var(--green); color: var(--on-green); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--green-deep); }
.btn.secondary { background: transparent; color: var(--blue); border-color: var(--line); }
.btn.secondary:hover { background: var(--sky); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.block { width: 100%; margin-top: 20px; }
.form-error { color: var(--danger); font-size: .9rem; margin-top: 12px; min-height: 1.2em; }

/* pricing */
.plan { display: flex; flex-direction: column; }
.plan .price { font-size: 2rem; font-weight: 800; color: var(--navy); margin: 6px 0 2px; }
.plan .price small { font-size: .9rem; font-weight: 500; color: var(--slate); }
.plan ul { padding-left: 18px; margin: 12px 0 20px; flex: 1; }
.plan.current { border-color: var(--green); outline: 2px solid color-mix(in srgb, var(--green) 30%, transparent); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--slate); font-weight: 700; }
td select { width: auto; padding: 4px 8px; }

/* faq */
details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 650; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details summary::after { content: "+"; color: var(--blue); font-weight: 800; }
details[open] summary::after { content: "\2212"; }
details p { margin: 10px 0 0; color: var(--slate); }
.faq-cat { margin-top: 28px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--slate); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
/* More tabs than fit on a phone: the last edge fades, so it reads as "scroll for more". */
@media (max-width: 640px) { .tabs { mask-image: linear-gradient(to right, #000 85%, transparent); -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); padding-right: 24px; } }
.tabs button { font: inherit; background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--slate); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }
.stat { font-size: 1.8rem; font-weight: 800; color: var(--navy); }

.lock { opacity: .6; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 8px; font-size: .9rem; z-index: 50; }
[hidden] { display: none !important; }

/* added with the template extras */
.nav select { width: auto; max-width: 220px; padding: 6px 28px 6px 10px; font-size: .9rem; margin: 0; }
.nav .lang { font-weight: 700; font-size: .8rem; letter-spacing: .04em; border: 1px solid var(--line); padding: 6px 10px; }
.row.end { justify-content: flex-end; }
.consent { background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid var(--line); }
.consent .page { padding-top: 10px; padding-bottom: 10px; }
.dialog { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); padding: 22px; max-width: 420px; width: calc(100% - 32px); }
.dialog::backdrop { background: rgba(7, 26, 46, .45); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: .92rem; margin-top: 14px; }
.check input { width: auto; margin-top: 4px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--slate); font-size: .85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.btn.google { background: var(--surface); color: var(--ink); border-color: var(--line); width: 100%; }
.btn.google:hover { background: var(--sky); }
.btn.google svg { width: 18px; height: 18px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; font: 15px/1.6 ui-monospace, Menlo, monospace; padding: 14px; background: var(--paper); border-radius: 8px; border: 1px dashed var(--line); }
.qr { background: #fff; /* design-lint: allow (QR scanners need a white background) */ padding: 8px; border-radius: 8px; border: 1px solid var(--line); width: 160px; height: 160px; }
.thread { display: grid; gap: 12px; }
.msg { padding: 14px 16px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); max-width: 680px; }
.msg.staff { background: var(--sky); margin-left: auto; }
.msg .who { font-size: .8rem; color: var(--slate); margin-bottom: 4px; }
.msg p { white-space: pre-wrap; margin: 0; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; font-variant-numeric: tabular-nums; max-width: 320px; margin-top: 12px; }
.totals .grand { font-weight: 800; color: var(--navy); }
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split > * { min-width: 0; }
@media (max-width: 760px) { .split { grid-template-columns: minmax(0, 1fr); } }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--slate); font: 11px var(--font); }
.chart .bar { fill: var(--blue); }
.chart .bar.now { fill: var(--green); }
.chart .grid { stroke: var(--line); }
.prose { max-width: 68ch; }
.prose h2 { margin-top: 32px; }
.prose li + li { margin-top: 6px; }
td .btn + .btn { margin-left: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Alerts bell and feed */
.top-in { position: relative; }
.bell { position: relative; margin-left: auto; background: none; border: 0; color: var(--ink); padding: 8px; border-radius: 8px; cursor: pointer; display: inline-flex; }
.bell:hover { background: var(--sky); }
.bell + .menu-btn, .bell ~ .nav { margin-left: 0; }
.bell .dot { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.feed { position: absolute; right: var(--gutter); top: calc(100% + 4px); width: min(360px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); z-index: 30; }
.feed article { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.feed article:last-child { border-bottom: 0; }
.feed article.new { background: color-mix(in srgb, var(--sky) 55%, var(--surface)); }
.feed h4 { margin: 0 0 4px; font-size: .95rem; }
.feed p { margin: 0 0 4px; font-size: .9rem; }

/* Notices, manual, join code */
.notice-item { border-top: 1px solid var(--line); padding: 14px 0; }
.notice-item:first-of-type { border-top: 0; padding-top: 0; }
.notice-item h3 { margin-bottom: 4px; }
.notice-item p { white-space: pre-wrap; }
.code-big { font: 800 1.8rem/1.2 ui-monospace, Menlo, monospace; letter-spacing: .12em; color: var(--navy); margin: 4px 0 8px; word-break: break-all; }
.guide { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: 10px; }
.guide summary { padding: 14px 16px; cursor: pointer; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; list-style: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: "+"; margin-left: auto; color: var(--slate); font-weight: 400; font-size: 1.2rem; }
.guide[open] summary::after { content: "–"; }
.guide .steps { padding: 0 16px 14px; }
.guide ol, .guide ul { margin: 0 0 10px; padding-left: 22px; }
.guide li { margin-bottom: 4px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 16px; }
.chips button { font: inherit; font-size: .875rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 6px 12px; border-radius: 99px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--surface); font-weight: 700; }
.biz-hero { background: var(--navy); color: #fff; padding: 40px 0; margin-bottom: 32px; }
.biz-hero h1 { color: #fff; }
.biz-hero p { color: color-mix(in srgb, #fff 82%, transparent); max-width: 60ch; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .biz-hero { background: var(--sky); } }
:root[data-theme="dark"] .biz-hero { background: var(--sky); }
.biz-hero .btn.secondary { background: transparent; color: #fff; border-color: color-mix(in srgb, #fff 60%, transparent); }
.biz-hero .btn.secondary:hover { background: color-mix(in srgb, #fff 12%, transparent); }
.guide .steps p { color: var(--ink); }

/* Footer: who runs the site and how to reach them */
.foot-grid { display: grid; gap: 16px 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.foot-grid strong { color: var(--ink); }
.foot-grid nav { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }

/* Loading: a bar while requests run, skeletons until a page fills in, a spinner on busy buttons */
html.is-loading::before { content: ""; position: fixed; top: 0; left: 0; height: 3px; width: 40%; background: var(--green); z-index: 100; animation: loadbar 1.1s ease-in-out infinite; }
@keyframes loadbar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.loading:empty { min-height: 96px; border-radius: var(--r); background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 40%, var(--surface)) 50%, var(--line) 75%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; opacity: .6; }
.grid.loading:empty { min-height: 260px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--on-green); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.secondary.busy::after { border-color: var(--blue); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { html.is-loading::before, .loading:empty, .btn.busy::after { animation-duration: 3s; } }

/* Form errors next to the field they belong to */
[aria-invalid="true"] { border-color: var(--danger); outline: 1px solid var(--danger); }
.check input[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.field-error { color: var(--danger); font-size: .85rem; font-weight: 600; margin: 6px 0 0; }
.field-error::before { content: "! "; }

/* Cookie banner */
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 640px; margin: 0 auto; z-index: 60; background: var(--surface); color: var(--ink); border: 1px solid var(--slate); border-radius: var(--r); padding: 16px 18px; display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; }
.cookie-bar p { margin: 0; flex: 1 1 280px; font-size: .92rem; }

/* Sticky call to action on phones */
.sticky-cta { display: none; }
@media (max-width: 720px) {
  .sticky-cta { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--slate); transform: translateY(110%); transition: transform .2s ease; }
  .sticky-cta.show { transform: none; }
  .sticky-cta .btn { flex: 1; }
  body.has-cta { padding-bottom: 72px; }
  .hero { padding-top: 32px; }
}

/* 404 and thank-you pages */
.center-page { text-align: center; }
.center-page .left { text-align: left; margin-top: 24px; }
.row.center { justify-content: center; }
.big-code { font-size: 5rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: color-mix(in srgb, var(--blue) 30%, var(--paper)); margin: 0 0 8px; }
.tick { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--green) 18%, var(--surface)); color: var(--green-deep); }
.h3 { font-size: 1.05rem; }
.next { margin: 0; padding-left: 22px; }
.next li + li { margin-top: 8px; }

/* Kemudi: "by Rekatur" beside the name */
.brand small { font-weight: 500; font-size: .7rem; color: var(--slate); letter-spacing: .02em; align-self: flex-end; margin: 0 0 2px -4px; }

/* CRM */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 16px 0 24px; }
.stat-grid .card { padding: 16px; margin-top: 0; min-width: 0; }
/* Long amounts such as RM16,500.50 must fit a half-width card on a phone. */
.stat-grid .stat { font-size: clamp(1.1rem, 5vw, 1.5rem); overflow-wrap: anywhere; }
.todo { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.todo input[type="checkbox"] { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.todo .grow { flex: 1; min-width: 0; }
.todo.done .grow { color: var(--slate); text-decoration: line-through; }
.board { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start; }
.board .card { padding: 16px; margin-top: 0; }
.deal { padding: 12px 0; border-top: 1px solid var(--line); }
.deal select { margin-top: 8px; padding: 6px 10px; font-size: .875rem; }
.deal-list .deal { border-top: 0; border-bottom: 1px solid var(--line); }
.deal-list .deal:first-child { padding-top: 0; }
.inline-form { display: grid; gap: 8px 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; margin-top: 12px; }
.inline-form label { margin: 0 0 4px; }
.inline-form .wide { grid-column: 1 / -1; }
.inline-form .form-error { grid-column: 1 / -1; margin: 0; min-height: 0; }
a.rowlink { color: inherit; text-decoration: none; font-weight: 700; }
a.rowlink:hover { color: var(--blue); }
.dialog.wide { max-width: 520px; }
.dialog h3 { margin-top: 0; }
.timeline textarea { min-height: 80px; }

/* Finance */
.narrow-wide { max-width: 860px; }
td.num, th.num { text-align: right; white-space: nowrap; }
#lines input { margin: 0; }
#totals div { display: flex; justify-content: flex-end; gap: 24px; padding: 2px 0; }
#totals div span:last-child { min-width: 120px; }
#totals .grand { font-weight: 800; font-size: 1.15rem; color: var(--navy); }
.docview-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 640px) { .docview-head > div:last-child { text-align: left !important; } .docview-head > div:last-child * { text-align: left !important; } }
.show-sm { display: none; }
/* Finance on a phone: each line becomes a small card (description on top; quantity, price, amount beneath),
   and the customer's view drops the unit-price column so the amounts stay readable. */
@media (max-width: 640px) {
  #lines thead { display: none; }
  #lines tbody tr { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  #lines tbody td { padding: 0; border: 0; }
  #lines tbody td:first-child { grid-column: 1 / -1; }
  #lines tbody td[data-amount] { align-self: end; padding-bottom: 10px; }
  #lines tbody td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--slate); margin-bottom: 2px; }
  #lines tbody tr { grid-template-columns: 1fr 1.3fr auto auto; }
  .hide-sm { display: none; }
  .show-sm { display: inline !important; }
}

/* Plan usage on Billing: people and AI credits against the plan's limits */
.usage { display: grid; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.meter-row { display: grid; gap: 6px; }
.meter { height: 8px; border-radius: 4px; background: var(--sky); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--green); border-radius: 4px; }

/* Get started checklist on the home page */
.setup-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.setup-list li { display: flex; gap: 10px; align-items: flex-start; }
.setup-list .step-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.setup-list li.done .step-dot { background: var(--green); border-color: var(--green); color: var(--on-green); }
.setup-list li.done a { color: var(--slate); text-decoration: line-through; }

/* A shop's own pages: its name in the header, a one-line footer. */
.shop-brand { font-weight: 800; font-size: 1.1rem; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 75vw; }
.foot-shop { padding: 20px 0; color: var(--slate); text-align: center; }
.foot-shop .linkish { font-size: inherit; }

.danger-text { color: var(--danger); }

/* Wide tables on a phone (App.cards): one card per row, each value with its column's name. */
@media (max-width: 640px) {
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.cards td { border: 0; padding: 3px 0; text-align: left; }
  table.cards td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--slate); }
  table.cards td:first-child { font-weight: 600; }
  table.cards td.num { text-align: left; }
  table.cards .hide-sm { display: block; }
}

/* Review of 13 Nov 2026: a quieter footer inside the app, dates in words, quick day chips, the Today strip, joy. */
.foot-app { padding: 18px 0; color: var(--slate); text-align: center; }
.foot-app .linkish { font-size: inherit; }
.date-say { display: block; margin-top: 4px; min-height: 1.2em; }
.quick-days { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { font: inherit; font-size: .875rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 12px; min-height: 40px; border-radius: 99px; cursor: pointer; }
.chip:hover { border-color: var(--blue); }
.today { display: grid; gap: 10px; margin: 12px 0 0; }
.today a.today-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: inherit; text-decoration: none; }
.today a.today-row.hot { border-color: var(--danger); }
.today .today-n { font-size: 1.35rem; font-weight: 800; min-width: 2.2em; color: var(--navy); }
.today .today-row.hot .today-n { color: var(--danger); }
.today .grow { flex: 1; min-width: 0; }
.more-cards > summary { cursor: pointer; font-weight: 700; padding: 12px 0; color: var(--blue); }
.fold > summary { cursor: pointer; font-weight: 600; color: var(--blue); padding: 8px 0; list-style-position: inside; }
.fold[open] > summary { margin-bottom: 8px; }
.what-happened { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; max-width: 520px; margin: 0 auto; background: var(--surface); border: 2px solid var(--green); border-radius: 16px; padding: 14px 16px; }
.what-happened .row { margin-top: 10px; }
.mic { min-width: 44px; }
.mic.on { background: var(--green); color: var(--on-green); border-color: var(--green); }
.pay-qr { display: block; width: min(240px, 70%); height: auto; margin: 12px auto 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.joy { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.joy i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; opacity: 0; animation: joy-fall 1.5s ease-in forwards; }
@keyframes joy-fall { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), 92vh) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) { .joy { display: none; } }

/* Command (home): one bento grid. Phone: one column, Today first. Tablet: two columns. Computer: four, with the wide
   cards (b-w2) across two. The page is wider than the others so the grid has room. */
.page.command { max-width: 1280px; }
.bento { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin: 16px 0 24px; }
.bento > * { min-width: 0; margin: 0; }
.bento > .card + .card { margin-top: 0; }
.bento .card h3 { margin-bottom: .6em; }
@media (min-width: 760px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bento > .b-w2 { grid-column: span 2; } }
@media (min-width: 1100px) { .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row dense; } .bento > .b-r2 { grid-row: span 2; } }
.wide .top-in, .wide footer .page { max-width: 1280px; }
.b-label { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 18px 0 8px; }
/* Today: the one dark card. Navy turns light in dark mode, and the text follows, so it reads either way. */
.b-hero { background: var(--navy); border-color: var(--navy); color: var(--paper); }
.b-hero h2, .b-hero .b-label { color: var(--paper); margin: 0; }
.b-hero .b-label { margin: 18px 0 8px; opacity: .85; }
.b-hero .today a.today-row { background: color-mix(in srgb, var(--paper) 9%, transparent); border-color: color-mix(in srgb, var(--paper) 22%, transparent); }
.b-hero .today a.today-row:hover { background: color-mix(in srgb, var(--paper) 15%, transparent); }
.b-hero .today .today-n { color: var(--paper); }
.b-hero .today a.today-row.hot { border-color: var(--hot); }
.b-hero .today .today-row.hot .today-n { color: var(--hot); }
.b-hero .muted { color: color-mix(in srgb, var(--paper) 78%, transparent); }
:root { --hot: #FFB4AB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hot: #B42318; } }
:root[data-theme="dark"] { --hot: #B42318; }
.next-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.next-steps li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--paper) 9%, transparent); }
.next-steps .grow { flex: 1; min-width: 0; }
.next-steps .btn { flex: none; background: var(--paper); color: var(--navy); border-color: var(--paper); }
.b-hero a { color: inherit; }
/* Numbers row: 2 by 2 beside Today on a computer. */
.bento > .stat-grid { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: stretch; }
.bento > .stat-grid .card { display: flex; flex-direction: column; justify-content: center; }
/* Money */
.money-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--paper); color: inherit; text-decoration: none; margin: 0 0 8px; }
a.li:hover { background: var(--sky); }
.li .grow { flex: 1; min-width: 0; }
.chart.cash { margin-top: 6px; }
.chart.cash polyline { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart.cash .in { stroke: var(--blue); }
.chart.cash .out { stroke: #D9822B; stroke-width: 2; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.key.in { background: var(--blue); } .key.out { background: #D9822B; }
.pos { color: var(--green-deep); } .neg { color: var(--danger); }
/* Deal pipeline */
.pipe { display: flex; gap: 3px; height: 12px; border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.pipe-rows { display: grid; gap: 8px; }
.p0 { background: var(--sky); } .p1 { background: color-mix(in srgb, var(--blue) 55%, var(--sky)); } .p2 { background: var(--blue); } .p3 { background: var(--green); }
/* Leads by day */
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 110px; align-items: end; }
.bars > div { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 4px; }
.bars span { display: block; border-radius: 6px; background: var(--sky); }
.bars span.best { background: var(--blue); }
.bars small { text-align: center; color: var(--slate); font-size: .7rem; }
/* Who is away: a week of days to tap */
.week { display: flex; gap: 2px; margin-bottom: 10px; }
.week .day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.week .day:hover { background: var(--sky); }
.week .day.sel { background: var(--blue); color: var(--paper); }
.week .dn { font-size: .7rem; font-weight: 600; } .week .dd { font-weight: 800; }
.week .dot { width: 6px; height: 6px; border-radius: 3px; background: #D9822B; }
.week .dot.off { background: transparent; }
#away-day { font-size: .9rem; }
/* Hire stages */
.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini { display: flex; flex-direction: column; padding: 10px; border-radius: 12px; background: var(--paper); }
.mini .stat { font-size: 1.4rem; }
.mini.hot { background: var(--warn-bg); color: var(--warn-ink); }
.meter.thin { height: 6px; margin: 6px 0 2px; }
/* On a phone a long amount (RM 12,840.00) would squeeze the words beside it into a narrow column. */
@media (max-width: 520px) { .today .today-n { font-size: 1.1rem; min-width: 2em; flex: none; } .today a.today-row { gap: 10px; padding: 12px 14px; } }

/* Glass (14 Nov 2026): surfaces are see-through panes over a calm sea of colour. No drop shadows: a pane is set apart by
   its blur, a light edge and the tone behind it. Where a browser cannot blur, panes fall back to the nearly solid tone. */
html { background: var(--paper); }
body { background: transparent; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60vmax 45vmax at 88% -8%, var(--sea-b), transparent 62%), radial-gradient(55vmax 50vmax at -10% 22%, var(--sea-a), transparent 60%), radial-gradient(70vmax 50vmax at 60% 108%, var(--sea-c), transparent 65%), var(--paper); }
.card, .top, .dialog, .cookie-bar, .sticky-cta, .nav { background: var(--glass-strong); }
.card, .dialog, .cookie-bar { border-color: var(--glass-line); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .dialog { background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
  .top, .cookie-bar, .sticky-cta { background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); }
  @media (max-width: 720px) { .nav { background: var(--glass-strong); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); } }
}
.top { border-bottom-color: var(--glass-line); }
.card .card, .card .li, .card .mini { -webkit-backdrop-filter: none; backdrop-filter: none; }
.card .li, .card .mini, .today a.today-row { background: color-mix(in srgb, var(--surface) 55%, transparent); }
input, select, textarea { background: color-mix(in srgb, var(--surface) 70%, transparent); border-color: color-mix(in srgb, var(--slate) 35%, transparent); border-radius: 10px; }
input:focus, select:focus, textarea:focus { background: var(--surface); }
.btn { border-radius: 999px; }
.btn.secondary { background: color-mix(in srgb, var(--surface) 50%, transparent); border-color: color-mix(in srgb, var(--slate) 30%, transparent); }
.badge { background: color-mix(in srgb, var(--sky) 75%, transparent); }
.dialog::backdrop { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
/* Today stays the one deep pane: sea-blue glass instead of a flat block. */
.b-hero { background: linear-gradient(140deg, color-mix(in srgb, var(--navy) 92%, transparent), color-mix(in srgb, var(--blue) 80%, var(--green) 20%)); border-color: color-mix(in srgb, var(--paper) 25%, transparent); }
.brand svg { width: 30px; height: 30px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); letter-spacing: -0.03em; max-width: 14em; }
@media print { body::before { display: none; } .card { background: none; border-color: var(--line); } }
.brand { white-space: nowrap; }
@media (min-width: 721px) { .nav { flex-wrap: nowrap; gap: 0; } .nav a, .nav button { padding: 8px 9px; font-size: .9rem; white-space: nowrap; } }
@media (min-width: 721px) and (max-width: 1180px) { .nav { flex-wrap: wrap; } }
@media (min-width: 721px) { .nav { background: none; } }

/* Side bar (14 Nov 2026): signed-in staff get the menu down the left on a computer, in groups (Work, Company, You).
   Below 960px the same menu opens from the Menu button, so a phone keeps its full width. */
.nav-group { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); padding: 14px 12px 4px; }
@media (max-width: 959px) {
  .has-side .top .menu-btn { display: inline-flex; }
  .has-side .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding: 4px var(--gutter) 16px; border-bottom: 1px solid var(--glass-line); background: var(--glass-strong); max-height: calc(100vh - 64px); overflow-y: auto; }
  .has-side .nav.open { display: flex; }
  .has-side .nav a, .has-side .nav button { padding: 10px 12px; font-size: .95rem; text-align: left; }
}
@media (min-width: 960px) {
  body.has-side { padding-left: 236px; }
  .has-side .top { position: fixed; inset: 0 auto 0 0; width: 236px; border-bottom: 0; border-right: 1px solid var(--glass-line); overflow-y: auto; }
  .has-side .top-in, .wide.has-side .top-in { max-width: none; min-height: 100%; flex-direction: column; align-items: stretch; gap: 4px; padding: 20px 12px 16px; }
  .has-side .brand { padding: 0 12px 10px; flex-wrap: wrap; white-space: normal; gap: 4px 10px; }
  .has-side .bell { position: absolute; top: 16px; right: 12px; margin: 0; }
  .has-side .nav { flex: 1; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 2px; margin: 0; background: none; }
  .has-side .nav a, .has-side .nav button { display: block; text-align: left; padding: 9px 12px; font-size: .95rem; border-radius: 10px; }
  .has-side .nav a[aria-current="page"] { background: color-mix(in srgb, var(--sky) 80%, transparent); }
  .has-side .nav select { margin: 0 0 4px; }
  .has-side .nav .lang { align-self: flex-start; margin: 8px 12px 0; padding: 6px 12px; }
  .has-side .feed { position: fixed; left: 244px; top: 16px; right: auto; }
  .has-side .page.command { max-width: 1320px; }
}
@media print { body.has-side { padding-left: 0; } .has-side .top { display: none; } }
/* The opened phone menu is solid: a pane inside the blurred header cannot blur again, and words behind it would show through. */
@media (max-width: 959px) { .has-side .nav { background: var(--surface); } }
@media (max-width: 720px) { .nav { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* Clean look (14 Nov 2026): one deep colour (navy) doing the work the eye follows, a serif for the big headings, numbered
   steps, pill buttons, and a tab bar at the bottom of a phone. Green stays for "done", "paid" and the logo's small sail. */
:root { --display: "Playfair Display", Georgia, "Times New Roman", serif; --deep: #0C447C; --on-deep: #F6F8FB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --deep: #B5D4F4; --on-deep: #071A2E; } }
:root[data-theme="dark"] { --deep: #B5D4F4; --on-deep: #071A2E; }
h1, .b-hero h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.card { border-radius: 20px; }
.btn { background: var(--deep); color: var(--on-deep); padding: 11px 22px; }
.btn:hover { background: color-mix(in srgb, var(--deep) 86%, var(--ink)); }
.nav .btn { color: var(--on-deep); } .nav .btn:hover { background: color-mix(in srgb, var(--deep) 86%, var(--ink)); }
.btn.secondary { color: var(--deep); } .btn.danger { background: transparent; }
.btn.busy::after { border-color: var(--on-deep); border-right-color: transparent; }
.tabs { border-bottom: 0; gap: 6px; }
.tabs button { border: 0; border-radius: 999px; padding: 8px 16px; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-bottom-color: transparent; }
/* The landing page opens on a deep pane, like a cover: serif headline, light pill button. */
.hero { margin-top: 8px; padding: clamp(32px, 7vw, 72px) clamp(22px, 5vw, 56px); border-radius: 28px; color: var(--on-deep);
  background: radial-gradient(70% 90% at 100% 100%, color-mix(in srgb, var(--blue) 70%, var(--green) 30%), transparent 70%), var(--deep); }
.hero h1 { color: var(--on-deep); font-size: clamp(2.3rem, 7vw, 3.8rem); font-weight: 500; line-height: 1.08; max-width: 12em; }
.hero p { color: color-mix(in srgb, var(--on-deep) 85%, transparent); }
.hero .badge { background: color-mix(in srgb, var(--on-deep) 16%, transparent); color: var(--on-deep); }
.hero .btn { background: var(--on-deep); color: var(--deep); }
.hero .btn.secondary { background: transparent; color: var(--on-deep); border-color: color-mix(in srgb, var(--on-deep) 45%, transparent); }
/* Numbered steps: a round chip before each line of "Start here". */
.next-steps { counter-reset: step; }
.next-steps li::before { counter-increment: step; content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: color-mix(in srgb, var(--paper) 16%, transparent); }
.stat { font-family: var(--display); font-weight: 600; }
/* Tab bar: phones only, staff only. The page leaves room for it. */
.tabbar { display: none; }
@media (max-width: 720px) {
  .tabbar { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 35; justify-content: space-around; padding: 6px; border-radius: 22px; border: 1px solid var(--glass-line); background: var(--glass-strong); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center; font: inherit; font-size: .7rem; font-weight: 600; color: var(--slate); text-decoration: none; background: none; border: 0; border-radius: 16px; cursor: pointer; }
  .tabbar a[aria-current="page"] { color: var(--deep); background: color-mix(in srgb, var(--sky) 70%, transparent); }
  body.has-side { padding-bottom: 84px; }
  .has-side .top .menu-btn { display: none; }
}
@media print { .tabbar { display: none; } }
.nav a.btn { background: var(--deep); color: var(--on-deep); padding: 8px 16px; }
@media (max-width: 720px) { .next-steps li { flex-wrap: wrap; } .next-steps li::before { width: 26px; height: 26px; } .next-steps .grow { flex-basis: 60%; } }

/* Compact and calm (14 Nov 2026): a box is as tall as what is in it, never stretched to match its neighbour, with less
   padding and less chrome, so a computer shows more boxes on one screen and a phone scrolls less. */
.page { padding-top: 24px; padding-bottom: 48px; }
.card { padding: 16px 18px; border-radius: 16px; }
.card h3 { font-size: 1rem; }
.grid { align-items: start; gap: 12px; }
#plans.grid { align-items: stretch; }
.stat { font-size: 1.45rem; line-height: 1.2; }
.command h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 0; }
.command > .row.spread { margin-bottom: 4px; }
.bento { gap: 12px; margin: 12px 0 20px; }
.bento > .stat-grid { gap: 12px; }
.bento > .stat-grid .card { padding: 12px 16px; }
.b-hero { padding: 16px; }
.today { gap: 8px; margin-top: 8px; }
.today a.today-row { padding: 10px 14px; }
.next-steps li { padding: 8px 10px; }
.b-label { margin: 14px 0 6px; }
#ask > p.small { display: none; }
#ask .row#ask-ideas { margin-top: 8px; }
.li { padding: 8px 12px; margin-bottom: 6px; }
.bars { height: 84px; }
.more-cards { margin-top: 0; }
/* Tablet and computer: each box keeps its own height and the next one tucks in under it. The page script measures the
   boxes (pack() in pages/dashboard.js) and the grid places them on 4px rows; without the script they simply line up. */
@media (min-width: 760px) {
  .bento.packed { grid-auto-rows: 4px; row-gap: 0; align-items: start; grid-auto-flow: row dense; }
  .bento.packed > .b-r2 { grid-row: auto; }
}
@media (min-width: 1700px) { .has-side .page.command { max-width: 1680px; } .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 759px) {
  .card { padding: 14px; }
  .bento > .stat-grid .card { padding: 10px 12px; }
  .bento > .stat-grid .small { font-size: .78rem; }
}
.form-error:empty { min-height: 0; margin: 0; }
.card > :last-child, .card form > :last-child { margin-bottom: 0; }
#ask-form, #say-form { margin-bottom: 0; }

/* Review fixes (14 Nov 2026): numbers in the text face (easier to read than the serif), boxes a person switched off. */
.stat { font-family: var(--font); font-weight: 800; }
.user-hide { display: none !important; }
#pb-list .check { display: flex; gap: 10px; align-items: center; font-weight: 500; margin: 10px 0; }
#pb-list input { width: auto; }
/* Printing a payslip or a statement: only the open dialog goes on paper. */
.strong { font-weight: 700; }
@media print {
  body:has(dialog[open]) main > :not(dialog), body:has(dialog[open]) footer, body:has(dialog[open]) .page > :not(dialog), dialog[open] form[method="dialog"] { display: none !important; }
  dialog[open] { position: static; border: 0; max-width: none; width: auto; background: none; }
}

/* Calendar: a month of days on the left, the chosen day in full on the right. On a phone a day shows dots, and the
   chosen day's list sits under the month. Each kind keeps one colour everywhere: chip, dot, row edge and key. */
.cal-wrap { display: grid; gap: 14px; grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr); align-items: start; }
.cal-card, .cal-side { margin-top: 0; }
.cal-head h2 { margin: 0; font-family: var(--display); font-weight: 600; }
.cal-nav { gap: 6px; flex-wrap: nowrap; }
.cal-days, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-days { margin-top: 12px; font-size: .75rem; font-weight: 700; color: var(--slate); text-transform: uppercase; letter-spacing: .04em; }
.cal-days span { padding: 0 6px 4px; }
.cal-grid.loading { min-height: 320px; }
.cal-cell { font: inherit; color: inherit; text-align: left; display: flex; flex-direction: column; gap: 3px; min-height: 86px; min-width: 0; padding: 6px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--slate) 16%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--surface) 45%, transparent); }
.cal-cell:hover { border-color: var(--blue); }
.cal-cell.out { opacity: .45; }
.cal-cell.holiday { background: color-mix(in srgb, var(--danger-bg) 55%, transparent); }
.cal-cell.on { border-color: var(--ink); border-width: 2px; padding: 5px; }
.cal-num { font-size: .8rem; font-weight: 700; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.now .cal-num { background: var(--ink); color: var(--paper); }
.cal-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-chip { display: block; font-size: .7rem; line-height: 1.35; padding: 1px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--k, var(--slate)) 16%, transparent); border-left: 3px solid var(--k, var(--slate)); }
.cal-chip.done { opacity: .55; text-decoration: line-through; }
.cal-chip.away, .cal-chip.hol { border-left: 0; color: var(--slate); background: none; padding-left: 0; }
.cal-chip.hol { color: var(--danger); font-weight: 600; }
.cal-more { font-size: .7rem; color: var(--slate); padding-left: 6px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dots i, .cal-key i { width: 7px; height: 7px; border-radius: 50%; background: var(--k, var(--slate)); display: inline-block; }
.k-meeting { --k: var(--blue); } .k-visit { --k: var(--green); } .k-delivery { --k: #C98A0B; } .k-other { --k: var(--slate); }
.fu { --k: #8E5BB5; } .away { --k: var(--slate); } .hol { --k: var(--danger); }
.cal-keys { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 12px 0 0; }
.cal-key i { margin-right: 6px; }
.cal-side h3 { margin-bottom: 10px; }
.cal-next-title { margin-top: 20px; }
.cal-row { font: inherit; color: inherit; text-align: left; text-decoration: none; width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 9px 12px; margin-bottom: 6px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--slate) 16%, transparent); border-left: 3px solid var(--k, var(--slate)); border-radius: 10px; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.cal-row:hover { border-color: var(--k, var(--blue)); }
.cal-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cal-row.done strong { text-decoration: line-through; color: var(--slate); }
.cal-when { flex: 0 0 76px; font-size: .8rem; font-weight: 700; color: var(--slate); padding-top: 2px; }
.cal-note { font-size: .9rem; margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--k, var(--slate)) 10%, transparent); }
.cal-date { margin: 10px 0 4px; }
#day-add { margin-top: 4px; }
@media (max-width: 960px) { .cal-wrap { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .cal-cell { min-height: 50px; align-items: center; padding: 4px 2px; gap: 2px; }
  .cal-cell.on { padding: 3px 1px; }
  .cal-chips { display: none; } .cal-dots { display: flex; justify-content: center; }
  .cal-days span { text-align: center; padding: 0 0 4px; }
  .cal-days, .cal-grid { gap: 3px; }
}
.cal-wrap > .card { margin-top: 0; }
#ev-form .inline-form { align-items: start; }
#ev-form .row.spread > .row { margin-left: auto; }
