:root {
    color-scheme: light dark;
    /* ── Light theme (default) ── */
    --bg-sidebar: #ffffff;
    --bg-page: #eef0f2;
    --bg-card: #ffffff;
    --bg-card-elevated: rgba(0, 0, 0, 0.06);
    --bg-nav-active: rgba(0, 0, 0, 0.06);
    --bg-banner: #e8f5ec;
    --bg-guide: rgba(0, 0, 0, 0.08);
    --bg-guide-hover: rgba(0, 0, 0, 0.12);
    --bg-input: rgba(0, 0, 0, 0.04);
    --bg-toggle-track: rgba(0, 0, 0, 0.12);
    --text-primary: #151719;
    --text-muted: rgba(0, 0, 0, 0.62);
    --text-subtle: rgba(0, 0, 0, 0.38);
    --text-on-accent: #14231d;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-header: rgba(0, 0, 0, 0.09);
    --border-input: rgba(0, 0, 0, 0.12);
    --accent-green: #5ad38e;
    --accent-green-hover: #4fc77e;
    --accent-green-dim: rgba(90, 211, 142, 0.2);
    --sidebar-width: 280px;
    --main-padding-x: 16px;
    --header-height: 64px;
    --content-inner-max: 938px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --logo-filter: none;
    --modal-ring: rgba(0, 0, 0, 0.08);
    --dont-see-bg: #1c1e20;
    --dont-see-text: #ffffff;
    --dont-see-hover: #232527;
    --illustration-border: #1e5736;
    --illustration-fill: #cff6e0;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* ── Dark theme ── */
        --bg-sidebar: #0e0f10;
        --bg-page: #151719;
        --bg-card: #1c1e20;
        --bg-card-elevated: rgba(255, 255, 255, 0.06);
        --bg-nav-active: rgba(255, 255, 255, 0.06);
        --bg-banner: #142e22;
        --bg-guide: rgba(255, 255, 255, 0.08);
        --bg-guide-hover: rgba(255, 255, 255, 0.12);
        --bg-input: rgba(255, 255, 255, 0.04);
        --bg-toggle-track: rgba(255, 255, 255, 0.12);
        --text-primary: #ffffff;
        --text-muted: rgba(255, 255, 255, 0.62);
        --text-subtle: rgba(255, 255, 255, 0.38);
        --text-on-accent: #14231d;
        --border-subtle: rgba(255, 255, 255, 0.08);
        --border-header: rgba(255, 255, 255, 0.09);
        --border-input: rgba(255, 255, 255, 0.12);
        --accent-green: #5ad38e;
        --accent-green-hover: #4fc77e;
        --accent-green-dim: rgba(90, 211, 142, 0.2);
        --logo-filter: brightness(0) invert(1);
        --modal-ring: rgba(255, 255, 255, 0.16);
        --dont-see-bg: #1c1e20;
        --dont-see-text: #ffffff;
        --dont-see-hover: #232527;
        --illustration-border: #5ad38e;
        --illustration-fill: #142e22;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: "TT Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    background: var(--bg-page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

img,
svg {
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.app {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
}

/* ─── Sidebar (280px) ─── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 40;
}

.sidebar-logo {
    padding: 12px 20px 0;
    height: 46px;
    flex-shrink: 0;
}

.sidebar-logo-img {
    width: 107px;
    height: 34px;
    filter: var(--logo-filter);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 20px 8px 8px;
    flex-shrink: 0;
}

.sidebar-spacer {
    flex: 1;
    min-height: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 42px;
    padding: 8px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-item:hover {
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-nav-active);
    color: var(--text-primary);
}

.nav-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.nav-icon svg {
    width: 24px;
    height: 24px;
}

.nav-label {
    white-space: nowrap;
}

.sidebar-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    gap: 16px;
    padding: 16px;
    flex-shrink: 0;
    height: 48px;
}

.device-status {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.device-status:hover {
    color: var(--text-primary);
}

.device-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-status-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.status-dot {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-green);
    border: 2px solid var(--bg-sidebar);
}

.eye-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.eye-icon[hidden] {
    display: none;
}

.hide-balances {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.hide-balances:hover {
    color: var(--text-primary);
}

.hide-balances svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* ─── Main layout ─── */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-page);
    position: relative;
}

