:root {
    color-scheme: dark;
    --background: #080a0f;
    --surface: rgba(20, 23, 31, 0.78);
    --surface-solid: #14171f;
    --surface-hover: #1a1e28;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f5f5f0;
    --muted: #979ba7;
    --violet: #7c5cff;
    --violet-soft: rgba(124, 92, 255, 0.14);
    --cyan: #42d3c7;
    --amber: #ffb547;
    --danger: #ff6b7a;
    --radius-large: 24px;
    --radius-medium: 16px;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(circle at 48% -20%, rgba(124, 92, 255, 0.15), transparent 38%),
        linear-gradient(180deg, #0b0d13 0%, var(--background) 45%, #07090d 100%);
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #a894ff;
    outline-offset: 3px;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.1;
    pointer-events: none;
}

.ambient-one {
    top: 22%;
    right: -240px;
    background: #7c5cff;
}

.ambient-two {
    bottom: 8%;
    left: -280px;
    background: #29c59a;
}

.shell {
    width: min(1420px, calc(100% - 48px));
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 94px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(124, 92, 255, 0.24), rgba(124, 92, 255, 0.04));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.1);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
    position: absolute;
    width: 15px;
    height: 5px;
    content: "";
    border: 2px solid #a894ff;
    border-radius: 999px;
    transform: rotate(60deg);
}

.brand-mark::after {
    transform: rotate(-60deg);
}

.brand-mark span {
    transform: rotate(0);
}

.brand > span:last-child {
    display: grid;
    gap: 1px;
}

.brand strong {
    font-size: 15px;
    letter-spacing: -0.01em;
}

.brand small {
    color: var(--muted);
    font-size: 11px;
}

.topbar-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logout {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
}

.account-switcher-wrap {
    position: relative;
}

.account-switcher {
    display: flex;
    min-width: 190px;
    height: 48px;
    align-items: center;
    gap: 10px;
    padding: 6px 11px 6px 7px;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.035);
    text-align: left;
    transition: 160ms ease;
}

.account-switcher:hover,
.account-switcher[aria-expanded="true"] {
    border-color: rgba(124, 92, 255, 0.4);
    background: rgba(124, 92, 255, 0.08);
}

.switcher-avatar,
.focus-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--focus-color, #7c5cff) 48%, transparent);
    color: #fff;
    background: color-mix(in srgb, var(--focus-color, #7c5cff) 20%, transparent);
    font-weight: 800;
}

.switcher-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 11px;
}

.switcher-copy {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 1px;
}

.switcher-copy small {
    color: var(--muted);
    font-size: 9px;
}

.switcher-copy strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.switcher-chevron {
    color: var(--muted);
    font-size: 14px;
}

.account-menu {
    position: absolute;
    z-index: 15;
    top: calc(100% + 9px);
    right: 0;
    width: min(370px, calc(100vw - 28px));
    padding: 10px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: #151821;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
}

.account-menu-heading {
    display: grid;
    gap: 2px;
    padding: 8px 9px 11px;
    border-bottom: 1px solid var(--border);
}

.account-menu-heading span {
    font-size: 11px;
    font-weight: 750;
}

.account-menu-heading small,
.account-menu-empty {
    color: var(--muted);
    font-size: 9px;
}

.account-menu-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
    padding: 9px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--text);
    background: transparent;
    text-align: left;
}

.account-menu-item:hover,
.account-menu-item.is-selected {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.045);
}

.account-menu-item.is-selected {
    border-color: rgba(124, 92, 255, 0.25);
    background: rgba(124, 92, 255, 0.08);
}

.menu-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--menu-color) 45%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--menu-color) 18%, transparent);
    font-size: 10px;
    font-weight: 800;
}

.account-menu-item > span:nth-child(2) {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 2px;
}

.account-menu-item strong,
.account-menu-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-item strong { font-size: 11px; }
.account-menu-item small { color: var(--muted); font-size: 9px; }
.account-menu-item i { color: #9c87ff; font-size: 12px; font-style: normal; }
.account-menu-empty { margin: 13px 9px; }

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
    color: #aeb1bb;
    font-size: 12px;
}

.privacy-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #44d39f;
    box-shadow: 0 0 12px rgba(68, 211, 159, 0.8);
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    transition: 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: wait;
    opacity: 0.55;
    transform: none;
}

