/* ==========================================================================
   Admin console (/)
   ========================================================================== */

.spacer { flex: 1; }
code { font-family: var(--f-mono); font-size: .92em; }

.boot {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: var(--bg); transition: opacity .5s var(--ease), visibility .5s;
}
.boot .wm3d { font-size: 24px; }
body:not(.is-booting) .boot { opacity: 0; visibility: hidden; }

/* --- Gate (sign in) ---------------------------------------------------- */
.gate {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--bg);
  overflow: hidden;
}
.gate-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px;
}
.gate-tools { display: flex; align-items: center; gap: 10px; }
.gate-time {
  font-family: var(--f-ui); font-size: 13px; font-weight: 560;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1;
  color: var(--ink-2);
  min-width: 8ch; text-align: right;
  letter-spacing: .01em;
}
.gate-top .wm3d { font-size: 17px; }
.gate-card {
  position: relative; z-index: 3;
  width: min(390px, 100%);
  display: grid; gap: 16px;
  padding: 30px;
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-pop);
}
.gate-kicker { color: var(--accent-text); margin: 0; }
.gate-card h1 { font-size: 34px; margin: 8px 0 6px; font-weight: 760; letter-spacing: -.04em; }
.gate-card .muted { margin: 0; font-size: 13.5px; }
.gate-card .input { height: 44px; border-radius: 11px; }
.gate-card .btn-lg { height: 46px; border-radius: 12px; }
.gate-card .btn-lg .ico { transition: transform .5s var(--ease-spring); }
.gate-card .btn-lg:hover .ico { transform: translateX(4px); }
.gate-foot { text-align: center; font-size: 12.5px; color: var(--ink-3); margin: 0; }
.gate-foot a { color: var(--ink-2); }
.gate-card.leaving { animation: gate-leave .45s var(--ease-in-out) forwards; }
@keyframes gate-leave { to { opacity: 0; transform: scale(.97); filter: blur(6px); } }

/* --- Shell ------------------------------------------------------------- */
.console { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .45s var(--ease); }
.side-mini { display: none; }
.side-toggle { color: var(--ink-3); margin-left: auto; }
.side-toggle .ico { width: 16px; height: 16px; }
.side-top .wordmark { overflow: hidden; min-width: 0; }

/* Collapsed: icon-only rail (remembered per browser). */
.console.side-collapsed { grid-template-columns: 72px minmax(0, 1fr); }
.console.side-collapsed .side { padding: 18px 10px 12px; align-items: center; }
.console.side-collapsed .side-top { flex-direction: column; gap: 10px; padding: 0; }
.console.side-collapsed .side-full { display: none; }
.console.side-collapsed .side-mini { display: inline-flex; }
.console.side-collapsed .side-toggle { margin: 0; }
.console.side-collapsed .nav { width: 100%; justify-items: center; }
.console.side-collapsed .nav-item { width: 44px; padding: 0; justify-content: center; }
.console.side-collapsed .nav-item > span, .console.side-collapsed .nav-label { display: none; }
.console.side-collapsed .nav-item .badge { position: absolute; top: 2px; right: 0; min-width: 15px; height: 15px; font-size: 9.5px; padding: 0 4px; margin: 0; }
.console.side-collapsed .nav-item .badge:not(.badge-accent) { display: none; }
.console.side-collapsed .side-sys { display: none; }
.console.side-collapsed .side-foot { flex-direction: column; padding: 0; margin-top: auto; }
.console.side-collapsed .side-me { display: none; }

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 20px;
  padding: 20px 14px 14px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px; }
.side-close { display: none; }
.nav { position: relative; display: grid; gap: 2px; isolation: isolate; }
.nav > .ind {
  position: absolute; left: 0; top: 0; z-index: -1;
  border-radius: 10px; background: var(--bg-3); box-shadow: 0 0 0 1px var(--line) inset;
  transition: transform .6s var(--ease-spring), height .3s var(--ease), width .3s var(--ease), opacity .2s;
}
.nav-label { margin: 16px 0 6px 12px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 36px; padding: 0 10px 0 12px;
  border-radius: 10px;
  color: var(--ink-3); text-decoration: none;
  font-weight: 560; font-size: 13.5px;
  transition: color var(--t);
}
.nav-item .ico { width: 17px; height: 17px; transition: transform .5s var(--ease-spring), color var(--t); }
.nav-item:hover { color: var(--ink); }
.nav-item:hover .ico { transform: scale(1.1) rotate(-4deg); }
.nav-item.active { color: var(--ink); }
.nav-item.active .ico { color: var(--accent); }
.nav-item .badge { margin-left: auto; }
.nav-item .badge:empty { display: none; }
.nav-item .badge { color: var(--ink-3); transition: color var(--t); }
.nav-item:hover .badge:not(.badge-accent), .nav-item.active .badge:not(.badge-accent) { color: var(--ink-2); }
.nav-item .badge-accent { color: var(--accent-ink); }
.nav-item .badge + .badge { margin-left: -6px; }

