:root {
  --bg: #0f1012;
  --bg-2: #141518;
  --surface: #18191c;
  --surface-2: #1e2023;
  --surface-3: #25272b;
  --line: #2a2c31;
  --line-2: #34373d;
  --text: #e8e6e1;
  --text-2: #b9b6ae;
  --muted: #8c8a84;
  --faint: #64625e;
  --accent: #8fd0a9;
  --accent-ink: #0d1a13;
  --accent-soft: rgba(143, 208, 169, .12);
  --warn: #e3b25a;
  --warn-soft: rgba(227, 178, 90, .13);
  --danger: #ec7a62;
  --danger-soft: rgba(236, 122, 98, .13);
  --info: #8fb4e3;
  --info-soft: rgba(143, 180, 227, .13);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --side: 236px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f3ef;
  --bg-2: #eeede8;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --surface-3: #efeee9;
  --line: #e3e1da;
  --line-2: #d4d1c8;
  --text: #1d1d1b;
  --text-2: #45443f;
  --muted: #75736c;
  --faint: #a19e95;
  --accent: #2f7d55;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 125, 85, .1);
  --warn: #a8700f;
  --warn-soft: rgba(168, 112, 15, .1);
  --danger: #c2432b;
  --danger-soft: rgba(194, 67, 43, .09);
  --info: #2f62a3;
  --info-soft: rgba(47, 98, 163, .09);
  --shadow: 0 10px 30px rgba(30, 28, 20, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- layout */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: -.02em;
}
.brand-name { font-weight: 650; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav-group { margin-bottom: 14px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 0 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none; font-size: 13.5px;
}
.nav a svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-3); color: var(--text); }
.nav a.active svg { color: var(--accent); opacity: 1; }
.nav .count { margin-left: auto; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.nav .count.hot { color: var(--accent); }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.side-foot .row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: -.015em; white-space: nowrap; }
.top .crumb { color: var(--muted); font-size: 13px; white-space: nowrap; }
.burger { display: none; }
.search { position: relative; margin-left: auto; width: min(380px, 40vw); }
.search input { width: 100%; padding-left: 34px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: var(--shadow); max-height: 70vh; overflow: auto; padding: 6px; z-index: 40;
}
.search-results .sr-title { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding: 8px 8px 4px; }
.search-results a { display: flex; gap: 10px; padding: 7px 8px; border-radius: 6px; color: var(--text); text-decoration: none; align-items: center; }
.search-results a:hover, .search-results a.sel { background: var(--surface-3); }
kbd {
  font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface-2);
}
.content { padding: 24px 28px 60px; max-width: 1480px; width: 100%; }

/* ---------- primitives */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  cursor: pointer; font-size: 13.5px; font-weight: 500; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line-2)); background: var(--danger-soft); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 20%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after {
  content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

input[type=text], input[type=password], input[type=number], input[type=search], input:not([type]), select, textarea {
  height: 34px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2);
  outline: none; transition: border-color .12s, box-shadow .12s; min-width: 0;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
select { padding-right: 28px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 34px; height: 20px; border-radius: 20px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--text); transition: transform .15s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); background: var(--accent-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); min-height: 52px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-h .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-b { padding: 16px 18px; }
.card-b.flush { padding: 0; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid, .toolbar + .card, .tabs + .card, .card + .tabs, .note + .card, .card + .note { margin-top: 16px; }

.grid { display: grid; gap: 16px; }
.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)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.sm { gap: 6px; }
.spacer { flex: 1; }

