@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(/fonts/Inter.woff2) format("woff2");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
        U+FEFF, U+FFFD;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url(/fonts/JetBrainsMono.woff2) format("woff2");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #08090a;
    --bg-raised: #101113;
    --surface: #17181b;
    --surface-2: #1d1e22;
    --surface-hover: #202127;
    --border: #24262b;
    --border-strong: #32343a;
    --text: #f7f8f8;
    --text-2: #c9cbd1;
    --text-3: #8a8f98;
    --accent: #5e6ad2;
    --accent-hover: #6e79dd;
    --accent-text: #ffffff;
    --accent-soft: rgba(94, 106, 210, 0.14);
    --danger: #ec6a5e;
    --danger-soft: rgba(236, 106, 94, 0.14);
    --ok: #4cb782;
    --ok-soft: rgba(76, 183, 130, 0.16);
    --warn: #d29d5e;
    --warn-soft: rgba(210, 157, 94, 0.15);
    --chart-1: #5e6ad2;
    --chart-2: #12a5b8;
    --grid: #24262b;
    --mail-surface: #ffffff;
    --shadow-menu: 0 6px 24px rgb(0 0 0 / 0.45), 0 0 0 1px var(--border-strong);
    --shadow-modal:
        0 24px 80px rgb(0 0 0 / 0.55), 0 0 0 1px var(--border-strong);
    --radius-s: 6px;
    --radius-m: 8px;
    --radius-l: 12px;
    --font-sans:
        "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        sans-serif;
    --font-mono:
        "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --mail-font: 13.5px/1.65 var(--font-sans);
}
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #fbfbfc;
    --bg-raised: #f4f5f8;
    --surface: #ffffff;
    --surface-2: #f4f5f8;
    --surface-hover: #eceef2;
    --border: #e3e4e8;
    --border-strong: #d3d5db;
    --text: #1c1d21;
    --text-2: #43454c;
    --text-3: #71747d;
    --accent: #5e6ad2;
    --accent-hover: #4f5abf;
    --accent-soft: rgba(94, 106, 210, 0.11);
    --danger: #d5473a;
    --danger-soft: rgba(213, 71, 58, 0.1);
    --ok: #1f9d64;
    --ok-soft: rgba(31, 157, 100, 0.14);
    --warn: #a8702a;
    --warn-soft: rgba(168, 112, 42, 0.12);
    --chart-1: #5e6ad2;
    --chart-2: #0891b2;
    --grid: #e8e9ed;
    --shadow-menu: 0 6px 24px rgb(20 21 26 / 0.12), 0 0 0 1px var(--border);
    --shadow-modal: 0 24px 80px rgb(20 21 26 / 0.22), 0 0 0 1px var(--border);
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        color-scheme: light;
        --bg: #fbfbfc;
        --bg-raised: #f4f5f8;
        --surface: #ffffff;
        --surface-2: #f4f5f8;
        --surface-hover: #eceef2;
        --border: #e3e4e8;
        --border-strong: #d3d5db;
        --text: #1c1d21;
        --text-2: #43454c;
        --text-3: #71747d;
        --accent: #5e6ad2;
        --accent-hover: #4f5abf;
        --accent-soft: rgba(94, 106, 210, 0.11);
        --danger: #d5473a;
        --danger-soft: rgba(213, 71, 58, 0.1);
        --ok: #1f9d64;
        --ok-soft: rgba(31, 157, 100, 0.14);
        --warn: #a8702a;
        --warn-soft: rgba(168, 112, 42, 0.12);
        --chart-1: #5e6ad2;
        --chart-2: #0891b2;
        --grid: #e8e9ed;
        --shadow-menu: 0 6px 24px rgb(20 21 26 / 0.12), 0 0 0 1px var(--border);
        --shadow-modal:
            0 24px 80px rgb(20 21 26 / 0.22), 0 0 0 1px var(--border);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}
button,
input,
textarea {
    font: inherit;
}
html {
    color-scheme: dark;
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.5;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;

    overflow-wrap: anywhere;
}
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
}
a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    color: var(--accent-hover);
}
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-radius: 4px;
}
::selection {
    background: var(--accent-soft);
}
svg.i {
    width: 15px;
    height: 15px;
    flex: none;
    stroke-width: 1.8;
}