.side-sys { margin-top: auto; padding: 14px; border-radius: 14px; background: var(--bg-1); box-shadow: 0 0 0 1px var(--line-2) inset; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.side-sys-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-width: 0; }
.side-sys-row .mono { font-size: 11.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.side-sys-row .label { flex: none; }
.meter { height: 3px; border-radius: 3px; background: var(--bg-4); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--ink-2); transition: width 1.2s var(--ease); }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 4px 2px 0 4px; }
.side-me { display: grid; min-width: 0; flex: 1; }
.side-me .label { font-size: 9.5px; }
.side-me .ellipsis { font-weight: 560; font-size: 13px; }
#me-av { --_c: var(--bg-4); color: var(--accent-text); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-menu { display: none; }
.crumbs { display: grid; gap: 1px; }
.crumbs .label { font-size: 9.5px; }
.crumbs h1 { margin: 0; font-size: 22px; font-weight: 760; letter-spacing: -.035em; }
.top-search {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(520px, calc(100% - 400px));
}
.top-search .search-field { width: 100%; }
.top-search .input { height: 38px; border-radius: 10px; }
.clock { color: var(--ink-3); font-size: 12px; min-width: 64px; text-align: right; }

.view { padding: 24px 28px 44px; display: grid; gap: 18px; align-content: start; }

/* --- Cards ------------------------------------------------------------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; flex-wrap: wrap; }
.card-head h3 { margin: 3px 0 0; font-size: 15px; font-weight: 640; }
.card-head > .chip:last-child { margin-left: auto; }
.card-head .search-field { width: min(260px, 100%); }
.card-head .search-field .input { height: 30px; padding-right: 10px; }

/* --- KPIs -------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi {
  position: relative;
  padding: 16px 18px 17px;
  border-radius: 18px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  display: grid; gap: 8px; min-width: 0;
  overflow: hidden;
}
.kpi-top { display: flex; align-items: center; gap: 8px; }
.kpi-top .ico { width: 14px; height: 14px; color: var(--ink-3); }
.kpi-val { font-family: var(--f-display); font-stretch: 112%; font-weight: 760; font-size: 34px; letter-spacing: -.04em; line-height: 1; }
.kpi-sub { font-size: 12.5px; font-weight: 500; color: var(--ink-3); display: flex; gap: 6px; align-items: center; min-width: 0; }
.kpi-sub b { color: var(--ink-2); font-weight: 560; }
.kpi.hot .kpi-top .ico { color: var(--accent); }
.kpi.hot .kpi-top .label { color: var(--ink-2); }
.kpi.warn .kpi-val { color: var(--warn); }
.kpi { transition: border-color .4s, transform .6s var(--ease-spring); }
.kpi:hover { border-color: var(--line-3); transform: translateY(-2px); }
.kpi.flash { animation: kpi-flash 1.4s var(--ease); }
@keyframes kpi-flash { 0% { border-color: var(--accent-line); background: var(--accent-soft); } }

.ov-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 18px; }
.chart-card .card-head { align-items: flex-start; justify-content: space-between; }
.chart-card h3 { font-size: 30px; font-weight: 760; letter-spacing: -.04em; margin-top: 6px; }
.chart { height: 190px; padding: 0 18px 16px; }

.rank { padding: 0 8px 10px; display: grid; }
.rank-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 8px 10px; border-radius: var(--r-sm);
  text-decoration: none;
}
.rank-row:hover { background: var(--bg-2); }
.rank-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 540; font-size: 13px; }
.rank-name .dot { background: var(--ok); }
.rank-name .dot.off { background: var(--warn); }
.rank-num { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.rank-bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: var(--ink-4); border-radius: 3px; transform-origin: left; animation: bar-x 1.1s var(--ease) backwards; }
.rank-row:nth-child(2) .rank-bar span { animation-delay: 60ms; } .rank-row:nth-child(3) .rank-bar span { animation-delay: 120ms; }
.rank-row:nth-child(4) .rank-bar span { animation-delay: 180ms; } .rank-row:nth-child(n+5) .rank-bar span { animation-delay: 240ms; }
@keyframes bar-x { from { transform: scaleX(0); } }
.rank-row:first-child .rank-bar span { background: var(--accent); }

.feed-head .seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.feed { max-height: 520px; overflow-y: auto; border-top: 1px solid var(--line); }
.ev {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
}
.ev:last-child { border-bottom: 0; }
.ev:hover { background: var(--bg-2); }
.ev-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-3); color: var(--ink-2); }
.ev-ico .ico { width: 15px; height: 15px; }
.ev-ico.in { background: var(--accent-soft); color: var(--accent-text); }
.ev-ico.ok { background: var(--ok-soft); color: var(--ok); }
.ev-ico.bad { background: var(--danger-soft); color: var(--danger); }
.ev-ico.info { background: var(--info-soft); color: var(--info); }
.ev-main { min-width: 0; display: grid; gap: 2px; }
.ev-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-title b { font-weight: 600; }
.ev-title .mono { color: var(--ink); font-size: 12px; }
.ev-meta { font-size: 12px; font-weight: 500; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-time { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.ev.new { animation: ev-new 1.8s var(--ease); }
@keyframes ev-new { 0% { background: var(--accent-soft); transform: translateY(-8px); opacity: 0; } 25% { transform: none; opacity: 1; } }

/* --- Tables ------------------------------------------------------------ */
.table { border-top: 1px solid var(--line); }
.trow {
  display: grid; align-items: center; gap: 14px;
  padding: 10px 18px; min-height: 52px;
  border-bottom: 1px solid var(--line);
  transition: background var(--t-fast);
}
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--bg-2); }
.trow.thead { min-height: 34px; padding-top: 8px; padding-bottom: 8px; background: var(--bg); }
.trow.thead:hover { background: var(--bg); }
.trow.thead > * { font-size: 11.5px; font-weight: 560; color: var(--ink-3); }
.trow .actions { display: flex; gap: 2px; justify-content: flex-end; }
.trow.checked { background: var(--accent-soft); }
.cell-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-main .av { --_s: 30px; border-radius: 8px; }
.cell-title { display: grid; min-width: 0; }
.cell-title strong { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-title span { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.cell-num { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); }
.table-more { padding: 12px; text-align: center; }

.d-row { grid-template-columns: minmax(200px, 1.6fr) 110px 120px 90px 70px 70px minmax(150px, auto); }
.d-setup {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  padding: 4px 0 6px 41px;
}
.d-setup .field { gap: 4px; }
.d-setup .label b { color: var(--warn); font-weight: 400; }
.mx-found { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); }

