/* Karyam.AI design system. Tokens first; dark mode follows the OS. */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e3e6ef;
  --text: #171a26;
  --muted: #5d6478;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --ok: #157a4b; --ok-bg: #e5f6ed;
  --warn: #8a5a00; --warn-bg: #fff3d6;
  --bad: #b42335; --bad-bg: #fde8eb;
  --info: #1f5fa8; --info-bg: #e5f0fc;
  --neutral-bg: #eceef4;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 4px 16px rgba(20, 24, 40, .04);
  --sidebar: 240px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117; --surface: #171a23; --surface-2: #1d212c; --border: #2a2f3d;
    --text: #e8eaf2; --muted: #9aa1b5; --accent: #8b85ff; --accent-ink: #0f1117; --accent-soft: #24234a;
    --ok: #5fd39b; --ok-bg: #15301f; --warn: #f2c35b; --warn-bg: #352a10;
    --bad: #ff8a99; --bad-bg: #3a1820; --info: #84b8f5; --info-bg: #142740; --neutral-bg: #252a36;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.25; margin: 0 0 .25rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.05rem; margin-bottom: .75rem; }
p { margin: 0 0 .75rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--surface); padding: .5rem 1rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; padding: .55rem 1rem; border-radius: 10px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: transparent; color: var(--text); font-size: 1.3rem; cursor: pointer; padding: .25rem .5rem; }
.link-sm { font-size: .85rem; }

/* Forms */
.form { display: grid; gap: .9rem; }
.form label { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; grid-column: 1 / -1; }
.row { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: .55rem .7rem; width: 100%; min-width: 0; }
input[readonly] { background: var(--surface-2); }
textarea { resize: vertical; }
.hint { font-weight: 400; color: var(--muted); }
.check { display: flex !important; grid-template-columns: none; align-items: center; gap: .5rem; font-weight: 500 !important; }
.check input { width: auto; }
fieldset.checks { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
fieldset.checks legend { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters label { min-width: 160px; }
.filters .grow { flex: 1 1 240px; }

/* Flash and badges */
.flash { border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--neutral-bg); color: var(--muted); }

/* App shell */
body.app { display: block; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border); padding: 1rem .75rem; overflow-y: auto; z-index: 20; }
.shell { margin-left: var(--sidebar); min-height: 100vh; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.1rem; color: var(--text); padding: .25rem .5rem 1rem; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.nav-section { margin-bottom: 1rem; }
.nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 .6rem .3rem; }
.nav-link { display: block; padding: .45rem .6rem; border-radius: 8px; color: var(--text); font-size: .93rem; }
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user { display: flex; align-items: center; gap: .75rem; }
.topbar-user form { margin: 0; }
.user-chip { display: flex; align-items: center; gap: .5rem; color: var(--text); }
.user-chip span { display: grid; line-height: 1.15; }
.user-chip small { color: var(--muted); }
.menu-btn { display: none; }
.main { padding: 1.5rem; max-width: 1200px; }

.avatar { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9rem; }
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; }
.avatar.lg { width: 60px; height: 60px; font-size: 1.2rem; }