kbd {
    display: inline-grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-family: var(--font-sans);
    font-size: 10.5px;
    font-weight: 500;
    color: var(--text-3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}

.row-subject .chip.is-path,
.reading-path,
.profile-name,
.side-row .label,
.list-title,
.row-from,
.row-subject .subj,
.row-snippet,
.id-email,
.block-sender,
.palette-item .grow,
.pm-from,
.pm-subj,
.mini-table td.who,
.reason .r-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(
    .mail-mono,
    .code,
    .hexdump,
    .hdr-wrap,
    .settings-card,
    .tile,
    .panel
) {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 30px;
    padding: 0 12px;
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        color 0.12s ease;
}
.btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--accent-text);
}
.btn-ghost,
.btn-danger-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-3);
}
.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.btn-danger-ghost:hover {
    background: var(--danger-soft);
    color: var(--danger);
}
.btn:disabled {
    opacity: 0.5;
    cursor: default;
}
.btn .kbd-hint {
    margin-left: 2px;
}
.btn-primary kbd {
    color: var(--accent-text);
    background: rgb(255 255 255 / 0.16);
    border-color: rgb(255 255 255 / 0.28);
}
.btn-primary:hover kbd {
    background: rgb(255 255 255 / 0.2);
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: none;
    position: relative;
    padding: 0;
    color: var(--text-3);
    background: transparent;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
    transition:
        background 0.12s ease,
        color 0.12s ease;
}
.icon-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.icon-btn.is-on {
    color: var(--accent);
}
.icon-btn.is-danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}
@media (pointer: coarse) {
    .icon-btn::after {
        content: "";
        position: absolute;
        inset: -8px -2px;
    }
}
.icon-btn svg.i {
    width: 16px;
    height: 16px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
.kit-select {
    letter-spacing: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    padding: 6px 10px;
    transition:
        border-color 0.12s ease,
        box-shadow 0.12s ease;
}
input:focus,
textarea:focus,
.kit-select:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.nav-search input:focus,
.toolbar-filter input:focus,
.tag-input:focus {
    border: 0;
    outline: none;
    box-shadow: none;
}
input::placeholder,
textarea::placeholder {
    color: var(--text-3);
}

.badge {
    display: inline-grid;
    place-items: center;
    min-width: 17px;
    height: 16px;
    padding: 0 5px;
    font-size: 10.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.badge.is-accent {
    color: var(--accent-text);
    background: var(--accent);
    border-color: var(--accent);
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    min-height: 20px;
    max-width: 100%;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.chip.is-warn {
    color: var(--warn);
    background: var(--warn-soft);
    border-color: transparent;
}
.chip.is-danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: transparent;
}
.chip.is-accent {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: transparent;
}
.chip.is-ok {
    color: var(--text);
    background: var(--ok-soft);
    border-color: transparent;
}

.chip.is-tag {
    gap: 3px;
    color: var(--accent);
    background: var(--accent-soft);
    border-color: transparent;
}
.chip-x {
    display: inline-grid;
    place-items: center;
    width: 14px;
    height: 14px;
    margin-right: -3px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    color: inherit;
    opacity: 0.55;
    cursor: pointer;
}
.chip-x:hover {
    opacity: 1;
    background: var(--accent-soft);
}
.chip-x .i {
    width: 10px;
    height: 10px;
}
.att .chip-x {
    width: 20px;
    height: 20px;
    margin-right: -5px;
}
.chip.chip-add {
    background: none;
    border-style: dashed;
    color: var(--text-3);
    cursor: pointer;
}
.chip.chip-add:hover {
    color: var(--text-2);
    border-color: var(--text-3);
}
.chip.chip-btn {
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}
.chip.chip-btn .chev {
    width: 11px;
    height: 11px;
    transition: transform 0.12s ease;
}
.chip.chip-btn.is-open .chev {
    transform: rotate(90deg);
}
.spam-note {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--warn);
}
.auth-detail {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 12px;
    margin: 10px 0 0;
    padding: 10px 12px;
    font-size: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.auth-detail dt {
    color: var(--text-3);
    font-weight: 600;
}
.auth-detail dd {
    margin: 0;
    color: var(--text-2);
    overflow-wrap: anywhere;
}
.chip.is-tag-edit {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent);
    padding-right: 4px;
}
.tag-input {
    width: 110px;
    height: 16px;
    padding: 0 0 0 2px;
    border: 0;
    border-radius: 0;
    background: none;
    font-size: 11px;
    color: inherit;
}
.row-subject .chip {
    flex: none;
    min-height: 16px;
    padding: 0 6px;
    font-size: 10px;
}
.row-subject .chip.is-path {
    display: inline-block;
    max-width: 45%;
    line-height: 14px;
    margin-left: auto;
}
.reading-path {
    max-width: 40%;
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 600;
    color: #fff;
    user-select: none;
}
.avatar.is-lg {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 13px;
}

.form-note {
    margin: 0;
    padding: 8px 11px;
    font-size: 12.5px;
    color: var(--text-2);
    background: var(--accent-soft);
    border-radius: var(--radius-s);
}
.lnk-center {
    display: block;
    margin: 4px auto 0;
    padding: 2px 4px;
    font-size: 12px;
    color: var(--text-3);
    background: none;
    border: none;
    cursor: pointer;
}
.lnk-center:hover {
    color: var(--accent);
}
.form-error {
    margin: 0;
    padding: 8px 11px;
    font-size: 12.5px;
    color: var(--danger);
    background: var(--danger-soft);
    border-radius: var(--radius-s);
}

.page-login {
    display: grid;
    place-items: start center;
    min-height: 100vh;
}
.login {
    width: 340px;
    max-width: calc(100vw - 48px);
    margin-top: clamp(48px, 16vh, 160px);
}
.login-brand {
    display: grid;
    place-items: center;
    margin-bottom: 18px;
}
.login-brand .brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: #fff;
    border-radius: 11px;
    box-shadow: 0 8px 24px rgba(94, 106, 210, 0.35);
}
.login-brand .brand-mark svg {
    width: 24px;
    height: 24px;
}
.login-title {
    margin: 0;
    text-align: center;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.login-sub {
    margin: 4px 0 26px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-3);
}
.login-github {
    width: 100%;
    height: 34px;
}
.oauth-mark {
    width: 15px;
    height: 15px;
}
.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    font-size: 11.5px;
    color: var(--text-3);
}
.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.login-form {
    display: grid;
    gap: 14px;
}
.login-form .btn {
    height: 34px;
}
.field {
    display: grid;
    gap: 5px;
}
.field-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
}
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.input-group input {
    width: 100%;
    height: 34px;
    padding-left: 32px;
}
.input-icon {
    position: absolute;
    left: 10px;
    width: 14px;
    height: 14px;
    color: var(--text-3);
    pointer-events: none;
}
.input-group input[data-reveal-target] {
    padding-right: 36px;
}
.input-reveal {
    position: absolute;
    right: 4px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    background: none;
    border: none;
    border-radius: var(--radius-s);
    color: var(--text-3);
    cursor: pointer;
}
.input-reveal:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.input-reveal svg {
    width: 14px;
    height: 14px;
}