.page-header-wrap {
    flex-shrink: 0;
    height: var(--header-height);
    padding: 12px var(--main-padding-x) 0;
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-header);
    box-sizing: border-box;
}

.page-header-wrap--settings {
    height: auto;
    min-height: var(--header-height);
    padding-bottom: 0;
    background: var(--bg-page);
}

.settings-header-inner {
    width: 100%;
}

.page-header h2 {
    margin: 0;
    font-size: 32px;
    font-weight: 500;
    line-height: 40px;
    letter-spacing: -0.02em;
}

.content {
    flex: 1;
    padding: 32px var(--main-padding-x) 134px;
    width: 100%;
}

.content--connect {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* ─── Connect / welcome card ─── */
.welcome-card {
    width: 100%;
    height: 566px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-sizing: border-box;
    overflow: hidden;
}

.welcome-inner {
    width: 100%;
    height: 100%;
    padding: 16px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* illustration + title + subtitle: exactly 426px tall */
.welcome-prompt {
    height: 426px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.illustration {
    width: 350px;
    height: 350px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.illustration svg {
    width: 350px;
    height: 350px;
    display: block;
}

.illustration .illustration-border {
    fill: var(--illustration-border);
}

.illustration .illustration-fill {
    fill: var(--illustration-fill);
}

.welcome-title {
    margin: 0;
    font-size: 32px;
    font-weight: 500;
    line-height: 40px;
    letter-spacing: -0.02em;
    text-align: center;
}

.welcome-subtitle {
    margin: 12px 0 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--text-muted);
    text-align: center;
}

/* button row: 44px, button centered, 24px gap below subtitle */
.welcome-btn-row {
    height: 44px;
    flex-shrink: 0;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Buttons (match suite.trezor.io) ─── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent-green);
    color: var(--text-on-accent);
    font-family: "TT Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 13.3333px;
    font-weight: 400;
    line-height: normal;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: var(--accent-green-hover);
    color: var(--text-on-accent);
}

.btn-primary--connect {
    width: 240px;
}

.btn-primary--banner {
    width: auto;
    height: 44px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 500;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-card-elevated);
    color: var(--text-subtle);
    font-family: "TT Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 13.3333px;
    font-weight: 400;
    line-height: normal;
    cursor: not-allowed;
    white-space: nowrap;
}

.btn-secondary:disabled {
    opacity: 1;
    color: var(--text-subtle);
    background: var(--bg-card-elevated);
}

.btn-text {
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
}

.text-link {
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ─── Earn page ─── */
.earn-page {
    display: flex;
    flex-direction: column;
    gap: 48px;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.earn-section {
    display: flex;
    flex-direction: column;
}

.earn-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.earn-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.earn-section-title h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 500;
    line-height: 32px;
}

.badge-inactive {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 2px 10px;
    border-radius: 100px;
    background: var(--bg-card-elevated);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
    .badge-inactive {
        background: #2c2d30;
        color: #ffffff;
    }
}

.powered-by {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 20px;
}

.partner-logo-wrap {
    display: flex;
    align-items: center;
    width: 100px;
    height: 40px;
    flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
    .partner-logo-wrap {
        filter: invert(1);
    }
}

.partner-logo-img {
    width: 100px;
    height: 40px;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.earn-description {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 24px;
}

.data-table {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .data-table {
        border: none;
    }

    .data-table-head {
        border-bottom-color: rgb(44, 45, 48);
    }

    .data-table-row {
        border-bottom-color: rgb(44, 45, 48);
    }

    .btn-secondary:disabled {
        background: rgba(255, 255, 255, 0.15);
        color: rgba(255, 255, 255, 0.3);
    }
}

.data-table-head {
    display: grid;
    grid-template-columns: 1.4fr 0.5fr 1.1fr;
    gap: 16px;
    padding: 16px 24px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table-row {
    display: grid;
    grid-template-columns: 1.4fr 0.5fr 1.1fr;
    gap: 16px;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
    min-height: 72px;
}

.data-table-row:last-child {
    border-bottom: none;
}

.coin-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coin-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.coin-name {
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
}

.coin-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vault-name {
    font-size: 14px;
    line-height: 20px;
    color: var(--text-muted);
}

.cell-muted {
    color: var(--text-muted);
    font-size: 14px;
}

.cell-apy {
    font-size: 14px;
}

.row-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.row-hint {
    color: var(--text-muted);
    font-size: 14px;
    text-align: right;
    line-height: 20px;
}

.earn-table-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    padding: 32px;
}

.earn-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent-green-dim);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: earn-spin 0.8s linear infinite;
}

@keyframes earn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Activity page ─── */
.activity-page {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    min-height: 400px;
    max-width: var(--content-inner-max);
}

.activity-page-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 24px;
}

