/* Fizlow HR — dark neon glass. Tokens first; light mode overrides the same names. */
:root {
  --bg: #0a0c0b; --bg-glow: color-mix(in srgb, var(--accent) 7%, transparent); --panel: rgba(20, 24, 22, .72); --panel-solid: #131715; --raise: rgba(255, 255, 255, .04);
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14); --ink: #eef3ea; --muted: #8d978f; --field: #0f1311;
  --accent: #c5f135; --accent-ink: #0b0d0a; --accent-fg: var(--accent); --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent); --glow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 28px color-mix(in srgb, var(--accent) 14%, transparent);
  --orange: #ff7a45; --ok: #5ee39a; --warn: #f5b84b; --bad: #ff6b6b; --info: #6cb6ff;
  --r: 18px; --r-sm: 12px; --shadow: 0 10px 40px rgba(0, 0, 0, .35);
  color-scheme: dark; font-family: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-mode="light"] {
  --bg: #eef0ea; --bg-glow: rgba(150, 190, 20, .12); --panel: rgba(255, 255, 255, .78); --panel-solid: #fff; --raise: rgba(0, 0, 0, .03);
  --line: rgba(20, 30, 20, .09); --line-2: rgba(20, 30, 20, .16); --ink: #141a13; --muted: #687268; --field: #fff;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent); --accent-fg: color-mix(in srgb, var(--accent) 55%, #000); --glow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 6px 22px color-mix(in srgb, var(--accent) 18%, transparent); --shadow: 0 8px 30px rgba(20, 30, 20, .08);
  --ok: #17924f; --warn: #b26b00; --bad: #d23c3c; --info: #2d6fd6;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 600px at 0% -10%, var(--bg-glow), transparent 60%), radial-gradient(700px 500px at 100% 0%, rgba(255, 122, 69, .05), transparent 60%), var(--bg); background-attachment: fixed; }
a { color: inherit; }
h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; } h2 { font-size: 15px; margin: 0 0 12px; letter-spacing: -.01em; } h3 { font-size: 13px; margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
code { font-size: 12px; color: var(--muted); }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.shell.rail { grid-template-columns: 76px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; padding: 12px 0 12px 12px; }
.side-in { height: 100%; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.logo { width: 34px; height: 34px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--glow); flex: none; }
.logo .ico { width: 20px; height: 20px; stroke-width: 2.2; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.navs { flex: 1; overflow-y: auto; padding: 4px 10px 10px; scrollbar-width: thin; }
.navs .group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 14px 10px 6px; }
.navs a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 11px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; position: relative; }
.navs a:hover { background: var(--raise); color: var(--ink); }
.navs a.on { background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); font-weight: 650; }
.navs a .badge { margin-left: auto; }
.rail .brand span, .rail .navs a span, .rail .navs .group, .rail .who-info { display: none; }
.rail .navs a { justify-content: center; } .rail .navs .group { display: block; height: 1px; background: var(--line); margin: 10px 8px; font-size: 0; }
.who { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.who-info { min-width: 0; flex: 1; font-size: 13px; } .who-info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-fg); font-weight: 700; font-size: 13px; flex: none; object-fit: cover; border: 1px solid var(--line-2); }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.badge { background: var(--orange); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; line-height: 18px; }