.button-primary {
    border-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #8064ff, #6750dc);
    box-shadow: 0 9px 24px rgba(105, 79, 226, 0.27), inset 0 1px rgba(255, 255, 255, 0.2);
}

.button-primary:hover {
    background: linear-gradient(135deg, #8d73ff, #725be4);
}

.button-ghost {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.035);
}

.button-ghost:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.065);
}

.button-danger {
    border-color: rgba(255, 107, 122, 0.22);
    color: #ff9aa4;
    background: rgba(255, 107, 122, 0.08);
}

.refresh-icon {
    display: inline-block;
    font-size: 17px;
}

.is-spinning .refresh-icon {
    animation: spin 800ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hero {
    display: grid;
    min-height: 340px;
    align-items: end;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 48px;
    padding: 72px 0 57px;
}

.focus-hero {
    min-height: 470px;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) minmax(440px, 520px);
    padding: 64px 0 56px;
}

.focus-account-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.focus-avatar {
    width: 45px;
    height: 45px;
    border-radius: 14px;
    font-size: 13px;
}

.focus-account-line > div {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.focus-account-line .eyebrow {
    margin: 0;
    font-size: 9px;
}

.focus-account-line strong {
    overflow: hidden;
    max-width: 300px;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.focus-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: 6px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #c5c7ce;
    background: rgba(255, 255, 255, 0.035);
    font-size: 9px;
    font-weight: 700;
}

.focus-status i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #858995;
}

.focus-status.status-ready { border-color: rgba(41, 197, 154, 0.2); color: #a9e5d2; background: rgba(41, 197, 154, 0.07); }
.focus-status.status-ready i { background: #29c59a; box-shadow: 0 0 10px rgba(41, 197, 154, 0.7); }
.focus-status.status-warning { border-color: rgba(255, 181, 71, 0.22); color: #ffd18b; background: rgba(255, 181, 71, 0.07); }
.focus-status.status-warning i { background: var(--amber); }
.focus-status.status-danger { border-color: rgba(255, 107, 122, 0.22); color: #ff9ca6; background: rgba(255, 107, 122, 0.07); }
.focus-status.status-danger i { background: var(--danger); }

.focus-headline {
    max-width: 820px;
    margin-bottom: 20px;
    font-size: clamp(43px, 4.7vw, 72px);
}

.focus-headline > span {
    color: var(--text);
    font-weight: 680;
}

.focus-headline em {
    color: #a4a6af;
    font-style: normal;
    font-weight: 520;
}

.focus-actions {
    display: flex;
    gap: 9px;
    margin-top: 25px;
}

.focus-panel {
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(27, 30, 41, 0.96), rgba(17, 20, 28, 0.96));
    box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.05);
}

.focus-panel-top {
    display: flex;
    align-items: center;
    gap: 23px;
    padding: 25px;
    border-bottom: 1px solid var(--border);
}

.usage-ring {
    display: grid;
    width: 116px;
    height: 116px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--ring-color) calc(var(--ring-value) * 1%), rgba(255, 255, 255, 0.07) 0);
    box-shadow: 0 0 30px color-mix(in srgb, var(--ring-color) 14%, transparent);
}

.usage-ring::before {
    position: absolute;
    width: 94px;
    height: 94px;
    content: "";
    border-radius: 50%;
    background: #171a23;
    box-shadow: inset 0 0 0 1px var(--border);
}

.usage-ring > div {
    position: relative;
    z-index: 1;
    display: grid;
    text-align: center;
}

.usage-ring strong {
    font-size: 25px;
    letter-spacing: -0.05em;
}

.usage-ring span,
.focus-week-copy span,
.focus-week-copy small {
    color: var(--muted);
    font-size: 9px;
}

.focus-week-copy {
    display: grid;
    gap: 4px;
}

.focus-week-copy strong {
    font-size: 19px;
    letter-spacing: -0.035em;
}

.focus-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 0 13px;
}

.focus-stat-grid > div {
    min-width: 0;
    padding: 18px 12px;
    border-right: 1px solid var(--border);
}

.focus-stat-grid > div:last-child { border-right: 0; }

.focus-stat-grid span,
.focus-stat-grid strong,
.focus-stat-grid small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.focus-stat-grid span,
.focus-stat-grid small { color: var(--muted); font-size: 8px; }
.focus-stat-grid strong { margin: 4px 0 1px; font-size: 15px; }