.activity-page-tab {
    position: relative;
    padding: 20px 0 16px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    cursor: pointer;
}

.activity-page-tab.active {
    color: var(--text-primary);
}

.activity-page-tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--text-primary);
}

.activity-page-panel {
    padding: 48px 24px;
}

.activity-empty h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
}

.activity-empty p {
    margin: 0;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 24px;
}

/* ─── Connect modal ─── */
.connect-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connect-modal-overlay[hidden] {
    display: none;
}

.connect-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.connect-modal-layout {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.dont-see-btn {
    display: block;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: var(--dont-see-bg);
    color: var(--dont-see-text);
    font-family: inherit;
    font-size: 13.3333px;
    font-weight: 400;
    line-height: normal;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s ease;
}

.dont-see-btn-inner {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
}

.dont-see-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dont-see-btn-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.dont-see-btn-label {
    white-space: nowrap;
}

.dont-see-btn:hover {
    background: var(--dont-see-hover);
}

.connect-modal-card {
    width: 400px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 0 0 2px var(--modal-ring);
    overflow: hidden;
}

.connect-modal-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 16px 0;
    height: 52px;
}

.connect-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: var(--bg-card-elevated);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.connect-modal-close:hover {
    background: var(--bg-guide-hover);
    color: var(--text-primary);
}

.connect-modal-body {
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.connect-modal-title {
    margin: 0 0 32px;
    font-size: 24px;
    font-weight: 500;
    line-height: 40px;
    text-align: center;
    color: var(--text-primary);
}

.btn-find-trezor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 12px;
    background: var(--accent-green);
    color: var(--text-on-accent);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    margin-bottom: 32px;
    transition: background 0.15s ease;
}

.btn-find-trezor:hover {
    background: var(--accent-green-hover);
}

.connect-modal-video-wrap {
    width: 352px;
    height: 470px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card-elevated);
    box-shadow: 0 0 0 2px var(--modal-ring);
}

.connect-modal-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.connect-modal-card.is-connecting,
.connect-modal-card.is-manual {
    width: 400px;
}

.connect-modal-card.is-manual {
    width: 440px;
    max-height: 90vh;
}

.connect-modal-card.is-manual .connect-modal-body {
    align-items: stretch;
    padding: 0;
}

.connect-step--manual {
    align-items: stretch;
    max-height: calc(90vh - 52px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.connect-manual-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) transparent;
}

.connect-manual-scroll::-webkit-scrollbar {
    width: 6px;
}

.connect-manual-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--border-medium);
}

.connect-manual-footer {
    flex-shrink: 0;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-card);
}

.connect-step {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.connect-step[hidden] {
    display: none;
}

.connect-step--manual-intro {
    align-items: stretch;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    padding: 0 20px 4px;
}

.connect-manual-intro-title {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 500;
    line-height: 32px;
    text-align: center;
    color: var(--text-primary);
}

.connect-manual-intro-lead {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 22px;
    color: var(--text-muted);
    text-align: center;
}

.connect-manual-intro-list {
    margin: 0 0 16px;
    padding-left: 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 22px;
    color: var(--text-muted);
}

.connect-manual-intro-list li + li {
    margin-top: 8px;
}

.connect-manual-intro-note {
    margin: 0 0 24px;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    color: var(--text-subtle);
    text-align: center;
}

.btn-connect-manually {
    width: 100%;
    height: 44px;
    border-radius: var(--radius-md);
}

/* Connecting step */
.connect-loading-wrap {
    width: 100%;
    padding: 48px 16px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.connect-loading-ring {
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
}

.connect-loading-ring-segment {
    position: absolute;
    inset: 0;
    border: 3px solid var(--accent-green-dim);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: connect-spin 0.9s linear infinite;
}

.connect-loading-ring-core {
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: var(--accent-green-dim);
    animation: connect-pulse 1.4s ease-in-out infinite;
}

@keyframes connect-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes connect-pulse {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.92);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.connect-status-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    color: var(--text-primary);
}

.connect-status-sub {
    margin: 0 0 28px;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-muted);
}