.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 650; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat .hint b { color: var(--text-2); font-weight: 550; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.dot.ok { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--danger); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.td-title { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .grow input { width: 100%; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  background: none; border: none; padding: 9px 14px; cursor: pointer; color: var(--muted); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 2px; }
.seg button { border: none; background: none; padding: 4px 11px; border-radius: 5px; cursor: pointer; color: var(--muted); font-size: 13px; }
.seg button.active { background: var(--surface-3); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field .help { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.setting { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: none; }
.setting .s-text { flex: 1; min-width: 0; }
.setting .s-title { font-weight: 550; }
.setting .s-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.setting .s-key { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.setting .s-ctl { flex: 0 0 auto; width: min(420px, 48%); display: flex; justify-content: flex-end; }
.setting .s-ctl input, .setting .s-ctl select { width: 100%; }
.setting.block { flex-direction: column; gap: 8px; }
.setting.block .s-ctl { width: 100%; }
.setting.block textarea { width: 100%; }
.setting.changed .s-title::after { content: " •"; color: var(--warn); }

.note { padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.note.warn { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); background: var(--warn-soft); }
.note.warn svg { color: var(--warn); }
.note.bad { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--danger-soft); }
.note.bad svg { color: var(--danger); }

.empty { padding: 42px 20px; text-align: center; color: var(--muted); }
.empty .e-title { color: var(--text-2); font-weight: 550; margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s ease infinite; border-radius: 6px; height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }
.loading-box { padding: 30px 18px; display: grid; gap: 12px; }

.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pager .spacer { flex: 1; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }

.list-item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.list-item:last-child { border-bottom: none; }
.list-item .li-time { color: var(--faint); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.stars { color: var(--warn); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--line-2); }

/* ---------- chart */
.chart { width: 100%; height: 210px; display: block; }
.chart .bar { fill: var(--accent); opacity: .85; }
.chart .bar:hover { opacity: 1; }
.chart .bar.ref { fill: var(--danger); }
.chart .axis { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.hbar { display: grid; grid-template-columns: 110px 1fr 46px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.hbar .track { height: 8px; background: var(--surface-3); border-radius: 8px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 8px; }
.hbar .fill.warn { background: var(--warn); }
.hbar .fill.bad { background: var(--danger); }
.chart-tip { position: fixed; pointer-events: none; z-index: 90; background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 9px; font-size: 12px; box-shadow: var(--shadow); }

/* ---------- services */
.svc { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.svc:last-child { border-bottom: none; }
.svc .svc-name { font-weight: 550; }
.svc .svc-meta { color: var(--muted); font-size: 12.5px; }

/* ---------- accounts */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.acc { display: flex; flex-direction: column; }
.acc .acc-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 650; color: var(--text-2); flex: none; overflow: hidden; font-size: 14px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.acc .acc-name { font-weight: 600; font-size: 15px; }
.acc .acc-body { padding: 0 18px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13px; }
.acc .acc-body .k { color: var(--muted); font-size: 12px; }
.acc .acc-foot { margin-top: auto; display: flex; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.acc.disabled { opacity: .72; }


/* ---------- logs */
.logs { font-family: var(--mono); font-size: 12px; line-height: 1.55; background: var(--bg-2); padding: 12px 0; height: calc(100vh - 260px); min-height: 360px; overflow: auto; }
.logs .ln { padding: 0 16px; white-space: pre-wrap; word-break: break-all; }
.logs .ln:hover { background: var(--surface-2); }
.logs .ln.ERROR, .logs .ln.CRITICAL { color: var(--danger); }
.logs .ln.WARNING { color: var(--warn); }
.logs .ln.DEBUG { color: var(--faint); }
.logs mark { background: var(--warn-soft); color: inherit; border-radius: 2px; }

/* ---------- overlays */
.overlay { position: fixed; inset: 0; background: rgba(8, 8, 9, .55); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .12s ease; }
:root[data-theme="light"] .overlay { background: rgba(40, 38, 30, .28); }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); width: min(560px, 100%); animation: pop .14s ease; }
.modal.wide { width: min(880px, 100%); }
.modal.xwide { width: min(1100px, 100%); }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 18px 20px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(8, 8, 9, .45); z-index: 55; animation: fade .12s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--surface); border-left: 1px solid var(--line-2); z-index: 56; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: slide .16s ease; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer .modal-b { overflow-y: auto; flex: 1; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 22px 0 10px; }
.section-title:first-child { margin-top: 0; }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--surface); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 13.5px; animation: pop .15s ease; word-break: break-word; }
.toast.bad { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }

.keybox { font-family: var(--mono); font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; max-height: 300px; overflow: auto; white-space: pre; }
.copy { cursor: pointer; border-bottom: 1px dashed var(--line-2); }
.copy:hover { color: var(--accent); }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(380px, 100%); padding: 28px; }
.login h1 { font-size: 20px; margin: 18px 0 4px; letter-spacing: -.02em; }
.login p { color: var(--muted); margin: 0 0 20px; font-size: 13.5px; }
.login .err { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 10px; }

.cat-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: none; }
.res { font-size: 12.5px; }

.offer-row { display: flex; align-items: center; gap: 12px; }

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 70; width: 260px; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow); }
  .app.nav-open .side { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 65; }
  .burger { display: inline-flex; }
  .top { padding: 10px 14px; }
  .top .crumb { display: none; }
  .content { padding: 16px 14px 50px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .setting { flex-direction: column; gap: 8px; }
  .setting .s-ctl { width: 100%; justify-content: flex-start; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .search { width: auto; flex: 1; }
  .search kbd { display: none; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat .value { font-size: 21px; }
  .acc-grid { grid-template-columns: 1fr; }
}

/* ================= mobile & touch ================= */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
body:has(.overlay), body:has(.drawer-overlay) { overflow: hidden; }
.logs .ln { content-visibility: auto; contain-intrinsic-size: auto 19px; }
@supports (height: 100dvh) { .login { min-height: 100dvh; } }
@keyframes sheet { from { transform: translateY(48px); opacity: 0; } }

@media (max-width: 900px) {
  body:has(.app.nav-open) { overflow: hidden; }
  .side { width: min(300px, 86vw); height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: calc(16px + env(safe-area-inset-bottom)); visibility: hidden;
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), visibility .22s; }
  .app.nav-open .side { visibility: visible; }
  .app.nav-open::after { animation: fade .15s ease; }
  .nav a { padding: 11px 12px; font-size: 15px; min-height: 44px; }
  .nav a svg { width: 18px; height: 18px; }
  .nav-title { padding-top: 4px; }

  .top { flex-wrap: wrap; row-gap: 8px; gap: 8px;
    padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
  .top h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top .search { order: 10; flex: 1 1 100%; width: 100%; margin-left: 0; }
  .top .search input { height: 40px; width: 100%; }
  .search-results { left: 0; right: 0; width: auto; max-height: 70vh; max-height: 70dvh; overflow-y: auto; overscroll-behavior: contain; }
  .content { padding: 14px max(12px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }

  input[type=text], input[type=password], input[type=number], input[type=search], input:not([type]), select, textarea { font-size: 16px; height: 40px; }
  textarea { height: auto; }
  .btn { height: 40px; }
  .btn.sm { height: 34px; padding: 0 12px; }
  .btn.icon { width: 40px; }
  .btn.sm.icon { width: 34px; }
  .switch .track { width: 40px; height: 24px; }
  .switch input:checked + .track::after { transform: translateX(16px); }

  .tabs { scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { padding: 11px 14px; scroll-snap-align: start; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { padding: 7px 12px; white-space: nowrap; }
  .toolbar > input, .toolbar > select, .toolbar > .grow { flex: 1 1 160px; min-width: 0; }
  .table-wrap { -webkit-overflow-scrolling: touch; }

  .card-h { padding: 12px 14px; min-height: 48px; }
  .card-b { padding: 14px; }
  .list-item, .svc, .cat-row { padding-left: 14px; padding-right: 14px; }
  .cat-row, .offer-row, .svc { flex-wrap: wrap; }
  .pager { padding: 10px 12px; flex-wrap: wrap; }
  .hbar { grid-template-columns: 88px 1fr 42px; }
  .td-title { max-width: 240px; }
  .keybox { max-width: 100%; }

  .logs { height: calc(100vh - 290px); height: calc(100dvh - 290px); min-height: 300px; font-size: 11.5px; }
  .logs .ln { padding: 0 12px; }
}

@media (max-width: 640px) {
  /* tables -> cards */
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; }
  table.rt thead { display: none; }
  table.rt tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.rt tbody tr:last-child { border-bottom: 0; }
  table.rt td { padding: 3px 0; border: 0; text-align: right; max-width: none; white-space: normal; overflow-wrap: anywhere; min-height: 24px; }
  table.rt td::before { content: attr(data-label); float: left; margin-right: 14px; max-width: 48%; color: var(--muted); font-size: 12.5px; font-weight: 400; text-align: left; }
  table.rt td::after { content: ""; display: table; clear: both; }
  table.rt td[data-label=""]::before, table.rt td:not([data-label])::before { display: none; }
  table.rt td:first-child { text-align: left; font-weight: 600; font-size: 14.5px; padding-bottom: 6px; }
  table.rt td:first-child::before { display: none; }
  table.rt td:empty { display: none; }
  table.rt td[colspan] { text-align: center; }
  table.rt .td-title, table.rt .ellipsis { max-width: 100%; white-space: normal; }

  /* bottom-sheet modals */
  .overlay { align-items: flex-end; padding: 0; overflow: hidden; }
  .modal, .modal.wide, .modal.xwide { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 16px 16px 0 0; border-bottom: 0;
    display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; animation: sheet .22s cubic-bezier(.2, .8, .2, 1); }
  .modal-h { padding: 14px 16px; flex: none; }
  .modal-b { padding: 16px; overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
  .modal-f { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex: none; }
  .modal-f .btn { flex: 1 1 auto; height: 44px; }
  .drawer { width: 100vw; border-left: 0; padding-bottom: env(safe-area-inset-bottom); }
  .drawer .modal-b { padding: 16px; }

  .toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; }
  .login { padding: 16px; }
  .login .card { padding: 22px 18px; width: 100%; }
  .acc .acc-body { padding: 0 14px 12px; }
  .acc .acc-foot .btn { flex: 1 1 auto; }
}

@media (max-width: 380px) {
  .g4 { grid-template-columns: 1fr; }
  .top h1 { font-size: 16px; }
}

@media (hover: none) {
  .btn:active { transform: scale(.97); }
  .chat-list .ci:active, .nav a:active, table.rt tbody tr:active, .list-item:active { background: var(--surface-2); }
  .logs .ln:hover { background: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ================= chat extras & mobile fit ================= */
.ord-link { font-weight: 600; text-decoration: none; border-bottom: 1px dashed currentColor; cursor: pointer; }
.img-view { display: grid; place-items: center; }
.img-view img { max-width: 100%; max-height: 75vh; max-height: 75dvh; border-radius: 8px; }
.drawer .order-acts { gap: 8px; }

@media (max-width: 900px) {
  body { overflow-x: hidden; }
  @supports (overflow: clip) { body { overflow-x: clip; } }
  .main, .content, #view, #view > div, .card, .card-b, .grow { min-width: 0; }
  .main { max-width: 100vw; }
  #topActions { flex-wrap: wrap; gap: 6px; min-width: 0; }
  .card-h { flex-wrap: wrap; row-gap: 8px; }
  .toolbar { flex-wrap: wrap; }
  .table-wrap { max-width: 100%; overflow-x: auto; }
  .pre, pre, code, .mono, .kv dd { overflow-wrap: anywhere; }
  img, video, canvas { max-width: 100%; }
  .drawer .order-acts .spacer { display: none; }
  .drawer .order-acts .btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
}

/* grid/flex children must be allowed to shrink below their content width (prevents page blow-up on phones) */
.row > .ellipsis, .row > .grow, .list-item > *, .toolbar > * { min-width: 0; }
#segBox { min-width: 0; max-width: 100%; }
#segBox .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
#segBox .seg::-webkit-scrollbar { display: none; }
#segBox .seg button { white-space: nowrap; flex: none; }
@media (max-width: 1180px) {
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app, .chat, .g2, .g3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .toolbar > #segBox { flex: 1 1 100%; }
  .list-item { flex-wrap: wrap; }
  .list-item > .row { flex: 1 1 100%; flex-wrap: wrap; row-gap: 4px; }
  .list-item .row > .ellipsis { flex: 1 1 140px; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .hbar { grid-template-columns: minmax(0, 44%) minmax(0, 1fr) 38px; }
  .hbar > :first-child { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; }
}

/* ================= chats (messenger layout) ================= */
.content:has(.cx) { padding-bottom: 20px; }
.cx { display: grid; grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: calc(100vh - 140px); min-height: 440px; overflow: hidden; padding: 0; }
.cx-list { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.cx-search { position: relative; padding: 12px 12px 8px; flex: none; }
.cx-search svg { position: absolute; left: 24px; top: 50%; margin-top: 2px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.cx-search input { width: 100%; height: 38px; padding-left: 36px; border-radius: 10px; background: var(--surface-2); }
.cx-items { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 6px 8px; }
.cx-ci { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; cursor: pointer; transition: background .12s ease; outline-offset: -2px; }
.cx-ci + .cx-ci { margin-top: 1px; }
.cx-ci:hover { background: var(--surface-2); }
.cx-ci.active { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.cx-ci .cx-ci-av { width: 44px; height: 44px; font-size: 16px; }
.cx-ci-main { flex: 1; min-width: 0; }
.cx-ci-top, .cx-ci-bot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cx-ci-bot { margin-top: 3px; }
.cx-ci-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-ci-time { flex: none; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cx-ci-prev { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-ci.unread .cx-ci-time { color: var(--accent); font-weight: 600; }
.cx-ci.unread .cx-ci-prev { color: var(--text-2); }
.cx-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.cx-pane { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); }
.cx-loading { flex: 1; display: grid; place-items: center; }
.cx-err { padding: 16px; }
.cx-ph { margin: auto; display: grid; justify-items: center; gap: 4px; padding: 36px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.cx-ph svg { color: var(--faint); margin-bottom: 8px; }
.cx-ph-t { font-weight: 600; font-size: 15px; color: var(--text-2); }
.cx-ph-s:empty { display: none; }
.cx-ph.sm { padding: 28px 16px; }

.cx-head { flex: none; display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 10px 12px 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.cx-head .cx-h-av { width: 38px; height: 38px; font-size: 15px; }
.cx-h-main { flex: 1; min-width: 0; }
.cx-h-name { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-h-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.cx-ords { flex: 0 1 auto; min-width: 0; max-width: 45%; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.cx-ords::-webkit-scrollbar { display: none; }
.cx-ord { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--info); background: var(--info-soft); }
.cx-ord:hover { text-decoration: none; filter: brightness(1.12); }
.cx-ib { flex: none; width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; transition: background .12s ease, color .12s ease; }
.cx-ib:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.cx-ib.loading { opacity: .5; pointer-events: none; }
.cx-back { display: none; margin-left: -6px; }

.cx-body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cx-msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; padding: 14px 18px 12px; }
.cx-msgs > :first-child { margin-top: auto; }
.cx-day { position: sticky; top: 4px; z-index: 2; align-self: center; margin: 14px 0 6px; }
.cx-day span { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text-2); background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.cx-m { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; min-width: 0; }
.cx-m.cont { margin-top: 2px; }
.cx-m.me { flex-direction: row-reverse; }
.cx-m .cx-av { width: 30px; height: 30px; font-size: 12px; flex: none; }
.cx-av.sp { visibility: hidden; }
.cx-b { position: relative; min-width: 0; max-width: min(560px, 76%); padding: 7px 11px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 1px rgba(0, 0, 0, .12); color: var(--text); }
.cx-m.me .cx-b { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 32%, transparent); }
.cx-m:not(.me):not(.more) .cx-b { border-bottom-left-radius: 4px; }
.cx-m.me:not(.more) .cx-b { border-bottom-right-radius: 4px; }
.cx-m:not(.me).more .cx-b { border-bottom-left-radius: 6px; }
.cx-m:not(.me).cont .cx-b { border-top-left-radius: 6px; }
.cx-m.me.more .cx-b { border-bottom-right-radius: 6px; }
.cx-m.me.cont .cx-b { border-top-right-radius: 6px; }
.cx-au { font-size: 12.5px; font-weight: 650; color: var(--accent); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-tx { font-size: 14px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.cx-tx::after, .cx-sys-t::after { content: ""; display: block; clear: both; }
.cx-tx a { color: var(--info); }
.cx-t { float: right; margin: 5px 0 -4px 10px; font-size: 11px; line-height: 1.4; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; user-select: none; }
.cx-m.me .cx-t { color: color-mix(in srgb, var(--accent) 55%, var(--muted)); }
.cx-imgs { display: grid; gap: 4px; margin: 2px -6px 4px; }
.cx-imgs.multi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-img { display: block; border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.cx-img img { display: block; width: 100%; max-width: 300px; max-height: 320px; object-fit: cover; cursor: zoom-in; }
.cx-b.media { padding: 4px; }
.cx-b.media .cx-au { padding: 2px 7px 3px; }
.cx-b.media .cx-imgs { margin: 0; }
.cx-b.media .cx-tx.only { position: absolute; right: 10px; bottom: 9px; padding: 1px 8px; border-radius: 999px; background: rgba(0, 0, 0, .55); }
.cx-b.media .cx-t { float: none; margin: 0; color: #fff; }
.cx-sys { align-self: center; max-width: min(600px, 94%); margin: 12px 0 4px; }
.cx-sys-b { display: flex; gap: 9px; align-items: flex-start; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.45; color: var(--text-2); background: color-mix(in srgb, var(--info) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--info) 22%, var(--line)); }
.cx-sys-b > svg { flex: none; margin-top: 2px; color: var(--info); }
.cx-sys-t { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cx-jump { position: absolute; right: 16px; bottom: 14px; z-index: 3; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer; animation: fade .15s ease; }
.cx-jump[hidden] { display: none; }
.cx-jump-n { position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.cx-jump-n:empty { display: none; }

.cx-comp { flex: none; padding: 8px 12px 10px; background: var(--surface); border-top: 1px solid var(--line); }
.cx-tpl { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.cx-tpl::-webkit-scrollbar { display: none; }
.cx-tpl:empty { display: none; }
.cx-chip { flex: none; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; white-space: nowrap; cursor: pointer; transition: border-color .12s ease, color .12s ease, background .12s ease; }
.cx-chip:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line-2)); color: var(--text); }
.cx-chip.ic { width: 30px; padding: 0; display: grid; place-items: center; }
.cx-in { display: flex; align-items: flex-end; gap: 4px; padding: 4px; border-radius: 24px; background: var(--surface-2); border: 1px solid var(--line-2); transition: border-color .12s ease, box-shadow .12s ease; }
.cx-in:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line-2)); box-shadow: 0 0 0 3px var(--accent-soft); }
.cx-in .cx-ib { width: 40px; height: 40px; }
.cx-in textarea, .cx-in textarea:focus, .cx-in textarea:focus-visible { flex: 1; min-width: 0; height: 40px; min-height: 40px; max-height: 150px; padding: 10px 4px; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none; resize: none; font-size: 14.5px; line-height: 1.4; color: var(--text); }
.cx-send { position: relative; flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--surface-3); color: var(--muted); cursor: pointer; transition: background .15s ease, color .15s ease, transform .1s ease; }
.cx-send.ready { background: var(--accent); color: var(--accent-ink); }
.cx-send:active { transform: scale(.93); }
.cx-send.loading { pointer-events: none; }
.cx-send.loading svg { opacity: 0; }
.cx-send.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

@media (max-width: 1180px) {
  .cx { grid-template-columns: 290px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .content:has(.cx) { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .cx { display: block; height: auto; min-height: 0; overflow: visible; }
  .cx-list { display: block; border-right: 0; background: transparent; }
  .cx-search { padding: 10px 10px 6px; }
  .cx-search svg { left: 22px; }
  .cx-search input { height: 42px; }
  .cx-items { overflow: visible; padding: 0 4px 6px; }
  .cx-ci { padding: 10px; min-height: 66px; }
  .cx-ci .cx-ci-av { width: 48px; height: 48px; font-size: 17px; }
  .cx-ci-name { font-size: 15px; }
  .cx-ci-prev { font-size: 13.5px; }
  .cx > .cx-pane { display: none; }
  .cx.has-open { position: fixed; left: 0; right: 0; top: 0; z-index: 50; height: 100vh; height: 100dvh; margin: 0; display: flex; flex-direction: column; overflow: hidden; border: 0; border-radius: 0; box-shadow: none; background: var(--bg-2); }
  .cx.has-open > .cx-list { display: none; }
  .cx.has-open > .cx-pane { display: flex; flex: 1 1 auto; min-height: 0; }
  body:has(.cx.has-open) { overflow: hidden; }
  .cx-back { display: inline-grid; }
  .cx-head { min-height: 58px; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); }
  .cx-head .cx-h-av { width: 36px; height: 36px; }
  .cx-ords { max-width: 36%; }
  .cx-msgs { padding: 10px max(10px, env(safe-area-inset-right)) 10px max(10px, env(safe-area-inset-left)); }
  .cx-b { max-width: 84%; }
  .cx-m .cx-av { width: 28px; height: 28px; }
  .cx-img img { max-width: min(260px, 100%); max-height: 280px; }
  .cx-tx { font-size: 15px; }
  .cx-jump { right: 12px; bottom: 12px; }
  .cx-comp { padding: 6px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .cx.kb .cx-comp { padding-bottom: 8px; }
  .cx-tpl { padding-bottom: 6px; }
  .cx-chip { height: 32px; }
  .cx-in textarea, .cx-in textarea:focus, .cx-in textarea:focus-visible { font-size: 16px; padding: 9px 4px; }
}
@media (hover: none) {
  .cx-ci:hover, .cx-ib:hover { background: transparent; }
  .cx-ci.active:hover { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
  .cx-ci:active { background: var(--surface-2); }
}
