:root {
  --bg: #090c14;
  --panel: rgba(18, 24, 38, .78);
  --panel-solid: #121826;
  --panel-2: #0e1320;
  --border: rgba(148, 163, 184, .12);
  --border-2: rgba(148, 163, 184, .2);
  --text: #e6e9f2;
  --muted: #8b95a9;
  --accent: #7c5cff;
  --accent-2: #22c3ee;
  --red: #f87171;
  --orange: #fb923c;
  --yellow: #facc15;
  --green: #34d399;
  --blue: #60a5fa;
  --gray: #64748b;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .35);
  --grad: linear-gradient(135deg, #7c5cff, #4f8bff 55%, #22c3ee);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(124, 92, 255, .16), transparent 60%) fixed,
    radial-gradient(700px 400px at -10% 110%, rgba(34, 195, 238, .08), transparent 60%) fixed,
    var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.narrow { max-width: 820px; }
.pad { padding: 4px 6px; }

.icon { display: inline-flex; flex: none; }
.icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn .icon svg, .chip .icon svg, .due .icon svg { width: 15px; height: 15px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 14px; height: calc(100vh - 28px); margin: 14px 0 14px 14px;
  display: flex; flex-direction: column; gap: 18px; overflow-y: auto; scrollbar-width: none;
  padding: 18px 14px 14px; border-radius: 24px; border: 1px solid var(--border);
  background:
    radial-gradient(260px 180px at 0% 0%, rgba(124, 92, 255, .22), transparent 70%),
    linear-gradient(180deg, rgba(22, 27, 45, .92), rgba(11, 14, 25, .92));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(14px);
}
.sidebar::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { position: relative; flex: none; display: grid; }
.brand-logo::after { content: ""; position: absolute; inset: 6px; border-radius: 12px; background: var(--grad); filter: blur(14px); opacity: .7; z-index: -1; }
.brand-logo img { border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand-tag { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 6px; background: rgba(124, 92, 255, .2); color: #c4b5fd; border: 1px solid rgba(124, 92, 255, .35); }
.pill:empty { display: none; }

.mobile-bar, .drawer-backdrop, .drawer-close { display: none; }
.menu-btn, .drawer-close {
  place-items: center; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; flex: none;
  border: 1px solid var(--border-2); background: rgba(148, 163, 184, .06); color: var(--text);
}
.menu-btn { display: grid; }
.drawer-close { position: absolute; top: 18px; right: 14px; width: 34px; height: 34px; border-radius: 10px; }
.menu-btn svg, .drawer-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mobile-title { font-weight: 600; font-size: 16px; }

.ask-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 10px 10px 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid rgba(124, 92, 255, .35); background: linear-gradient(135deg, rgba(124, 92, 255, .22), rgba(34, 195, 238, .1));
  color: var(--text); font: inherit; font-weight: 600; text-align: left; transition: border-color .15s, transform .15s;
}
.ask-btn:hover { border-color: rgba(124, 92, 255, .7); transform: translateY(-1px); }
.ask-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--grad); color: #fff; }
.ask-icon .icon svg { width: 15px; height: 15px; }
kbd { font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 4px 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); border: 1px solid var(--border-2); color: var(--muted); }

nav { display: flex; flex-direction: column; gap: 14px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { margin: 0 0 4px; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #5f6a80; }
nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 6px 10px 6px 6px; border-radius: 12px;
  color: var(--muted); font-weight: 500; transition: background .15s, color .15s;
}
nav a:hover { background: rgba(148, 163, 184, .07); color: var(--text); text-decoration: none; }
.nav-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(148, 163, 184, .06); border: 1px solid transparent; transition: background .15s; }
.nav-icon .icon svg { width: 17px; height: 17px; }
nav a.active { background: rgba(124, 92, 255, .14); color: #fff; }
nav a.active .nav-icon { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(124, 92, 255, .4); }
.badge { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 99px; background: rgba(148, 163, 184, .16); color: var(--text); font-size: 12px; font-weight: 600; text-align: center; line-height: 20px; }
.badge.outbox { background: var(--orange); color: #1b1208; }
.badge.tasks { background: rgba(124, 92, 255, .25); color: #d8ccff; }
.badge[hidden] { display: none; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: rgba(6, 9, 16, .55); }
.sidebar-foot:empty { display: none; }
.profile { display: flex; align-items: center; gap: 10px; }
.profile strong { font-size: 14px; }
.status-line { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.conns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.conn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.conn.on { color: #cbd5e1; }

.main { padding: 28px 36px 120px; min-width: 0; max-width: 1480px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.topbar h1 { font-size: 27px; letter-spacing: -.02em; }
.topbar p { margin: 5px 0 0; }
.view { display: flex; flex-direction: column; gap: 20px; }
.view.enter > * { animation: rise .35s ease both; }
.view.enter > *:nth-child(2) { animation-delay: .04s; }
.view.enter > *:nth-child(3) { animation-delay: .08s; }
.view.enter > *:nth-child(4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 22px; padding: 12px 16px; border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(124, 92, 255, .25), rgba(34, 195, 238, .15)); border: 1px solid rgba(124, 92, 255, .4);
  font-size: 14px;
}

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; backdrop-filter: blur(6px); }
.card.highlight { border-color: rgba(124, 92, 255, .5); }
.card.ghost-card { background: transparent; border-style: dashed; box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { display: flex; align-items: center; gap: 9px; font-size: 15px; letter-spacing: .01em; }
.card-head h3 .icon { color: #a78bfa; }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.link-more:hover { color: var(--text); text-decoration: none; }
.link-more .icon svg { width: 14px; height: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ---------- Overview hero ---------- */
.hero {
  position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding: 28px 30px; border-radius: 20px; border: 1px solid rgba(124, 92, 255, .35);
  background: linear-gradient(120deg, rgba(124, 92, 255, .35), rgba(79, 139, 255, .18) 45%, rgba(34, 195, 238, .12));
  box-shadow: var(--shadow);
}
.hero::after { content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 65%); pointer-events: none; }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: #c4b5fd; font-weight: 600; }
.hero h2 { font-size: 30px; letter-spacing: -.02em; }
.hero-summary { margin: 8px 0 0; color: #d6dcff; font-size: 15.5px; max-width: 720px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.stat {
  display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.stat:hover { transform: translateY(-2px); border-color: var(--border-2); text-decoration: none; }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.stat-icon .icon svg { width: 20px; height: 20px; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--text); font-size: 13px; font-weight: 500; }
.stat-hint { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.purple { --c: #a78bfa; } .stat.red { --c: var(--red); } .stat.orange { --c: var(--orange); } .stat.yellow { --c: var(--yellow); } .stat.blue { --c: var(--blue); } .stat.green { --c: var(--green); }

.focus-list, .mail-list, .recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.focus-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.focus-list li:first-child, .mail-list li:first-child .mail-row { border-top: 0; }
.mail-list li:first-child .mail-row { margin-top: 6px; }
.focus-name { color: var(--text); font-weight: 600; font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 12.5px; }
.prio-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--gray); }
.prio-dot.urgent { background: var(--red); box-shadow: 0 0 0 4px rgba(248, 113, 113, .15); }
.prio-dot.high { background: var(--orange); box-shadow: 0 0 0 4px rgba(251, 146, 60, .14); }
.prio-dot.normal { background: var(--blue); }
.prio-dot.low, .prio-dot.none { background: var(--gray); }
.due { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; }
.due.red { color: #fca5a5; } .due.orange { color: #fdba74; }
.mail-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; color: var(--text); }
.mail-row:hover { background: rgba(148, 163, 184, .07); text-decoration: none; }
.mail-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.mail-subject { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more { margin: 8px 0 0; }
.recent-list li { --c: var(--accent); display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.recent-list li:first-child { border-top: 0; }
.recent-list li.cat-task { --c: #a78bfa; } .recent-list li.cat-email { --c: var(--blue); } .recent-list li.cat-plan { --c: var(--yellow); } .recent-list li.cat-system { --c: var(--green); } .recent-list li.alarming { --c: var(--red); }
.recent-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.recent-icon .icon svg { width: 15px; height: 15px; }
.recent-list .grow { display: flex; flex-direction: column; }
.recent-title { font-size: 13.5px; font-weight: 500; }
.recent-title p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Overview panels (uniform, fixed-height cards) ---------- */
.bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 400px; gap: 20px; }
.panel {
  --c: var(--accent); display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  position: relative; transition: border-color .15s;
}
.panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--c), transparent 70%); opacity: .8; }
.panel:hover { border-color: var(--border-2); }
.panel.tone-purple { --c: #a78bfa; } .panel.tone-blue { --c: var(--blue); } .panel.tone-yellow { --c: var(--yellow); } .panel.tone-orange { --c: var(--orange); } .panel.tone-green { --c: var(--green); }
.panel-head { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex: none; }
.panel-head h3 { font-size: 15px; white-space: nowrap; }
.panel-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.panel-icon .icon svg { width: 16px; height: 16px; }
.panel-count { min-width: 24px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.panel-count:empty, .panel-meta:empty { display: none; }
.panel-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.panel-link { margin-left: auto; flex: none; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 18px 14px; scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .25) transparent; }
.panel-body > div > .skeleton-group { padding-top: 12px; }
.panel-body > div > .md { padding-top: 10px; font-size: 14px; }
.panel-body .empty { padding-top: 60px; }
.health-panel .panel-body { padding: 16px 18px; }
.health-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.list-label { margin: 16px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #5f6a80; }
.list-label.first { margin-top: 0; }
.health-panel .list-label { margin-bottom: 10px; }
.focus-list.next { opacity: .85; }
.health-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(14, 19, 32, .7); border: 1px solid var(--border); min-width: 0; }
.health-tile .grow { display: flex; flex-direction: column; min-width: 0; }
.health-tile strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-tile .small { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.health-tile.bad { border-color: rgba(248, 113, 113, .35); }
.health-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; color: var(--green); background: rgba(52, 211, 153, .12); }
.health-tile.bad .health-icon { color: var(--red); background: rgba(248, 113, 113, .12); }
.health-icon .icon svg { width: 16px; height: 16px; }
.health-panel .error-box { margin: 12px 0 0; }
.btn.icon-only { padding: 7px; flex: none; }

.health { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.health li { display: grid; grid-template-columns: 12px auto 1fr; gap: 10px; align-items: center; font-size: 14px; }
.health li .muted { text-align: right; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--gray); flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, .15); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px rgba(248, 113, 113, .15); }
.dot.purple { background: var(--accent); } .dot.red { background: var(--red); } .dot.orange { background: var(--orange); } .dot.yellow { background: var(--yellow); }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 11px;
  border: 1px solid var(--border-2); background: rgba(148, 163, 184, .06); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; transition: filter .15s, border-color .15s, background .15s;
}
.btn:hover { border-color: rgba(148, 163, 184, .35); text-decoration: none; }
.btn:disabled { opacity: .7; cursor: progress; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px rgba(124, 92, 255, .3); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.light { background: #fff; color: #14112b; border-color: #fff; }
.btn.glass { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 9px; gap: 6px; }
.icon-btn { padding: 9px; }
.chip-btn { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border-2); background: rgba(148, 163, 184, .05); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.chip-btn:hover { border-color: var(--accent); background: rgba(124, 92, 255, .12); }

input, textarea {
  width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border-2);
  background: var(--panel-2); color: var(--text); font: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .2); }
textarea { resize: vertical; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form .card-head { margin-bottom: 0; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap .icon { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search-wrap .icon svg { width: 16px; height: 16px; }
.search { width: 240px; padding-left: 36px; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 99px; font-size: 12px; background: rgba(148, 163, 184, .1); color: #cbd5e1; border: 1px solid var(--border-2); text-transform: lowercase; }
.chip.warn { background: rgba(251, 146, 60, .14); color: #fdba74; border-color: rgba(251, 146, 60, .35); text-transform: none; }
.chip.prio-urgent { background: rgba(248, 113, 113, .16); color: #fca5a5; border-color: rgba(248, 113, 113, .4); }
.chip.prio-high { background: rgba(251, 146, 60, .14); color: #fdba74; border-color: rgba(251, 146, 60, .35); }
.chip.prio-normal { background: rgba(96, 165, 250, .12); color: #93c5fd; border-color: rgba(96, 165, 250, .3); }
.chip.prio-low { color: var(--muted); }

/* ---------- Tasks board ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; align-items: start; }
.column { background: rgba(14, 19, 32, .7); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.column.working { border-color: rgba(124, 92, 255, .45); background: linear-gradient(180deg, rgba(124, 92, 255, .12), rgba(14, 19, 32, .7) 160px); }
.column header { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 2px 4px; }
.count { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 12px; background: rgba(148, 163, 184, .1); border-radius: 99px; padding: 0 8px; }
.task { position: relative; background: var(--panel-solid); border: 1px solid var(--border); border-radius: 12px; padding: 12px 12px 12px 15px; display: flex; flex-direction: column; gap: 9px; transition: transform .15s, border-color .15s; overflow: hidden; }
.task::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gray); opacity: .6; }
.task.prio-urgent::before { background: var(--red); opacity: 1; } .task.prio-high::before { background: var(--orange); opacity: 1; } .task.prio-normal::before { background: var(--blue); opacity: 1; }
.task:hover { border-color: var(--border-2); transform: translateY(-1px); }
.task-name { color: var(--text); font-weight: 600; font-size: 14px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.task-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- Email ---------- */
.email-head { display: flex; gap: 12px; margin-bottom: 12px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 260) 60% 52%), hsl(calc(var(--h, 260) + 45) 65% 38%));
}
.avatar.small { width: 32px; height: 32px; font-size: 13px; }
.email-from { display: flex; justify-content: space-between; gap: 8px; }
.email-subject { font-weight: 500; margin: 2px 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.email-body { white-space: pre-wrap; word-break: break-word; margin: 12px 0; padding: 14px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--border); font: 14px/1.6 inherit; font-family: inherit; }
.pending { border-color: rgba(251, 146, 60, .35); }
.pending.done { border-color: var(--border); }
.pending.compact { padding: 14px; box-shadow: none; }
.pending.compact .email-body { max-height: 220px; overflow-y: auto; font-size: 13.5px; }
.pending-head { display: flex; justify-content: space-between; margin-bottom: 10px; }
.meta { display: grid; grid-template-columns: 64px 1fr; gap: 4px 10px; margin: 0; font-size: 14px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; word-break: break-word; }

/* ---------- Markdown ---------- */
.md { word-break: break-word; }
.md p { margin: 0 0 10px; }
.md p:last-child { margin-bottom: 0; }
.md h4 { margin: 14px 0 6px; font-size: 14px; }
.md ul, .md ol { margin: 4px 0 12px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md code { background: rgba(148, 163, 184, .14); padding: 1px 6px; border-radius: 6px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.md blockquote { margin: 6px 0; padding: 4px 12px; border-left: 3px solid var(--border-2); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.md.inset { margin-top: 12px; padding: 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 11px; }
.codeblock { position: relative; margin: 8px 0 12px; }
.codeblock pre { margin: 0; padding: 14px; padding-right: 76px; overflow-x: auto; border-radius: 11px; background: #060810; border: 1px solid var(--border); }
.codeblock code { background: none; padding: 0; font-size: 13px; white-space: pre-wrap; }
.copy-btn { position: absolute; top: 8px; right: 8px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--border-2); background: var(--panel-solid); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }

/* ---------- Shared bits ---------- */
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row.center { justify-content: center; }
.btn.danger { color: #fca5a5; border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .06); }
.btn.danger:hover { border-color: rgba(248, 113, 113, .6); background: rgba(248, 113, 113, .12); }
.link-btn { padding: 0; margin-top: 4px; border: 0; background: none; color: var(--accent-2); font: inherit; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.chip.ok { background: rgba(52, 211, 153, .12); color: #6ee7b7; border-color: rgba(52, 211, 153, .35); text-transform: none; }
.chip.bad { background: rgba(248, 113, 113, .12); color: #fca5a5; border-color: rgba(248, 113, 113, .35); text-transform: none; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 36px 16px; }
.empty-state h3 { font-size: 17px; }
.empty-state p { margin: 0 0 10px; max-width: 420px; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 18px; color: #c4b5fd; background: linear-gradient(135deg, rgba(124, 92, 255, .25), rgba(34, 195, 238, .12)); border: 1px solid rgba(124, 92, 255, .35); }
.empty-icon .icon svg { width: 24px; height: 24px; }

/* ---------- Outbox ---------- */
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 6px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.flow-step { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; }
.flow-step + .flow-step { border-left: 1px solid var(--border); }
.flow-step strong { font-size: 14px; }
.flow-step p { margin: 2px 0 0; }
.flow-num { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 11px; color: #c4b5fd; background: rgba(124, 92, 255, .15); }
.flow-step:last-child .flow-num { color: var(--green); background: rgba(52, 211, 153, .12); }
.outbox-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.list-card { padding: 16px 10px 10px; }
.list-card .card-head { padding: 0 8px; margin-bottom: 8px; }
.draft-list { display: flex; flex-direction: column; gap: 4px; }
.draft {
  display: flex; align-items: flex-start; gap: 11px; width: 100%; padding: 11px 10px; border-radius: 12px; text-align: left; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; transition: background .15s, border-color .15s;
}
.draft:hover { background: rgba(148, 163, 184, .06); }
.draft.active { background: rgba(124, 92, 255, .14); border-color: rgba(124, 92, 255, .4); }
.draft .grow { display: flex; flex-direction: column; gap: 1px; }
.draft-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.draft-subject { font-size: 13.5px; color: #cbd5e1; }
.draft-snippet { font-size: 12.5px; color: var(--muted); }
.mail-preview { padding: 0; overflow: hidden; }
.mail-preview-head { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px 18px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(124, 92, 255, .1), transparent); }
.mail-preview-head h2 { font-size: 21px; letter-spacing: -.01em; }
.mail-to { display: flex; gap: 12px; align-items: flex-start; }
.mail-to .meta { grid-template-columns: 48px 1fr; font-size: 13.5px; }
.paper {
  margin: 20px 24px; padding: 22px 24px; border-radius: 14px; white-space: pre-wrap; word-break: break-word;
  background: #f8f9fc; color: #1f2433; font-size: 14.5px; line-height: 1.7; box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 10px 30px rgba(0, 0, 0, .25);
  max-height: 520px; overflow-y: auto;
}
.paper.muted { background: var(--panel-2); color: var(--muted); box-shadow: none; }
.mail-preview > .error-box, .mail-preview > div > .error-box { margin: 0 24px 12px; }
.mail-preview-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 24px 20px; border-top: 1px solid var(--border); }
.mail-preview-foot p { margin: 0; }
.handled-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.handled-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.handled-list li:first-child { border-top: 0; padding-top: 0; }
.handled-list .chip { text-transform: none; }

/* ---------- Activity ---------- */
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mini-stat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); }
.mini-stat > div { display: flex; flex-direction: column; min-width: 0; }
.mini-stat strong { font-size: 22px; line-height: 1.15; }
.mini-label { font-size: 13px; font-weight: 500; }
.mini-stat.purple { --c: #a78bfa; } .mini-stat.blue { --c: var(--blue); } .mini-stat.green { --c: var(--green); } .mini-stat.yellow { --c: var(--yellow); }
.filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.filter { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.filter:hover { color: var(--text); }
.filter.active { background: rgba(124, 92, 255, .22); color: #fff; }
.filter-count { font-size: 11px; padding: 0 6px; border-radius: 99px; background: rgba(148, 163, 184, .14); line-height: 17px; }
.feed { display: flex; flex-direction: column; gap: 18px; }
.day-label { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #a3acbf; }
.events { list-style: none; margin: 0; padding: 0; position: relative; }
.events::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(180deg, rgba(124, 92, 255, .4), rgba(148, 163, 184, .1)); }
.event { --c: var(--accent); position: relative; display: flex; gap: 14px; padding: 8px 0; }
.event.cat-task { --c: #a78bfa; } .event.cat-email { --c: var(--blue); } .event.cat-plan { --c: var(--yellow); } .event.cat-system { --c: var(--green); } .event.alarming { --c: var(--red); }
.event-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, #0f1422); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.event-icon .icon svg { width: 17px; height: 17px; }
.event-main { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 14px; background: rgba(14, 19, 32, .7); border: 1px solid var(--border); transition: border-color .15s; }
.event-main:hover { border-color: var(--border-2); }
.event-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.event-title { font-size: 14px; }
.event-title p { margin: 0; }
.event-head time { flex: none; }
.event-body { margin-top: 6px; font-size: 13.5px; color: #c3cad8; }
.event-body blockquote { margin: 4px 0; }
.event-body.collapsed { max-height: 4.8em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
.jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.jobs li { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 12px; background: rgba(14, 19, 32, .7); border: 1px solid var(--border); }
.jobs li .grow { display: flex; flex-direction: column; }
.jobs strong { font-size: 14px; }
.job-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 10px; }
.jobs li.ok .job-icon { color: var(--green); background: rgba(52, 211, 153, .12); }
.jobs li.bad .job-icon { color: var(--red); background: rgba(248, 113, 113, .12); }
.jobs li.bad { border-color: rgba(248, 113, 113, .35); }
.job-icon .icon svg { width: 16px; height: 16px; }
.job-error { margin: 6px 0 0; font-size: 12.5px; color: #fecaca; word-break: break-word; }
.jobs-foot { margin: 12px 0 0; }
.terminal { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-2); background: #05070d; box-shadow: var(--shadow); }
.terminal-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #0d111c; border-bottom: 1px solid var(--border); }
.lights { display: flex; gap: 6px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; } .lights i:nth-child(3) { background: #28c840; }
.terminal-title { display: flex; align-items: center; gap: 6px; font: 600 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.terminal-title .icon svg { width: 14px; height: 14px; }
.term-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--border-2); background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.term-btn:hover, .term-btn.on { color: var(--text); border-color: var(--accent); }
.term-btn.on { background: rgba(124, 92, 255, .2); }
.term-btn .icon svg { width: 13px; height: 13px; }
.terminal-body { max-height: 380px; overflow: auto; padding: 12px 14px; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; color: #9aa4b8; }
.terminal-body .skeleton-group { padding: 4px 0; }
.log-line { white-space: pre-wrap; word-break: break-word; padding-left: 0; }
.log-ts { color: #5f6a80; margin-right: 10px; }
.log-line.err { color: #fca5a5; }
.log-line.warn { color: #fde68a; }
.log-line.good { color: #86efac; }

/* ---------- States ---------- */
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 8px 0; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-group { display: flex; flex-direction: column; gap: 10px; }
.skeleton { height: 14px; border-radius: 7px; background: linear-gradient(90deg, rgba(148, 163, 184, .08), rgba(148, 163, 184, .18), rgba(148, 163, 184, .08)); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
.skeleton.short { width: 60%; }
.skeleton.inline { display: inline-block; width: 34px; height: 22px; vertical-align: middle; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { padding: 24px 12px; text-align: center; color: var(--muted); }
.empty strong { color: var(--text); display: block; margin-bottom: 4px; }
.empty p { margin: 0; }
.error-box { padding: 10px 12px; border-radius: 10px; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .35); color: #fecaca; white-space: pre-wrap; margin: 0 0 10px; }

/* ---------- Modal & toasts ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 12, .7); backdrop-filter: blur(4px); }
.modal-card { position: relative; width: min(840px, 100%); max-height: 88vh; overflow-y: auto; background: var(--panel-solid); border: 1px solid var(--border-2); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); animation: rise .25s ease both; }
.modal-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.modal-card h2 { font-size: 18px; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { padding: 10px 16px; border-radius: 11px; background: var(--panel-solid); border: 1px solid var(--border-2); box-shadow: var(--shadow); max-width: 420px; transition: opacity .4s, transform .4s; }
.toast.error { border-color: rgba(248, 113, 113, .5); color: #fecaca; }
.toast.hide { opacity: 0; transform: translateY(8px); }

/* ---------- Floating chat ---------- */
.chat-launcher {
  position: fixed; right: 26px; bottom: 26px; z-index: 60; width: 60px; height: 60px; border-radius: 50%;
  border: 0; cursor: pointer; color: #fff; background: var(--grad);
  box-shadow: 0 14px 34px rgba(124, 92, 255, .5), 0 0 0 1px rgba(255, 255, 255, .12) inset;
  display: grid; place-items: center; transition: transform .2s;
}
.chat-launcher:hover { transform: scale(1.06); }
.chat-launcher::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(124, 92, 255, .45); animation: pulse 2.6s ease-out infinite; }
.chat-open .chat-launcher::before { display: none; }
@keyframes pulse { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.launcher-icon { position: absolute; display: grid; place-items: center; transition: transform .25s, opacity .25s; }
.launcher-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.close-icon { opacity: 0; transform: rotate(-90deg); }
.chat-open .open-icon { opacity: 0; transform: rotate(90deg); }
.chat-open .close-icon { opacity: 1; transform: none; }
.launcher-dot { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.launcher-dot[hidden] { display: none; }

.chat-panel {
  position: fixed; right: 26px; bottom: 100px; z-index: 60; width: 400px; height: min(640px, calc(100vh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #0f1422; border: 1px solid var(--border-2); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(124, 92, 255, .15);
  transform-origin: bottom right; animation: pop .22s cubic-bezier(.2, .9, .3, 1.2) both;
}
.chat-panel[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.chat-head { display: flex; align-items: center; gap: 11px; padding: 14px 14px 14px 16px; background: var(--grad); color: #fff; }
.chat-head-avatar { border-radius: 12px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.chat-head strong { display: block; font-size: 15px; }
.chat-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255, 255, 255, .85); }
.chat-head-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.chat-head-btn:hover { background: rgba(255, 255, 255, .24); }
.chat-head-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 8px; max-width: 100%; }
.msg.user { flex-direction: column; align-items: flex-end; }
.msg-avatar { border-radius: 8px; flex: none; margin-top: 2px; }
.msg-col { display: flex; flex-direction: column; min-width: 0; max-width: calc(100% - 34px); }
.msg-bubble { padding: 10px 13px; border-radius: 16px; font-size: 14px; min-width: 0; }
.msg.assistant .msg-bubble { background: #171e30; border: 1px solid var(--border); border-top-left-radius: 5px; }
.msg.user .msg-bubble { max-width: 85%; background: var(--grad); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; word-break: break-word; }
.msg-time { font-size: 11px; color: var(--muted); margin: 3px 4px 0; }
.msg .md ul, .msg .md ol { padding-left: 18px; }
.typing { display: flex; gap: 4px; align-items: center; padding: 14px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.chat-suggest:empty { display: none; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 12px; border: 1px solid var(--border-2); border-radius: 16px; background: var(--panel-2); }
.chat-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .2); }
.chat-form textarea { border: 0; background: transparent; padding: 7px 0; resize: none; max-height: 140px; box-shadow: none; }
.chat-form textarea:focus { box-shadow: none; }
.chat-send { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--grad); color: #fff; cursor: pointer; flex: none; }
.chat-send:disabled { opacity: .5; cursor: progress; }
.chat-send svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-foot { margin: 8px 0 12px; text-align: center; font-size: 11.5px; color: var(--muted); }

.locked { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.locked .card { max-width: 460px; text-align: center; }
.locked h1 { font-size: 22px; margin: 12px 0 8px; }

/* ---------- Small screens ---------- */
@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-2, .grid-2.even, .outbox-layout { grid-template-columns: minmax(0, 1fr); }
  .hero { flex-direction: column; align-items: flex-start; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .bento .panel { max-height: 440px; }
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .mobile-bar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    background: rgba(9, 12, 20, .85); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px);
  }
  .mobile-bar img { border-radius: 9px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: min(300px, 86vw); height: 100dvh; margin: 0;
    border-radius: 0 24px 24px 0; border-left: 0; transform: translateX(-105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  }
  .nav-open .sidebar { transform: none; }
  .drawer-close { display: grid; }
  .drawer-backdrop {
    display: block; position: fixed; inset: 0; z-index: 45; background: rgba(3, 6, 12, .62); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .nav-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .nav-open .chat-launcher { display: none; }
  .brand { padding-right: 44px; }
  .flow { grid-template-columns: 1fr; }
  .flow-step + .flow-step { border-left: 0; border-top: 1px solid var(--border); }
  .paper { margin: 14px; padding: 16px; }
  .mail-preview-head, .mail-preview-foot { padding-left: 16px; padding-right: 16px; }
  .card-head { flex-wrap: wrap; }
  .main { padding: 18px 14px 110px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 22px; }
  .hero h2 { font-size: 24px; }
  .banner { flex-direction: column; align-items: flex-start; }
  .inline-form { flex-direction: column; }
  .search { width: 100%; }
  .chat-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
  .chat-open .chat-launcher { display: none; }
  .chat-launcher { right: 18px; bottom: 18px; }
}