.connect-progress-track {
    width: 100%;
    max-width: 280px;
    height: 4px;
    border-radius: 999px;
    background: var(--bg-card-elevated);
    overflow: hidden;
}

.connect-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: var(--accent-green);
    transition: width 5s linear;
}

.connect-progress-fill.is-running {
    width: 100%;
}

/* Manual connection step */
.connect-failed-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    margin: 4px 0 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(235, 87, 87, 0.25);
    background: rgba(235, 87, 87, 0.1);
    color: #eb5757;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    box-sizing: border-box;
}

.connect-failed-banner svg {
    flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
    .connect-failed-banner {
        background: rgba(235, 87, 87, 0.14);
        border-color: rgba(255, 107, 107, 0.22);
        color: #ff6b6b;
    }
}

.connect-manual-head {
    margin-bottom: 20px;
}

.connect-manual-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    text-align: left;
}

.connect-manual-sub {
    margin: 0;
    font-size: 13px;
    line-height: 20px;
    color: var(--text-muted);
    text-align: left;
}

.connect-word-count-wrap {
    margin-bottom: 16px;
}

.connect-word-count-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.connect-word-count {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
    background: var(--bg-card-elevated);
    box-shadow: 0 0 0 1px var(--border-subtle);
}

.connect-word-count-btn {
    flex: 1;
    height: 34px;
    padding: 0 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.connect-word-count-btn:hover:not(.active) {
    color: var(--text-primary);
}

.connect-word-count-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--border-subtle);
}

@media (prefers-color-scheme: dark) {
    .connect-word-count-btn.active {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border-subtle);
    }
}

.recovery-phrase-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    padding-bottom: 8px;
}

.connect-passphrase-wrap {
    margin-top: 4px;
    padding-bottom: 8px;
}

.connect-passphrase-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: var(--bg-card-elevated);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    box-shadow: 0 0 0 1px var(--border-subtle);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.connect-passphrase-toggle:hover {
    background: var(--bg-input);
}

.connect-passphrase-toggle[aria-expanded="true"] {
    box-shadow: 0 0 0 2px var(--accent-green);
}

.connect-passphrase-toggle-hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-subtle);
}

.connect-passphrase-field {
    margin-top: 10px;
}

.connect-passphrase-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.connect-passphrase-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    box-shadow: 0 0 0 1px var(--border-subtle);
    transition: box-shadow 0.15s ease;
}

.connect-passphrase-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-green);
}

.recovery-word-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.recovery-word-index {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-card-elevated);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: var(--text-subtle);
    box-shadow: 0 0 0 1px var(--border-subtle);
}

.recovery-word-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    box-sizing: border-box;
    box-shadow: 0 0 0 1px var(--border-input);
    transition: box-shadow 0.15s ease, background 0.15s ease;
}

.recovery-word-input::placeholder {
    color: var(--text-subtle);
    font-weight: 400;
}

.recovery-word-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-green);
    background: var(--bg-card-elevated);
}

.recovery-word-input:not(:placeholder-shown) {
    box-shadow: 0 0 0 1px var(--border-medium);
}

.recovery-word-input:not(:placeholder-shown):focus {
    box-shadow: 0 0 0 2px var(--accent-green);
}

.btn-manual-connect {
    width: 100%;
    height: 44px;
    border-radius: var(--radius-md);
    font-size: 13.333px;
    font-weight: 500;
}

.btn-manual-connect:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ─── Activity floating panel ─── */
.activity-panel {
    position: absolute;
    top: 0;
    left: calc(100% - 4px);
    width: 474px;
    z-index: 50;
    pointer-events: none;
}

.activity-panel:not([hidden]) {
    pointer-events: auto;
}

.activity-panel[hidden] {
    display: none;
}

.activity-panel-card {
    pointer-events: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: 0 0 0 2px var(--modal-ring);
}