.token-health {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 17px 14px;
    padding: 11px 12px;
    border: 1px solid rgba(41, 197, 154, 0.16);
    border-radius: 12px;
    background: rgba(41, 197, 154, 0.055);
}

.token-health.is-offline {
    border-color: rgba(255, 107, 122, 0.16);
    background: rgba(255, 107, 122, 0.05);
}

.token-health-icon {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    color: #89e0c4;
    background: rgba(41, 197, 154, 0.12);
}

.token-health > div {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 2px;
}

.token-health strong,
.token-health small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-health strong { font-size: 9px; }
.token-health small { color: var(--muted); font-size: 8px; }

.token-health-badge {
    padding: 4px 6px;
    border-radius: 999px;
    color: #8fe1c7;
    background: rgba(41, 197, 154, 0.1);
    font-size: 7px;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.token-health.is-offline .token-health-badge { color: #ff9ca6; background: rgba(255, 107, 122, 0.1); }

.focus-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 17px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 8px;
}

.focus-panel-footer > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eyebrow {
    margin: 0 0 13px;
    color: #9c87ff;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 760px;
    margin-bottom: 22px;
    font-size: clamp(44px, 5.1vw, 78px);
    font-weight: 680;
    letter-spacing: -0.06em;
    line-height: 0.98;
}

h1 span {
    color: #a4a6af;
    font-weight: 520;
}

.hero-copy {
    max-width: 670px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
}

.hero-status {
    display: grid;
    min-width: 205px;
    gap: 5px;
    padding: 20px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    background: rgba(255, 255, 255, 0.025);
}

.hero-status span,
.hero-status small {
    color: var(--muted);
    font-size: 11px;
}

.hero-status strong {
    font-size: 20px;
    letter-spacing: -0.03em;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.summary-card {
    position: relative;
    display: grid;
    min-height: 150px;
    align-content: center;
    gap: 5px;
    padding: 26px 30px;
    border-right: 1px solid var(--border);
}

.summary-card:last-child {
    border-right: 0;
}

.summary-card::before {
    position: absolute;
    top: 0;
    right: 24px;
    left: 24px;
    height: 1px;
    content: "";
    opacity: 0;
    background: linear-gradient(90deg, transparent, var(--violet), transparent);
}

.summary-card.accent-violet::before,
.summary-card.accent-cyan::before,
.summary-card.accent-amber::before {
    opacity: 0.7;
}

.summary-card.accent-cyan::before {
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.summary-card.accent-amber::before {
    background: linear-gradient(90deg, transparent, var(--amber), transparent);
}

.summary-kicker {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.summary-card strong {
    font-size: 31px;
    letter-spacing: -0.05em;
}

.summary-card small {
    color: #777b87;
    font-size: 11px;
}

.accounts-section {
    padding: 70px 0 84px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 25px;
}

.section-heading h2 {
    margin: 0;
    font-size: 26px;
    letter-spacing: -0.035em;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-controls label {
    color: var(--muted);
    font-size: 11px;
}

select {
    min-height: 38px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: var(--surface-solid);
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.account-card {
    --account-color: var(--violet);
    position: relative;
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.account-card:hover {
    border-color: var(--border-strong);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
    transform: translateY(-2px);
}

.account-card.is-focused {
    border-color: color-mix(in srgb, var(--account-color) 55%, var(--border));
    box-shadow: 0 18px 55px color-mix(in srgb, var(--account-color) 10%, transparent);
}

.account-card::before {
    position: absolute;
    top: -1px;
    right: 28px;
    left: 28px;
    height: 1px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--account-color), transparent);
    opacity: 0.72;
}

.account-head {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.account-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.account-avatar {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--account-color) 40%, transparent);
    border-radius: 13px;
    color: #fff;
    background: color-mix(in srgb, var(--account-color) 18%, transparent);
    font-size: 14px;
    font-weight: 800;
}

.account-name {
    min-width: 0;
}

.account-name h3 {
    overflow: hidden;
    margin: 0 0 3px;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-name p {
    overflow: hidden;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-badge {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #c1c3ca;
    background: rgba(255, 255, 255, 0.04);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.limit-list {
    display: grid;
    margin-top: 30px;
}

.usage-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 22px;
}

.usage-facts > div {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.025);
}

.usage-facts span,
.usage-facts strong {
    display: block;
}

.usage-facts span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 9px;
}

.usage-facts strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.limit-meta,
.limit-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.limit-meta {
    margin-bottom: 10px;
}

.limit-meta span {
    color: #c7c9cf;
    font-size: 11px;
    font-weight: 650;
}

.limit-meta strong {
    font-size: 18px;
    letter-spacing: -0.035em;
}

.progress {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
}

.progress span {
    display: block;
    width: var(--remaining);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--account-color) 70%, #fff), var(--account-color));
    box-shadow: 0 0 14px color-mix(in srgb, var(--account-color) 45%, transparent);
    transition: width 500ms ease;
}

.limit-labels {
    margin-top: 8px;
    color: #737783;
    font-size: 10px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.card-footer small {
    color: #717581;
    font-size: 10px;
}

.card-actions {
    display: flex;
    gap: 5px;
}

.focus-button {
    min-width: 66px;
    height: 32px;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: #aeb1ba;
    background: rgba(255, 255, 255, 0.03);
    font-size: 9px;
    font-weight: 750;
}

.focus-button:hover,
.is-focused .focus-button {
    border-color: color-mix(in srgb, var(--account-color) 45%, transparent);
    color: #fff;
    background: color-mix(in srgb, var(--account-color) 13%, transparent);
}

.mini-button,
.icon-button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: #b8bbc3;
    background: rgba(255, 255, 255, 0.03);
    font-size: 14px;
}

.mini-button:hover,
.icon-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.disconnected {
    display: grid;
    min-height: 205px;
    place-items: center;
    padding: 28px 0 8px;
    text-align: center;
}

.disconnected-symbol {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    place-items: center;
    border: 1px dashed color-mix(in srgb, var(--account-color) 45%, transparent);
    border-radius: 50%;
    color: var(--account-color);
    background: color-mix(in srgb, var(--account-color) 8%, transparent);
    font-size: 24px;
}

.disconnected h4 {
    margin: 0 0 7px;
    font-size: 15px;
}

.disconnected p {
    max-width: 260px;
    margin: 0 auto 18px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.skeleton {
    min-height: 402px;
    overflow: hidden;
}

.skeleton::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.05) 45%, transparent 70%);
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.empty-state {
    display: grid;
    grid-column: 1 / -1;
    min-height: 390px;
    place-items: center;
    align-content: center;
    padding: 55px 24px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-large);
    background: radial-gradient(circle at 50% 45%, rgba(124, 92, 255, 0.08), transparent 35%);
    text-align: center;
}

.empty-orbit {
    display: grid;
    width: 78px;
    height: 78px;
    margin-bottom: 25px;
    place-items: center;
    border: 1px solid rgba(124, 92, 255, 0.35);
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(124, 92, 255, 0.15);
}

.empty-orbit::before,
.empty-orbit::after,
.empty-orbit span {
    position: absolute;
    width: 24px;
    height: 8px;
    content: "";
    border: 2px solid #9c87ff;
    border-radius: 999px;
    transform: rotate(60deg);
}

.empty-orbit::after { transform: rotate(-60deg); }
.empty-orbit span { transform: rotate(0); }

.empty-state h3 {
    margin-bottom: 8px;
    font-size: 22px;
}

.empty-state > p:not(.eyebrow) {
    max-width: 430px;
    margin-bottom: 23px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

footer {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    color: #676b76;
    font-size: 11px;
}

footer p {
    margin: 0;
}

.dialog {
    width: min(520px, calc(100% - 30px));
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    color: var(--text);
    background: #12151d;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
}

.dialog::backdrop {
    background: rgba(3, 4, 7, 0.74);
    backdrop-filter: blur(8px);
}

.dialog form,
.detail-dialog > div {
    padding: 28px;
}

.dialog-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
}

.dialog-heading h2 {
    margin-bottom: 0;
    font-size: 22px;
    letter-spacing: -0.035em;
}

.dialog-copy {
    margin: 18px 0 24px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.field {
    display: grid;
    gap: 8px;
}

.field span,
.color-field legend {
    color: #c6c8cf;
    font-size: 11px;
    font-weight: 650;
}

.field input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.035);
}