.main { min-width: 0; padding: 12px 20px 40px; }
.topbar { position: sticky; top: 12px; z-index: 4; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); margin-bottom: 18px; }
.crumb { font-size: 12px; color: var(--muted); } .title { min-width: 0; }
.search { position: relative; margin-left: auto; width: min(320px, 34vw); }
.search input { padding-left: 36px; border-radius: 12px; height: 38px; }
.search .ico { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.search kbd { position: absolute; right: 9px; top: 9px; font: 11px/18px inherit; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; }
.results { position: absolute; top: 44px; left: 0; right: 0; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; max-height: 340px; overflow: auto; }
.results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; text-decoration: none; } .results a:hover, .results a.on { background: var(--accent-soft); }
.iconbtn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line); color: var(--ink); padding: 0; position: relative; }
.iconbtn:hover { border-color: var(--line-2); } .iconbtn .badge { position: absolute; top: -5px; right: -5px; }
.page { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page > * { animation: rise .4s ease both; } .page > *:nth-child(2) { animation-delay: .04s; } .page > *:nth-child(3) { animation-delay: .08s; } .page > *:nth-child(4) { animation-delay: .12s; }
.bottomnav { display: none; }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card.glow { box-shadow: var(--glow); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; } .card-h h2 { margin: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.cols2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.cols3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.stat { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 14px; overflow: hidden; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: transform .2s, border-color .2s; }
.stat:hover { transform: translateY(-2px); border-color: var(--line-2); }
.stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.stat b { display: block; font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.stat b a { text-decoration: none; }
.stat .chip { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-fg); }
.stat .spark { position: absolute; right: 12px; bottom: 12px; width: 90px; height: 30px; opacity: .9; }
.stat.hl { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: var(--glow); }
.stat.hl span { color: rgba(11, 13, 10, .65); } .stat.hl .chip { background: rgba(0, 0, 0, .12); color: var(--accent-ink); }
.stat.or .chip { background: rgba(255, 122, 69, .14); color: var(--orange); }
.stat small { font-size: 12px; font-weight: 600; margin-left: 6px; }
.hero { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; padding: 22px; background: linear-gradient(120deg, var(--accent-soft), transparent 55%), var(--panel); }
.hero .kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-fg); font-weight: 700; }
.hero h1 { font-size: 26px; margin: 4px 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
tbody tr { transition: background .12s; } tbody tr:hover { background: var(--raise); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 180px; }
tr.total td { font-weight: 700; border-top: 1px solid var(--line-2); border-bottom: 0; }
tr.dim td { opacity: .5; }

/* ---------- forms & buttons ---------- */
form.f, .f { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }
.f h3, h3.span2 { margin: 10px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-fg); }
label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--field); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
input[type=color] { padding: 2px; height: 38px; width: 56px; }
input[type=file] { padding: 7px; font-size: 13px; }
textarea { min-height: 76px; }
.span2 { grid-column: 1 / -1; }
.contents { display: contents; }
label.chk { display: flex; gap: 9px; align-items: center; font-weight: 500; color: var(--ink); font-size: 14px; } label.chk input { width: auto; }
button, .btn { font: inherit; font-weight: 650; font-size: 14px; border: 1px solid transparent; border-radius: 12px; padding: 9px 16px; cursor: pointer; background: var(--accent); color: var(--accent-ink);
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px; transition: transform .12s, box-shadow .2s, background .2s; }
button:hover, .btn:hover { box-shadow: var(--glow); } button:active { transform: scale(.97); }
button.sec, .btn.sec { background: var(--raise); color: var(--ink); border-color: var(--line-2); } button.sec:hover, .btn.sec:hover { box-shadow: none; border-color: var(--accent); }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); padding: 5px 11px; font-size: 13px; font-weight: 600; } button.ghost:hover { box-shadow: none; border-color: var(--accent-fg); color: var(--accent-fg); }
button.danger { background: rgba(255, 107, 107, .15); color: var(--bad); border-color: rgba(255, 107, 107, .3); } button.danger:hover { box-shadow: none; background: var(--bad); color: #fff; }
button.okb { background: rgba(94, 227, 154, .15); color: var(--ok); border-color: rgba(94, 227, 154, .3); } button.okb:hover { box-shadow: none; background: var(--ok); color: #06210f; }
button.sm, .btn.sm { padding: 5px 11px; font-size: 13px; }
button:disabled { opacity: .45; cursor: default; box-shadow: none; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .spread { justify-content: space-between; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--raise); color: var(--muted); border: 1px solid var(--line); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: rgba(94, 227, 154, .12); color: var(--ok); border-color: rgba(94, 227, 154, .25); }
.pill.warn { background: rgba(245, 184, 75, .12); color: var(--warn); border-color: rgba(245, 184, 75, .25); }
.pill.bad { background: rgba(255, 107, 107, .12); color: var(--bad); border-color: rgba(255, 107, 107, .25); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a, .chips button { padding: 6px 13px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--raise); color: var(--muted); border: 1px solid var(--line); text-decoration: none; }
.chips .on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chips button:hover { box-shadow: none; color: var(--ink); }
.tabs { display: inline-flex; gap: 4px; flex-wrap: wrap; padding: 4px; margin-bottom: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; max-width: 100%; }
.tabs button { background: transparent; color: var(--muted); border-radius: 10px; padding: 7px 14px; font-weight: 600; }
.tabs button:hover { box-shadow: none; color: var(--ink); }
.tabs button.on { background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.up { color: var(--ok); } .down { color: var(--bad); }

/* ---------- widgets ---------- */
.clock { text-align: center; padding: 26px 18px; position: relative; overflow: hidden; }
.clock .time { font-size: 54px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--accent-fg); text-shadow: 0 0 30px color-mix(in srgb, var(--accent) 35%, transparent); }
.clock button { font-size: 17px; padding: 14px 34px; margin-top: 14px; border-radius: 16px; }
.gauge { display: grid; place-items: center; text-align: center; } .gauge svg { width: 100%; max-width: 220px; } .gauge b { font-size: 26px; display: block; margin-top: -54px; } .gauge span { color: var(--muted); font-size: 12px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.progress { height: 7px; border-radius: 99px; background: var(--raise); border: 1px solid var(--line); overflow: hidden; min-width: 80px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 50%, transparent); }
.progress.bad i { background: var(--bad); box-shadow: none; } .progress.warn i { background: var(--warn); box-shadow: none; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 13.5px; } .kv span { color: var(--muted); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); } .list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.people { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.person { background: var(--raise); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; transition: border-color .2s, transform .2s; }
.person:hover { border-color: var(--accent); transform: translateY(-2px); }
.person .top { display: flex; gap: 10px; align-items: center; } .person .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- dialog / toast ---------- */
dialog { border: 1px solid var(--line-2); border-radius: 20px; padding: 0; width: min(560px, calc(100% - 24px)); max-height: calc(100vh - 40px); box-shadow: var(--shadow); color: var(--ink); background: var(--panel-solid); }
dialog.wide { width: min(1000px, calc(100% - 24px)); }
dialog[open] { animation: rise .25s ease; }
dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
dialog .dh { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel-solid); z-index: 1; }
dialog .dh h2 { margin: 0; } dialog .db { padding: 18px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--panel-solid); color: var(--ink); border: 1px solid var(--accent); box-shadow: var(--glow);
  padding: 11px 18px; border-radius: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 32px); z-index: 30; font-weight: 600; }