.page-app {
    overflow: hidden;
}
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}
.app-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
    height: 46px;
    padding: 0 12px;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
}
.brand-tile {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: var(--accent-text, #fff);
    background: var(--accent);
}
.brand-tile svg {
    width: 14px;
    height: 14px;
}
.nav-tabs {
    display: flex;
    gap: 2px;
}
.nav-tab {
    padding: 5px 10px;
    font-size: 12.8px;
    font-weight: 500;
    color: var(--text-2);
    background: none;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
}
.nav-tab:hover {
    color: var(--text);
    background: var(--surface-2);
}
.nav-tab.is-active {
    color: var(--text);
    background: var(--surface-2);
}
.nav-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    max-width: 480px;
    height: 32px;
    margin-inline: auto;
    padding: 0 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
}
.nav-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.nav-search .i {
    flex: none;
    width: 15px;
    height: 15px;
    color: var(--text-3);
}
.nav-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    font-size: 12.8px;
    color: var(--text);
}
.nav-sep {
    flex: none;
    align-self: center;
    width: 1px;
    height: 20px;
    background: var(--border);
}
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
}
.theme-opt.is-on {
    background: var(--accent-soft);
}
.app-boot {
    display: grid;
    place-items: center;
    width: 100%;
    color: var(--text-3);
    font-size: 13px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    flex: none;
    width: 248px;
    background: var(--bg-raised);
    border-right: 1px solid var(--border);
}
.sidebar[hidden] {
    display: none;
}
.profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: 260px;
    flex: none;
    min-width: 0;
    padding: 5px 7px;
    font-weight: 500;
    text-align: left;
    color: var(--text);
    background: transparent;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
    transition: background 0.12s ease;
}
.profile-btn:hover {
    background: var(--surface-hover);
}
.profile-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
}
.profile-btn .i {
    color: var(--text-3);
    width: 13px;
    height: 13px;
}
.chev-down {
    transform: rotate(90deg);
    transition: transform 0.16s ease;
}
.is-menu-open .chev-down,
[aria-expanded="true"] > .chev-down {
    transform: rotate(270deg);
}
.profile-btn.is-menu-open {
    position: relative;
    z-index: 85;
}
.profile-btn.is-menu-open:hover {
    background: var(--surface-hover);
}
.profile-btn.is-menu-open:hover .chev-down {
    color: var(--text);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px 10px;
}
.compose-btn {
    justify-content: flex-start;
    padding-left: 10px;
}
.compose-btn .grow {
    flex: 1;
    text-align: left;
}
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2px 10px 12px;
}
.side-section {
    margin-top: 14px;
}
.side-section:first-child {
    margin-top: 2px;
}
.side-heading {
    padding: 0 7px 4px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-3);
    user-select: none;
}