.a-row { grid-template-columns: 22px minmax(220px, 1.8fr) minmax(110px, .9fr) 70px 110px minmax(150px, auto); }
.a-addr { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 4px; padding: 2px 4px; margin-left: -4px; }
.a-addr:hover { background: var(--bg-4); }
.a-addr .dom { color: var(--ink-3); }
.pw-chip {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  height: 20px; padding: 0 7px 0 6px; border-radius: 99px;
  font-size: 11px; font-weight: 600; line-height: 1;
  color: var(--ok); background: var(--ok-soft);
}
.pw-chip .ico { width: 11px; height: 11px; stroke-width: 2; }
.icon-btn.has-pw { color: var(--ok); }
.icon-btn.has-note { color: var(--accent); }
.a-main { display: grid; gap: 1px; min-width: 0; }
.a-note {
  justify-self: start; max-width: 100%; margin-left: -4px; padding: 0 4px; border-radius: 4px;
  font-size: 12px; color: var(--ink-3); text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
button.a-note:hover { background: var(--bg-4); color: var(--ink-2); }
.a-note-in { height: auto; min-height: 96px; padding: 9px 11px; line-height: 1.45; resize: vertical; }

.s-row { grid-template-columns: minmax(0, 1.4fr) 130px 120px 120px; }

/* --- Addresses --------------------------------------------------------- */
.addr-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 18px; }
.create-form { display: grid; gap: 14px; padding: 4px 18px 18px; }
.addr-compose {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(140px, .9fr) auto; align-items: center; gap: 8px;
}
.addr-compose .input { height: 42px; font-size: 14px; }
.addr-compose .select { height: 42px; }
.addr-compose .select.snap { animation: select-snap 1.2s var(--ease); }
@keyframes select-snap { 0% { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); } }
.addr-compose .select.needs-pick { border-color: var(--warn); }
.a-dom-hint { margin-top: -6px; color: var(--warn); }
.addr-compose .at { font-family: var(--f-display); font-size: 20px; color: var(--ink-3); }
.create-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; border-top: 1px dashed var(--line-2); padding-top: 14px; }
.bulk-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; }
#b-style button { font-family: var(--f-mono); font-size: 11.5px; }
.addr-stats { padding: 18px; display: grid; gap: 16px; align-content: start; }
.stat-big { display: flex; align-items: baseline; gap: 10px; }
.stat-big b { font-family: var(--f-display); font-stretch: 112%; font-weight: 720; font-size: 40px; letter-spacing: -.03em; line-height: 1; }
.stat-list { display: grid; gap: 8px; }
.stat-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 12.5px; }
.stat-line span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.stat-line .mono { color: var(--ink-3); }
.select-sm { height: 30px; width: auto; min-width: 140px; font-size: 12.5px; }
#a-table .search-field .input, .card-head .search-field .input { height: 30px; }

.result-list { max-height: 50vh; overflow: auto; border: 1px solid var(--line-2); border-radius: var(--r); }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-family: var(--f-mono); font-size: 12px; }
.result-row:last-child { border-bottom: 0; }
.result-row span:last-child { color: var(--accent-text); }