.field input::placeholder {
    color: #626672;
}

.color-field {
    margin: 20px 0 0;
    padding: 0;
    border: 0;
}

.color-options {
    display: flex;
    gap: 11px;
    margin-top: 10px;
}

.color-options input {
    position: absolute;
    opacity: 0;
}

.color-options span {
    display: block;
    width: 30px;
    height: 30px;
    border: 5px solid #12151d;
    border-radius: 50%;
    background: var(--swatch);
    box-shadow: 0 0 0 1px var(--border-strong);
    transition: 150ms ease;
}

.color-options input:checked + span {
    box-shadow: 0 0 0 2px #f4f4f0;
    transform: scale(1.08);
}

.security-note {
    display: flex;
    gap: 11px;
    margin-top: 24px;
    padding: 14px;
    border: 1px solid rgba(66, 211, 199, 0.15);
    border-radius: 12px;
    color: #8d918f;
    background: rgba(66, 211, 199, 0.055);
}

.security-note > span {
    display: grid;
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #07110e;
    background: var(--cyan);
    font-size: 11px;
    font-weight: 900;
}

.security-note p {
    margin: 0;
    font-size: 10px;
    line-height: 1.55;
}

.security-note strong {
    display: block;
    color: #c9d6d2;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 24px;
}

.detail-dialog {
    width: min(690px, calc(100% - 30px));
}