.side-row {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    height: 27px;
    padding: 0 7px;
    font-size: 12.8px;
    text-align: left;
    color: var(--text-2);
    background: transparent;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
    user-select: none;
    transition:
        background 0.1s ease,
        color 0.1s ease;
}
.side-row:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.side-row.is-active {
    background: var(--accent-soft);
    color: var(--text);
}
.side-row.is-active > .i {
    color: var(--accent);
}
.side-row > .i {
    color: var(--text-3);
}
.side-row .label {
    flex: 1;
    min-width: 0;
}
.side-row .badge {
    margin-left: auto;
}
.side-row .chev {
    width: 12px;
    height: 12px;
    flex: none;
    color: var(--text-3);
    transition: transform 0.12s ease;
}
.side-row.is-open .chev {
    transform: rotate(90deg);
}
.tree-domain {
    font-weight: 600;
    color: var(--text);
    margin-top: 0.5rem;
}
.tree-domain:first-child {
    margin-top: 2px;
}
.tree-addr {
    padding-left: 18px;
}
.tree-addr-row {
    display: flex;
    align-items: center;
    position: relative;
}
.row-menu {
    width: 24px;
    height: 24px;
}
@media (hover: hover) {
    .row-menu {
        position: absolute;
        right: 2px;
        opacity: 0;
    }
    .tree-addr-row:is(:hover, :has(:focus-visible, .is-menu-open, [aria-busy="true"])) .row-menu {
        opacity: 1;
    }
    .tree-addr-row:is(:hover, :has(:focus-visible, .is-menu-open, [aria-busy="true"])) .badge {
        visibility: hidden;
    }
}
.row-menu[aria-busy="true"] {
    cursor: progress;
}
.row-menu[aria-busy="true"] svg.i {
    animation: spin 0.9s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
@media (pointer: coarse) {
    .row-menu::after {
        inset: -1px -6px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .row-menu[aria-busy="true"] svg.i {
        animation: none;
    }
}
.tree-folder {
    padding-left: 34px;
    color: var(--text-3);
}
.tree-folder .label {
    font-size: 12.5px;
}
.tree-folder:hover {
    color: var(--text);
}
.tree-more {
    height: 24px;
    padding-left: 56px;
    color: var(--text-3);
}
.tree-more .label {
    font-size: 11.5px;
}
.tree-more:hover {
    background: none;
    color: var(--text-2);
}

.main {
    display: flex;
    flex: 1;
    min-width: 0;
}
.list-pane {
    display: flex;
    flex-direction: column;
    flex: none;
    width: 350px;
    min-width: 0;
    border-right: 1px solid var(--border);
    background: var(--bg);
}
.list-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    height: 44px;
    padding: 0 10px 0 14px;
    border-bottom: 1px solid var(--border);
}

.list-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
    height: 36px;
    padding: 0 8px 0 14px;
    border-bottom: 1px solid var(--border);
}
.toolbar-filter {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 0;
    height: 100%;
}
.toolbar-filter .i {
    flex: none;
    width: 13px;
    height: 13px;
    color: var(--text-3);
}
.toolbar-filter input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    font-size: 12.3px;
    color: var(--text);
}
.toolbar-filter.is-note span {
    font-size: 12.3px;
    color: var(--text-3);
}
.toolbar-range {
    flex: none;
    margin-right: 2px;
    font-size: 11.5px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.list-toolbar .icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}