/* Content */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions form { margin: 0; display: flex; gap: .5rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; min-width: 0; }
.card.narrow { max-width: 560px; }
.two-col { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.two-col > .card { margin-bottom: 0; }
.two-col + * { margin-top: 1.25rem; }
.grid-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-cards .card { margin: 0; }
.widget .big { font-size: 1.2rem; margin-bottom: .25rem; }
.kv { list-style: none; padding: 0; margin: 0 0 1rem; }
.kv li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.kv li:last-child { border-bottom: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem 1.5rem; margin: 0; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.profile-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.page-head .profile-top { margin-bottom: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list-actions { display: flex; align-items: center; gap: .5rem; }
.list-actions form { margin: 0; }
.list form { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 1.5rem .5rem; }
.empty p { margin: 0; }
.danger-zone h2 { color: var(--bad); }
.secret { font-size: 1.05rem; }

.table-wrap { overflow-x: auto; margin: 0 -1.25rem; padding: 0 1.25rem; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table input { padding: .4rem .5rem; }
.decide-form { display: flex; gap: .4rem; align-items: center; margin: 0; min-width: 300px; }
.decide-form label { flex: 1; }

.stat-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; display: grid; }
.stat { min-width: 0; }
.stat strong { font-size: clamp(1.05rem, 4.2vw, 1.5rem); overflow-wrap: anywhere; }
.stat span { color: var(--muted); font-size: .85rem; }
.balance-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1.25rem; }
.balance { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: grid; gap: .1rem; }
.balance span { color: var(--muted); font-size: .85rem; }
.balance strong { font-size: 1.7rem; }
.balance small { color: var(--muted); }
.clock-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.clock-card h2 { margin: 0; }
.clock-card p { margin: 0; }
.clock-card form { margin: 0; }
.clock-times { display: flex; gap: 2rem; }
.clock-times div { display: grid; }
.clock-times small { color: var(--muted); }

.people { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.person { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem; color: var(--text); min-width: 0; }
.person:hover { border-color: var(--accent); text-decoration: none; }
.person-main { display: grid; min-width: 0; }
.person-main strong, .person-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.org, .org ul { list-style: none; margin: 0; padding-left: 1.4rem; }
.org { padding-left: 0; }
.org ul { border-left: 2px solid var(--border); margin-left: .9rem; }
.org li { margin: .4rem 0; }
.org-node { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .7rem .35rem .35rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); }
.org-node span { display: grid; line-height: 1.2; }
.org-node small { color: var(--muted); }
.org-node:hover { border-color: var(--accent); text-decoration: none; }
.activity li { align-items: flex-start; }

/* Public pages */
body.public { min-height: 100vh; display: flex; flex-direction: column; }
.public-top { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; max-width: 1100px; width: 100%; margin: 0 auto; }
.public-top .brand { padding: 0; }
body.public main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1rem 1.5rem 3rem; }
.public-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem; }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; align-items: center; padding: 3rem 0 2.5rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -.02em; margin-bottom: 1rem; }
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
.hero-actions { margin-top: 1.5rem; }
.hero-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.5rem; box-shadow: var(--shadow); display: grid; gap: .9rem; }
.mini-row { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: 10px; background: var(--surface-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-info { background: var(--info); }
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.feature p { color: var(--muted); margin: 0; }
.auth-card, .center-card { max-width: 420px; margin: 3rem auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; box-shadow: var(--shadow); }
.center-card { text-align: center; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .shell { margin-left: 0; }
  .menu-btn { display: block; }
  .user-chip span { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
}
@media (max-width: 600px) {
  .main { padding: 1rem; }
  .topbar { padding: .5rem 1rem; gap: .5rem; }
  .card { padding: 1rem; }
  .table-wrap { margin: 0 -1rem; padding: 0 1rem; }
  .clock-times { gap: 1.2rem; }
  .public-top, body.public main { padding-left: 1rem; padding-right: 1rem; }
  .auth-card { padding: 1.5rem; margin-top: 1.5rem; }
}
@media print {
  .sidebar, .topbar, .btn, form { display: none !important; }
  .shell { margin: 0; }
  body { background: #fff; color: #000; }
}
.table td:first-child { white-space: nowrap; }
.row { align-items: start; }
input, select, textarea { font-weight: 400; }
.form > .btn { justify-self: start; }
.auth-card .form > .btn { justify-self: stretch; }

/* Finance */
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.table tr.over td { background: var(--bad-bg); }
meter { width: 6rem; height: .7rem; vertical-align: middle; }
.plan-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 1.25rem; }
.plan-grid .card { margin: 0; }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.plan .big { font-size: 1.6rem; font-weight: 700; margin: .25rem 0; }
.plan .big small { font-size: .9rem; font-weight: 400; color: var(--muted); }
.center-card.wide { max-width: 760px; text-align: left; }
.doc { display: grid; gap: 1rem; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--accent); padding-bottom: .75rem; }
.doc-title { display: grid; text-align: right; }
.doc-title strong { font-size: 1.2rem; text-transform: uppercase; letter-spacing: .05em; }
.doc .two-col { gap: 1rem; }
.net-pay { display: flex; justify-content: space-between; font-size: 1.2rem; padding: .75rem 1rem; border: 2px solid var(--accent); border-radius: var(--radius); margin: 0; }
body.print-page { background: var(--bg); }
.print-sheet { max-width: 820px; margin: 2rem auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
@media (max-width: 600px) { .print-sheet { margin: 0; border-radius: 0; padding: 1rem; } }
@media print {
  body.print-page, .print-sheet { background: #fff; color: #000; border: 0; margin: 0; padding: 0; max-width: none; }
  .no-print { display: none !important; }
  .doc-head { border-color: #000; }
  .net-pay { border-color: #000; }
  .table th, .table td { padding: .3rem .4rem; }
  @page { size: auto; margin: 12mm; }
}

/* Workstream */
.avatar.xs { width: 24px; height: 24px; font-size: .65rem; }
.grow { flex: 1; }
.count { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--neutral-bg); color: var(--muted); font-size: .78rem; font-weight: 600; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .75rem; }
.card-head h2 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.chips { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.chip { font-size: .72rem; padding: .05rem .45rem; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.due { color: var(--muted); font-size: .78rem; }
.due.late { color: var(--bad); font-weight: 600; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 .75rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin: -.5rem 0 1.25rem; overflow-x: auto; }
.tab { padding: .55rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-color: var(--accent); }
.project-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.project-card { color: var(--text); margin: 0; display: grid; gap: .5rem; align-content: start; }
.project-card:hover { border-color: var(--accent); text-decoration: none; }
.project-card .kv { margin: 0; }
.project-top { display: flex; align-items: center; gap: .6rem; }
.project-key { font-size: .75rem; font-weight: 700; padding: .15rem .45rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.project-people { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.people-checks { max-height: 15rem; overflow-y: auto; padding: .5rem; border: 1px solid var(--border) !important; border-radius: 9px; }
.sprint-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; }
.board { position: relative; display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; scroll-snap-type: x proximity; }
.column { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; display: grid; gap: .5rem; scroll-snap-align: start; min-width: 0; }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: .2rem .3rem; }
.column-head h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0; }
.column-body { display: grid; gap: .5rem; min-height: 3rem; border-radius: 9px; align-content: start; }
.column-body.drop-over { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--accent-soft); }
.task-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; display: grid; gap: .4rem; box-shadow: var(--shadow); cursor: grab; }
.task-card.dragging { opacity: .5; }
.task-card.saving { opacity: .7; }
.task-title { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .3rem; }
.task-card .task-meta { margin: 0; }
.task-foot { display: flex; align-items: center; gap: .5rem; }
.move-form { display: flex; gap: .3rem; margin: 0; }
.move-form select { padding: .25rem .4rem; font-size: .8rem; }
.js .move-form button { display: none; }
.quick-add { display: flex; gap: .4rem; margin: 0; }
.quick-add input { padding: .4rem .55rem; }
.task-rows li { align-items: flex-start; }
.task-rows .list-actions select { width: auto; max-width: 11rem; padding: .3rem .4rem; }
.complete-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.complete-form select { min-width: 0; flex: 1 1 10rem; }

.task-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1.25rem; align-items: start; }
.task-layout details { margin-top: .5rem; }
.task-layout summary { cursor: pointer; color: var(--accent); font-weight: 500; margin-bottom: .5rem; }
.comments { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .9rem; }
.comments li { display: flex; gap: .7rem; align-items: flex-start; }
.comments p { margin: .2rem 0 0; }
.facts.compact { margin-top: 1rem; grid-template-columns: 1fr 1fr; }
.timer-card { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; border-left: 4px solid var(--ok); }
.timer-card form { margin: 0; }
.timer-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 .75rem; }
.timesheet td:first-child { white-space: normal; min-width: 12rem; }
.timesheet tfoot td, .timesheet tfoot th { border-top: 2px solid var(--border); padding: .6rem; }
.steps { padding-left: 1.2rem; margin: 0 0 .75rem; display: grid; gap: .4rem; }

/* Calendar */
.layer-filter { align-items: center; }
.layer-filter fieldset.checks { margin: 0; }
.layer-filter .check span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.dot-events, .k-event { --k: var(--accent); --kb: var(--accent-soft); }
.dot-holidays, .k-holiday { --k: var(--ok); --kb: var(--ok-bg); }
.dot-leave, .k-leave { --k: var(--warn); --kb: var(--warn-bg); }
.dot-work, .k-task, .k-sprint { --k: var(--info); --kb: var(--info-bg); }
.layer-filter .check span { background: var(--k); }
.calendar { padding: 0; overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: .5rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); }
.cal-day { min-height: 6.5rem; padding: .3rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.weekend { background: var(--surface-2); }
.cal-day.other { opacity: .5; }
.cal-date { font-size: .8rem; font-weight: 600; color: var(--muted); width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-date { background: var(--accent); color: var(--accent-ink); }
.cal-item { display: block; font-size: .74rem; line-height: 1.3; padding: .1rem .35rem; border-radius: 5px; background: var(--kb); color: var(--text); border-left: 3px solid var(--k); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item:hover { text-decoration: none; filter: brightness(.97); }
.cal-pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; background: var(--kb); color: var(--k); }
.person-row { display: flex; align-items: center; gap: .6rem; color: var(--text); }
.person-row:hover { text-decoration: none; }
.person-row:hover strong { color: var(--accent); }

@media (max-width: 900px) {
  .task-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .board { grid-template-columns: repeat(4, 82%); margin: 0 -1rem; padding: 0 1rem .5rem; }
  .cal-day { min-height: 3.2rem; padding: .15rem; }
  .cal-item { font-size: 0; padding: 0; height: 6px; border-left: 0; background: var(--k); }
  .cal-item b { display: none; }
  .cal-day small { display: none; }
  .cal-head div { padding: .4rem .1rem; text-align: center; font-size: .65rem; }
  .facts.compact { grid-template-columns: 1fr; }
}
.layer-filter .check { min-width: 0; }

/* Payroll compliance */
.notice { background: var(--info-bg); color: var(--info); border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; }
.stepper { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.step { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .75rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.step-dot { flex: none; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--neutral-bg); color: var(--muted); font-weight: 700; font-size: .85rem; }
.step-text { display: grid; min-width: 0; line-height: 1.3; }
.step-text strong { font-size: .9rem; }
.step-text small { color: var(--muted); overflow-wrap: anywhere; }
.step-done .step-dot { background: var(--ok-bg); color: var(--ok); }
.step-current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.step-current .step-dot { background: var(--accent); color: var(--accent-ink); }
.step-panel { border-left: 4px solid var(--accent); }
.warn-list { margin: 0 0 1rem; padding: 0; list-style: none; display: grid; gap: .4rem; }
.warn-list li { background: var(--warn-bg); color: var(--warn); border-radius: 9px; padding: .55rem .8rem; }
.warn-list a { color: inherit; text-decoration: underline; }
.download-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.regime-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }
.form .regime-tile { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; cursor: pointer; font-weight: 400; }
.regime-tile input { width: auto; margin-top: .2rem; }
.regime-tile > span { display: grid; gap: .15rem; }
.regime-tile .big { font-size: 1.35rem; font-weight: 700; }
.regime-tile .badge { justify-self: start; }
.regime-tile.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.decl-grid { display: grid; gap: .9rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.decl-grid label > span:first-child { display: flex; justify-content: space-between; gap: .5rem; }
.decl-grid.compact { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form h3 { margin: .5rem 0 0; font-size: .95rem; }
.worksheet tr.total td { font-weight: 700; border-top: 2px solid var(--border); }
.lwf-table td:first-child { min-width: 12rem; }
.lwf-table input { min-width: 6rem; }
.form16 h3 { font-size: .95rem; margin: .5rem 0 0; }
.form16-table td:first-child { color: var(--muted); width: 3rem; }
@media (max-width: 900px) {
  .stepper { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stepper { grid-template-columns: 1fr; }
  .step { padding: .5rem .7rem; }
}
@media print {
  .form16-table td, .worksheet td { padding: .2rem .4rem; }
}
.worksheet td:first-child, .form16-table td:nth-child(2), .warn-list li { white-space: normal; }
.form:not(.form-grid) { grid-template-columns: minmax(0, 1fr); }
.step-panel .decide-form { min-width: 0; flex-wrap: wrap; }
.statement td:first-child, .form16 td:first-child { white-space: normal; }
.statement { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.table-wrap { position: relative; } /* keeps .sr-only labels inside scrolled tables from widening the page */

/* Icons (Lucide, ISC) */
.icon { flex: none; vertical-align: -3px; }
.icon-dot { display: inline-block; width: 18px; flex: none; }
.nav-link { display: flex; align-items: center; gap: .6rem; }
.nav-link .icon { color: var(--muted); }
.nav-link.active .icon, .nav-link:hover .icon { color: var(--accent); }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .5rem 0 .75rem; }
kbd { font: 600 .72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: .2rem .35rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--muted); }

/* Command bar (Ctrl+K) */
.cmdk-open { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font: inherit; font-size: .88rem; padding: .4rem .6rem; border-radius: 10px; cursor: pointer; min-width: 15rem; }
.cmdk-open span { flex: 1; text-align: left; }
.cmdk-open:hover { border-color: var(--accent); color: var(--text); }
.cmdk { width: min(640px, calc(100vw - 2rem)); max-height: min(560px, 80vh); padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(10, 12, 30, .35); margin-top: 10vh; }
.cmdk::backdrop { background: rgba(15, 17, 30, .45); }
.cmdk-form { display: flex; flex-direction: column; max-height: inherit; }
.cmdk-input { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); color: var(--muted); }
.cmdk-input input { border: 0; padding: .2rem 0; font-size: 1.05rem; background: transparent; }
.cmdk-input input:focus-visible { outline: none; }
.cmdk-list { list-style: none; margin: 0; padding: .4rem; overflow-y: auto; }
.cmdk-list a, .cmdk-ask button { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .55rem .7rem; border-radius: 9px; color: var(--text); font: inherit; text-align: left; background: none; border: 0; cursor: pointer; }
.cmdk-list a small { margin-left: auto; color: var(--muted); }
.cmdk-list a.active, .cmdk-ask button.active, .cmdk-list a:hover, .cmdk-ask button:hover { background: var(--accent-soft); text-decoration: none; }
.cmdk-ask { border-top: 1px solid var(--border); margin-top: .3rem; padding-top: .3rem; }
.cmdk-ask .icon { color: var(--accent); }
.cmdk-help { margin: 0; padding: .55rem 1rem; border-top: 1px solid var(--border); font-size: .78rem; color: var(--muted); display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }

/* My day */
.myday { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; align-items: stretch; }
.myday-hello { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.myday-hello h1 { font-size: 1.6rem; }
.ask-inline { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .3rem .35rem .3rem .75rem; margin: .9rem 0 .7rem; }
.ask-inline:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ask-inline input { border: 0; padding: .35rem 0; background: transparent; }
.ask-inline input:focus-visible { outline: none; }
.ask-icon { color: var(--accent); display: flex; }
.ask-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.ask-chip { display: inline-block; font: inherit; font-size: .84rem; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.ask-chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.myday-clock { margin: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: .6rem; }
.clock-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.clock-state { font-weight: 600; margin: 0; }
.myday-clock form { width: 100%; }
.btn-clock { width: 100%; font-size: 1.1rem; padding: .9rem 1.2rem; }
.btn-clock.out { background: var(--surface); color: var(--accent); }
.myday-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-bottom: 1.25rem; }
.myday-grid .card { margin: 0; }
.myday-grid .big { font-size: 1.6rem; font-weight: 700; margin: 0; }
.card-head h2 .icon { color: var(--accent); }
.focus-list { list-style: none; margin: 0; padding: 0; }
.focus-list li { display: grid; gap: .1rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.focus-list li:last-child { border-bottom: 0; }
.focus-list a { color: var(--text); }
.focus-list a strong { color: var(--accent); margin-right: .25rem; }
.focus-list .urgent { color: var(--bad); font-weight: 600; }

/* Karya Assistant */
.chat { display: flex; flex-direction: column; gap: 1rem; min-height: 60vh; }
.chat-hello { text-align: center; padding: 1.5rem 0 .5rem; }
.chat-hello img { margin-bottom: .5rem; }
.chat-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; flex: 1; }
.chat-log:empty { display: none; }
.msg { display: flex; gap: .6rem; align-items: flex-start; max-width: 100%; }
.msg-body { padding: .7rem .95rem; border-radius: 14px; min-width: 0; overflow-wrap: anywhere; }
.msg-body > :last-child { margin-bottom: 0; }
.msg-body ul, .msg-body ol { margin: .25rem 0 .6rem; padding-left: 1.2rem; }
.msg-body h3 { font-size: 1rem; margin: .4rem 0; }
.msg-body .table-wrap { margin: .5rem 0; }
.msg-user { justify-content: flex-end; }
.msg-user .msg-body { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; max-width: 80%; }
.msg-bot .msg-body { background: var(--surface-2); border-bottom-left-radius: 4px; max-width: min(46rem, 88%); }
.msg-avatar { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.typing { color: var(--muted); font-style: italic; }
.error-text { color: var(--bad); }
.chat-form { display: flex; gap: .5rem; align-items: flex-end; border: 1px solid var(--border); border-radius: 14px; padding: .4rem; background: var(--surface); }
.chat-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-form textarea { border: 0; resize: none; max-height: 160px; padding: .5rem .6rem; background: transparent; }
.chat-form textarea:focus-visible { outline: none; }
.chat .hint { margin: 0; font-size: .8rem; }

/* Approvals inbox */
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox-item { display: grid; grid-template-columns: minmax(170px, 1fr) 2.2fr auto; gap: 1rem; align-items: center; }
.inbox-who { display: flex; align-items: center; gap: .65rem; }
.inbox-what p { margin: .25rem 0 0; }
.insight { display: flex; gap: .4rem; align-items: flex-start; color: var(--accent); font-size: .86rem; margin-top: .4rem !important; }
.insight .icon { margin-top: 3px; }
.inbox .decide-form { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; max-width: 300px; }
.empty-art { text-align: center; padding: 2.5rem 1.25rem; }
.empty-art img { max-width: 100%; height: auto; margin-bottom: .75rem; }

/* Landing extras */
.hero-art { justify-self: center; max-width: 100%; height: auto; }
.feature-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: .75rem; }
.pricing { margin: 3rem 0 2rem; text-align: center; }
.pricing .plan-grid { text-align: left; margin-top: 1.25rem; }
.pricing h3 { margin: 0; }

@media (max-width: 900px) {
  .myday { grid-template-columns: 1fr; }
  .inbox-item { grid-template-columns: 1fr; }
  .inbox .decide-form { justify-content: flex-start; max-width: none; }
  .cmdk-open { min-width: 0; }
  .cmdk-open span, .cmdk-open kbd { display: none; }
}

/* ===== v0.6 design refresh: app shell, charts, landing ===== */
:root {
  --side-bg: #1e1b4b; --side-bg-2: #2e2a6b; --side-ink: #d4d2f5; --side-muted: #a5a3d9;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --bar: #4f46e5; --bar-soft: #a5a1f5; --grid: #e3e6ef;
  --shadow-lg: 0 10px 30px rgba(30, 27, 75, .10), 0 2px 6px rgba(30, 27, 75, .06);
  --radius-lg: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --side-bg: #12112b; --side-bg-2: #26245a; --side-ink: #cfcdf3; --side-muted: #8e8cc4;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --bar: #8b85ff; --bar-soft: #4b4794; --grid: #2a2f3d;
    --shadow-lg: none;
  }
}
h1 { letter-spacing: -.01em; }

/* App shell */
.sidebar { background: var(--side-bg); border-right: 0; color: var(--side-ink); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sidebar-top { padding: 1rem .9rem .25rem; }
.sidebar .brand { color: #fff; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .75rem 1rem; scrollbar-width: thin; scrollbar-color: var(--side-bg-2) transparent; }
.sidebar .nav-title { color: var(--side-muted); font-weight: 600; }
.sidebar .nav-link { color: var(--side-ink); }
.sidebar .nav-link .icon { color: var(--side-muted); }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); }
.sidebar .nav-link:hover .icon { color: #fff; }
.sidebar .nav-link.active { background: var(--side-bg-2); color: #fff; box-shadow: inset 3px 0 0 #8b85ff; }
.sidebar .nav-link.active .icon { color: #c7c4ff; }
.sidebar a:focus-visible, .sidebar button:focus-visible { outline-color: #c7c4ff; }
.sidebar-user { display: flex; align-items: center; gap: .5rem; padding: .75rem .9rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-user form { margin: 0; }
.sidebar-user .icon-btn { color: var(--side-muted); display: grid; place-items: center; border-radius: 8px; padding: .4rem; }
.sidebar-user .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-me { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; color: #fff; }
.sidebar-me:hover { text-decoration: none; }
.sidebar-me span { display: grid; line-height: 1.2; min-width: 0; }
.sidebar-me strong, .sidebar-me small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-me small { color: var(--side-muted); }
.sidebar .avatar { background: var(--side-bg-2); color: #fff; }
.sidebar-scrim { display: none; }
.topbar { gap: .75rem; padding: .55rem 1.5rem; min-height: 60px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.topbar-title { font-size: 1.02rem; }
.topbar-user { gap: .35rem; }
.top-icon { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--muted); }
.top-icon:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }
.top-count { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.user-chip { padding: .2rem .5rem .2rem .25rem; border-radius: 999px; margin-left: .25rem; }
.user-chip:hover { background: var(--surface-2); text-decoration: none; }
.main { max-width: 1320px; padding: 1.5rem 1.75rem 2.5rem; }
.card { border-radius: 14px; }
.card h2 { font-size: 1rem; }
.btn { border-radius: 10px; transition: filter .15s, background .15s; }
.btn-ghost:hover { background: var(--accent-soft); }
.table tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.page-head h1 { font-size: 1.6rem; }
.tabbar { display: none; }

/* KPI tiles and charts */
.kpi-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 1.25rem; }
.kpi { display: flex; gap: .85rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; box-shadow: var(--shadow); min-width: 0; }
.kpi > div { display: grid; min-width: 0; }
.kpi-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.kpi.tone-ok .kpi-icon { background: var(--ok-bg); color: var(--ok); }
.kpi.tone-info .kpi-icon { background: var(--info-bg); color: var(--info); }
.kpi.tone-warn .kpi-icon { background: var(--warn-bg); color: var(--warn); }
.kpi-label { color: var(--muted); font-size: .85rem; }
.kpi strong { font-size: 1.6rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: .8rem; }
.chart-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); margin-bottom: 1.25rem; }
.chart-grid .card { margin: 0; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.c-grid { stroke: var(--grid); stroke-width: 1; }
.c-axis { fill: var(--muted); font-size: 10px; font-family: inherit; }
.c-bar { fill: var(--bar-soft); }
.c-bar-hi { fill: var(--bar); }
.hbars .c-bar { fill: var(--bar); }
.c-hitbox { fill: transparent; }
.c-hit:hover .c-bar { fill: var(--bar); }
.c-hit:hover .c-hitbox { fill: var(--accent-soft); opacity: .5; }
.chart-total { margin: -.25rem 0 .25rem; }
.chart-total strong { font-size: 1.4rem; }
.chart-empty { text-align: center; color: var(--muted); padding: 1.25rem .5rem; display: grid; justify-items: center; gap: .5rem; }
.chart-empty p { margin: 0; }
.donut-wrap { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; flex: none; }
.c-track { fill: none; stroke: var(--neutral-bg); stroke-width: 14; }
.c-slice { fill: none; stroke-width: 14; }
.ring .c-track, .ring .c-slice { stroke-width: 6; stroke-linecap: round; }
.c-slice.s1, .key.s1 { stroke: var(--s1); background: var(--s1); }
.c-slice.s2, .key.s2 { stroke: var(--s2); background: var(--s2); }
.c-slice.s3, .key.s3 { stroke: var(--s3); background: var(--s3); }
.c-slice.s4, .key.s4 { stroke: var(--s4); background: var(--s4); }
.c-center { fill: var(--text); font-size: 20px; font-weight: 700; font-family: inherit; }
.c-sub { fill: var(--muted); font-size: 10px; font-family: inherit; }
.c-ring { fill: var(--text); font-size: 14px; font-weight: 700; font-family: inherit; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; flex: 1; min-width: 150px; }
.legend li { display: flex; align-items: center; gap: .55rem; font-size: .9rem; }
.legend li strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.key { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.rings { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.rings li { display: flex; align-items: center; gap: .8rem; }
.rings li > span { display: grid; }
.ring { width: 56px; height: 56px; flex: none; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.hbar-top { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; margin-bottom: .25rem; }
.hbar-top a { color: var(--text); }
.hbar { width: 100%; height: 8px; display: block; }
.hbar-track { fill: var(--neutral-bg); }

/* Mobile app shell */
@media (max-width: 900px) {
  .sidebar { width: min(300px, 86vw); }
  .sidebar.open + .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(15, 17, 30, .45); z-index: 15; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 12; background: var(--surface); border-top: 1px solid var(--border); padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; gap: .1rem; padding: .3rem 0; color: var(--muted); font: inherit; font-size: .7rem; background: none; border: 0; cursor: pointer; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar [aria-current="page"] { color: var(--accent); font-weight: 600; }
  .tabbar .tab-ask .icon { background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: 6px; width: 36px; height: 36px; margin-top: -14px; box-shadow: var(--shadow-lg); }
  .tabbar .top-count { top: 0; right: calc(50% - 20px); }
  body.app .shell { padding-bottom: 4.5rem; }
  .topbar-user .top-icon { display: none; }
  .main { padding: 1.1rem; }
}
@media (max-width: 600px) {
  .kpi-row { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .kpi { padding: .75rem; gap: .6rem; flex-direction: column; align-items: flex-start; }
  .kpi-icon { width: 34px; height: 34px; }
  .kpi strong { font-size: 1.3rem; }
  .chart-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print { .tabbar, .sidebar-scrim { display: none !important; } }

/* Sign in */
body.auth main { max-width: 1000px; }
.auth-split { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; margin: 2rem auto; max-width: 920px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); }
.auth-side { background: linear-gradient(160deg, #1e1b4b, #4f46e5); color: #fff; padding: 2.5rem; display: flex; flex-direction: column; gap: .75rem; }
.auth-side .eyebrow { color: #c7c4ff; }
.auth-side h2 { font-size: 1.6rem; line-height: 1.25; }
.auth-side .ticks li { color: #e6e5ff; }
.auth-side .ticks .icon { color: #a5f3c8; }
.auth-side img { margin-top: auto; align-self: center; max-width: 70%; height: auto; }
.auth-split .auth-card { margin: 0; border: 0; box-shadow: none; border-radius: 0; max-width: none; padding: 2.75rem; align-self: center; }

/* Public pages */
.public-top { position: sticky; top: 0; z-index: 30; max-width: none; padding: 0; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.landing .public-top { border-bottom-color: var(--border); }
.public-top-inner { display: flex; align-items: center; gap: 1.5rem; max-width: 1180px; margin: 0 auto; padding: .8rem 1.5rem; }
.public-links { display: flex; gap: 1.4rem; flex: 1; justify-content: center; }
.public-links a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.public-links a:hover { color: var(--text); text-decoration: none; }
.public-cta { margin-left: auto; display: flex; gap: .5rem; }
body.landing main { max-width: none; padding: 0; }
.l-wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.l-section { padding: 5rem 0; }
.l-head { text-align: center; max-width: 46rem; margin: 0 auto 2.75rem; }
.l-head h2, .l-section h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); letter-spacing: -.02em; line-height: 1.15; margin-bottom: .75rem; }
.l-head .lead { margin: 0 auto; }
.landing h3 { font-size: 1.1rem; margin: 0 0 .4rem; }

.l-hero { background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), linear-gradient(180deg, var(--accent-soft), var(--bg) 70%); padding: 4.5rem 0 0; overflow: hidden; }
.l-hero .hero { display: block; padding-top: 0; padding-bottom: 0; text-align: center; }
.l-hero .hero-text { max-width: 52rem; margin: 0 auto; }
.l-hero h1 { font-size: clamp(2.2rem, 5.4vw, 4rem); line-height: 1.06; letter-spacing: -.035em; margin: 1.1rem 0 1.1rem; }
.l-hero .lead { margin: 0 auto; font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 40rem; }
.hero-pill { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem .3rem .3rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .88rem; box-shadow: var(--shadow); }
.hero-pill span { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; }
.hero-pill:hover { text-decoration: none; border-color: var(--accent); }
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.btn-light { background: #fff; color: #1e1b4b; border-color: #fff; }
.hero-proof { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.4rem; padding: 0; margin: 1.5rem 0 0; color: var(--muted); font-size: .9rem; }
.hero-proof li { display: flex; align-items: center; gap: .4rem; }
.hero-proof .icon { color: var(--ok); }
.hero-visual { position: relative; margin-top: 3.5rem; }
.shot { margin: 0; border-radius: var(--radius-lg); background: var(--surface); padding: 6px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.shot img { display: block; width: 100%; height: auto; border-radius: 13px; }
.shot-hero { max-width: 1100px; margin: 0 auto -4rem; box-shadow: 0 30px 80px rgba(30, 27, 75, .22); }
.float { position: absolute; display: flex; align-items: center; gap: .65rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .7rem .9rem; box-shadow: var(--shadow-lg); text-align: left; }
.float span:last-child { display: grid; line-height: 1.25; }
.float small { color: var(--muted); }
.float-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; }
.float-icon.ok { background: var(--ok-bg); color: var(--ok); }
.float-icon.ai { background: var(--accent-soft); color: var(--accent); }
.float-a { left: 0; top: 30%; }
.float-b { right: 0; top: 62%; }
.l-strip { padding: 6rem 0 2.5rem; border-bottom: 1px solid var(--border); }
.l-strip p { text-align: center; color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1rem; }
.l-strip ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin: 0; padding: 0; }
.l-strip li { padding: .4rem .9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: .9rem; color: var(--muted); }
.value-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.value, .role { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.6rem; }
.value p, .role p { color: var(--muted); margin: 0; }
.feature-icon.sm { width: 32px; height: 32px; border-radius: 9px; margin: 0; }
.l-modules { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.module-row { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: 3.5rem; align-items: center; }
.module-row + .module-row { margin-top: 5rem; }
.module-row.flip .module-text { order: 2; }
.module-row h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.2; letter-spacing: -.015em; margin-bottom: .9rem; }
.module-eyebrow { display: flex; align-items: center; gap: .6rem; color: var(--accent); font-weight: 700; margin-bottom: .9rem; }
.ticks { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .55rem; }
.ticks li { display: flex; gap: .55rem; align-items: flex-start; }
.ticks .icon { color: var(--ok); margin-top: 3px; }
.l-ai { background: linear-gradient(160deg, #13112f, #1e1b4b 55%, #312e81); color: #e8e7ff; }
.l-ai h2 { color: #fff; }
.l-ai .eyebrow { color: #a5a1ff; }
.l-ai .shot { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
.ask-list { list-style: none; padding: 0; margin: 1.25rem 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.ask-list li { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-size: .9rem; }
.ask-list .icon { color: #a5a1ff; }
.ai-note { color: #bdbbe8; display: flex; align-items: center; gap: .4rem; }
.role-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.l-soft { background: var(--surface-2); }
.all-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.all-grid li { display: flex; align-items: center; gap: .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1rem; font-weight: 500; }
.all-grid .icon { color: var(--accent); }
.security { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; align-items: center; }
.sec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.sec-list li { display: flex; gap: .8rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem; }
.sec-list .icon { color: var(--accent); flex: none; margin-top: 2px; }
.sec-list span { display: grid; gap: .2rem; }
.sec-list small { color: var(--muted); }
.landing .pricing { margin: 0; padding: 5rem 0; text-align: left; }
.landing .pricing .l-head { text-align: center; }
.landing .plan-grid { align-items: stretch; }
.landing .plan { position: relative; display: flex; flex-direction: column; padding: 1.75rem; border-radius: 18px; }
.landing .plan .btn { margin-top: auto; }
.landing .plan .big { font-size: 2.2rem; letter-spacing: -.02em; }
.plan-popular { border: 2px solid var(--accent); box-shadow: 0 16px 40px rgba(79, 70, 229, .18); }
.plan-tag { position: absolute; top: -12px; left: 1.75rem; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 700; padding: .2rem .7rem; border-radius: 999px; }
.faq { max-width: 820px; }
.faq-list { display: grid; gap: .75rem; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 1.25rem; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 0; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--muted); transition: transform .2s; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { color: var(--muted); margin: 0 0 1.1rem; }
.l-cta { background: linear-gradient(135deg, #4f46e5, #1e1b4b); color: #fff; text-align: center; padding: 4.5rem 0; }
.l-cta h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); letter-spacing: -.02em; }
.l-cta p { color: #dcdaff; font-size: 1.1rem; }
.l-cta .btn:not(.btn-light) { background: #fff; color: #1e1b4b; border-color: #fff; }
.l-cta .btn-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.site-foot { background: var(--surface); border-top: 1px solid var(--border); padding: 3.5rem 0 1.5rem; }
.site-foot-inner { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.site-foot h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .75rem; }
.site-foot-inner > div:not(.foot-brand) { display: grid; gap: .5rem; align-content: start; }
.site-foot a:not(.brand) { color: var(--text); font-size: .93rem; }
.foot-brand .brand { padding: 0 0 .75rem; }
.foot-legal { max-width: 1180px; margin: 2.5rem auto 0; padding: 1.25rem 1.5rem 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }

@media (max-width: 960px) {
  .public-links { display: none; }
  .module-row, .security { grid-template-columns: 1fr; gap: 2rem; }
  .module-row.flip .module-text { order: 0; }
  .float { display: none; }
  .site-foot-inner { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .auth-split { grid-template-columns: 1fr; margin: 1rem 0; }
  .auth-side { display: none; }
  .auth-split .auth-card { padding: 1.75rem 1.25rem; }
}
@media (max-width: 600px) {
  .l-section { padding: 3.5rem 0; }
  .l-wrap, .public-top-inner { padding-left: 1rem; padding-right: 1rem; }
  .l-hero { padding-top: 2.5rem; }
  .hero-visual { margin-top: 2.25rem; }
  .shot-hero { margin-bottom: -2rem; }
  .l-strip { padding-top: 4rem; }
  .sec-list { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; }
}
.module-row.flip { grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); }
.public-top { display: block; }
.public-top-inner { width: 100%; }
@media (max-width: 960px) { .module-row.flip { grid-template-columns: 1fr; } }
.chart-card .card-head { flex-wrap: nowrap; align-items: center; }
.chart-card .card-head h2 { margin: 0; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chart-card .card-head a { white-space: nowrap; }
.stat strong { font-size: clamp(1.05rem, 1.45vw, 1.35rem); overflow-wrap: normal; font-variant-numeric: tabular-nums; }
/* HD screenshots */
.shot img { background: var(--surface-2); }
.shot-phone { position: absolute; right: 2%; bottom: -5.5rem; width: clamp(150px, 17%, 220px); padding: 5px; border-radius: 30px; background: #12112b; border-color: #12112b; box-shadow: 0 30px 70px rgba(30, 27, 75, .35); }
.shot-phone img { border-radius: 25px; }
.float-a { left: 1%; top: 38%; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 3rem; }
.caption { margin: .9rem .25rem 0; color: var(--muted); }
.caption strong { color: var(--text); }
@media (max-width: 960px) {
  .duo { grid-template-columns: 1fr; }
  .shot-phone { display: none; }
}

/* Team and roles, sign up, role preview */
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 14px; margin: 0 0 16px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.preview-text { margin: 0; flex: 1 1 260px; }
.preview-text .icon { vertical-align: -3px; margin-right: 4px; }
.preview-bar form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.preview-bar select { padding: 4px 8px; }
.access-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.role-card h3 { margin: 0; font-size: 1.05rem; }
.role-card form { margin-top: 12px; }
.role-features { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: .9rem; }
.role-features strong { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.perm-table td.num, .perm-table th.num { text-align: center; }
.perm-table tbody th[scope="row"] { font-weight: 500; text-align: left; text-transform: none; letter-spacing: normal; font-size: .92rem; color: var(--text); }
.perm-table .perm-area th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; }
.perm-table input[type="checkbox"] { width: 18px; height: 18px; }
.welcome-card { border-color: var(--accent); background: var(--accent-soft); }
.welcome-card ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.8; }
.invite-link code { word-break: break-all; }
.cell-person { display: inline-flex; align-items: center; gap: 10px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline; margin: 0; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.h3 { font-size: 1.05rem; margin: 0 0 6px; }

.inline-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.join-requests { border-color: var(--warn); }
.join-requests .list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.join-requests select, .inline-form select, .inline-form input { width: auto; }
.join-requests .row-actions { white-space: normal; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card > .h3 { margin-top: 20px; }

/* Company sign-in address: "acme" + ".karyam.ai" in one field */
.input-affix { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); background: var(--surface); overflow: hidden; margin-top: .35rem; }
.input-affix input { border: 0; margin: 0; min-width: 0; flex: 1; border-radius: 0; }
.input-affix > span { display: flex; align-items: center; padding: 0 .65rem; color: var(--muted); background: var(--bg, transparent); white-space: nowrap; font-size: .9rem; }
.input-affix:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.portal-address { overflow-wrap: anywhere; }
