:root {
  --ink: #0F1C24; --ink-2: #33454D; --muted: #6A7F88; --line: #E3ECEE; --line-2: #EEF2F4;
  --bg: #F3F6F7; --card: #fff; --soft: #F7FAFB;
  --brand: #0E7771; --brand-2: #07D5C8; --brand-dark: #003532;
  --ok: #10B981; --warn: #F59E0B; --err: #DC2626;
  --r: 14px; --shadow: 0 1px 2px rgba(15, 28, 36, .05), 0 6px 24px rgba(15, 28, 36, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.5 Inter, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
h1 { font-size: 24px; line-height: 1.25; margin: 0; font-weight: 800; letter-spacing: -.015em; color: var(--brand-dark); }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 700; color: var(--brand-dark); }
h3 { font-size: 14px; margin: 0 0 10px; font-weight: 700; }
code { background: var(--line-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 60px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--brand-dark); text-decoration: none; font-size: 16px; white-space: nowrap; }
.brand__mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); position: relative; flex: none; }
.brand__mark::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 32 32%27%3E%3Cpath d=%27M8 22V15M14 22V10M20 22v-5M26 22V12%27 stroke=%27white%27 stroke-width=%273.2%27 stroke-linecap=%27round%27/%3E%3C/svg%3E") center/100% no-repeat; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 8px 12px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; }
.nav a:hover { background: var(--soft); } .nav a.is-on { background: #E3F6F4; color: var(--brand); }
.me { display: flex; align-items: center; gap: 10px; }
.me form { margin: 0; }
.me__name { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-dark); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.main { max-width: 1320px; margin: 0 auto; padding: 26px 24px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; }
.grow { flex: 1; min-width: 240px; }
.crumb { margin: 0 0 6px !important; } .crumb a { text-decoration: none; font-weight: 600; font-size: 13px; }
.row { display: flex; align-items: center; } .gap { gap: 10px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .end { justify-content: flex-end; }
.stack { display: grid; gap: 14px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--r); }
.flash { padding: 11px 14px; border-radius: 10px; margin: 0 0 16px; background: #E3F6F4; color: #0B5A55; font-weight: 500; }
.flash--err { background: #FEE2E2; color: #991B1B; }
.note { padding: 10px 12px; background: #FFF7E6; border-radius: 9px; font-size: 13px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: #C8D7DB; background: var(--soft); } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn--primary:hover { background: #0B6560; border-color: #0B6560; }
.btn--ghost { background: transparent; } .btn--danger { color: var(--err); } .btn--danger:hover { border-color: #F5B5B5; background: #FEF2F2; }
.btn--sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; } .btn--lg { padding: 13px 18px; font-size: 15.5px; } .btn--block { width: 100%; }
.icon-btn { width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
input, select, textarea { font: inherit; color: var(--ink); }
.input, .field input, .field select, .field textarea, dialog textarea { width: 100%; padding: 10px 12px; border: 1px solid #D3E0E4; border-radius: 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.row .input { width: auto; min-width: 200px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, dialog textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 119, 113, .14); }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; color: var(--ink-2); } .field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field small { color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.checks { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); max-height: 200px; overflow-y: auto; }
.seg { display: inline-flex; border: 1px solid #D3E0E4; border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink-2); border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; } .seg button.is-on { background: var(--brand); color: #fff; }
.title-input { font: 800 24px/1.25 Inter, sans-serif; color: var(--brand-dark); border: 1px solid transparent; border-radius: 10px; padding: 2px 8px; margin-left: -9px; background: transparent; width: min(640px, 100%); letter-spacing: -.015em; }
.title-input:hover { border-color: var(--line); } .title-input:focus { outline: none; border-color: var(--brand); background: #fff; }
.code-input { display: block; width: 100%; min-width: 0; font: 800 clamp(26px, 8vw, 36px)/1 Inter, sans-serif !important; letter-spacing: .14em; text-align: center; padding: 14px 12px !important; border: 1px solid #D3E0E4; border-radius: 12px; background: var(--soft); color: var(--brand-dark); outline: none; font-variant-numeric: tabular-nums; }
.code-input::placeholder { color: #C3D0D4; }
.code-input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(14, 119, 113, .14); }
.code-input.is-bad { border-color: var(--err); background: #FEF2F2; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.tag--ok { background: #DCFCE7; color: #166534; } .tag--live { background: #E3F6F4; color: var(--brand); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; background: var(--line-2); margin: 1px 0; }
.chip--number { background: #E3F6F4; color: #0B5A55; } .chip--date { background: #EEF2FF; color: #3730A3; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #A3B1B7; vertical-align: middle; }
.dot--ok { background: var(--ok); } .dot--err { background: var(--err); }
.dot--pulse { background: var(--brand-2); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(7, 213, 200, .6); } 70% { box-shadow: 0 0 0 8px rgba(7, 213, 200, 0); } 100% { box-shadow: 0 0 0 0 rgba(7, 213, 200, 0); } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.card .table { border: 0; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--soft); }
.table tr.is-link { cursor: pointer; } .table tr.is-link:hover td { background: #FAFDFD; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; } .table .c { text-align: center; } .table .r { text-align: right; }
.matrix th.c { font-size: 11.5px; max-width: 110px; line-height: 1.25; }
.matrix input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.matrix tr.is-off td { opacity: .5; }

/* ---------- auth ---------- */
.bare { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, #D8F5F2 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #E3ECFF 0, transparent 55%), var(--bg); }
.auth { width: 100%; max-width: 440px; }
.auth__card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: 0 20px 60px rgba(15, 28, 36, .08); }
.auth__card h1 { margin: 18px 0 6px; }
.auth__card > p { margin: 0 0 20px; }
.auth__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--brand-dark); }
.auth__foot { margin: 20px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.otp { margin: 0 0 18px; padding: 20px; border-radius: 16px; background: var(--soft); border: 1px solid var(--line); text-align: center; }
.otp__code { font: 800 44px/1 Inter, sans-serif; letter-spacing: .08em; color: var(--brand-dark); }
.otp__to { margin: 6px 0 16px; font-weight: 700; color: var(--brand); font-size: 18px; }
.otp__status { margin: 14px 0 6px; font-weight: 600; }
.otp.is-expired .otp__code { opacity: .3; text-decoration: line-through; }
.dev-box { margin-top: 18px; padding: 12px; border-radius: 10px; background: #FFF7E6; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- home ---------- */
.steps { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 18px; margin-bottom: 22px; background: linear-gradient(135deg, #E9FAF8, #F3F7FF); border: 1px solid #D5EFEC; border-radius: var(--r); }
.steps__item { flex: 1 1 220px; display: flex; gap: 12px; }
.steps__item b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; }
.steps__item strong { display: block; } .steps__item span { color: var(--ink-2); font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.dcard { position: relative; display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.dcard:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15, 28, 36, .09); }
.dcard__art { height: 96px; display: flex; align-items: flex-end; gap: 8px; padding: 16px 20px 0; background: linear-gradient(135deg, var(--brand-dark), #0E5E5A); }
.dcard__art i { flex: 1; border-radius: 5px 5px 0 0; background: linear-gradient(var(--brand-2), rgba(7, 213, 200, .35)); }
.dcard__body { padding: 14px 16px; display: grid; gap: 2px; }
.dcard .tag { position: absolute; top: 10px; right: 10px; }

/* ---------- dataset sheet ---------- */
.sheet-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.sheet-wrap { overflow: auto; max-height: 64vh; border: 1px solid var(--line); border-radius: 10px; }
.sheet { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.sheet th { position: sticky; top: 0; z-index: 1; background: var(--soft); border-bottom: 1px solid var(--line); padding: 0; text-align: left; }
.sheet td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 0; }
.sheet__field { display: grid; gap: 1px; width: 100%; min-width: 150px; padding: 8px 10px; border: 0; background: transparent; text-align: left; font: inherit; cursor: pointer; border-right: 1px solid var(--line-2); }
.sheet__field:hover { background: #E9F5F4; }
.sheet__field span { font-weight: 700; } .sheet__field small { color: var(--muted); font-size: 11.5px; }
.sheet__idx { width: 40px; text-align: center; color: var(--muted); font-size: 12px; background: var(--soft); }
.sheet__act { width: 36px; text-align: center; }
.sheet__cell { width: 100%; min-width: 150px; border: 0; padding: 9px 10px; background: transparent; outline: none; }
.sheet__cell.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet__cell:focus { background: #F0FBFA; box-shadow: inset 0 0 0 2px var(--brand); }
.sheet__cell.is-bad { background: #FEF2F2; }
#ds-state.is-warn { color: #B45309; font-weight: 600; }

/* ---------- dialogs ---------- */
.dlg { border: 0; border-radius: 18px; padding: 24px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(15, 28, 36, .25); }
.dlg::backdrop { background: rgba(15, 28, 36, .45); backdrop-filter: blur(2px); }
.dlg h3 { font-size: 18px; margin: 0; }
.dlg--wide { width: min(720px, calc(100vw - 32px)); }
.dlg--xl { width: min(1100px, calc(100vw - 32px)); padding: 0; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 26px 16px; text-align: center;
  border: 2px dashed var(--line); border-radius: 12px; background: var(--soft); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.is-over { border-color: var(--brand); background: #E3F6F4; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop b { color: var(--brand-dark); word-break: break-all; }
.dlg .stack > * { min-width: 0; } /* wide content must not stretch the dialog past the screen */
.dlg p { overflow-wrap: anywhere; }
.imp-fields { display: flex; flex-wrap: wrap; gap: 6px; max-height: 150px; overflow-y: auto; }
.imp-fields .chip { margin: 0; padding: 3px 9px; overflow-wrap: anywhere; }
.imp-fields small { opacity: .7; }
#import-dlg { max-height: calc(100dvh - 32px); overflow-y: auto; }
@media (max-width: 520px) {
  .ds-actions .btn { flex: 1 1 auto; }
  .ds-actions #ds-state:empty { display: none; }
  #import-dlg { padding: 18px; }
  #import-dlg .drop { padding: 18px 12px; }
  #import-dlg .row.end > * { flex: 1; }
}
.dlg textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.dlg--xl { overflow: hidden; }
.dlg--xl > form { display: flex; flex-direction: column; height: min(720px, calc(100vh - 48px)); }
.bd { display: grid; grid-template-columns: 400px 1fr; flex: 1; min-height: 0; }
.bd__side { padding: 22px; overflow-y: auto; border-right: 1px solid var(--line); display: grid; gap: 16px; align-content: start; }
.bd__preview { padding: 22px; background: var(--bg); display: grid; grid-template-rows: auto 1fr; gap: 10px; overflow: auto; }
.bd__foot { padding: 14px 22px; border-top: 1px solid var(--line); }
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: var(--ink-2); text-align: center; }
.type svg { width: 24px; height: 24px; color: var(--brand); margin-bottom: 2px; }
.type b { font-size: 12.5px; } .type span { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.type:hover { border-color: #BFE3E0; } .type.is-on { border-color: var(--brand); background: #EAF8F6; box-shadow: 0 0 0 2px rgba(14, 119, 113, .15); }

/* ---------- toasts ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; padding: 11px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; z-index: 100; transition: .25s; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.toast--ok { background: var(--brand); } .toast--err { background: var(--err); }

/* ---------- cast ---------- */
.cast-grid { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 18px; align-items: start; }
.screens { display: grid; gap: 10px; }
.screen-row { display: grid; grid-template-columns: 1fr minmax(160px, 260px) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.device { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); margin: 0; }

/* ---------- widgets grid ---------- */
.wgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.wgrid__empty { grid-column: 1 / -1; padding: 60px 20px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--r); background: #fff; }
.w { grid-column: span 6; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 150px; min-width: 0; overflow: hidden; }
.w--span3 { grid-column: span 3; } .w--span4 { grid-column: span 4; } .w--span6 { grid-column: span 6; } .w--span8 { grid-column: span 8; } .w--span12 { grid-column: span 12; }
.w--line, .w--bar, .w--area, .w--pie, .w--doughnut { min-height: 320px; } .w--table { min-height: 200px; } .w--gauge { min-height: 220px; }
.w__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 0; min-height: 20px; }
.w__head h3 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w__tools { display: flex; gap: 2px; flex: none; }
.w__body { flex: 1; padding: 10px 16px 16px; position: relative; display: flex; flex-direction: column; min-height: 0; }
.w__chart { position: relative; flex: 1; min-height: 220px; }
.w__empty { flex: 1; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 20px; background: var(--soft); border-radius: 10px; }
.w__kpi { position: relative; z-index: 1; }
.w__kpi-val { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--brand-dark); line-height: 1.1; font-variant-numeric: tabular-nums; }
.w__kpi-val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w__kpi-val small { font-size: .46em; font-weight: 700; margin-left: .2em; color: var(--muted); letter-spacing: 0; }
.w__kpi-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.w__delta { display: inline-block; margin-top: 8px; padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: 12.5px; }
.w__delta span { font-weight: 500; opacity: .8; }
.w__delta.is-up { background: #DCFCE7; color: #166534; } .w__delta.is-down { background: #FEE2E2; color: #991B1B; }
.w__target { margin-top: 12px; font-size: 12px; color: var(--muted); }
.w__bar { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-bottom: 5px; }
.w__bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.w__bar i.is-done { background: var(--ok); }
.w__spark { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; opacity: .9; pointer-events: none; }
.w--kpi .w__body { padding-bottom: 50px; }
.w__gauge { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; }
.w__gauge b { display: block; font-size: 28px; font-weight: 800; color: var(--brand-dark); }
.w__gauge span { color: var(--muted); font-size: 12px; }
.w--gauge .w__chart { min-height: 160px; width: 100%; max-width: 440px; margin: 0 auto; }
.w__text { white-space: normal; color: var(--ink-2); }
.w__text--sm { font-size: 13px; } .w__text--md { font-size: 15px; } .w__text--lg { font-size: 20px; font-weight: 600; } .w__text--xl { font-size: 30px; font-weight: 800; color: var(--brand-dark); line-height: 1.2; }
.w__table { overflow: auto; max-height: 420px; }
.w__table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.w__table th { text-align: left; color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 7px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.w__table td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); }
.w__table .num { text-align: right; font-variant-numeric: tabular-nums; }
.w.is-edit { cursor: grab; outline: 2px dashed transparent; outline-offset: 2px; }
.w.is-edit:hover { outline-color: #BFE3E0; }
.w.is-drag { opacity: .45; }
.wgrid--preview { grid-template-columns: 1fr; align-content: start; }
.wgrid--preview .w { grid-column: 1 / -1; }

/* present mode (fullscreen from the app) */
body.is-present .top, body.is-present .page-head, body.is-present .main > p { display: none; }
body.is-present .main { max-width: none; padding: 20px; }

/* ---------- meeting screen ---------- */
body.screen { --scr-bg: #071319; --scr-card: #0D1F27; --scr-line: rgba(255, 255, 255, .07); --scr-ink: #E8F3F5; --scr-muted: #8AA5AD;
  background: radial-gradient(1400px 800px at 0% 0%, #0C2A2E 0, transparent 60%), var(--scr-bg); color: var(--scr-ink); min-height: 100vh; overflow: hidden; }
body.screen.no-cursor, body.screen.no-cursor * { cursor: none !important; }
.scr-wait { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; padding: 4vh 5vw; }
.scr-wait__brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 22px; }
.scr-wait__brand .brand__mark { width: 34px; height: 34px; }
.scr-wait__grid { display: grid; grid-template-columns: 1fr auto; gap: 6vw; align-items: center; }
.scr-wait__lead { font-size: clamp(18px, 2.2vw, 30px); color: var(--scr-muted); max-width: 900px; margin: 0 0 3vh; line-height: 1.35; }
.scr-wait__lead b { color: var(--scr-ink); }
.scr-code { font: 800 clamp(56px, min(15vw, 22vh), 240px)/1 Inter, sans-serif; white-space: nowrap; letter-spacing: .06em; background: linear-gradient(135deg, #fff, var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.scr-wait__url { font-size: clamp(16px, 1.6vw, 24px); color: var(--brand-2); margin: 3vh 0 0; font-weight: 600; }
.scr-wait__paired { font-size: clamp(16px, 1.6vw, 24px); margin: 2vh 0 0; color: #FCD34D; font-weight: 600; }
.scr-qr { display: grid; justify-items: center; gap: 12px; color: var(--scr-muted); }
.scr-qr > div { padding: 16px; background: #fff; border-radius: 20px; }
.scr-qr img, .scr-qr canvas { display: block; width: clamp(160px, 16vw, 260px) !important; height: auto !important; }
.scr-wait__foot { color: var(--scr-muted); font-size: 14px; }
.scr-show { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 2.2vh 2vw; gap: 2vh; }
.scr-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.scr-bar__title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.scr-bar__title .brand__mark { width: 34px; height: 34px; }
.scr-bar h1 { color: var(--scr-ink); font-size: clamp(22px, 2.2vw, 40px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr-bar__meta { display: flex; align-items: center; gap: 22px; color: var(--scr-muted); font-size: clamp(13px, 1vw, 18px); white-space: nowrap; }
.scr-bar__code b { color: var(--scr-ink); letter-spacing: .08em; }
#clock { color: var(--scr-ink); font-weight: 700; font-size: clamp(18px, 1.5vw, 28px); font-variant-numeric: tabular-nums; }
/* rows share the height; with many blocks each keeps a readable minimum and the grid scrolls (touch on MAXHUB) */
.wgrid--screen { gap: clamp(10px, 1.4vw, 28px); grid-auto-rows: minmax(clamp(170px, 26vh, 340px), 1fr); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.wgrid--screen .w { background: var(--scr-card); border-color: var(--scr-line); box-shadow: none; min-height: 0; }
.wgrid--screen .w__head h3 { color: var(--scr-muted); font-size: clamp(14px, 1.05vw, 20px); }
.wgrid--screen .w__head { padding: 1.4vh 1.2vw 0; }
.wgrid--screen .w__body { padding: 1vh 1.2vw 1.6vh; }
.wgrid--screen .w__chart { min-height: 0; }
.wgrid--screen .w__kpi-val { color: #fff; font-size: clamp(30px, min(3.8vw, 7vh), 84px); }
.wgrid--screen .w__kpi-val small { color: var(--scr-muted); }
.wgrid--screen .w__kpi-sub, .wgrid--screen .w__target { font-size: clamp(13px, .95vw, 18px); color: var(--scr-muted); }
.wgrid--screen .w__delta { font-size: clamp(13px, 1vw, 20px); }
.wgrid--screen .w__delta.is-up { background: rgba(16, 185, 129, .15); color: #6EE7B7; } .wgrid--screen .w__delta.is-down { background: rgba(239, 68, 68, .15); color: #FCA5A5; }
.wgrid--screen .w__bar { background: rgba(255, 255, 255, .08); height: 10px; }
.wgrid--screen .w__gauge b { color: #fff; font-size: clamp(30px, 3vw, 60px); } .wgrid--screen .w__gauge span { color: var(--scr-muted); font-size: clamp(13px, .9vw, 17px); }
.wgrid--screen .w__text { color: var(--scr-ink); } .wgrid--screen .w__text--xl { color: #fff; font-size: clamp(30px, 3vw, 64px); } .wgrid--screen .w__text--lg { font-size: clamp(20px, 1.8vw, 36px); } .wgrid--screen .w__text--md { font-size: clamp(16px, 1.3vw, 26px); }
.wgrid--screen .w__table { max-height: none; } .wgrid--screen .w__table table { font-size: clamp(13px, 1vw, 20px); }
.wgrid--screen .w__table th { background: var(--scr-card); color: var(--scr-muted); border-color: var(--scr-line); font-size: clamp(12px, .85vw, 16px); }
.wgrid--screen .w__table td { border-color: var(--scr-line); }
.wgrid--screen .w__empty { background: rgba(255, 255, 255, .03); color: var(--scr-muted); }

/* ---------- work items ("Ажлууд") ---------- */
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.pill--doing { background: #E3F6F4; color: #0B5A55; } .pill--waiting { background: #FEF3C7; color: #92400E; } .pill--todo { background: #EEF2FF; color: #3730A3; }
.pill--hold { background: #F1F5F9; color: #64748B; } .pill--done { background: #DCFCE7; color: #166534; }
.tstats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tstat { display: grid; gap: 2px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink-2); box-shadow: var(--shadow); border-top: 3px solid var(--line); }
.tstat b { font-size: 26px; font-weight: 800; color: var(--brand-dark); line-height: 1.1; } .tstat span { font-size: 13px; font-weight: 600; } .tstat em { font-style: normal; font-weight: 400; color: var(--muted); }
.tstat--doing { border-top-color: var(--brand); } .tstat--waiting { border-top-color: var(--warn); } .tstat--todo { border-top-color: #6366F1; } .tstat--hold { border-top-color: #94A3B8; } .tstat--done { border-top-color: var(--ok); }
.tstat:hover, .tstat.is-on { border-color: var(--brand); } .tstat.is-on { background: #F2FBFA; }
.tfilter { margin-bottom: 18px; }
.tlayout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.tlayout--task { grid-template-columns: minmax(0, 1fr) 380px; }
.tstreams { display: grid; gap: 16px; min-width: 0; }
.tstream { padding: 16px 18px 6px; }
.tstream__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tstream__head h2 { margin: 0; }
.tstream__counts { display: flex; gap: 6px; flex-wrap: wrap; }
.titem { display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 0; border-top: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.titem:hover .titem__title { color: var(--brand); }
.titem .pill { justify-self: start; margin-top: 1px; }
.titem__main { display: grid; gap: 3px; min-width: 0; }
.titem__title { font-weight: 600; }
.titem__note { color: var(--ink-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.titem__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.titem__wait { color: #92400E; } .titem__next { color: var(--brand); }
.titem__age { text-align: right; white-space: nowrap; }
.tfeed { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.tfeed__item { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line-2); color: var(--ink); text-decoration: none; font-size: 13px; }
.tfeed__item:hover b { color: var(--brand); }
.tfeed__when { font-size: 12px; color: var(--muted); } .tfeed__body { color: var(--ink-2); overflow-wrap: anywhere; }
.tnote-form { margin-bottom: 8px; } .tnote-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #D3E0E4; border-radius: 10px; font: inherit; resize: vertical; }
.tlog { list-style: none; margin: 0; padding: 0; }
.tlog li { padding: 12px 0 12px 16px; border-top: 1px solid var(--line-2); position: relative; }
.tlog li::before { content: ""; position: absolute; left: 0; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.tlog li.is-auto::before { background: #CBD5E1; } .tlog li.is-auto .tlog__body { color: var(--muted); font-size: 13px; }
.tlog__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.tlog__head form { margin: 0; } .tlog__head b { color: var(--ink-2); }
.tlog__body { margin-top: 3px; white-space: normal; overflow-wrap: anywhere; }
.tinfo { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 13.5px; } .tinfo dt { color: var(--muted); } .tinfo dd { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* dashboard block */
.w__tasks { overflow: auto; display: grid; gap: 14px 22px; align-content: start; max-height: 560px; }
.w--span8 .w__tasks, .w--span12 .w__tasks { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.w__tasks h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.w__task { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 7px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.w__task b { font-weight: 600; } .w__task p { grid-column: 2; margin: 0; color: var(--ink-2); font-size: 12.5px; }
.w__task small { grid-column: 2; color: var(--muted); font-size: 12px; } .w__task small i { font-style: normal; color: #92400E; }
.wgrid--screen .w__tasks { max-height: none; flex: 1; min-height: 0; }
.wgrid--screen .w__tasks h4 { color: var(--scr-muted); font-size: clamp(12px, .85vw, 16px); }
.wgrid--screen .w__task { border-color: var(--scr-line); font-size: clamp(14px, 1.05vw, 21px); }
.wgrid--screen .w__task p { color: var(--scr-muted); font-size: clamp(13px, .9vw, 18px); } .wgrid--screen .w__task small { font-size: clamp(12px, .8vw, 16px); color: var(--scr-muted); }
.wgrid--screen .w__task small i { color: #FCD34D; }
.wgrid--screen .pill { background: rgba(255,255,255,.08); color: var(--scr-ink); } .wgrid--screen .pill--doing { color: var(--brand-2); } .wgrid--screen .pill--waiting { color: #FCD34D; } .wgrid--screen .pill--done { color: #6EE7B7; }
@media (max-width: 1100px) { .tlayout, .tlayout--task { grid-template-columns: 1fr; } .tfeed { position: static; max-height: none; } .tstats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .w__tasks { grid-template-columns: 1fr !important; } .titem { grid-template-columns: minmax(0, 1fr); gap: 6px; } .titem__age { text-align: left; } .grid2 { grid-template-columns: 1fr; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .w--span3 { grid-column: span 6; } .w--span4 { grid-column: span 6; } .w--span8 { grid-column: span 12; }
  .bd { grid-template-columns: 1fr; overflow-y: auto; } .bd__side { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .bd__preview { min-height: 340px; }
  .cast-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .top { padding: 0 16px; gap: 12px; height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .me { margin-left: auto; } .me__text { display: none; }
  .main { padding: 18px 16px 48px; }
  .wgrid { gap: 12px; } .w { grid-column: 1 / -1 !important; }
  .row .input { min-width: 0; flex: 1; }
  .page-head > form, .page-head > .row { width: 100%; }
  .screen-row { grid-template-columns: 1fr; }
  .types { grid-template-columns: repeat(2, 1fr); }
  .auth__card { padding: 24px 20px; }
  .scr-wait__grid { grid-template-columns: 1fr; }
}

/* ---------- meeting screen: other sizes / orientations ---------- */
@media (max-width: 1100px), (orientation: portrait) {
  .wgrid--screen .w--span3, .wgrid--screen .w--span4 { grid-column: span 6; }
  .wgrid--screen .w--span8 { grid-column: span 12; }
  .wgrid--screen { grid-auto-rows: minmax(clamp(190px, 22vh, 340px), auto); }
  .wgrid--screen .w__chart { min-height: clamp(220px, 24vh, 460px); }
  .wgrid--screen .w--gauge .w__chart { min-height: clamp(150px, 14vh, 300px); }
  .wgrid--screen .w__kpi-val { font-size: clamp(30px, 6.5vw, 84px); }
  .wgrid--screen .w__head h3, .wgrid--screen .w__kpi-sub, .wgrid--screen .w__target { font-size: clamp(13px, 1.9vw, 20px); }
  .wgrid--screen .w__table table { font-size: clamp(13px, 1.8vw, 20px); }
  .scr-show { padding: 16px; gap: 14px; }
  .scr-bar { flex-wrap: wrap; row-gap: 6px; }
  .scr-bar__title { flex: 1 1 100%; }
  .scr-bar__meta { gap: 14px; font-size: clamp(12px, 1.8vw, 18px); }
  .scr-wait { padding: 4vh 6vw; }
  .scr-wait__grid { grid-template-columns: 1fr; justify-items: center; align-content: center; text-align: center; gap: 6vh; }
  .scr-code { font-size: clamp(56px, 17vw, 260px); }
  .scr-wait__lead { font-size: clamp(16px, 3.2vw, 32px); margin-inline: auto; }
  .scr-wait__url, .scr-wait__paired { font-size: clamp(15px, 2.6vw, 26px); }
  .scr-qr img, .scr-qr canvas { width: clamp(150px, 30vw, 300px) !important; }
}
@media (orientation: portrait) and (min-width: 700px) {
  /* tall MAXHUB: charts get more height, KPI cards stay compact */
  .wgrid--screen .w--line, .wgrid--screen .w--bar, .wgrid--screen .w--area, .wgrid--screen .w--pie, .wgrid--screen .w--doughnut { grid-row: span 2; }
}
@media (max-width: 700px) {
  .wgrid--screen .w { grid-column: 1 / -1 !important; }
  .wgrid--screen { grid-auto-rows: auto; }
  .wgrid--screen .w--line, .wgrid--screen .w--bar, .wgrid--screen .w--area, .wgrid--screen .w--pie, .wgrid--screen .w--doughnut { min-height: 300px; }
  .wgrid--screen .w--kpi { min-height: 150px; }
  .scr-bar__meta #s-by { display: none; }
  .scr-wait { padding: 24px 16px; }
  .scr-wait__brand { font-size: 18px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .scr-wait__grid { grid-template-columns: 1fr auto; gap: 4vw; }
  .scr-code { font-size: clamp(48px, 18vh, 160px); }
  .scr-qr img, .scr-qr canvas { width: clamp(120px, 34vh, 220px) !important; }
}

/* send-to-screen dialog (dashboard page) */
.dlg { overflow-x: hidden; }
.cast-dlg { gap: 16px; }
.cast-dlg__head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.cast-dlg__head p { margin: 2px 0 0; overflow-wrap: anywhere; }
.cast-dlg__icon { width: 40px; height: 40px; border-radius: 12px; background: #E3F6F4; color: var(--brand); display: grid; place-items: center; }
.cast-dlg__icon svg { width: 22px; height: 22px; }
.cast-dlg__steps { margin: 0; padding: 12px 14px 12px 32px; background: var(--soft); border-radius: 12px; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 4px; }
.cast-dlg__steps b { color: var(--brand-dark); overflow-wrap: anywhere; }
.cast-dlg__err { margin: -6px 0 0; color: var(--err); font-size: 13px; font-weight: 600; }
.cast-dlg__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