.device-dialog-content {
    padding: 28px;
}

.device-code-box {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 25px;
    border: 1px solid rgba(124, 92, 255, 0.24);
    border-radius: 16px;
    background: rgba(124, 92, 255, 0.07);
    text-align: center;
}

.device-code-box > span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.device-code-box > strong {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: clamp(28px, 7vw, 42px);
    letter-spacing: 0.12em;
}

.dialog-actions a.button {
    text-decoration: none;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
}

.login-shell {
    display: grid;
    width: min(1050px, 100%);
    min-height: 650px;
    grid-template-columns: minmax(0, 1.05fr) minmax(350px, 0.95fr);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 28px;
    background: rgba(17, 20, 28, 0.92);
    box-shadow: 0 38px 120px rgba(0, 0, 0, 0.58);
}

.login-card {
    display: flex;
    padding: clamp(32px, 5vw, 62px);
    flex-direction: column;
    justify-content: center;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 52px;
}

.login-brand > span:last-child {
    display: grid;
    gap: 1px;
}

.login-brand strong { font-size: 14px; }
.login-brand small { color: var(--muted); font-size: 9px; }

.login-heading h1 {
    margin-bottom: 17px;
    font-size: clamp(47px, 6vw, 68px);
}

.login-heading > p:last-child {
    max-width: 470px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 17px;
    margin-top: 31px;
}

.password-input-wrap {
    position: relative;
    display: block;
}

.password-input-wrap input {
    padding-right: 85px;
}

.password-input-wrap button {
    position: absolute;
    top: 50%;
    right: 7px;
    padding: 7px 9px;
    border: 0;
    border-radius: 7px;
    color: var(--muted);
    background: transparent;
    font-size: 9px;
    transform: translateY(-50%);
}

.password-input-wrap button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.login-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 3px;
}

.login-error {
    margin: -3px 0 0;
    padding: 11px 12px;
    border: 1px solid rgba(255, 107, 122, 0.2);
    border-radius: 9px;
    color: #ffabb3;
    background: rgba(255, 107, 122, 0.06);
    font-size: 10px;
}

.login-security {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 26px;
    padding-top: 19px;
    border-top: 1px solid var(--border);
}

.security-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 12px rgba(66, 211, 199, 0.7);
}

.security-dot.is-warning {
    background: var(--amber);
    box-shadow: 0 0 12px rgba(255, 181, 71, 0.6);
}

.login-security > div {
    display: grid;
    gap: 2px;
}

.login-security strong { font-size: 9px; }
.login-security small { color: var(--muted); font-size: 8px; }

.login-aside {
    position: relative;
    display: flex;
    padding: 54px;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border-left: 1px solid var(--border);
    background:
        radial-gradient(circle at 100% 0%, rgba(124, 92, 255, 0.28), transparent 48%),
        linear-gradient(145deg, rgba(124, 92, 255, 0.08), rgba(41, 197, 154, 0.035));
}