.i.chev-left {
    transform: rotate(180deg);
}
.list-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.011em;
}
.list-title .muted {
    color: var(--text-3);
    font-weight: 500;
}
.list-scroll {
    flex: 1;
    overflow-y: auto;
}
.list-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-3);
    font-size: 12.5px;
}
.list-empty .i {
    width: 22px;
    height: 22px;
    margin-bottom: 8px;
    opacity: 0.7;
}
.row {
    position: relative;
    display: block;
    width: 100%;
    padding: 9px 14px 9px 30px;
    text-align: left;
    color: var(--text-2);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.row:hover {
    background: var(--surface);
}
.row.is-active {
    background: var(--accent-soft);
}
.row .dot {
    position: absolute;
    left: 13px;
    top: 15px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: transparent;
}
.row.is-unseen .dot {
    background: var(--accent);
}
.row-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.row-from {
    flex: 1;
    min-width: 0;
    font-size: 12.8px;
    font-weight: 450;
    color: var(--text-2);
}
.row.is-unseen .row-from {
    font-weight: 650;
    color: var(--text);
}
.row-date {
    flex: none;
    font-size: 11px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.row-subject {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    font-size: 12.8px;
    color: var(--text-2);
}
.row.is-unseen .row-subject .subj {
    color: var(--text);
    font-weight: 500;
}
.row-subject .i {
    width: 12px;
    height: 12px;
    flex: none;
}
.row-subject .i.star {
    color: var(--warn);
}
.row-subject .i.clip {
    color: var(--text-3);
}
.row-subject .auth-fail {
    display: inline-flex;
    color: var(--danger);
}
.row-snippet {
    display: block;
    font-size: 12px;
    color: var(--text-3);
}

.reading {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    background: var(--bg);
}
.reading-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
    height: 44px;
    padding: 0 10px;
    border-bottom: 1px solid var(--border);
}
.toolbar-sep {
    width: 1px;
    height: 16px;
    margin: 0 6px;
    background: var(--border-strong);
    flex: none;
}
.toolbar-spacer {
    flex: 1;
}
.reading-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
}
.reading-empty {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--text-3);
    font-size: 12.5px;
    text-align: center;
}
.reading-empty .i {
    width: 26px;
    height: 26px;
    margin-bottom: 10px;
    opacity: 0.6;
}
.reading-empty .hints {
    margin-top: 14px;
    display: grid;
    gap: 5px;
    font-size: 12px;
}
.reading-empty .hints span {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.msg {
    max-width: 860px;
    margin: 18px auto 32px;
    padding: 22px 28px 40px;
    border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
    border-radius: var(--radius-m);
}
.msg-subject {
    margin: 0 0 14px;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}
.msg-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px 10px;
}
.msg-meta .avatar {
    margin-top: 2px;
}
.msg-who {
    flex: 1 1 200px;
    min-width: 0;
}
.msg-from-line {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}
.msg-from-name {
    font-weight: 600;
    font-size: 13px;
}
.msg-from-addr,
.msg-to-line {
    font-size: 12px;
    color: var(--text-3);
}
.msg-date {
    flex: none;
    margin-left: auto;
    font-size: 12px;
    color: var(--text-3);
}
.msg-chips {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.tabs {
    display: inline-flex;
    flex-wrap: wrap;
    max-width: 100%;
    gap: 2px;
    margin: 16px 0 0;
    padding: 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
}
.tab {
    height: 24px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    background: transparent;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
    transition:
        background 0.1s ease,
        color 0.1s ease;
}
.tab:hover {
    color: var(--text);
}
.tab.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 0 0 1px var(--border);
}

.msg-body {
    margin-top: 14px;
}
.mail-html-wrap[data-styled] {
    background: var(--mail-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    overflow: hidden;
}
.mail-html {
    display: block;
    width: 100%;
    border: 0;
}
.mail-text {
    margin: 0;
    padding: 2px 1px;
    font: var(--mail-font);
    color: var(--text);
    white-space: pre-wrap;
}
.mono {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 450;
    line-height: 1.6;
    color: var(--text-2);
}
.mail-mono {
    margin: 0;
    padding: 14px 16px;
    white-space: pre-wrap;
}
.code {
    display: grid;
    grid-template-columns: auto 1fr;
    margin: 0;
    overflow: hidden;
    padding: 10px 0;
}
.code .ln {
    padding: 0 14px 0 16px;
    text-align: right;
    color: var(--text-3);
    opacity: 0.55;
    user-select: none;
    white-space: nowrap;
    align-self: start;
}
.code .lc {
    padding-right: 18px;
    min-width: 0;
    white-space: pre-wrap;
}
.hexdump {
    display: grid;
    grid-template-columns: max-content max-content max-content;
    justify-content: space-between;
    align-content: start;
    column-gap: 1.5em;
    margin: 0;
    padding: 20px 24px;
    overflow-x: auto;
}
.hexdump > span {
    white-space: pre;
}
.hx-off {
    color: var(--text-3);
    letter-spacing: 0.14em;
}
.hx-ascii {
    letter-spacing: 0.2em;
}
.hx-ctrl {
    color: var(--accent);
}
.hx-hi {
    color: var(--text-3);
}
.body-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--text-3);
}
.body-note .lnk {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    cursor: pointer;
}
.body-note .lnk:hover {
    color: var(--accent-hover);
}
.body-note .lnk.is-quiet {
    color: var(--text-3);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.body-note .lnk.is-quiet:hover {
    color: var(--text-2);
}
.body-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.hdr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.hdr-table td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.hdr-table td.k {
    width: 180px;
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-3);
    white-space: nowrap;
}
.hdr-table td.v {
    color: var(--text-2);
}
.hdr-wrap {
    overflow: hidden;
}