#toast.show { opacity: 1; transform: translate(-50%, 0); } #toast.err { border-color: var(--bad); box-shadow: 0 0 24px rgba(255, 107, 107, .25); color: var(--bad); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: 100%; max-width: 410px; padding: 30px; box-shadow: var(--shadow); }
.auth form { display: grid; gap: 14px; margin-top: 14px; }
.auth .brand { padding: 0 0 14px; }

/* ---------- module bits ---------- */
table.entry input { min-width: 74px; padding: 6px 8px; } table.entry td, table.entry th { padding: 4px 6px; }
.task { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: var(--raise); transition: border-color .2s; }
.task:has([data-k=on]:checked) { border-color: var(--accent); }
.task .f { margin-top: 10px; } .task:has([data-k=on]:not(:checked)) .f { display: none; }
.remark { background: rgba(245, 184, 75, .12); color: var(--warn); border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.prio { padding-left: 20px; } .prio li { padding: 6px 0; display: flex; justify-content: space-between; max-width: 380px; }
.ckitem { padding: 8px 0; border-bottom: 1px solid var(--line); }
.themes { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { display: grid; gap: 6px; justify-items: center; font-size: 12px; color: var(--muted); background: none; border: 0; padding: 4px; }
.swatch i { width: 42px; height: 42px; border-radius: 14px; border: 2px solid var(--line-2); display: block; } .swatch.on i { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.swatch:hover { box-shadow: none; }
.preview { border: 1px dashed var(--line-2); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
details { margin-top: 10px; } summary { cursor: pointer; font-weight: 600; }
.slip { max-width: 760px; }
.slip .head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--accent); padding-bottom: 12px; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.slip .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.slip .net { background: var(--accent); color: var(--accent-ink); border-radius: 14px; padding: 14px 16px; display: flex; justify-content: space-between; font-size: 19px; font-weight: 800; margin-top: 14px; box-shadow: var(--glow); }
.letter { max-width: 720px; margin: 0 auto; line-height: 1.65; }
.letter .lh { border-bottom: 2px solid var(--accent); padding-bottom: 8px; margin-bottom: 14px; }
.letter blockquote { border-left: 3px solid var(--accent); margin: 8px 0; padding: 4px 12px; }
.letter .sign { display: flex; justify-content: space-between; gap: 20px; margin-top: 50px; flex-wrap: wrap; }
.cal { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cal .m { background: var(--raise); border: 1px solid var(--line); border-radius: 14px; padding: 12px; } .cal .m h3 { margin-bottom: 8px; color: var(--accent-fg); }
.cal .d { display: flex; gap: 10px; padding: 5px 0; font-size: 13px; } .cal .d b { width: 28px; text-align: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent-fg); }

@media (max-width: 900px) {
  .shell, .shell.rail { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 20; transform: translateX(-105%); transition: transform .22s; padding: 10px; }
  .side.open { transform: none; } .rail .brand span, .rail .navs a span, .rail .navs .group, .rail .who-info { display: revert; }
  .main { padding: 8px 12px 96px; }
  .topbar { top: 8px; padding: 8px 10px; } .search { display: none; } h1 { font-size: 20px; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 15; background: var(--panel-solid); border: 1px solid var(--line-2);
    border-radius: 20px; padding: 6px; box-shadow: var(--shadow); }
  .bottomnav a { display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; text-decoration: none; color: var(--muted); padding: 6px 0; border-radius: 14px; }
  .bottomnav a.on { background: var(--accent); color: var(--accent-ink); }
  .slip .cols { grid-template-columns: 1fr; }
  .clock .time { font-size: 44px; }
}
@media (min-width: 901px) { #menu { display: none; } }
@media (max-width: 900px) { .rail-btn { display: none !important; } }
.topbar > a { text-decoration: none; display: grid; }
.thumb { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line-2); vertical-align: middle; }
.rail .who { flex-direction: column; padding: 12px 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
@media print {
  :root { --ink: #000; --muted: #444; --panel: #fff; --line: #ddd; --accent: #000; --accent-ink: #fff; }
  body { background: #fff; } .side, .topbar, .bottomnav, .noprint, #toast { display: none !important; }
  .shell { display: block; } .card { border: 0; backdrop-filter: none; } .slip .net { color: #fff; box-shadow: none; }
  body:has(dialog[open]) > :not(dialog) { display: none !important; }
  dialog { position: static; box-shadow: none; width: 100%; max-height: none; border: 0; background: #fff; } dialog .dh { display: none; }
}

/* ---------- zombies ---------- */
.zb .shut, .zb .xx, .zb .m-sad { display: none; }
.zb .pupil { transition: transform .12s ease-out; }
.zb .open { transform-origin: center; animation: blink 5s infinite; }
.zb-tall .open { animation-delay: 1.3s; } .zb-shorty .open { animation-delay: 2.1s; } .zb-capsule .open { animation-delay: 3.4s; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.blink-led { animation: led 1.6s ease-in-out infinite; } @keyframes led { 50% { opacity: .25; } }
.drool { animation: drool 2.4s ease-in-out infinite; transform-origin: top; } @keyframes drool { 50% { transform: scaleY(1.5); } }
.away .zb .pupil { transform: translate(-3px, -2.5px) !important; }
.away .zb .open { animation: none; transform: scaleY(.55); }
.away .zb { transform: rotate(-3deg) translateX(-4px); }
.peek .zb-shorty .pupil, .peek .zb-capsule .pupil { transform: translate(3px, 1px) !important; }
.peek .zb-tall .open, .peek .zb-dome .open { display: none; } .peek .zb-tall .shut, .peek .zb-dome .shut { display: inline; }
.happy .zb .open { display: none; } .happy .zb .shut { display: inline; transform: scaleY(-1); }
.happy .zb { animation: hop .5s ease 2; } @keyframes hop { 50% { transform: translateY(-14px); } }
.sad .zb .open { display: none; } .sad .zb .xx { display: inline; } .sad .zb .m-ok { display: none; } .sad .zb .m-sad { display: inline; }

/* ---------- auth ---------- */
.auth2 { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(980px, 100%); display: grid; grid-template-columns: 1.05fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 28px; overflow: hidden;
  box-shadow: var(--shadow), 0 0 80px color-mix(in srgb, var(--accent) 8%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); animation: rise .5s ease both; }
.auth-art { position: relative; min-height: 560px; padding: 26px; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(420px 300px at 30% 110%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%), radial-gradient(300px 220px at 90% 10%, rgba(255, 122, 69, .16), transparent 70%), linear-gradient(160deg, #121714, #0b0e0c); }
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 34px 34px; mask-image: linear-gradient(transparent, #000 60%); opacity: .6; }
.auth-art .brand { padding: 0; position: relative; color: #eef3ea; }
.auth-copy { position: relative; margin-top: 34px; color: #eef3ea; } .auth-copy h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 8px; max-width: 340px; } .auth-copy p { color: #8d978f; margin: 0; }
.crew { position: relative; margin-top: auto; height: 250px; }
.crew .zb { position: absolute; bottom: -2px; transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); }
.crew .zb-tall { left: 27%; width: 25%; } .crew .zb-shorty { left: 49%; width: 19%; } .crew .zb-capsule { left: 66%; width: 21%; } .crew .zb-dome { left: 2%; width: 46%; }
.auth-form { padding: 46px 42px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { font-size: 28px; margin: 14px 0 4px; } .auth-form form { display: grid; gap: 14px; margin: 20px 0 10px; }
.logo.sm { width: 40px; height: 40px; border-radius: 13px; }
.pw { position: relative; display: block; } .pw input { padding-right: 44px; }
.pwbtn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); background: transparent; color: var(--muted); padding: 6px; border-radius: 9px; }
.pwbtn:hover { box-shadow: none; color: var(--accent-fg); }
button.wide { width: 100%; justify-content: center; padding: 12px; margin-top: 4px; }
.center { text-align: center; }
@media (max-width: 760px) {
  .auth-card { grid-template-columns: 1fr; } .auth-art { min-height: 0; padding: 20px 20px 0; } .auth-copy { margin-top: 14px; } .auth-copy h2 { font-size: 21px; }
  .crew { height: 170px; margin-top: 18px; } .auth-form { padding: 26px 22px 30px; } .auth-form .logo.sm { display: none; }
}

/* ---------- 404 ---------- */
.nf { position: relative; min-height: calc(100vh - 140px); display: grid; place-items: center; overflow: hidden; border-radius: 24px; text-align: center; padding: 30px 16px; --gust: 0;
  background: radial-gradient(520px 320px at 50% 40%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.nf.full { min-height: 100vh; border-radius: 0; }
.nf-wind i { position: absolute; left: -20%; top: var(--y); width: var(--w); height: 2px; border-radius: 2px; opacity: .45;
  background: linear-gradient(90deg, transparent, var(--accent)); animation: gust var(--d) linear infinite; }
@keyframes gust { from { transform: translateX(0); } to { transform: translateX(140vw); } }
.nf-stage { position: relative; z-index: 1; max-width: 560px; }
.nf-num { display: flex; justify-content: center; align-items: flex-end; gap: 6px; font-size: clamp(110px, 22vw, 200px); font-weight: 900; line-height: .85; letter-spacing: -.04em; margin-bottom: 26px;
  transform: skewX(calc(var(--gust) * -8deg)); }
.nf-num span { background: linear-gradient(180deg, var(--ink), color-mix(in srgb, var(--ink) 25%, transparent)); -webkit-background-clip: text; background-clip: text; color: transparent; position: relative; }
.nf-num .zero { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 20%, transparent)); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 24px color-mix(in srgb, var(--accent) 40%, transparent)); }
.nf-num .zb-mini { position: absolute; left: 50%; bottom: 72%; width: 62%; transform: translateX(-50%) rotate(calc(var(--gust) * -12deg)); transform-origin: bottom; animation: peek 3.2s ease-in-out infinite; filter: none; }
@keyframes peek { 0%, 100% { margin-bottom: 0; } 50% { margin-bottom: 6px; } }
.nf .kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .3em; color: var(--accent-fg); font-weight: 700; }
.nf-title { font-size: clamp(28px, 5vw, 44px); margin: 8px 0 10px; } .nf-title b { display: inline-block; font-weight: 800; transition: transform .08s linear; white-space: pre; }
.nf p { margin: 0 auto 22px; max-width: 420px; }

/* ---------- FizAI ---------- */
.fizai { position: fixed; left: 22px; bottom: 22px; z-index: 25; }
.fab { width: 62px; height: 62px; border-radius: 20px; padding: 6px; background: var(--panel-solid); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: var(--glow), var(--shadow); animation: float 3.4s ease-in-out infinite; position: relative; }
.fab:hover { box-shadow: 0 0 0 1px var(--accent), 0 0 36px color-mix(in srgb, var(--accent) 35%, transparent); }
.fab .robot { width: 100%; height: 100%; } .robot .led { fill: currentColor; animation: led 1.4s infinite; } .robot .r-eyes circle { fill: currentColor; animation: blink 4s infinite; transform-box: fill-box; transform-origin: center; }
.fab-tip { position: absolute; left: 72px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--panel-solid); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 5px 10px; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.fab:hover .fab-tip { opacity: 1; } .fizai.open .fab { animation: none; } .fizai.open .fab-tip { display: none; }
@keyframes float { 50% { transform: translateY(-5px); } }
.panel { position: absolute; left: 0; bottom: 76px; width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100vh - 120px)); display: flex; flex-direction: column;
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow), 0 0 60px color-mix(in srgb, var(--accent) 10%, transparent); overflow: hidden;
  transform-origin: bottom left; animation: pop .25s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes pop { from { opacity: 0; transform: scale(.85) translateY(10px); } }
.panel header { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); }
.panel header small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.panel header small i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); } .panel header small i.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.iconbtn.sm { width: 32px; height: 32px; border-radius: 10px; } .iconbtn.sm .ico { width: 16px; height: 16px; }
.pav { width: 34px; height: 34px; flex: none; color: var(--accent); display: grid; } .pav .robot { width: 100%; height: 100%; } .pav.big { width: 64px; height: 64px; margin: 0 auto 8px; }
.flog { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.hello { text-align: center; margin: auto 0; } .hello h3 { font-size: 17px; margin-bottom: 6px; }
.tip { text-align: left; margin-top: 14px; background: var(--raise); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; font-size: 13px; } .tip b { color: var(--accent-fg); } .tip p { margin: 6px 0 0; color: var(--muted); }
.msg { display: flex; gap: 8px; align-items: flex-end; animation: rise .25s ease both; } .msg .pav { width: 26px; height: 26px; }
.msg.user { justify-content: flex-end; }
.bubble { max-width: 84%; padding: 10px 13px; border-radius: 16px; font-size: 13.8px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; font-weight: 500; }
.msg.assistant .bubble { background: var(--raise); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble p { margin: 0 0 7px; } .bubble p:last-child { margin: 0; } .bubble ul, .bubble ol { margin: 4px 0 8px; padding-left: 20px; } .bubble li { margin: 2px 0; }
.bubble a { color: var(--accent-fg); font-weight: 600; } .bubble code { background: var(--field); padding: 1px 5px; border-radius: 5px; color: var(--ink); }
.dots { display: inline-flex; gap: 4px; } .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite; } .dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-4px); opacity: .4; } }
.fsug { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 8px; scrollbar-width: none; } .fsug::-webkit-scrollbar { display: none; }
.fsug button { flex: none; background: var(--raise); color: var(--ink); border: 1px solid var(--line-2); border-radius: 99px; padding: 6px 12px; font-size: 12.5px; font-weight: 500; }
.fsug button:hover { box-shadow: none; border-color: var(--accent); color: var(--accent-fg); }
.fin { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.fin textarea { overflow: hidden; min-height: 42px; max-height: 120px; resize: none; border-radius: 14px; padding: 10px 12px; line-height: 1.4; }
.fin button { width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 14px; flex: none; }
@media (max-width: 900px) {
  .fizai { left: 14px; bottom: 92px; } .fab { width: 54px; height: 54px; border-radius: 17px; }
  .panel { position: fixed; left: 10px; right: 10px; bottom: 10px; width: auto; height: min(78vh, 640px); }
}
.nf-title .w { display: inline-block; white-space: nowrap; }
.nf-num .zb-mini { width: 80%; }
@media (max-width: 760px) { .crew { height: 150px; } .crew .zb { max-height: 150px; } }
@media (hover: none) { .fab-tip { display: none; } }

/* ---------- brand mark + wordmark; assistant moved bottom-right ---------- */
.logo { background: none; box-shadow: none; position: relative; width: 38px; height: 38px; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 45%, transparent)); }
.logo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 65%, #fff), var(--accent) 55%, color-mix(in srgb, var(--accent) 70%, #000));
  -webkit-mask: url(/logo-mark.png) center / contain no-repeat; mask: url(/logo-mark.png) center / contain no-repeat; }
:root[data-mode="light"] .side .logo::before { background: linear-gradient(150deg, var(--accent), var(--accent-fg)); }
.logo.sm { width: 46px; height: 46px; border-radius: 0; }
.title h1 { display: flex; align-items: center; gap: 12px; }
.wordmark { display: inline-flex; align-items: flex-start; gap: 1px; padding-left: 12px; border-left: 1px solid var(--line-2); font-weight: 900; font-size: .62em; letter-spacing: .04em; color: var(--accent-fg); line-height: 1; }
.wordmark svg { width: .5em; height: .5em; fill: currentColor; margin-top: .55em; }
.fizai { left: auto; right: 22px; }
.panel { left: auto; right: 0; transform-origin: bottom right; }
.fab-tip { left: auto; right: 72px; }
@media (max-width: 900px) { .fizai { left: auto; right: 14px; } .panel { left: 10px; right: 10px; } }
@media (max-width: 520px) { .title h1 { gap: 8px; } .wordmark { font-size: .5em; padding-left: 8px; } }

/* read-only view (accountant on books, sales staff on reward rules): hide save/delete actions */
.ro form button[type="submit"], .ro [data-act="del"], .ro [data-act="edit"], .ro [data-act="post"], .ro [data-act="reject"] { display: none !important; }