/* --- Mail -------------------------------------------------------------- */
.main:has(> .view-mail:not([hidden])) { height: 100vh; overflow: hidden; }
.view-mail { padding: 0; gap: 0; flex: 1; min-height: 0; }
.mail-shell { display: grid; grid-template-columns: minmax(360px, 470px) minmax(0, 1fr); min-height: 0; height: 100%; }
.mlist { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.mlist-head { padding: 14px 14px 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; border-bottom: 1px solid var(--line); }
.mlist-tools { display: flex; align-items: center; gap: 4px; }
/* Never wider than the list: when the tabs don't fit, they scroll sideways. */
#m-folder { min-width: 0; overflow-x: auto; scrollbar-width: none; }
#m-folder::-webkit-scrollbar { display: none; }
#m-folder button { flex: none; }
.mlist-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.mlist-filters.has-search { grid-template-columns: 150px minmax(0, 1fr); }
.mlist-filters .input, .mlist-filters .select { height: 32px; }
.mlist-sub { display: flex; align-items: center; gap: 10px; height: 28px; padding-left: 9px; }
.m-bulk { display: flex; gap: 1px; }
#m-addr-chip button { display: inline-grid; place-items: center; margin-right: -4px; color: inherit; }
#m-addr-chip .ico { width: 11px; height: 11px; }
.mitems { flex: 1; overflow-y: auto; position: relative; }
.mitems > .plate { left: 6px; right: 6px; border-radius: 12px; }

.mi {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 16px 30px minmax(0, 1fr); gap: 10px; align-items: start;
  margin: 0 6px; padding: 11px 12px 11px 10px;
  border-radius: 12px;
  cursor: default;
  transition: background var(--t);
}
/* Hairline between rows, aligned with the text; gone next to a highlighted row. */
.mi + .mi::after {
  content: ''; position: absolute; left: 76px; right: 12px; top: 0; height: 1px; background: var(--line);
  transition: opacity var(--t);
}
.mi.active::after, .mi.active + .mi::after, .mi.checked::after, .mi.checked + .mi::after { opacity: 0; }
.mi:first-child, .mitems > .plate + .mi { margin-top: 6px; }
.mi .check { margin-top: 7px; }
.mi .av { --_s: 30px; border-radius: 9px; }
.mi.active { background: var(--row-active); }
.mi.checked { background: var(--accent-soft); }
.mitems.kbd-nav .mi.focus:not(.active) { box-shadow: 0 0 0 1px var(--line-2) inset; }
.mi-main { min-width: 0; display: grid; gap: 1px; line-height: 1.35; }
.mi-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mi-from { font-weight: 600; color: var(--ink-2); font-size: 13.5px; }
.mi-time { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); flex: none; }
.mi-subject { font-size: 13px; color: var(--ink-2); font-weight: 520; flex: 1 1 auto; }
.mi-to { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.mi-to b { color: var(--info); font-weight: 600; }
.mi-to .muted { color: var(--ink-3); }
/* Search preview */
.m-suggest {
  position: fixed; z-index: 60;
  display: grid; gap: 2px; align-content: start;
  padding: 6px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-3); border-radius: var(--r); box-shadow: var(--shadow-pop);
  animation: menu-in .25s var(--ease);
}
.ms-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; align-items: start; width: 100%; padding: 9px 10px; border-radius: 8px; text-align: left; }
.ms-item:hover, .ms-item.active { background: var(--bg-4); }
.ms-item .av { --_s: 30px; border-radius: 8px; margin-top: 1px; }
.ms-main { display: grid; gap: 2px; min-width: 0; }
.ms-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ms-from { font-size: 13px; font-weight: 600; color: var(--ink); }
.ms-time { margin-left: auto; flex: none; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.ms-subject { font-size: 12.5px; color: var(--ink-2); }
.ms-snippet { font-size: 12px; color: var(--ink-3); }
.ms-to { font-size: 11.5px; color: var(--ink-3); }
.m-suggest mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; }
.ms-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; padding: 8px 10px 4px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); }
.ms-foot { align-items: center; }
.ms-foot kbd { margin-right: 4px; }
.ms-more { height: 26px; }
.ms-empty { padding: 16px 12px; text-align: center; font-size: 13px; color: var(--ink-3); }
.ms-empty b { color: var(--ink); font-weight: 600; }
.mi-tag { font-size: 10.5px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 99px; padding: 1px 7px; flex: none; }
.mi-badges { display: flex; gap: 6px; align-items: center; flex: none; }
.mi-badges .ico { width: 13px; height: 13px; color: var(--ink-3); }
.mi.unread .mi-from, .mi.unread .mi-subject { color: var(--ink); font-weight: 650; }
.mi.unread::before { content: ''; position: absolute; left: 2px; top: 24px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.mi .mi-star { color: var(--ink-4); }
.mi.starred .mi-star { color: var(--warn); }
.mi.starred .mi-star .ico { fill: currentColor; color: var(--warn); }
.mi.new { animation: ev-new 1.8s var(--ease); }
.mi-foot { padding: 14px; text-align: center; }

.mread { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.mread > .empty { flex: 1; }
.mmsg { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.mmsg-bar { display: flex; align-items: center; gap: 2px; height: 52px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; }
.mmsg-bar [data-mm='star'].active .ico { fill: currentColor; color: var(--warn); }
.m-back { display: none; }
.mmsg-scroll { flex: 1; overflow-y: auto; padding: 24px 30px 28px; display: flex; flex-direction: column; gap: 16px; }
.mmsg-subject { margin: 0; font-size: 28px; font-weight: 740; letter-spacing: -.03em; line-height: 1.14; word-break: break-word; }
.mmsg-from { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.mmsg-from .av { --_s: 40px; border-radius: 11px; }
.mmsg-meta { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 13.5px; }
.mmsg-meta strong { font-weight: 640; }
.mmsg-meta .mono { font-size: 12px; }
.mmsg-to { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.mmsg-to button { color: var(--info); font-size: 12px; border-radius: 4px; padding: 0 3px; }
.mmsg-to button:hover { background: var(--bg-3); }
.mmsg-date { display: grid; justify-items: end; gap: 2px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

.msg-code {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px 16px 16px 18px;
  border-radius: 16px; background: var(--bg-2); box-shadow: 0 0 0 1px var(--line-2) inset;
}
.msg-code .label { color: var(--accent-text); margin: 0 0 8px; }
.code-cells { display: flex; gap: 6px; }
.code-cells span { width: 36px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-family: var(--f-mono); font-size: 22px; background: var(--bg-3); box-shadow: 0 0 0 1px var(--line-2) inset; }
.msg-code .btn { margin-left: auto; height: 38px; border-radius: 11px; min-width: 110px; }
.btn.done { --_bg: var(--ok); --_fg: #0d1a12; }

/* --- Settings ---------------------------------------------------------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: 1 / -1; }
.set-form { display: grid; gap: 14px; padding: 4px 18px 18px; align-content: start; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .input-group, .inline-form .input { flex: 1; min-width: 0; }
.sys-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.sys-cell { padding: 14px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 5px; min-width: 0; }
.sys-cell:nth-child(4n) { border-right: 0; }
.sys-cell b { font-family: var(--f-mono); font-weight: 400; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys-cell small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-note { margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.bk-note code { color: var(--ink-2); }
.bk-list { border-top: 0; }
.bk-row { grid-template-columns: minmax(0, 1.4fr) 110px 110px 100px; }
#s-bk > .empty { grid-column: 1 / -1; padding: 28px 18px; }

/* --- Domains page intro + guide --------------------------------------- */
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.page-intro p { margin: 0; color: var(--ink-2); max-width: 560px; }
.page-intro code { color: var(--accent-text); }
.page-intro .inline-form { width: min(440px, 100%); }
.page-intro .input { height: 36px; }
.page-intro .btn { height: 36px; }

.guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: 100%; max-width: 1040px; margin: 8px auto 0; align-items: stretch; }
.guide-intro { grid-column: 1 / -1; display: grid; gap: 8px; justify-items: center; text-align: center; padding: 10px 0 18px; }
.guide-intro h2 { margin: 0; font-size: clamp(26px, 3vw, 38px); font-weight: 760; letter-spacing: -.035em; }
.guide-intro h2 span { color: var(--accent-text); }
.guide-intro .muted { margin: 0; max-width: 560px; font-size: 14px; }
.guide-intro .label { color: var(--accent-text); }
.guide-step { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; padding: 22px 24px; align-content: start; }
.guide-step h3 { margin: 2px 0 6px; font-size: 16px; font-weight: 640; }
.guide-step p { margin: 0 0 10px; color: var(--ink-2); }
.guide-step a { color: var(--accent-text); }
.step-n { font-size: 30px; color: var(--accent); font-weight: 780; letter-spacing: -.04em; }
.rec-table {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px 16px; padding: 12px 14px; margin-bottom: 10px;
  border-radius: var(--r-sm); background: var(--bg); border: 1px dashed var(--line-3);
}
.rec-table code { font-size: 12.5px; overflow-wrap: break-word; }
.rec-table > code:nth-child(3n+1), .rec-table > code:nth-child(3n+2) { white-space: nowrap; }

/* --- Sub-users ---------------------------------------------------------- */
/* Hidden by role/permission; !important beats code that toggles `hidden`. */
.is-sub [data-admin],
.no-perm-addresses [data-perm="addresses"],
.no-perm-delete [data-perm="delete"] { display: none !important; }
.no-perm-addresses .addr-grid { grid-template-columns: 1fr; }
.is-sub .settings-grid > .card:first-child { grid-column: 1 / -1; }
.is-sub .side-foot { margin-top: auto; }
.is-sub .col-catch .switch { opacity: .5; }
.is-sub .settings-grid > .card:first-child .set-form { max-width: 460px; }

.u-fields, .u-form { display: grid; gap: 14px; }
.u-cred { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.u-dom-head { display: flex; align-items: center; gap: 6px; }
.u-dom-head .btn { height: 24px; padding: 0 8px; font-size: 11.5px; }
.u-dom-search .input { height: 32px; padding-right: 10px; }
.dom-pick {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px;
  max-height: 212px; overflow: auto; padding: 4px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-1);
}
.dom-opt {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--ink-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.dom-opt:hover { background: var(--bg-2); color: var(--ink); }
.dom-opt:has(input:checked) { background: var(--accent-soft); color: var(--ink); }
.dom-opt .ellipsis { flex: 1; min-width: 0; }
.dom-opt .chip { height: 18px; padding: 0 6px; font-size: 10px; }
.dom-pick .empty { grid-column: 1 / -1; padding: 18px; }
.perm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer;
}
.perm-row + .perm-row { margin-top: -6px; }
.perm-row > span:first-child { display: grid; gap: 2px; min-width: 0; }
.perm-row b { font-weight: 600; font-size: 13px; }

.u-about { display: grid; align-content: start; }
.u-points { list-style: none; margin: 0; padding: 0 18px; display: grid; gap: 14px; }
.u-points li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.u-points .ico { width: 16px; height: 16px; margin-top: 2px; color: var(--accent-text); }
.u-totals { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 18px 18px; margin-top: 16px; border-top: 1px dashed var(--line-2); }

.u-row { grid-template-columns: minmax(170px, 1.1fr) minmax(200px, 1.6fr) 150px 120px 110px minmax(84px, auto); }
.u-row.off { opacity: .62; }
.u-doms, .u-perms { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.u-doms .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Responsive -------------------------------------------------------- */
@media (max-width: 1380px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .ov-grid, .addr-grid, .guide { grid-template-columns: 1fr; }
  .d-row { grid-template-columns: minmax(180px, 1.6fr) 100px 110px 80px minmax(130px, auto); }
  .d-row > .col-addr, .d-row > .col-mail { display: none; }
  .sys-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sys-cell:nth-child(4n) { border-right: 1px solid var(--line); }
  .sys-cell:nth-child(2n) { border-right: 0; }
}
@media (max-width: 960px) {
  .console { grid-template-columns: 1fr; }
  .side {
    position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(280px, 86vw);
    background: var(--bg-1); border-right: 1px solid var(--line-2);
    transform: translateX(-102%); transition: transform .28s var(--ease);
  }
  .console.side-open .side { transform: none; box-shadow: var(--shadow-pop); }
  .side-scrim { position: fixed; inset: 0; z-index: 55; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .console.side-open .side-scrim { opacity: 1; pointer-events: auto; }
  .side-close, .topbar-menu { display: inline-grid; }
  .side-toggle { display: none; }
  .topbar { padding: 0 14px; gap: 10px; }
  .clock { display: none; }
  .view { padding: 16px 14px 32px; }
  .mail-shell { grid-template-columns: 1fr; }
  .mlist { border-right: 0; }
  .mread { position: fixed; inset: 0; z-index: 40; background: var(--bg-1); transform: translateX(100%); transition: transform .3s var(--ease); }
  .view-mail.reading .mread { transform: none; }
  .m-back { display: inline-grid; }
  .mmsg-scroll { padding: 18px 14px 24px; }
  .mmsg-subject { font-size: 21px; }
  .mmsg-from { flex-wrap: wrap; row-gap: 10px; }
  .mmsg-meta { flex-basis: calc(100% - 54px); }
  .mmsg-date { order: 3; width: 100%; display: flex; justify-content: space-between; }
  .settings-grid { grid-template-columns: 1fr; }
  .a-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .a-row > .col-dom, .a-row > .col-mail, .a-row > .col-date { display: none; }
  .u-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; }
  .u-row > .col-perm, .u-row > .col-status, .u-row > .col-last { display: none; }
  .s-row { grid-template-columns: minmax(0, 1fr) auto; }
  .s-row > :nth-child(2), .s-row > :nth-child(3) { display: none; }
  .bk-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bk-row > :nth-child(2), .bk-row > :nth-child(3) { display: none; }
}
@media (min-width: 961px) { .side-scrim { display: none; } }
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-val { font-size: 24px; }
  .d-row { grid-template-columns: minmax(0, 1fr) auto; }
  .d-row > .col-status, .d-row > .col-mx, .d-row > .col-catch { display: none; }
  .d-row.thead > :not(:first-child):not(:last-child) { display: none; }
  .d-setup { grid-template-columns: 1fr; padding-left: 0; }
  .addr-compose { grid-template-columns: minmax(0, 1fr) auto; }
  .addr-compose .at { display: none; }
  .addr-compose .select { grid-column: 1 / -1; grid-row: 2; }
  .card-head .search-field { flex: 1 1 100%; width: 100%; order: 5; }
  .code-cells span { width: 30px; height: 40px; font-size: 18px; }
  .mlist-filters { grid-template-columns: 1fr; }
  .page-intro .inline-form { width: 100%; }
  .rec-table { grid-template-columns: 50px minmax(0, 1fr); }
  .rec-table > :nth-child(3n) { grid-column: 1 / -1; }
  .rec-table > .label:nth-child(3) { display: none; }
  .guide-step { grid-template-columns: 1fr; }
  .u-cred { grid-template-columns: 1fr; }
  .u-row { grid-template-columns: minmax(0, 1fr) auto; }
  .u-row > .col-doms { display: none; }
  .sys-grid { grid-template-columns: 1fr 1fr; }
}

/* === Phones: an app shell with a bottom tab bar ========================= */
.mmsg-top, .mmsg-more, .m-bulk-done { display: none; }
@keyframes m-dock-in { from { transform: translateY(100%); } }

@media (max-width: 860px), (pointer: coarse) and (max-height: 520px) {
  :root { --dock: 56px; }
  html { overscroll-behavior-y: none; }
  /* Nothing may widen the page: on a phone that zooms it out and drops the tab bar off-screen. */
  html, body { overflow-x: clip; }

  /* Shell: no drawer. The main sections sit in the tab bar, the rest under More. */
  .console { display: block; min-height: 100dvh; }
  .side, .side-scrim, .topbar-menu { display: none !important; }
  .main { min-height: 100dvh; padding-bottom: calc(var(--dock) + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; }
  .console:has(.view-mail:not([hidden]).reading) .tabbar,
  .console:has(.view-mail:not([hidden]) .m-bulk:not([hidden])) .tabbar { transform: translateY(105%); }

  .topbar {
    height: calc(54px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  }
  .crumbs .label { display: none; }
  .crumbs h1 { font-size: 24px; }
  .top-search { position: static; transform: none; flex: 1 1 auto; width: auto; max-width: 280px; min-width: 0; margin-left: auto; }
  .top-search:empty { display: none; }
  .top-search kbd { display: none; }
  .top-search .search-field > .input { padding-right: 34px; }
  .view { padding: 14px max(14px, env(safe-area-inset-right)) 28px max(14px, env(safe-area-inset-left)); gap: 14px; }

  /* Card toolbars: filters scroll sideways, search and buttons share a row. */
  .card-head { gap: 8px; }
  .card-head > .spacer { display: none; }
  .card-head > .seg { flex: 1 1 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .card-head > .seg::-webkit-scrollbar { display: none; }
  .card-head > .seg button { flex: none; }
  .card-head .search-field { flex: 1 1 160px; width: auto; order: 0; min-width: 0; }
  .card-head .search-field .input { height: 40px; }
  .card-head .btn-sm { height: 40px; padding: 0 14px; }
  .card-head .select-sm { height: 40px; flex: 1 1 130px; min-width: 0; }

  .input-group:has(> .input-suffix) > .input { padding-right: 104px; }

  /* Overview */
  .kpi:hover { transform: none; }
  .kpi-sub { display: block; line-height: 1.4; }
  .feed-head .seg { flex: 1 1 100%; }

  /* --- Mail: list fills the screen above the tab bar --- */
  .main:has(> .view-mail:not([hidden])) { height: 100dvh; min-height: 0; }
  .view.view-mail { padding: 0; }
  .mail-shell { grid-template-columns: minmax(0, 1fr); }
  .mlist-head { padding: 10px 14px 6px; gap: 10px; grid-template-columns: minmax(0, 1fr); }
  .mlist-tools { gap: 6px; }
  #m-folder { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  #m-folder::-webkit-scrollbar { display: none; }
  #m-folder button { flex: none; }
  #m-refresh { display: none; }
  .mlist-filters { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .mlist-filters .input, .mlist-filters .select { height: 42px; border-radius: 12px; }
  .mlist-sub { height: 32px; padding-left: 13px; }

  .mitems { overscroll-behavior-y: contain; }
  .mi {
    grid-template-columns: 42px minmax(0, 1fr); gap: 12px;
    margin: 0; padding: 13px 16px 13px 16px; border-radius: 0;
    -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
  }
  .mi:first-child, .mitems > .plate + .mi { margin-top: 0; }
  .mitems > .plate { display: none; }
  .mi:active:not(.checked) { background: var(--bg-2); }
  .mi + .mi::after { left: 70px; right: 0; }
  .mi.unread::before { left: 5px; top: 31px; width: 6px; height: 6px; }
  .mi .av { --_s: 42px; border-radius: 12px; grid-column: 1; grid-row: 1; }
  /* The checkbox lies over the avatar: tap the avatar to select. */
  .mi .check {
    grid-column: 1; grid-row: 1; z-index: 2;
    width: 42px; height: 42px; margin: 0; border-radius: 12px;
    opacity: 0; transition: opacity .2s, background .2s;
  }
  .mi .check input { inset: 0; }
  .mi .check span { width: 22px; height: 22px; border-radius: 7px; border-width: 2px; }
  .mitems.selecting .mi .check { opacity: 1; background: color-mix(in srgb, var(--bg-3) 88%, transparent); }
  .mi.checked .check { opacity: 1; background: var(--accent-soft); }
  .mi.checked .check span { background: var(--accent); border-color: var(--accent); }
  .mi-main { gap: 2px; }
  .mi-from { font-size: 15.5px; }
  .mi-time { font-size: 12px; }
  .mi-subject { font-size: 14.5px; }
  .mi-to { font-size: 13.5px; }
  .mi .mi-star { width: 36px; height: 36px; margin: -8px -10px -8px -4px; }
  .mi .otp { height: 28px; padding: 0 10px; font-size: 13px; }

  /* Selection: actions replace the tab bar */
  .m-bulk {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    display: flex; gap: 0;
    padding: 2px max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg-2) 90%, transparent);
    backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-top: 1px solid var(--line-2);
    animation: m-dock-in .45s var(--ease);
  }
  .m-bulk-done { display: flex; }
  .m-bulk .icon-btn, .mmsg-bar > .icon-btn {
    flex: 1 1 0; min-width: 0; width: auto; height: 56px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    border-radius: 14px;
    font-size: 10.5px; font-weight: 600; color: var(--ink-2);
  }
  .m-bulk .icon-btn .ico, .mmsg-bar > .icon-btn .ico { width: 22px; height: 22px; transition: transform .4s var(--ease-spring); }
  .m-bulk .icon-btn:active .ico, .mmsg-bar > .icon-btn:active .ico { transform: scale(.85); }
  .m-bulk .icon-btn::after, .mmsg-bar > .icon-btn::after { content: attr(data-label); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* --- Reader: a pushed screen with its actions at the bottom --- */
  .mread {
    position: fixed; inset: 0; z-index: 40;
    background: var(--bg);
    transform: translateX(calc(100% + 80px));
    transition: transform .5s var(--ease);
    box-shadow: -24px 0 60px -24px rgba(0, 0, 0, .55);
  }
  .view-mail.reading .mread { transform: none; }
  .mread > .empty { display: none; }
  .mmsg { position: relative; height: 100%; }
  .mmsg-top {
    display: flex; align-items: center; flex: none;
    height: calc(52px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(2px, env(safe-area-inset-left));
    border-bottom: 1px solid transparent;
    transition: border-color .25s;
  }
  .mmsg.scrolled .mmsg-top { border-bottom-color: var(--line-2); }
  .mmsg-top-back {
    display: inline-flex; align-items: center;
    height: 44px; padding: 0 12px 0 2px;
    border-radius: 12px;
    color: var(--accent-text); font-size: 16.5px; font-weight: 600;
  }
  .mmsg-top-back .ico { width: 28px; height: 28px; stroke-width: 2; }
  .mmsg-top-back:active { background: var(--bg-3); }
  .mmsg-top-pos { color: var(--ink-3); font-size: 11.5px; }
  .mmsg-bar {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
    height: auto; gap: 0;
    padding: 2px max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-top: 1px solid var(--line-2); border-bottom: 0;
  }
  .mmsg-bar > .m-back, .mmsg-bar > .spacer, .mmsg-bar > [data-mm='close'],
  .mmsg-bar > [data-mm='source'], .mmsg-bar > [data-mm='eml'] { display: none; }
  .mmsg-bar > .mmsg-more { display: flex; }
  .mmsg-bar > [data-mm='star'].active { color: var(--warn); }
  .mmsg-scroll { padding: 14px max(18px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); overscroll-behavior-y: contain; }
  .mmsg-subject { font-size: 25px; line-height: 1.15; }
  .mmsg-meta { font-size: 14.5px; }
  .mmsg-meta > div:first-child { display: grid; justify-items: start; }
  .mmsg-meta .mono { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Phones held sideways: the tab bar shrinks to icons. */
@media (pointer: coarse) and (max-height: 520px) {
  :root { --dock: 46px; }
  .tab { height: 46px; }
  .tab-label { display: none; }
  /* Short screen: the mail list keeps its rows; the page title gives way. */
  .main:has(> .view-mail:not([hidden])) > .topbar, .mlist-sub:not(:has(.m-bulk:not([hidden]))) { display: none; }
}

/* More sheet header */
.me-sys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.me-sys span { display: grid; gap: 3px; min-width: 0; padding: 10px 12px; border-radius: 14px; background: var(--bg-3); font-size: 11.5px; color: var(--ink-3); }
.me-sys b { font-family: var(--f-mono); font-size: 12.5px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