.dlv {
    display: grid;
    gap: 12px;
    font-size: 13px;
    color: var(--text-2);
}
.dlv-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 16px;
    margin: 0;
}
.dlv-facts dt {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
}
.dlv-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}
.dlv-head {
    margin: 8px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}
.dlv-steps {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0 0 0 16px;
    list-style: none;
    border-left: 1px solid var(--border);
}
.dlv-steps li {
    position: relative;
}
.dlv-steps li::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border-strong);
}
.dlv-step-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}
.dlv-step-head time,
.dlv-sub {
    font-size: 12px;
    color: var(--text-3);
}
.dlv-rcpt {
    overflow-wrap: anywhere;
}
.dlv-line {
    margin-top: 4px;
    overflow-wrap: anywhere;
}
.dlv-replies {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.dlv-reply {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 2px 8px;
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    text-align: left;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    cursor: pointer;
}
.dlv-reply:hover {
    background: var(--surface-hover);
}
.dlv-reply-subject {
    color: var(--text);
    overflow-wrap: anywhere;
}
.dlv-reply .dlv-sub {
    grid-column: 2;
}

.att-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
.att {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 11px 0 9px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    cursor: pointer;
    text-decoration: none;
    transition:
        background 0.12s ease,
        color 0.12s ease;
}
.att:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.att .i {
    color: var(--text-3);
}
.att .size {
    color: var(--text-3);
    font-weight: 400;
    font-size: 11px;
}

.menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 84;
}
.menu {
    position: fixed;
    z-index: 86;
    min-width: 218px;
    padding: 5px;
    background: var(--surface);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-menu);
    animation: menu-in 0.1s ease;
}
@keyframes menu-in {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
}
.menu-head {
    padding: 7px 9px 6px;
}
.menu-head .who {
    font-size: 12.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}
.menu-head-top {
    display: flex;
    align-items: center;
    gap: 8px;
}
.menu-head-top .who {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}
.role-badge {
    flex: none;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
}
.id-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.gh-badge {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: none;
    color: var(--text);
    background: var(--surface-2);
    border-radius: var(--radius-s);
}
.gh-badge .i {
    width: 15px;
    height: 15px;
}
.id-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}
.id-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
}
.id-email {
    font-size: 11px;
    color: var(--text-3);
}
.menu-sep {
    height: 1px;
    margin: 5px 4px;
    background: var(--border);
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    height: 29px;
    padding: 0 9px;
    font-size: 12.8px;
    text-align: left;
    color: var(--text-2);
    background: transparent;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
}
.menu-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.menu-item:disabled {
    opacity: 0.6;
    pointer-events: none;
}
.menu-item .i {
    color: var(--text-3);
}
.menu-item:hover .i {
    color: var(--text);
}
.menu-item .grow {
    flex: 1;
}
.menu-item .kbd-hint {
    margin-left: auto;
}
.menu-item.is-danger {
    color: var(--danger);
}
.menu-item.is-danger .i {
    color: var(--danger);
}
.menu-item.is-danger:hover {
    background: var(--danger-soft);
}
.menu-label {
    padding: 6px 9px 3px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-3);
}

.settings {
    max-width: 620px;
    margin: 0 auto;
    padding: 20px 26px 60px;
}
.settings-card {
    padding: 8px 8px 10px;
}
.settings-card + .settings-card {
    margin-top: 10px;
}
.drawer-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 9px 2px;
}
.drawer-field .btn {
    align-self: flex-start;
}
.drawer-note {
    margin: 0;
    padding: 6px 9px 2px;
    font-size: 11.5px;
    color: var(--text-3);
}

.toggle-row {
    cursor: pointer;
}
.switch {
    flex: none;
    width: 34px;
    height: 20px;
    padding: 2px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}
.switch-knob {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-3);
    transition:
        transform 0.15s ease,
        background 0.15s ease;
}
.switch.is-on {
    background: var(--accent);
    border-color: var(--accent);
}
.switch.is-on .switch-knob {
    background: #fff;
    transform: translateX(14px);
}

