:root {
  --red: #d0112b;
  --red-dark: #9c0c1f;
  --red-soft: #fdecee;
  --black: #0b0b0e;
  --glow: radial-gradient(70% 45% at 0% 100%, #b30d24cc 0%, transparent 70%), radial-gradient(55% 40% at 100% 0%, #8a0a1a99 0%, transparent 70%), var(--black);
  --display: "Montserrat", "Segoe UI", system-ui, Arial, sans-serif;
  --ink: #1d2027;
  --ink-2: #4a505c;
  --muted: #7b8190;
  --line: #e6e8ee;
  --bg: #f4f5f8;
  --card: #fff;
  --side: #0b0b0e;
  --side-2: #1d1d24;
  --green: #2e9e5b;
  --green-soft: #e5f5ec;
  --yellow: #e8b21e;
  --yellow-soft: #fdf5dc;
  --grey: #9aa0ab;
  --grey-soft: #eff0f3;
  --blue: #2f6fdb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 35, .06), 0 2px 8px rgba(20, 24, 35, .04);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-family: var(--display); }
h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
.boot { min-height: 100vh; display: grid; place-items: center; font-size: 0; }
.boot::before { content: ""; width: 64px; height: 64px; border-radius: 16px; background: url(/img/synergy-logo.png) center / cover; animation: boot-pulse 1.2s ease-in-out infinite; }
@keyframes boot-pulse { 50% { transform: scale(.92); opacity: .6; } }
/* loading skeleton (app.js SKELETON) */
.sk i { display: block; }
.sk-line, .sk-av { border-radius: 6px; height: 12px; background: linear-gradient(90deg, #eceef2 0%, #f6f7f9 40%, #eceef2 80%) 0 0 / 300% 100%; animation: sk-shine 1.3s linear infinite; }
.sk-line.h26 { height: 26px; }
.w10 { width: 10%; } .w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; }
.sk-head { display: grid; gap: 10px; margin-bottom: 22px; }
.sk-card { display: grid; gap: 12px; margin-bottom: 14px; }
.sk-table { padding: 6px 16px; }
.sk-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid #f0f1f4; }
.sk-row:last-child { border-bottom: 0; }
.sk-row .sk-line:nth-child(2) { flex: 1; max-width: 320px; }
.sk-av { width: 34px; height: 34px; border-radius: 50%; flex: none; }
@keyframes sk-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk-line, .sk-av, .boot::before { animation: none; } }
/* line icons (js/icons.js) */
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.btn .i, .badge .i { width: 1.1em; height: 1.1em; }
.i.heat { width: 1em; height: 1em; color: #f0622d; fill: #f0622d33; margin-right: 1px; }
.i.flow { width: .95em; height: .95em; color: var(--muted); margin: 0 1px; }
.badge .i { vertical-align: -.18em; margin-right: 2px; }
.btn.sm:has(> .i:only-child) { padding-inline: 7px; }
.btn.ghost[title="Устгах"]:hover, .btn.ghost[title="Цуцлах"]:hover, .btn.ghost[title="Багаас хасах"]:hover { color: var(--red); background: var(--red-soft); }
.checklist .item .tick .i { width: 12px; height: 12px; stroke-width: 3.5; }
.icon-tile { width: 48px; height: 48px; border-radius: 12px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; }
.icon-tile .i { width: 24px; height: 24px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pre { white-space: pre-wrap; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: radial-gradient(130% 35% at 0% 100%, #8c0a1c 0%, transparent 70%), radial-gradient(90% 20% at 100% 0%, #4a0812 0%, transparent 75%), var(--side); color: #d9dbe1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 14px 14px; }
.brand-logo { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px #ffffff1a, 0 4px 18px #d0112b55; }
.brand b { display: block; color: #fff; font-family: var(--display); font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.brand span { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 10.5px; color: var(--red); letter-spacing: .08em; text-transform: uppercase; }
.energy { font-family: var(--display); font-style: italic; font-weight: 900; text-transform: uppercase; color: var(--red); letter-spacing: .02em; }
.nav { padding: 6px 10px 16px; display: grid; gap: 2px; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #858a96; margin: 14px 8px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: #d9dbe1; font-size: 13.5px; }
.nav a:hover { background: #ffffff0f; }
.nav a.active { background: linear-gradient(90deg, var(--red) 0%, #8f0a1b 100%); color: #fff; font-weight: 600; box-shadow: 0 4px 16px #d0112b40; }
.nav .ico { width: 18px; display: grid; place-items: center; opacity: .85; }
.nav .ico .i { width: 18px; height: 18px; }
.nav a.active .ico { opacity: 1; }
.topbar #menu .i { width: 24px; height: 24px; }
.tl-ok { color: var(--green); }
.nav .badge { margin-left: auto; background: #fff2; color: #fff; font-size: 11px; padding: 0 7px; border-radius: 10px; }
.nav a.active .badge { background: #fff3; }
.side-foot { margin-top: auto; padding: 12px 14px; border-top: 1px solid #ffffff12; font-size: 12px; }
.side-foot button { width: 100%; margin-top: 8px; background: transparent; color: #fff; border-color: #ffffff33; }
.side-foot button:hover { background: var(--side-2); border-color: #ffffff55; }
.main { min-width: 0; }
.topbar, .tabbar, .side-backdrop { display: none; }
.page { padding: 22px 26px 60px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head h1 { position: relative; padding-left: 14px; }
.page-head h1::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 2px; background: var(--red); }
.demo-banner { background: var(--yellow-soft); color: #6d5300; padding: 6px 26px; font-size: 12.5px; border-bottom: 1px solid #f1e2b0; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card.accent { border-top: 3px solid var(--red); }
.card.callout { background: var(--red-soft); border-color: #f6c9ce; }
.stat { padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 6px; }
.stat .value { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.good { border-top: 3px solid var(--green); }
.stat.bad { border-top: 3px solid var(--red); }
.stat.warn { border-top: 3px solid var(--yellow); }
.delta-up { color: var(--green); font-weight: 600; }
.delta-down { color: var(--red); font-weight: 600; }

/* ---------- buttons, forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #cdd1da; background: #fafbfc; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.dark { background: var(--black); border-color: var(--black); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: #0000000a; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.lg { padding: 11px 18px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.btn-group button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
.btn-group button.on { background: var(--ink); color: #fff; }
label.field { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.input, input[type=text], input[type=number], input[type=date], input[type=time], input[type=tel], input[type=email], input[type=password], input[type=search], input[type=datetime-local], input[type=month], select, textarea {
  width: 100%; border: 1px solid #d8dbe3; background: #fff; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; outline: none; font-weight: 400;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px #cf20301a; }
textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
.search { max-width: 260px; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.t td { padding: 9px 10px; border-bottom: 1px solid #f0f1f4; vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #fafbfd; }
.t tfoot td { font-weight: 700; background: #fafbfc; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
td.empty { padding: 22px 12px; font-size: 13px; }
.empty-ico { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto 8px; border-radius: 50%; background: #f1f2f5; color: #a3a8b3; }
.empty-ico .i { width: 19px; height: 19px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 650; background: var(--grey-soft); color: var(--ink-2); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: #1d7a43; }
.badge.yellow { background: var(--yellow-soft); color: #8a6500; }
.badge.red { background: var(--red-soft); color: var(--red-dark); }
.badge.grey { background: var(--grey-soft); color: #5d6370; }
.badge.blue { background: #e7effd; color: #2155b0; }
.badge.dark { background: var(--ink); color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--grey); flex: none; }
.dot.green { background: var(--green); } .dot.yellow { background: var(--yellow); } .dot.red { background: var(--red); } .dot.grey { background: var(--grey); }
.palms { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 750; font-size: 12px; background: var(--grey-soft); color: var(--ink-2); }
.palms.P { background: var(--green-soft); color: #1d7a43; }
.palms.L { background: var(--yellow-soft); color: #8a6500; }
.palms.A { background: var(--red-soft); color: var(--red-dark); }
.palms.M { background: #e7effd; color: #2155b0; }
.palms.S { background: #efe8fb; color: #6a3fb8; }

/* ---------- avatar ---------- */
.av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; color: #fff; font-weight: 700; flex: none; font-size: 14px; }
.av.lg { width: 64px; height: 64px; font-size: 24px; }
.av.xl { width: 110px; height: 110px; font-size: 42px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .nm { font-weight: 650; }
.person .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; }
.tabs button { border: 0; background: none; padding: 9px 12px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 13.5px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--red); }
.tabs .count { font-size: 11px; background: var(--grey-soft); border-radius: 10px; padding: 0 6px; margin-left: 4px; }

/* ---------- member cards ---------- */
.mcard { display: flex; gap: 14px; align-items: flex-start; padding: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.mcard:hover { border-color: #e3b3ba; box-shadow: 0 6px 18px -10px #d0112b55; transform: translateY(-1px); }
.mcard .av.lg { width: 52px; height: 52px; font-size: 21px; border-radius: 14px; }
.mcard .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard .cat { font-size: 12.5px; color: var(--red); font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 1px; }
.mcard .co { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- checklist ---------- */
.checklist { display: grid; gap: 2px; }
.checklist .stage-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 4px; font-weight: 700; }
.checklist .item { display: flex; gap: 9px; align-items: flex-start; padding: 7px 6px; border-radius: 8px; }
.checklist .item .tick { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c8ccd5; flex: none; margin-top: 1px; display: grid; place-items: center; font-size: 11px; color: #fff; }
.checklist .item.done .tick { background: var(--green); border-color: var(--green); }
.checklist .item.done .lbl { color: var(--muted); text-decoration: line-through; }
.checklist .item .meta { font-size: 11.5px; color: var(--muted); }

/* ---------- bars & charts ---------- */
.bar { height: 8px; background: var(--grey-soft); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--red); border-radius: 6px; }
.bar.green > i { background: var(--green); }
.bar.yellow > i { background: var(--yellow); }
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 18px; }
.vbars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.vbars .col i { display: block; width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: var(--green); }
.vbars .col i.yellow { background: var(--yellow); } .vbars .col i.red { background: var(--red); } .vbars .col i.grey { background: #d5d8df; }
.vbars .col b { font-size: 11px; color: var(--ink-2); }
.vbars .col span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
svg.spark { display: block; width: 100%; height: 34px; }
.spark-wrap { position: relative; margin-top: 8px; cursor: crosshair; }
.spark-wrap .spark-dot, .spark-wrap .spark-hot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff; transform: translate(-50%, -50%); pointer-events: none; }
.spark-wrap .spark-x { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line, #e3e5ea); pointer-events: none; }
.spark-wrap .spark-tip { position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); background: var(--black, #0b0b0e); color: #fff; border-radius: 8px; padding: 5px 9px; font-size: 11px; white-space: nowrap; pointer-events: none; display: grid; text-align: center; z-index: 5; box-shadow: 0 6px 18px #0003; }
.spark-wrap .spark-tip b { font-size: 13px; }
.spark-wrap .spark-tip span { opacity: .65; }
.spark-wrap:not(.hover) :is(.spark-x, .spark-hot, .spark-tip) { display: none; }
.spark-wrap.hover .spark-dot { opacity: .35; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 18, 26, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(900px, 100%); }
.modal.confirm { width: min(400px, 100%); padding: 26px 24px 20px; text-align: center; animation: cf-in .16s ease-out; }
.modal.confirm h2 { font-size: 17px; line-height: 1.4; margin: 14px 0 0; }
.modal.confirm p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.cf-ico { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #eef0f4; color: var(--ink-2); }
.cf-ico .i { width: 24px; height: 24px; }
.modal.confirm.danger .cf-ico { background: var(--red-soft); color: var(--red); }
.cf-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.cf-foot .btn { justify-content: center; padding-block: 10px; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: var(--red-dark); }
@keyframes cf-in { from { transform: scale(.96); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
#toast-root { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 380px; font-size: 13.5px; animation: pop .18s ease-out; }
.toast.err { background: var(--red); }
.toast.ok { background: #1d7a43; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- login ---------- */
/* two halves: red brand panel | light form panel */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #f5f5f7; }
.login-art { position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; color: #fff;
  background: radial-gradient(70% 50% at 100% 100%, #ff3b5233 0%, transparent 70%), linear-gradient(155deg, #d8122d 0%, #a50d22 50%, #5c0713 100%); }
/* banner's world map: screen blend drops its black background, leaving only the light network lines */
.login-art::before { content: ""; position: absolute; inset: 0; background: url(/img/synergy-banner.png) left center / auto 100% no-repeat; mix-blend-mode: screen; opacity: .35; -webkit-mask-image: linear-gradient(90deg, #000 0, #0008 25vh, transparent 50vh); mask-image: linear-gradient(90deg, #000 0, #0008 25vh, transparent 50vh); }
.login-art > * { position: relative; }
.login-art .brand-logo { width: 60px; height: 60px; border-radius: 15px; box-shadow: 0 6px 20px #0004; }
.login-copy { display: grid; gap: 14px; }
.login-art h1 { font-size: clamp(28px, 3vw, 44px); line-height: 1.08; font-weight: 900; text-transform: uppercase; }
.login-art h1 em { font-style: normal; color: #1a0306; }
.login-art .energy { font-size: clamp(24px, 2.6vw, 38px); line-height: 1; color: #fff; }
.login-art p { color: #ffffffd0; max-width: 440px; margin: 6px 0 0; font-size: 15px; line-height: 1.6; }
.login-foot { font-size: 12px; color: #ffffffa0; letter-spacing: .04em; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(400px, 100%); display: grid; gap: 14px; padding: 36px 32px 28px; background: #fff; border: 1px solid #ececf0; border-radius: 18px; box-shadow: 0 1px 2px #0000000a, 0 12px 32px -12px #1a0a0e26; color: var(--ink); }
.login-card h2 { font-size: 24px; font-weight: 800; }
.login-card .lc-sub { color: var(--muted); margin: -8px 0 8px; font-size: 14px; }
.lf-field { position: relative; display: block; }
.lf-field > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #9aa0ab; pointer-events: none; }
.login-card .lf-field input { height: 48px; padding: 0 44px; border-radius: 12px; background: #fafafb; border: 1px solid #dcdee5; font-size: 15px; }
.login-card .lf-field input:focus { background: #fff; border-color: var(--red); box-shadow: 0 0 0 3px #d0112b1f; }
.lf-field:focus-within > svg { color: var(--red); }
.lf-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: #9aa0ab; cursor: pointer; display: grid; place-items: center; }
.lf-eye:hover { color: var(--ink); background: #f0f1f4; }
.lf-eye svg { width: 18px; height: 18px; }
.lf-submit { height: 48px; margin-top: 6px; border: 0; border-radius: 12px; cursor: pointer; color: #fff; background: var(--red); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 6px 16px -6px #d0112b80; }
.lf-submit:hover { background: var(--red-dark); }
.lf-submit svg { width: 18px; height: 18px; }
.lf-submit:disabled { opacity: .7; cursor: wait; }
.lf-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #ffffff55; border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.lf-note { margin: 4px 0 0; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- AI chat ---------- */
.chat { display: grid; grid-template-rows: 1fr auto; height: calc(100vh - 150px); min-height: 420px; }
.chat-log { overflow-y: auto; padding: 4px 4px 12px; display: grid; gap: 12px; align-content: start; }
.msg { max-width: 820px; padding: 12px 14px; border-radius: 12px; white-space: pre-wrap; line-height: 1.55; }
.msg.user { background: var(--ink); color: #fff; justify-self: end; }
.msg.assistant { background: #fff; border: 1px solid var(--line); }
.msg.assistant table { border-collapse: collapse; margin: 6px 0; }
.msg.assistant td, .msg.assistant th { border: 1px solid var(--line); padding: 4px 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; }
.chip:hover { border-color: var(--red); color: var(--red); }

/* ---------- presentation & screens (dark, full-screen) ---------- */
.stage { position: fixed; inset: 0; background: var(--glow); color: #fff; display: grid; grid-template-rows: auto 1fr auto; z-index: 40; }
.stage.red { background: radial-gradient(90% 55% at 50% 125%, #e0142f 0%, #8f0a1b 45%, transparent 75%), radial-gradient(60% 40% at 100% 0%, #5a0712aa 0%, transparent 70%), var(--black); }
.stage-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; font-size: 13px; color: #fffc; gap: 10px; }
.stage-top .pill { background: #ffffff12; border: 1px solid #ffffff1a; padding: 4px 10px; border-radius: 16px; }
.stage-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #fff; }
.stage-brand img { width: 38px; height: 38px; border-radius: 9px; }
.stage-body { display: grid; place-items: center; padding: 10px 40px; overflow: hidden; }
.stage-bar { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 12px; background: #0005; flex-wrap: wrap; }
.stage-bar .btn { background: #ffffff1a; border-color: #ffffff2a; color: #fff; }
.stage-bar .btn.primary { background: var(--red); border-color: var(--red); }
.slide { text-align: center; width: min(1200px, 100%); }
.slide .kicker { font-family: var(--display); letter-spacing: .25em; font-weight: 800; color: var(--red); font-size: 18px; }
.stage.red .slide .kicker { color: #fff; opacity: .85; }
.slide h1 { font-size: clamp(34px, 5vw, 64px); margin: 10px 0; font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; }
/* EduSlot / feature poster, modelled on the chapter's social posts */
.poster-slide { display: grid; grid-template-columns: minmax(260px, 400px) 1fr; gap: 48px; align-items: center; text-align: left; }
.poster-photo { aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; border: 2px solid var(--red); box-shadow: 0 0 40px #d0112b66, inset 0 0 0 1px #ffffff22; background: radial-gradient(80% 60% at 50% 100%, #8f0a1b, #1a1a20); display: grid; place-items: center; }
.poster-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-photo .av { width: 60%; height: auto; aspect-ratio: 1; font-size: 96px; }
.poster-tag { display: inline-block; border: 1px solid #ffffff55; padding: 4px 12px; font-family: var(--display); font-weight: 700; letter-spacing: .2em; font-size: 14px; }
.poster-slide h1 { margin: 14px 0 4px; line-height: 1.02; }
.poster-slide .topic-2 { font-family: var(--display); font-weight: 900; text-transform: uppercase; color: var(--red); font-size: clamp(22px, 3vw, 40px); }
.poster-field { margin-top: 18px; }
.poster-field small { display: block; font-family: var(--display); font-weight: 700; letter-spacing: .2em; font-size: 13px; color: #ffffffaa; }
.poster-field b { font-family: var(--display); font-size: clamp(20px, 2.4vw, 32px); font-weight: 800; }
.poster-field span { font-size: clamp(16px, 1.6vw, 21px); }
.poster-slide #timer { text-align: left; }
.poster-slide .timer-bar { margin-left: 0; }
.slide-logo { width: 150px; height: 150px; border-radius: 26px; box-shadow: 0 0 60px #d0112b77; }
.slide .energy { font-size: clamp(22px, 2.6vw, 34px); margin-top: 4px; }
.stage.red .slide .energy { color: #fff; }
.poster-loc { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; background: #ffffff14; border: 1px solid #ffffff22; padding: 8px 16px; border-radius: 30px; font-weight: 600; }
.slide .sub { font-size: clamp(16px, 1.8vw, 22px); opacity: .85; }
.qr-pair { display: flex; gap: 40px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.qr-box { background: #fff; color: var(--ink); border-radius: 18px; padding: 18px; width: 290px; }
.qr-box img { width: 100%; display: block; }
.qr-box b { display: block; margin-top: 8px; font-size: 16px; }
.qr-box span { font-size: 12px; color: var(--muted); }
.timer { font-family: var(--display); font-size: 64px; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer.warn { color: #ffcc4d; }
.timer.over { color: #ff6b6b; }
#timer { display: inline-block; text-align: center; }
.timer-bar { height: 6px; background: #ffffff22; border-radius: 4px; overflow: hidden; width: 260px; margin: 6px auto 0; }
.timer-bar i { display: block; height: 100%; background: #3ddc84; transition: width 1s linear; }
.present-member { display: grid; grid-template-columns: 340px 1fr; gap: 40px; align-items: center; text-align: left; }
.present-member .pcard { background: #fff; color: var(--ink); border-radius: 20px; padding: 26px; text-align: center; }
.present-member .poster { background: #ffffff10; border: 1px solid #ffffff22; border-radius: 20px; min-height: 380px; display: grid; place-items: center; overflow: hidden; }
.present-member .poster img { max-width: 100%; max-height: 60vh; display: block; }
.ref-panel { background: #fff; color: var(--ink); border-radius: 20px; padding: 18px; text-align: left; min-height: 360px; display: grid; grid-template-rows: auto 1fr auto; gap: 10px; }
.agenda-list { text-align: left; columns: 2; column-gap: 40px; font-size: 18px; max-width: 980px; margin: 20px auto 0; }
.agenda-list li { margin-bottom: 8px; break-inside: avoid; }
.agenda-list li.on { color: #ffd34d; font-weight: 700; }
.screen-grid { display: grid; grid-template-columns: 420px 1fr; gap: 30px; width: 100%; height: 100%; padding: 10px 30px 30px; }
.screen-qr { background: #fff; color: var(--ink); border-radius: 20px; padding: 24px; display: grid; align-content: center; gap: 12px; text-align: center; }
.screen-qr img { width: 100%; }
.screen-faces { display: flex; flex-wrap: wrap; gap: 18px; align-content: flex-start; }
.screen-faces .face { width: 104px; text-align: center; font-size: 12px; }
.screen-faces .face .av { width: 76px; height: 76px; font-size: 30px; border: 3px solid #3ddc84; }
.screen-faces .face.late .av { border-color: #ffcc4d; }
.screen-stat { background: #ffffff12; border-radius: 12px; padding: 10px 16px; }
.screen-stat b { font-size: 30px; display: block; }
.kiosk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; width: 100%; align-content: start; overflow-y: auto; max-height: 100%; padding: 4px; }
.kiosk-grid button { background: #ffffff10; border: 1px solid #ffffff20; color: #fff; border-radius: 14px; padding: 14px 8px; cursor: pointer; display: grid; justify-items: center; gap: 8px; }
.kiosk-grid button.done { opacity: .35; }
.kiosk-grid .av { width: 70px; height: 70px; font-size: 28px; }

/* ---------- gantt ---------- */
.gantt { display: grid; font-size: 12px; overflow-x: auto; }
.gantt .g-row { display: grid; grid-template-columns: 240px 1fr; border-bottom: 1px solid #f0f1f4; min-height: 34px; align-items: center; }
.gantt .g-label { padding: 6px 8px; }
.gantt .g-track { position: relative; height: 100%; min-height: 34px; }
.gantt .g-bar { position: absolute; top: 8px; height: 18px; border-radius: 5px; background: var(--red); color: #fff; font-size: 10.5px; padding: 0 6px; overflow: hidden; white-space: nowrap; line-height: 18px; }
.gantt .g-bar.ms { width: 12px !important; height: 12px; transform: rotate(45deg); top: 11px; padding: 0; border-radius: 2px; }
.gantt .g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--blue); }

/* ---------- power team plant ---------- */
.plant { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 16px 10px; }
.plant svg { width: 120px; height: 130px; }
.pt-help { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; margin-bottom: 14px; }
.pt-help p { margin: 6px 0 0; color: var(--ink-2); }
.pt-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.pt-key { display: inline-flex; align-items: center; gap: 6px; margin: 4px 12px 0 0; font-size: 12.5px; }
.pt-key i { width: 11px; height: 16px; border-radius: 50%; background: #f6c9ce; border: 1.5px solid #e8a3ac; }
.pt-key i.on { background: var(--red); border-color: #a00d20; }
.pt-key i.blank { background: #fff; border: 1.5px dashed #c9cdd5; }
.pt-loners { margin-bottom: 18px; }
.pt-loner-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; margin-top: 14px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.pt-loner { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #f1d3d7; border-radius: 10px; padding: 8px 10px; }
.pt-loner span { flex: 1; min-width: 0; display: grid; }
.pt-loner small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-loner select { width: 150px; flex: none; padding: 5px 8px; font-size: 12.5px; }
.pt-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.pt-card { display: grid; gap: 12px; }
.pt-top { display: flex; gap: 14px; align-items: flex-start; }
.pt-top h3 { margin-bottom: 6px; }
.pt-flower { width: 92px; height: 92px; flex: none; }
.pt-members { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.pt-members li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f0f1f4; font-size: 13px; }
.pt-members li a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.pt-members li small { color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-members li .btn { padding: 2px 6px; color: var(--muted); }
.pt-members li .btn:hover { color: var(--red); }
/* ---------- member profile ---------- */
.mp-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 22px 24px; flex-wrap: wrap; border-top: 3px solid var(--red); }
.mp-id { display: flex; gap: 20px; align-items: center; min-width: 0; }
.mp-id .av.xl { width: 96px; height: 96px; font-size: 38px; border-radius: 22px; box-shadow: 0 6px 18px -8px #0006; }
.mp-title { min-width: 0; display: grid; gap: 2px; }
.mp-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.mp-title h1 { font-size: 26px; }
.mp-cat { color: var(--red); font-weight: 700; font-size: 15px; }
.mp-co { color: var(--ink-2); }
.mp-contacts { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.mp-contacts a { color: var(--ink-2); text-decoration: none; }
.mp-contacts a:hover { color: var(--red); }
.mp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.mp-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.mp-stat span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mp-stat b { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-stat b small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.mp-stat b.mp-money { font-size: 20px; line-height: 39px; }
.mp-stat em { font-style: normal; font-size: 12px; color: var(--muted); }
.mp-stat.tl-green { border-left: 4px solid var(--green); } .mp-stat.tl-yellow { border-left: 4px solid var(--yellow); }
.mp-stat.tl-red { border-left: 4px solid var(--red); } .mp-stat.tl-grey { border-left: 4px solid var(--grey); }
.mp-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.mp-col { display: grid; gap: 14px; min-width: 0; }
.mp-section + .mp-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.mp-section h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mp-section p { margin: 0; line-height: 1.6; }
.mp-blank { color: #b4b8c2; font-style: italic; }
.mp-empty { border: 1px dashed #d8dbe3; border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.mp-empty p { margin: 0; max-width: 420px; }
.tl-rows { display: grid; gap: 12px; }
.tl-row { display: grid; grid-template-columns: 170px 1fr 56px; align-items: center; gap: 14px; }
.tl-name { font-weight: 600; font-size: 13px; display: grid; }
.tl-name small { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.tl-row b { text-align: right; font-variant-numeric: tabular-nums; }
.tl-row b small { color: var(--muted); font-weight: 500; }
.mp-palms { display: flex; flex-wrap: wrap; gap: 4px; }
.mp-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.mp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mp-legend .palms { width: 18px; height: 18px; font-size: 10px; }
.mp-pad { padding: 14px 16px 0; }
.mp-dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 13.5px; }
.mp-dl dt { color: var(--muted); }
.mp-dl dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.mp-sugg { display: grid; }
.mp-sugg-row { display: flex; gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid #f0f1f4; text-decoration: none; border-radius: 8px; }
.mp-sugg-row:last-child { border-bottom: 0; }
.mp-sugg-row:hover { background: #fafbfc; }
.mp-sugg-row .grow { display: grid; gap: 1px; }
.mp-sugg-row small { color: var(--muted); font-size: 12px; }
.mp-sugg-row i { font-style: normal; color: #c3c7cf; font-size: 20px; }
.mp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.mp-tags span { font-size: 10.5px; background: var(--grey-soft); color: var(--ink-2); padding: 1px 7px; border-radius: 10px; }
.mp-product { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.mp-product img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
@media (max-width: 1100px) { .mp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mp-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .mp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tl-row { grid-template-columns: 110px 1fr 48px; } .mp-id .av.xl { width: 72px; height: 72px; font-size: 30px; } }
/* ---------- website content admin ---------- */
.ws-auto { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; margin-bottom: 16px; font-size: 13px; color: var(--ink-2); background: #fafbfc; }
.ws-bar { margin-bottom: 14px; flex-wrap: nowrap; align-items: flex-start; }
.ws-bar p { margin: 0; max-width: 720px; }
.ws-bar .btn { flex: none; }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.ws-story { display: grid; gap: 12px; }
.ws-story blockquote { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink); }
.ws-result { justify-self: start; background: var(--red-soft); color: var(--red-dark); font-weight: 700; padding: 4px 10px; border-radius: 8px; font-size: 13px; }
.ws-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ws-gallery figure { margin: 0; position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ws-gallery figure.off img { opacity: .4; }
.ws-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.ws-gallery figcaption { padding: 8px 10px; display: grid; font-size: 13px; }
.ws-gallery figcaption small { color: var(--muted); }
.ws-fig-act { position: absolute; top: 8px; right: 8px; }
.empty-state { text-align: center; padding: 36px 20px; display: grid; justify-items: center; gap: 8px; }
.empty-state p { max-width: 460px; margin: 0 0 8px; }
.pt-search { margin-bottom: 10px; }
.pt-pick { display: grid; max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.pt-pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #f0f1f4; cursor: pointer; }
.pt-pick-row:last-child { border-bottom: 0; }
.pt-pick-row:hover { background: #fafbfc; }
.pt-pick-row input { width: 17px; height: 17px; accent-color: var(--red); flex: none; }
.pt-pick-row span.grow { display: grid; }
.pt-pick-row small { color: var(--muted); }
@media (max-width: 860px) { .pt-help { grid-template-columns: 1fr; } }

/* ---------- print ---------- */
.print-only { display: none; }
@media print {
  .side, .topbar, .page-head .row, .no-print, .demo-banner { display: none !important; }
  .layout { display: block; }
  .page { padding: 0; }
  .print-only { display: block; }
  .card { box-shadow: none; }
  body { background: #fff; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screen-grid { grid-template-columns: 1fr; }
  .present-member { grid-template-columns: 1fr; }
  .poster-slide { grid-template-columns: 1fr; gap: 24px; }
  .poster-photo { max-width: 260px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: var(--black); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 #ffffff14; }
  .topbar .brand-logo { width: 30px; height: 30px; border-radius: 8px; }
  .topbar b { font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: .01em; }
  .topbar-me { width: 30px; height: 30px; border-radius: 50%; background: var(--red); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
  .page { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
  .side-backdrop { position: fixed; inset: 0; background: #0b0b0e80; z-index: 29; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side-backdrop { display: block; }
  .layout:has(.side.open) ~ .side-backdrop { opacity: 1; pointer-events: auto; }
  .side { padding-bottom: 72px; overflow-y: auto; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px #0b0b0e0f; }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; gap: 3px; padding: 4px 0; border: 0; background: none; color: #8a909c; font: inherit; font-size: 10.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
  .tabbar .i { width: 22px; height: 22px; }
  .tabbar .on { color: var(--red); }
  .tabbar .on .i { stroke-width: 2.4; }
  .tabbar .dot-badge { position: absolute; top: 3px; left: calc(50% + 7px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fff; }
  body.is-full .tabbar { display: none; }
  .sk .sk-card:nth-child(n+5) { display: none; }
  .grid.split { grid-template-columns: minmax(0, 1fr) !important; }
  .grid.split > .card:first-child:has(.checklist) { order: 2; }
  /* page header actions: one swipeable row instead of wrapping */
  .page-head { gap: 12px; }
  .page-head > .row { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .page-head > .row::-webkit-scrollbar, .tabs::-webkit-scrollbar, .btn-group::-webkit-scrollbar { display: none; }
  .page-head > .row .btn { flex: none; white-space: nowrap; }
  .tabs { scrollbar-width: none; }
  .btn-group { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .btn-group button { white-space: nowrap; flex: none; }
  .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; }
  .g4.keep2, .g5.keep2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-art { padding: 28px 20px; gap: 16px; }
  .login-art p, .login-foot, .login-art::before { display: none; }
  .login-form { padding: 28px 20px 40px; place-items: start center; }
  .agenda-list { columns: 1; }
  .stage-body { padding: 10px 16px; }
}
/* phones: header tables become stacked cards (labels come from app.js labelTables) */
@media (max-width: 600px) {
  table.t.cardable, .t.cardable tbody, .t.cardable tr, .t.cardable td { display: block; width: auto !important; }
  .t.cardable thead { display: none; }
  .t.cardable tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .t.cardable tr:last-child { border-bottom: 0; }
  .t.cardable td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 3px 0; border: 0; text-align: right; min-height: 0; }
  .t.cardable td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; color: var(--muted); font-size: 12px; font-weight: 500; }
  .t.cardable td:first-child { display: block; text-align: left; font-size: 15px; padding-bottom: 6px; }
  .t.cardable td:first-child::before, .t.cardable td[data-label=""]::before, .t.cardable td.empty::before { display: none; }
  .t.cardable td[data-label=""] { justify-content: flex-end; }
  .t.cardable td:empty { display: none; }
  .t.cardable td.empty { display: block; text-align: center; padding: 18px 0; }
  .t.cardable td.num { white-space: nowrap; }
  .t.cardable tfoot { display: block; }
}