.login-aside::before,
.login-aside::after {
    position: absolute;
    width: 280px;
    height: 280px;
    content: "";
    border: 1px solid rgba(124, 92, 255, 0.13);
    border-radius: 50%;
}

.login-aside::before { top: -105px; right: -100px; }
.login-aside::after { top: -50px; right: -155px; }

.login-aside h2 {
    position: relative;
    z-index: 1;
    margin-bottom: 33px;
    font-size: clamp(30px, 4vw, 45px);
    letter-spacing: -0.055em;
    line-height: 1.05;
}

.login-aside ul {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.login-aside li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid var(--border);
    color: #c2c4cb;
    font-size: 10px;
}

.login-aside li span {
    color: #8e76ff;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 8px;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 24px 0;
}

.detail-stat {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.detail-stat span,
.detail-stat small {
    display: block;
    color: var(--muted);
    font-size: 9px;
}

.detail-stat strong {
    display: block;
    margin: 4px 0 2px;
    font-size: 18px;
}

.chart-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.chart-heading h3 {
    margin: 0;
    font-size: 13px;
}

.bar-chart {
    display: grid;
    height: 160px;
    align-items: end;
    grid-template-columns: repeat(14, minmax(8px, 1fr));
    gap: 6px;
    padding-top: 20px;
}

.bar-column {
    display: grid;
    height: 100%;
    align-items: end;
    gap: 7px;
}

.bar-column span {
    min-height: 3px;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, #9c87ff, #664bdc);
}

.bar-column small {
    overflow: hidden;
    color: #686c77;
    font-size: 8px;
    text-align: center;
}

.toast-region {
    position: fixed;
    z-index: 20;
    right: 20px;
    bottom: 20px;
    display: grid;
    width: min(360px, calc(100% - 40px));
    gap: 8px;
}

.toast {
    padding: 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: #dfe1e6;
    background: #181b24;
    box-shadow: var(--shadow);
    font-size: 12px;
    animation: toast-in 220ms ease;
}

.toast.error {
    border-color: rgba(255, 107, 122, 0.3);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1050px) {
    .focus-hero { grid-template-columns: 1fr; }
    .focus-panel { width: 100%; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-card:nth-child(2) { border-right: 0; }
    .summary-card:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
    .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .shell { width: min(100% - 28px, 1420px); }
    .topbar { min-height: 80px; }
    .privacy-badge,
    #refreshButton { display: none; }
    .button { padding: 0 13px; }
    .hero { grid-template-columns: 1fr; padding: 54px 0 40px; }
    .focus-account-line { align-items: flex-start; flex-wrap: wrap; }
    .focus-status { margin-left: 0; }
    .focus-actions { align-items: stretch; flex-direction: column; }
    .focus-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .focus-stat-grid > div:nth-child(2) { border-right: 0; }
    .focus-stat-grid > div:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
    .hero-status { display: none; }
    h1 { font-size: clamp(42px, 13vw, 62px); }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .summary-card { min-height: 130px; padding: 21px; }
    .summary-card strong { font-size: 26px; }
    .accounts-section { padding: 52px 0 64px; }
    .section-heading { align-items: start; flex-direction: column; gap: 18px; }
    .account-grid { grid-template-columns: 1fr; }
    footer { align-items: start; flex-direction: column; justify-content: center; gap: 5px; }
    .detail-stats { grid-template-columns: 1fr; }
    .login-page { padding: 14px; }
    .login-shell { min-height: 0; grid-template-columns: 1fr; }
    .login-aside { display: none; }
    .login-card { min-height: calc(100vh - 28px); }
}

@media (max-width: 460px) {
    .brand small { display: none; }
    .topbar-actions .button-primary { font-size: 0; }
    .topbar-actions .button-primary span { font-size: 18px; }
    .account-switcher { min-width: 48px; width: 48px; padding-right: 6px; }
    .switcher-copy,
    .switcher-chevron { display: none; }
    .focus-panel-top { align-items: flex-start; flex-direction: column; }
    .focus-panel-footer { align-items: flex-start; flex-direction: column; }
    .summary-grid { grid-template-columns: 1fr; }
    .summary-card { min-height: 112px; border-right: 0; border-bottom: 1px solid var(--border); }
    .summary-card:last-child { border-bottom: 0; }
    .dialog form,
    .detail-dialog > div { padding: 21px; }
    .device-dialog-content { padding: 21px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