.block-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.block-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 1px 4px 1px 9px;
    border-radius: var(--radius-s);
}
.block-row:hover {
    background: var(--surface-hover);
}
.block-scope {
    color: var(--text-3);
}
.block-sender {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    color: var(--text-2);
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    background: rgb(0 0 0 / 0.55);
    backdrop-filter: blur(3px);
    animation: fade-in 0.12s ease;
}
@keyframes fade-in {
    from {
        opacity: 0;
    }
}
.modal {
    width: 640px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-modal);
    animation: modal-in 0.14s ease;
}
@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
}
.modal-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    padding: 12px 14px 10px;
}
.modal-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
}
.modal-body {
    padding: 0 14px;
    overflow-y: auto;
}
.modal-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    padding: 12px 14px;
}

.compose-grid {
    display: grid;
    gap: 0;
}
.compose-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 2px 0;
    border-bottom: 1px solid var(--border);
}
.compose-line label {
    flex: none;
    width: 52px;
    font-size: 12px;
    color: var(--text-3);
}
.compose-line input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 4px 0;
}
.compose-line input:focus {
    box-shadow: none;
}
.compose-line .lnk,
.compose-quote .lnk {
    background: none;
    border: none;
    padding: 2px 6px;
    font-size: 11.5px;
    color: var(--text-3);
    cursor: pointer;
    border-radius: 4px;
}
.compose-line .lnk:hover,
.compose-quote .lnk:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.compose-text {
    width: 100%;
    min-height: 220px;
    margin-top: 10px;
    padding: 2px 0;
    background: transparent;
    border: none;
    box-shadow: none;
    resize: vertical;
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.6;
}
.compose-text:focus {
    box-shadow: none;
}
.kit-select {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-align: left;
    cursor: pointer;
}
.kit-select:hover .chev-down,
.kit-select.is-menu-open .chev-down {
    color: var(--text);
}
.kit-select-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kit-select .i {
    flex: none;
    width: 14px;
    height: 14px;
    color: var(--text-3);
}
.compose-line .kit-select {
    flex: 1;
    padding: 4px 0;
    background: transparent;
    border: none;
    box-shadow: none;
}
.compose-sig {
    width: 100%;
    padding: 2px 0;
    color: var(--text-3);
    background: transparent;
    border: none;
    box-shadow: none;
    resize: none;
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.6;
}
.compose-sig:focus {
    color: var(--text-2);
    box-shadow: none;
}
.compose-quote {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 6px 0 14px;
}
.quote-toggle {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    height: 16px;
    padding: 0 3px 0 7px;
    font-size: 13px;
    line-height: 1;
    color: var(--text-2);
    background: var(--surface-hover);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    cursor: pointer;
}
.quote-toggle:hover {
    color: var(--text);
    border-color: var(--text-3);
}
.quote-toggle .i {
    width: 12px;
    height: 12px;
}
.compose-quote-text {
    flex-basis: 100%;
    font: var(--mail-font);
    color: var(--text);
    overflow-wrap: anywhere;
}
.compose-quote-text a {
    color: var(--accent);
}
.compose-status {
    flex: 1;
    font-size: 12px;
    color: var(--text-3);
}
.compose-status.is-error {
    color: var(--danger);
}

.shortcut-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 28px;
    padding-bottom: 14px;
}
.shortcut-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    font-size: 12.5px;
    color: var(--text-2);
}
.shortcut-row .keys {
    margin-left: auto;
    display: inline-flex;
    gap: 3px;
}

.palette-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgb(0 0 0 / 0.4);
    animation: fade-in 0.1s ease;
}
.palette {
    position: fixed;
    left: 50%;
    top: 18vh;
    transform: translateX(-50%);
    z-index: 91;
    width: 560px;
    max-width: calc(100vw - 32px);
    background: var(--surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-modal);
    overflow: hidden;
    animation: modal-in 0.12s ease;
}
.palette-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    color: var(--text);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
}
.palette-input:focus {
    outline: none;
    box-shadow: none;
}
.palette-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 5px;
}
.palette-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 32px;
    padding: 0 10px;
    font-size: 12.8px;
    text-align: left;
    color: var(--text-2);
    background: transparent;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
}
.palette-item .i {
    color: var(--text-3);
}
.palette-item.is-sel {
    background: var(--surface-hover);
    color: var(--text);
}
.palette-item .grow {
    flex: 1;
    min-width: 0;
}
.palette-item .hint {
    font-size: 11px;
    color: var(--text-3);
    flex: none;
}
.palette-section {
    padding: 8px 10px 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-3);
}
.palette-msg {
    height: 40px;
}
.palette-msg .pm-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}
.pm-from {
    font-size: 12px;
    color: var(--text);
}
.pm-subj {
    font-size: 11.5px;
    color: var(--text-3);
}
.palette-empty {
    padding: 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-3);
}

.toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 100;
    display: grid;
    gap: 8px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 230px;
    max-width: 360px;
    padding: 10px 13px;
    font-size: 12.8px;
    color: var(--text);
    background: var(--surface);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-menu);
    animation: toast-in 0.16s ease;
}
@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}
.toast .i {
    color: var(--ok);
    flex: none;
}
.toast.is-error .i {
    color: var(--danger);
}

.admin-scroll {
    flex: 1;
    overflow-y: auto;
}
.admin {
    max-width: 1060px;
    margin: 0 auto;
    padding: 20px 26px 60px;
}
.admin-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.admin-title {
    flex: 1;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.seg {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
}
.seg button {
    height: 24px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    background: transparent;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
}
.seg button:hover {
    color: var(--text);
}
.seg button.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 0 0 1px var(--border);
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 10px;
}
.tile {
    padding: 12px 14px 11px;
}
.tile-label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-3);
}
.tile-value {
    margin-top: 3px;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.tile-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}
.tile-delta {
    font-size: 11px;
    font-weight: 500;
}
.tile-delta.up {
    color: var(--ok);
}
.tile-delta.down {
    color: var(--danger);
}
.tile-delta.flat {
    color: var(--text-3);
}
.tile-spark {
    display: block;
}
.tile-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-3);
}

.panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}
.panel {
    min-width: 0;
    padding: 14px 16px;
}
.panel.is-wide {
    grid-column: 1 / -1;
}
.panel-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}
.panel-title {
    flex: 1;
    margin: 0;
    font-size: 12.8px;
    font-weight: 600;
}
.panel-sub {
    font-size: 11px;
    color: var(--text-3);
}
.legend {
    display: inline-flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-3);
}
.legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.legend i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.chart-wrap {
    position: relative;
}
.chart-wrap svg {
    display: block;
    width: 100%;
    height: auto;
}
.chart-tip {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    padding: 6px 9px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    box-shadow: var(--shadow-menu);
    white-space: nowrap;
    transform: translate(-50%, calc(-100% - 10px));
}
.chart-tip .k {
    color: var(--text-3);
}
.chart-tip b {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.3px;
}
.mini-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}
.mini-table tr:last-child td {
    border-bottom: none;
}
.mini-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
}
.mini-table td.who {
    max-width: 0;
    width: 100%;
    color: var(--text-2);
}

.cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: baseline;
    padding: 4px 0 2px;
}
.cloud span {
    color: var(--text-3);
    line-height: 1.25;
    cursor: default;
    transition: color 0.12s ease;
}
.cloud span:hover {
    color: var(--text);
}
.cloud span.hot {
    color: var(--accent);
    font-weight: 600;
}
.cloud span.warm {
    color: var(--text-2);
    font-weight: 500;
}

.qstats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.reason-list {
    display: grid;
    gap: 7px;
}
.reason {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    font-size: 12.3px;
}
.reason .r-label {
    color: var(--text-2);
}
.reason .r-n {
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.reason .r-bar {
    grid-column: 1 / -1;
    height: 3px;
    border-radius: 2px;
    background: var(--surface-2);
    overflow: hidden;
}
.reason .r-bar i {
    display: block;
    height: 100%;
    background: var(--chart-1);
    border-radius: 2px;
}

.admin-error {
    padding: 40px;
    text-align: center;
    color: var(--text-3);
}

.back-btn {
    display: none;
}
@media (max-width: 1080px) {
    .list-pane {
        width: 300px;
    }
}
@media (max-width: 900px) {
    .nav-brand-name,
    .nav-tabs,
    .nav-profile .profile-name {
        display: none;
    }
    .topnav {
        gap: 8px;
        padding: 0 8px;
    }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        transform: translateX(-100%);
        visibility: hidden;
        transition:
            transform 0.18s ease,
            visibility 0s linear 0.18s;
        box-shadow: none;
    }
    .sidebar.is-open {
        transform: translateX(0);
        visibility: visible;
        transition:
            transform 0.18s ease,
            visibility 0s;
        box-shadow: var(--shadow-modal);
    }
    .list-pane {
        width: 100%;
        border-right: none;
    }
    .app.is-msg-open .list-pane {
        display: none;
    }
    .app:not(.is-msg-open) .reading {
        display: none;
    }
    .back-btn {
        display: inline-grid;
    }
    .reading-toolbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 44px;
        padding-block: 5px;
    }
    .burger-btn {
        display: inline-grid;
    }
    .panels {
        grid-template-columns: 1fr;
    }
    .msg {
        padding: 18px 16px 40px;
    }
    .tabs {
        display: flex;
    }
    .tab {
        flex: 1 1 auto;
        padding: 0 6px;
    }
}
@media (min-width: 901px) {
    .burger-btn {
        display: none;
    }
}