.activity-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-subtle);
}

.activity-panel-tabs {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-height: 32px;
}

.activity-panel-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 4px 8px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    border-radius: 0;
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.activity-panel-tab:hover {
    color: var(--text-primary);
}

.activity-panel-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.activity-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--bg-card-elevated);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

@media (prefers-color-scheme: dark) {
    .activity-panel-close {
        background: rgba(255, 255, 255, 0.12);
        color: rgba(255, 255, 255, 0.62);
    }
}

.activity-panel-close:hover {
    background: var(--bg-guide-hover);
    color: var(--text-primary);
}

.activity-panel-body {
    padding: 12px 4px 4px;
}

.activity-panel-body[hidden] {
    display: none;
}

.activity-empty-panel {
    padding: 0 4px 4px;
    text-align: left;
}

.activity-empty-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    color: var(--text-primary);
}

.activity-empty-sub {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: var(--text-muted);
}

#nav-activity-btn.active,
#nav-activity-btn[aria-expanded="true"] {
    background: var(--bg-nav-active);
    color: var(--text-primary);
}

/* ─── Settings ─── */
.settings-tabs {
    display: flex;
    gap: 24px;
    max-width: var(--content-inner-max);
    margin-top: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.settings-tab {
    position: relative;
    padding: 0 0 10px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    cursor: pointer;
}

.settings-tab.active {
    color: var(--text-primary);
}

.settings-tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--text-primary);
}

.settings-page {
    display: flex;
    flex-direction: column;
    gap: 48px;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.settings-banner {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 24px 48px 24px 24px;
    background: var(--bg-banner);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.settings-banner-icon {
    color: var(--accent-green);
    flex-shrink: 0;
}

.settings-banner-text h3 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
}

.settings-banner-text p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 20px;
}

.settings-banner-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.os-icons {
    display: flex;
    gap: 12px;
    color: var(--text-subtle);
    font-size: 12px;
}

.banner-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.settings-group {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.settings-group-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 500;
    line-height: 32px;
    padding-top: 4px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .settings-card {
        border: none;
    }
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row-text strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
}

.settings-row-text p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 20px;
}

.settings-row--field label {
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
}

.settings-row--actions {
    justify-content: flex-start;
    gap: 24px;
}

.settings-row--version {
    font-size: 14px;
    color: var(--text-muted);
}

.select-wrap select {
    min-width: 160px;
    height: 40px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23808080' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.select-wrap--compact select {
    min-width: 120px;
}

.toggle {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--bg-toggle-track);
    transition: background 0.2s ease;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform 0.2s ease, background 0.2s ease;
}

.toggle input:checked + .toggle-slider {
    background: var(--accent-green-dim);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: var(--accent-green);
}

.settings-placeholder .activity-empty {
    padding: 48px 0;
}

/* ─── Guide button (44×44, 12px radius) ─── */
.guide-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-guide);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
}

.guide-button svg {
    width: 24px;
    height: 24px;
}

.guide-button:hover {
    background: var(--bg-guide-hover);
}

[hidden] {
    display: none !important;
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
    .data-table-head,
    .data-table-row {
        grid-template-columns: 1fr 0.4fr 1fr;
    }

    .row-hint {
        display: none;
    }
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 72px;
    }

    .sidebar-logo {
        padding: 12px 8px 0;
        height: auto;
    }

    .sidebar-logo-img {
        width: 40px;
        height: auto;
    }

    .nav-label {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 8px;
    }

    .settings-group {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .settings-banner {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .settings-banner-actions {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .page-header h2 {
        font-size: 28px;
        line-height: 34px;
    }

    .welcome-title {
        font-size: 28px;
        line-height: 34px;
    }

    .illustration-stage {
        height: auto;
        min-height: 280px;
    }

    .illustration,
    .illustration svg {
        width: 280px;
        height: 280px;
    }

    .welcome-card {
        height: auto;
        min-height: auto;
    }

    .connect-modal-card.is-manual {
        width: calc(100vw - 32px);
        max-width: 440px;
    }

    .recovery-phrase-grid {
        grid-template-columns: 1fr;
    }

    .data-table-head {
        display: none;
    }

    .data-table-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .row-action {
        justify-content: flex-start;
    }
}
