@import"https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@300;400;500;600&family=Syne:wght@700;800&display=swap";

:root {
    --bg: #0d0e12;
    --bg-accent: #13151c;
    --bg-elevated: #1a1d27;
    --bg-hover: #20232f;
    --bg-muted: #1a1d27;
    --card: #13151c;
    --card-foreground: #e8e9f0;
    --card-highlight: rgba(255, 255, 255, .05);
    --popover: #13151c;
    --popover-foreground: #e8e9f0;
    --panel: #0d0e12;
    --panel-strong: #13151c;
    --panel-hover: #1a1d27;
    --chrome: rgba(13, 14, 18, .95);
    --chrome-strong: rgba(13, 14, 18, .98);
    --text: #e8e9f0;
    --text-strong: #fafafa;
    --chat-text: #e8e9f0;
    --muted: #7b7e95;
    --muted-strong: #3d4055;
    --muted-foreground: #7b7e95;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.12);
    --border-hover: rgba(255, 255, 255, 0.2);
    --input: #1a1d27;
    --ring: #ff3f3f;
    --accent: #ff3f3f;
    --accent-hover: #ff6b35;
    --accent-muted: #ff3f3f;
    --accent-subtle: rgba(255, 63, 63, .15);
    --accent-foreground: #fafafa;
    --accent-glow: rgba(255, 63, 63, .25);
    --primary: #ff3f3f;
    --primary-foreground: #ffffff;
    --secondary: #1a1d27;
    --secondary-foreground: #e8e9f0;
    --accent-2: #ff6b35;
    --accent-2-muted: rgba(255, 107, 53, .7);
    --accent-2-subtle: rgba(255, 107, 53, .15);
    --ok: #2ecc71;
    --ok-muted: rgba(46, 204, 113, .75);
    --ok-subtle: rgba(46, 204, 113, .12);
    --destructive: #ff3f3f;
    --destructive-foreground: #fafafa;
    --warn: #ff6b35;
    --warn-muted: rgba(255, 107, 53, .75);
    --warn-subtle: rgba(255, 107, 53, .12);
    --danger: #ff3f3f;
    --danger-muted: rgba(255, 63, 63, .75);
    --danger-subtle: rgba(255, 63, 63, .12);
    --info: #3b82f6;
    --focus: rgba(255, 63, 63, .25);
    --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--ring);
    --focus-glow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ring), 0 0 20px var(--accent-glow);
    --grid-line: rgba(255, 255, 255, .04);
    --theme-switch-x: 50%;
    --theme-switch-y: 50%;
    --mono: "Space Mono", monospace;
    --font-body: "DM Sans", sans-serif;
    --font-display: "Syne", sans-serif;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .25), 0 0 0 1px rgba(255, 255, 255, .03);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .03);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .03);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 18px;
    --radius-full: 9999px;
    --radius: 12px;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-in-out: cubic-bezier(.4, 0, .2, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --duration-fast: .12s;
    --duration-normal: .2s;
    --duration-slow: .35s;
    color-scheme: dark
}

:root[data-theme=light] {
    --bg: #fafafa;
    --bg-accent: #f5f5f5;
    --bg-elevated: #ffffff;
    --bg-hover: #f0f0f0;
    --bg-muted: #f0f0f0;
    --bg-content: #f5f5f5;
    --card: #ffffff;
    --card-foreground: #18181b;
    --card-highlight: rgba(0, 0, 0, .03);
    --popover: #ffffff;
    --popover-foreground: #18181b;
    --panel: #fafafa;
    --panel-strong: #f5f5f5;
    --panel-hover: #ebebeb;
    --chrome: rgba(250, 250, 250, .95);
    --chrome-strong: rgba(250, 250, 250, .98);
    --text: #3f3f46;
    --text-strong: #18181b;
    --chat-text: #3f3f46;
    --muted: #71717a;
    --muted-strong: #52525b;
    --muted-foreground: #71717a;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --border-hover: #a1a1aa;
    --input: #e4e4e7;
    --accent: #dc2626;
    --accent-hover: #ef4444;
    --accent-muted: #dc2626;
    --accent-subtle: rgba(220, 38, 38, .12);
    --accent-foreground: #ffffff;
    --accent-glow: rgba(220, 38, 38, .15);
    --primary: #dc2626;
    --primary-foreground: #ffffff;
    --secondary: #f4f4f5;
    --secondary-foreground: #3f3f46;
    --accent-2: #0d9488;
    --accent-2-muted: rgba(13, 148, 136, .75);
    --accent-2-subtle: rgba(13, 148, 136, .12);
    --ok: #16a34a;
    --ok-muted: rgba(22, 163, 74, .75);
    --ok-subtle: rgba(22, 163, 74, .1);
    --destructive: #dc2626;
    --destructive-foreground: #fafafa;
    --warn: #d97706;
    --warn-muted: rgba(217, 119, 6, .75);
    --warn-subtle: rgba(217, 119, 6, .1);
    --danger: #dc2626;
    --danger-muted: rgba(220, 38, 38, .75);
    --danger-subtle: rgba(220, 38, 38, .1);
    --info: #2563eb;
    --focus: rgba(220, 38, 38, .2);
    --focus-glow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ring), 0 0 16px var(--accent-glow);
    --grid-line: rgba(0, 0, 0, .05);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .04);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, .15), 0 0 0 1px rgba(0, 0, 0, .04);
    --shadow-glow: 0 0 24px var(--accent-glow);
    color-scheme: light
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font: 400 14px/1.55 var(--font-body);
    letter-spacing: -.02em;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale
}

@keyframes theme-circle-transition {
    0% {
        clip-path: circle(0% at var(--theme-switch-x, 50%) var(--theme-switch-y, 50%))
    }

    to {
        clip-path: circle(150% at var(--theme-switch-x, 50%) var(--theme-switch-y, 50%))
    }
}

html.theme-transition {
    view-transition-name: theme
}

html.theme-transition::view-transition-old(theme) {
    mix-blend-mode: normal;
    animation: none;
    z-index: 1
}

html.theme-transition::view-transition-new(theme) {
    mix-blend-mode: normal;
    z-index: 2;
    animation: theme-circle-transition .4s var(--ease-out) forwards
}

@media(prefers-reduced-motion:reduce) {

    html.theme-transition::view-transition-old(theme),
    html.theme-transition::view-transition-new(theme) {
        animation: none !important
    }
}

openclaw-app {
    display: block;
    position: relative;
    z-index: 1;
    min-height: 100vh
}

a {
    color: var(--accent);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit
}

::selection {
    background: var(--accent-subtle);
    color: var(--text-strong)
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full)
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong)
}

@keyframes rise {
    0% {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes fade-in {
    0% {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes scale-in {
    0% {
        opacity: 0;
        transform: scale(.95)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

@keyframes dashboard-enter {
    0% {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0
    }

    to {
        background-position: 200% 0
    }
}

@keyframes pulse-subtle {

    0%,
    to {
        opacity: 1
    }

    50% {
        opacity: .7
    }
}

@keyframes glow-pulse {

    0%,
    to {
        box-shadow: 0 0 #ff5c5c00
    }

    50% {
        box-shadow: 0 0 20px var(--accent-glow)
    }
}

.stagger-1 {
    animation-delay: 0ms
}

.stagger-2 {
    animation-delay: 50ms
}

.stagger-3 {
    animation-delay: .1s
}

.stagger-4 {
    animation-delay: .15s
}

.stagger-5 {
    animation-delay: .2s
}

.stagger-6 {
    animation-delay: .25s
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring)
}

.shell {
    --shell-pad: 16px;
    --shell-gap: 16px;
    --shell-nav-width: 220px;
    --shell-topbar-height: 56px;
    --shell-focus-duration: .2s;
    --shell-focus-ease: var(--ease-out);
    height: 100vh;
    display: grid;
    grid-template-columns: var(--shell-nav-width) minmax(0, 1fr);
    grid-template-rows: var(--shell-topbar-height) 1fr;
    grid-template-areas: "topbar topbar" "nav content";
    gap: 0;
    animation: dashboard-enter .4s var(--ease-out);
    transition: grid-template-columns var(--shell-focus-duration) var(--shell-focus-ease);
    overflow: hidden
}

@supports (height: 100dvh) {
    .shell {
        height: 100dvh
    }
}

.shell--chat {
    min-height: 100vh;
    height: 100vh;
    overflow: hidden
}

@supports (height: 100dvh) {
    .shell--chat {
        height: 100dvh
    }
}

.shell--nav-collapsed,
.shell--chat-focus {
    grid-template-columns: 0px minmax(0, 1fr)
}

.shell--onboarding {
    grid-template-rows: 0 1fr
}

.shell--onboarding .topbar {
    display: none
}

.shell--onboarding .content,
.shell--chat-focus .content {
    padding-top: 0
}

.shell--chat-focus .content>*+* {
    margin-top: 0
}

.topbar {
    grid-area: topbar;
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    height: var(--shell-topbar-height);
    border-bottom: 1px solid var(--border);
    background: var(--bg)
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px
}

.topbar .nav-collapse-toggle {
    width: 36px;
    height: 36px;
    margin-bottom: 0
}

.topbar .nav-collapse-toggle__icon {
    width: 20px;
    height: 20px
}

.topbar .nav-collapse-toggle__icon svg {
    width: 20px;
    height: 20px
}

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

.brand-logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.1;
    color: var(--text-strong)
}

.brand-sub {
    font-size: 10px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: .05em;
    text-transform: uppercase;
    line-height: 1
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: 8px
}

.topbar-status .pill {
    padding: 6px 10px;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    height: 32px;
    box-sizing: border-box
}

.topbar-status .pill .mono {
    display: flex;
    align-items: center;
    line-height: 1;
    margin-top: 0
}

.topbar-status .statusDot {
    width: 6px;
    height: 6px
}

.topbar-status .theme-toggle {
    --theme-item: 24px;
    --theme-gap: 2px;
    --theme-pad: 3px
}

.topbar-status .theme-icon {
    width: 12px;
    height: 12px
}

.nav {
    grid-area: nav;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
    background: var(--bg);
    scrollbar-width: none;
    transition: width var(--shell-focus-duration) var(--shell-focus-ease), padding var(--shell-focus-duration) var(--shell-focus-ease), opacity var(--shell-focus-duration) var(--shell-focus-ease);
    min-height: 0
}

.nav::-webkit-scrollbar {
    display: none
}

.shell--chat-focus .nav {
    width: 0;
    padding: 0;
    border-width: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0
}

.nav--collapsed {
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: none;
    opacity: 0;
    pointer-events: none
}

.nav-collapse-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
    margin-bottom: 16px
}

.nav-collapse-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border)
}

.nav-collapse-toggle__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--muted);
    transition: color var(--duration-fast) ease
}

.nav-collapse-toggle__icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-linejoin: round
}

.nav-collapse-toggle:hover .nav-collapse-toggle__icon {
    color: var(--text)
}

.nav-group {
    margin-bottom: 20px;
    display: grid;
    gap: 2px
}

.nav-group:last-child {
    margin-bottom: 0
}

.nav-group__items {
    display: grid;
    gap: 1px
}

.nav-group--collapsed .nav-group__items {
    display: none
}

.nav-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast) ease, background var(--duration-fast) ease
}

.nav-label:hover {
    color: var(--text);
    background: var(--bg-hover)
}

.nav-label--static {
    cursor: default
}

.nav-label--static:hover {
    color: var(--muted);
    background: transparent
}

.nav-label__text {
    flex: 1
}

.nav-label__chevron {
    font-size: 10px;
    opacity: .5;
    transition: transform var(--duration-fast) ease
}

.nav-group--collapsed .nav-label__chevron {
    transform: rotate(-90deg)
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease, color var(--duration-fast) ease
}

.nav-item__icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: .7;
    transition: opacity var(--duration-fast) ease
}

.nav-item__icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-linejoin: round
}

.nav-item__text {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap
}

.nav-item:hover {
    color: var(--text);
    background: var(--bg-hover);
    text-decoration: none
}

.nav-item:hover .nav-item__icon {
    opacity: 1
}

.nav-item.active {
    color: var(--text-strong);
    background: var(--accent-subtle)
}

.nav-item.active .nav-item__icon {
    opacity: 1;
    color: var(--accent)
}

.content {
    grid-area: content;
    padding: 12px 16px 32px;
    display: block;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden
}

.content>*+* {
    margin-top: 24px
}

:root[data-theme=light] .content {
    background: var(--bg-content)
}

.content--chat {
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow: hidden;
    padding-bottom: 0
}

.content--chat>*+* {
    margin-top: 0
}

.content-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 8px;
    overflow: hidden;
    transform-origin: top center;
    transition: opacity var(--shell-focus-duration) var(--shell-focus-ease), transform var(--shell-focus-duration) var(--shell-focus-ease), max-height var(--shell-focus-duration) var(--shell-focus-ease), padding var(--shell-focus-duration) var(--shell-focus-ease);
    max-height: 80px
}

.shell--chat-focus .content-header {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0px;
    padding: 0;
    pointer-events: none
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.15;
    color: var(--text-strong)
}

.page-sub {
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
    margin-top: 6px;
    letter-spacing: -.01em
}

.page-meta {
    display: flex;
    gap: 8px
}

.content--chat .content-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px
}

.content--chat .content-header>div:first-child {
    text-align: left
}

.content--chat .page-meta {
    justify-content: flex-start
}

.content--chat .chat-controls {
    flex-shrink: 0
}

.grid {
    display: grid;
    gap: 20px
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr))
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr))
}

.stat-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr))
}

.note-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr))
}

.row {
    display: flex;
    gap: 12px;
    align-items: center
}

.stack {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr)
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center
}

@media(max-width:1100px) {
    .shell {
        --shell-pad: 12px;
        --shell-gap: 12px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        grid-template-areas: "topbar" "nav" "content"
    }

    .nav {
        position: static;
        max-height: none;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 10px 14px;
        background: var(--bg)
    }

    .nav-group {
        grid-auto-flow: column;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        margin-bottom: 0
    }

    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr
    }

    .topbar {
        position: static;
        padding: 12px 14px;
        gap: 10px
    }

    .topbar-status {
        flex-wrap: wrap
    }

    .table-head,
    .table-row,
    .list-item {
        grid-template-columns: 1fr
    }
}

@media(max-width:1100px) {
    .nav {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 4px;
        padding: 10px 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none
    }

    .nav::-webkit-scrollbar {
        display: none
    }

    .nav-group,
    .nav-group__items {
        display: contents
    }

    .nav-label {
        display: none
    }

    .nav-group--collapsed .nav-group__items {
        display: contents
    }

    .nav-item {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: var(--radius-md);
        white-space: nowrap;
        flex-shrink: 0
    }
}

@media(max-width:600px) {
    .shell {
        --shell-pad: 8px;
        --shell-gap: 8px
    }

    .topbar {
        padding: 10px 12px;
        gap: 8px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center
    }

    .brand {
        flex: 1;
        min-width: 0
    }

    .brand-title {
        font-size: 14px
    }

    .brand-sub {
        display: none
    }

    .topbar-status {
        gap: 6px;
        width: auto;
        flex-wrap: nowrap
    }

    .topbar-status .pill {
        padding: 4px 8px;
        font-size: 11px;
        gap: 4px
    }

    .topbar-status .pill .mono {
        display: none
    }

    .topbar-status .pill span:nth-child(2) {
        display: none
    }

    .nav {
        padding: 8px 10px;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none
    }

    .nav::-webkit-scrollbar {
        display: none
    }

    .nav-group {
        display: contents
    }

    .nav-label {
        display: none
    }

    .nav-item {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: var(--radius-md);
        white-space: nowrap;
        flex-shrink: 0
    }

    .content-header {
        display: none
    }

    .content {
        padding: 4px 4px 16px;
        gap: 12px
    }

    .card {
        padding: 12px;
        border-radius: var(--radius-md)
    }

    .card-title {
        font-size: 13px
    }

    .stat-grid {
        gap: 8px;
        grid-template-columns: repeat(2, 1fr)
    }

    .stat {
        padding: 10px;
        border-radius: var(--radius-md)
    }

    .stat-label {
        font-size: 11px
    }

    .stat-value {
        font-size: 18px
    }

    .note-grid {
        grid-template-columns: 1fr;
        gap: 8px
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px
    }

    .field input,
    .field textarea,
    .field select {
        padding: 8px 10px;
        border-radius: var(--radius-md);
        font-size: 14px
    }

    .btn {
        padding: 8px 12px;
        font-size: 12px
    }

    .pill {
        padding: 4px 10px;
        font-size: 12px
    }

    .chat-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px
    }

    .chat-header__left {
        flex-direction: column;
        align-items: stretch
    }

    .chat-header__right {
        justify-content: space-between
    }

    .chat-session {
        min-width: unset;
        width: 100%
    }

    .chat-thread {
        margin-top: 8px;
        padding: 12px 8px
    }

    .chat-msg {
        max-width: 90%
    }

    .chat-bubble {
        padding: 8px 12px;
        border-radius: var(--radius-md)
    }

    .chat-compose {
        gap: 8px
    }

    .chat-compose__field textarea {
        min-height: 60px;
        padding: 8px 10px;
        border-radius: var(--radius-md);
        font-size: 14px
    }

    .log-stream {
        border-radius: var(--radius-md);
        max-height: 380px
    }

    .log-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 8px
    }

    .log-time {
        font-size: 10px
    }

    .log-level {
        font-size: 9px
    }

    .log-subsystem {
        font-size: 11px
    }

    .log-message {
        font-size: 12px
    }

    .list-item {
        padding: 10px;
        border-radius: var(--radius-md)
    }

    .list-title {
        font-size: 13px
    }

    .list-sub {
        font-size: 11px
    }

    .code-block {
        padding: 8px;
        border-radius: var(--radius-md);
        font-size: 11px
    }

    .theme-toggle {
        --theme-item: 24px;
        --theme-gap: 2px;
        --theme-pad: 3px
    }

    .theme-icon {
        width: 12px;
        height: 12px
    }
}

@media(max-width:400px) {
    .shell {
        --shell-pad: 4px
    }

    .topbar {
        padding: 8px 10px
    }

    .brand-title {
        font-size: 13px
    }

    .nav {
        padding: 6px 8px
    }

    .nav-item {
        padding: 6px 8px;
        font-size: 11px
    }

    .content {
        padding: 4px 4px 12px;
        gap: 10px
    }

    .card {
        padding: 10px
    }

    .stat {
        padding: 8px
    }

    .stat-value {
        font-size: 16px
    }

    .chat-bubble {
        padding: 8px 10px
    }

    .chat-compose__field textarea {
        min-height: 52px;
        padding: 8px 10px;
        font-size: 13px
    }

    .btn {
        padding: 6px 10px;
        font-size: 11px
    }

    .topbar-status .pill {
        padding: 3px 6px;
        font-size: 10px
    }

    .theme-toggle {
        --theme-item: 22px;
        --theme-gap: 2px;
        --theme-pad: 2px
    }

    .theme-icon {
        width: 11px;
        height: 11px
    }
}

.chat {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    padding-bottom: 12px;
    margin-bottom: 12px;
    background: transparent
}

.chat-header__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0
}

.chat-session {
    min-width: 180px
}

.chat-thread {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 4px;
    margin: 0 -4px;
    min-height: 0;
    border-radius: 12px;
    background: transparent
}

.chat-focus-exit {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 100;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease-out, color .15s ease-out, border-color .15s ease-out;
    box-shadow: 0 4px 12px #0003
}

.chat-focus-exit:hover {
    background: var(--panel-strong);
    color: var(--text);
    border-color: var(--accent)
}

.chat-focus-exit svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round
}

.chat-new-messages {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    margin: 8px auto;
    font-size: 13px;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--panel-strong);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    z-index: 10;
    transition: background .15s ease-out, border-color .15s ease-out
}

.chat-new-messages:hover {
    background: var(--panel);
    border-color: var(--accent)
}

.chat-new-messages svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0
}

.chat-compose {
    position: sticky;
    bottom: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding: 12px 4px 4px;
    background: linear-gradient(to bottom, transparent, var(--bg) 20%);
    z-index: 10
}

.chat-attachments {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    background: var(--panel);
    border-radius: 8px;
    border: 1px solid var(--border);
    width: fit-content;
    max-width: 100%;
    align-self: flex-start
}

.chat-attachment {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg)
}

.chat-attachment__img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.chat-attachment__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #000000b3;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s ease-out
}

.chat-attachment:hover .chat-attachment__remove {
    opacity: 1
}

.chat-attachment__remove:hover {
    background: #dc2626e6
}

.chat-attachment__remove svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2px
}

:root[data-theme=light] .chat-attachments {
    background: #f8fafc;
    border-color: #1018281a
}

:root[data-theme=light] .chat-attachment {
    border-color: #10182826;
    background: #fff
}

:root[data-theme=light] .chat-attachment__remove {
    background: #0009
}

.chat-message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px
}

.chat-message-image {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
    cursor: pointer;
    transition: transform .15s ease-out
}

.chat-message-image:hover {
    transform: scale(1.02)
}

.chat-group.user .chat-message-images {
    justify-content: flex-end
}

.chat-compose__row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex: 1
}

:root[data-theme=light] .chat-compose {
    background: linear-gradient(to bottom, transparent, var(--bg-content) 20%)
}

.chat-compose__field {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: stretch
}

.chat-compose__field>span {
    display: none
}

.chat-compose .chat-compose__field textarea {
    width: 100%;
    height: 40px;
    min-height: 40px;
    max-height: 150px;
    padding: 9px 12px;
    border-radius: 8px;
    overflow-y: auto;
    resize: none;
    white-space: pre-wrap;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.45
}

.chat-compose__field textarea:disabled {
    opacity: .7;
    cursor: not-allowed
}

.chat-compose__actions {
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    gap: 8px
}

.chat-compose .chat-compose__actions .btn {
    padding: 0 16px;
    font-size: 13px;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box
}

.chat-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap
}

.chat-controls__session {
    min-width: 140px;
    max-width: 300px
}

.chat-controls__thinking {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px
}

.btn--icon {
    padding: 8px !important;
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: #ffffff0f
}

.chat-controls__separator {
    color: #fff6;
    font-size: 18px;
    margin: 0 8px;
    font-weight: 300
}

:root[data-theme=light] .chat-controls__separator {
    color: #1018284d
}

.btn--icon:hover {
    background: #ffffff1f;
    border-color: #fff3
}

:root[data-theme=light] .btn--icon {
    background: #fff;
    border-color: var(--border);
    box-shadow: 0 1px 2px #1018280d;
    color: var(--muted)
}

:root[data-theme=light] .btn--icon:hover {
    background: #fff;
    border-color: var(--border-strong);
    color: var(--text)
}

.btn--icon svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-linejoin: round
}

.chat-controls__session select {
    padding: 6px 10px;
    font-size: 13px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis
}

.chat-controls__thinking {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 10px;
    background: #ffffff0a;
    border-radius: 6px;
    border: 1px solid var(--border)
}

:root[data-theme=light] .chat-controls__thinking {
    background: #ffffffe6;
    border-color: #10182826
}

@media(max-width:640px) {
    .chat-session {
        min-width: 140px
    }

    .chat-compose {
        grid-template-columns: 1fr
    }

    .chat-controls {
        flex-wrap: wrap;
        gap: 8px
    }

    .chat-controls__session {
        min-width: 120px
    }
}

.chat-thinking {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, .18);
    background: #ffffff0a;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4
}

:root[data-theme=light] .chat-thinking {
    border-color: #10182840;
    background: #1018280a
}

.chat-text {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word
}

.chat-text :where(p+p, p+ul, p+ol, p+pre, p+blockquote) {
    margin-top: .75em
}

.chat-text :where(ul, ol) {
    padding-left: 1.5em
}

.chat-text :where(a) {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px
}

.chat-text :where(a:hover) {
    opacity: .8
}

.chat-text :where(:not(pre)>code) {
    background: #00000026;
    padding: .15em .4em;
    border-radius: 4px
}

.chat-text :where(pre) {
    background: #00000026;
    border-radius: 6px;
    padding: 10px 12px;
    overflow-x: auto
}

.chat-text :where(pre code) {
    background: none;
    padding: 0
}

.chat-text :where(blockquote) {
    border-left: 3px solid var(--border-strong);
    margin-left: 0;
    color: var(--muted);
    background: #ffffff05;
    padding: 8px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0
}

.chat-text :where(blockquote blockquote) {
    margin-top: 8px;
    border-left-color: var(--border-hover);
    background: #ffffff08
}

.chat-text :where(blockquote blockquote blockquote) {
    border-left-color: var(--muted-strong);
    background: #ffffff0a
}

:root[data-theme=light] .chat-text :where(blockquote) {
    background: #00000008
}

:root[data-theme=light] .chat-text :where(blockquote blockquote) {
    background: #0000000d
}

:root[data-theme=light] .chat-text :where(blockquote blockquote blockquote) {
    background: #0000000a
}

:root[data-theme=light] .chat-text :where(:not(pre)>code) {
    background: #00000014;
    border: 1px solid rgba(0, 0, 0, .1)
}

:root[data-theme=light] .chat-text :where(pre) {
    background: #0000000d;
    border: 1px solid rgba(0, 0, 0, .1)
}

.chat-text :where(hr) {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1em 0
}

.chat-text[dir=rtl] {
    text-align: right
}

.chat-text[dir=rtl] :where(ul, ol) {
    padding-left: 0;
    padding-right: 1.5em
}

.chat-text[dir=rtl] :where(blockquote) {
    border-left: none;
    border-right: 3px solid var(--border);
    padding-left: 0;
    padding-right: 1em
}

.chat-group {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
    margin-left: 4px;
    margin-right: 16px
}

.chat-group.user {
    flex-direction: row-reverse;
    justify-content: flex-start
}

.chat-group-messages {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: min(900px, calc(100% - 60px))
}

.chat-group.user .chat-group-messages {
    align-items: flex-end
}

.chat-group.user .chat-group-footer {
    justify-content: flex-end
}

.chat-group-footer {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-top: 6px
}

.chat-sender-name {
    font-weight: 500;
    font-size: 12px;
    color: var(--muted)
}

.chat-group-timestamp {
    font-size: 11px;
    color: var(--muted);
    opacity: .7
}

.chat-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 8px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    -webkit-user-select: none;
    user-select: none
}

.chat-divider__line {
    flex: 1 1 0;
    height: 1px;
    background: var(--border);
    opacity: .9
}

.chat-divider__label {
    padding: 2px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #ffffff05
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--panel-strong);
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 4px
}

.chat-avatar.user {
    background: var(--accent-subtle);
    color: var(--accent)
}

.chat-avatar.assistant,
.chat-avatar.other,
.chat-avatar.tool {
    background: var(--secondary);
    color: var(--muted)
}

img.chat-avatar {
    display: block;
    object-fit: cover;
    object-position: center
}

.chat-bubble {
    position: relative;
    display: inline-block;
    border: 1px solid transparent;
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    box-shadow: none;
    transition: background .15s ease-out, border-color .15s ease-out;
    max-width: 100%;
    word-wrap: break-word
}

.chat-bubble.has-copy {
    padding-right: 36px
}

.chat-copy-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    border-radius: var(--radius-md);
    padding: 4px 6px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease-out, background .12s ease-out
}

.chat-copy-btn__icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
    position: relative
}

.chat-copy-btn__icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-linejoin: round
}

.chat-copy-btn__icon-copy,
.chat-copy-btn__icon-check {
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity .15s ease
}

.chat-copy-btn__icon-check,
.chat-copy-btn[data-copied="1"] .chat-copy-btn__icon-copy {
    opacity: 0
}

.chat-copy-btn[data-copied="1"] .chat-copy-btn__icon-check {
    opacity: 1
}

.chat-bubble:hover .chat-copy-btn {
    opacity: 1;
    pointer-events: auto
}

.chat-copy-btn:hover {
    background: var(--bg-hover)
}

.chat-copy-btn[data-copying="1"] {
    opacity: 0;
    pointer-events: none
}

.chat-copy-btn[data-error="1"] {
    opacity: 1;
    pointer-events: auto;
    border-color: var(--danger-subtle);
    background: var(--danger-subtle);
    color: var(--danger)
}

.chat-copy-btn[data-copied="1"] {
    opacity: 1;
    pointer-events: auto;
    border-color: var(--ok-subtle);
    background: var(--ok-subtle);
    color: var(--ok)
}

.chat-copy-btn:focus-visible {
    opacity: 1;
    pointer-events: auto;
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

@media(hover:none) {
    .chat-copy-btn {
        opacity: 1;
        pointer-events: auto
    }
}

:root[data-theme=light] .chat-bubble {
    border-color: var(--border);
    box-shadow: inset 0 1px 0 var(--card-highlight)
}

.chat-bubble:hover {
    background: var(--bg-hover)
}

.chat-group.user .chat-bubble {
    background: var(--accent-subtle);
    border-color: transparent
}

:root[data-theme=light] .chat-group.user .chat-bubble {
    border-color: #ea580c33;
    background: #fb923c1f
}

.chat-group.user .chat-bubble:hover {
    background: #ff4d4d26
}

.chat-bubble.streaming {
    animation: pulsing-border 1.5s ease-out infinite
}

@keyframes pulsing-border {

    0%,
    to {
        border-color: var(--border)
    }

    50% {
        border-color: var(--accent)
    }
}

.chat-bubble.fade-in {
    animation: fade-in .2s ease-out
}

@keyframes fade-in {
    0% {
        opacity: 0;
        transform: translateY(4px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.chat-tool-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    background: var(--card);
    box-shadow: inset 0 1px 0 var(--card-highlight);
    transition: border-color .15s ease-out, background .15s ease-out;
    max-height: 120px;
    overflow: hidden
}

.chat-tool-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover)
}

.chat-tool-card:first-child {
    margin-top: 0
}

.chat-tool-card--clickable {
    cursor: pointer
}

.chat-tool-card--clickable:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

.chat-tool-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px
}

.chat-tool-card__title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2
}

.chat-tool-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0
}

.chat-tool-card__icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-linejoin: round
}

.chat-tool-card__action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--accent);
    opacity: .8;
    transition: opacity .15s ease-out
}

.chat-tool-card__action svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-linejoin: round
}

.chat-tool-card--clickable:hover .chat-tool-card__action {
    opacity: 1
}

.chat-tool-card__status {
    display: inline-flex;
    align-items: center;
    color: var(--ok)
}

.chat-tool-card__status svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round
}

.chat-tool-card__status-text {
    font-size: 11px;
    margin-top: 4px
}

.chat-tool-card__detail {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px
}

.chat-tool-card__preview {
    font-size: 11px;
    color: var(--muted);
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--secondary);
    border-radius: var(--radius-md);
    white-space: pre-wrap;
    overflow: hidden;
    max-height: 44px;
    line-height: 1.4;
    border: 1px solid var(--border)
}

.chat-tool-card--clickable:hover .chat-tool-card__preview {
    background: var(--bg-hover);
    border-color: var(--border-strong)
}

.chat-tool-card__inline {
    font-size: 11px;
    color: var(--text);
    margin-top: 6px;
    padding: 6px 8px;
    background: var(--secondary);
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    word-break: break-word
}

.chat-reading-indicator {
    background: transparent;
    border: 1px solid var(--border);
    padding: 12px;
    display: inline-flex
}

.chat-reading-indicator__dots {
    display: flex;
    gap: 6px;
    align-items: center
}

.chat-reading-indicator__dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    animation: reading-pulse 1.4s ease-in-out infinite
}

.chat-reading-indicator__dots span:nth-child(1) {
    animation-delay: 0s
}

.chat-reading-indicator__dots span:nth-child(2) {
    animation-delay: .2s
}

.chat-reading-indicator__dots span:nth-child(3) {
    animation-delay: .4s
}

@keyframes reading-pulse {

    0%,
    60%,
    to {
        opacity: .3;
        transform: scale(.8)
    }

    30% {
        opacity: 1;
        transform: scale(1)
    }
}

.chat-split-container {
    display: flex;
    gap: 0;
    flex: 1;
    min-height: 0;
    height: 100%
}

.chat-main {
    min-width: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: flex .25s ease-out
}

.chat-sidebar {
    flex: 1;
    min-width: 300px;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slide-in .2s ease-out
}

@keyframes slide-in {
    0% {
        opacity: 0;
        transform: translate(20px)
    }

    to {
        opacity: 1;
        transform: translate(0)
    }
}

.sidebar-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--panel)
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--panel)
}

.sidebar-header .btn {
    padding: 4px 8px;
    font-size: 14px;
    min-width: auto;
    line-height: 1
}

.sidebar-title {
    font-weight: 600;
    font-size: 14px
}

.sidebar-content {
    flex: 1;
    overflow: auto;
    padding: 16px
}

.sidebar-markdown {
    font-size: 14px;
    line-height: 1.5
}

.sidebar-markdown pre {
    background: #0000001f;
    border-radius: 4px;
    padding: 12px;
    overflow-x: auto
}

.sidebar-markdown code {
    font-family: var(--mono);
    font-size: 13px
}

@media(max-width:768px) {
    .chat-split-container--open {
        position: fixed;
        inset: 0;
        z-index: 1000
    }

    .chat-split-container--open .chat-main {
        display: none
    }

    .chat-split-container--open .chat-sidebar {
        width: 100%;
        min-width: 0;
        border-left: none
    }
}

.update-banner {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0 calc(-1 * var(--shell-pad)) 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    text-align: center;
    font-weight: 500;
    padding: 10px 16px
}

.update-banner__btn {
    margin-left: 8px;
    border-color: var(--danger);
    color: var(--danger);
    font-size: 12px;
    padding: 4px 12px
}

.update-banner__btn:hover:not(:disabled) {
    background: #ef444426
}

.card {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 20px;
    animation: rise .35s var(--ease-out) backwards;
    transition: border-color var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out);
    box-shadow: var(--shadow-sm), inset 0 1px 0 var(--card-highlight)
}

.card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md), inset 0 1px 0 var(--card-highlight)
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--text-strong)
}

.card-sub {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.5
}

.stat {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    border: 1px solid var(--border);
    transition: border-color var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
    box-shadow: inset 0 1px 0 var(--card-highlight)
}

.stat:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm), inset 0 1px 0 var(--card-highlight)
}

.stat-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 6px;
    letter-spacing: -.03em;
    line-height: 1.1
}

.stat-value.ok {
    color: var(--ok)
}

.stat-value.warn {
    color: var(--warn)
}

.stat-card {
    display: grid;
    gap: 6px
}

.note-title {
    font-weight: 600;
    letter-spacing: -.01em
}

.status-list {
    display: grid;
    gap: 8px
}

.status-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border)
}

.status-list div:last-child {
    border-bottom: none
}

.account-count {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted)
}

.account-card-list {
    margin-top: 16px;
    display: grid;
    gap: 12px
}

.account-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    background: var(--bg-elevated);
    transition: border-color var(--duration-fast) ease
}

.account-card:hover {
    border-color: var(--border-strong)
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px
}

.account-card-title {
    font-weight: 500
}

.account-card-id {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted)
}

.account-card-status {
    margin-top: 10px;
    font-size: 13px
}

.account-card-status div {
    padding: 4px 0
}

.account-card-error {
    margin-top: 8px;
    color: var(--danger);
    font-size: 12px
}

.label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--secondary);
    font-size: 13px;
    font-weight: 500;
    transition: border-color var(--duration-fast) ease
}

.pill:hover {
    border-color: var(--border-strong)
}

.pill.danger {
    border-color: var(--danger-subtle);
    background: var(--danger-subtle);
    color: var(--danger)
}

.theme-toggle {
    --theme-item: 28px;
    --theme-gap: 2px;
    --theme-pad: 4px;
    position: relative
}

.theme-toggle__track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, var(--theme-item));
    gap: var(--theme-gap);
    padding: var(--theme-pad);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--secondary)
}

.theme-toggle__indicator {
    position: absolute;
    top: 50%;
    left: var(--theme-pad);
    width: var(--theme-item);
    height: var(--theme-item);
    border-radius: var(--radius-full);
    transform: translateY(-50%) translate(calc(var(--theme-index, 0) * (var(--theme-item) + var(--theme-gap))));
    background: var(--accent);
    transition: transform var(--duration-normal) var(--ease-out);
    z-index: 0
}

.theme-toggle__button {
    height: var(--theme-item);
    width: var(--theme-item);
    display: grid;
    place-items: center;
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: color var(--duration-fast) ease
}

.theme-toggle__button:hover {
    color: var(--text)
}

.theme-toggle__button.active {
    color: var(--accent-foreground)
}

.theme-toggle__button.active .theme-icon {
    stroke: var(--accent-foreground)
}

.theme-icon {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-linejoin: round
}

.statusDot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--danger);
    box-shadow: 0 0 8px #ef444480;
    animation: pulse-subtle 2s ease-in-out infinite
}

.statusDot.ok {
    background: var(--ok);
    box-shadow: 0 0 8px #22c55e80;
    animation: none
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -.01em;
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out)
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm)
}

.btn:active {
    background: var(--secondary);
    transform: translateY(0);
    box-shadow: none
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0
}

.btn.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--primary-foreground);
    box-shadow: 0 1px 2px #0003
}

.btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow)
}

.btn-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 2px 5px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    border-radius: 4px;
    background: #ffffff26;
    color: inherit;
    opacity: .8
}

.btn.primary .btn-kbd {
    background: #fff3
}

:root[data-theme=light] .btn-kbd {
    background: #00000014
}

:root[data-theme=light] .btn.primary .btn-kbd {
    background: #ffffff40
}

.btn.active {
    border-color: var(--accent);
    background: var(--accent-subtle);
    color: var(--accent)
}

.btn.danger {
    border-color: transparent;
    background: var(--danger-subtle);
    color: var(--danger)
}

.btn.danger:hover {
    background: #ef444426
}

.btn--sm {
    padding: 6px 10px;
    font-size: 12px
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed
}

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

.field.full {
    grid-column: 1 / -1
}

.field span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500
}

.field input,
.field textarea,
.field select {
    border: 1px solid var(--input);
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    outline: none;
    box-shadow: inset 0 1px 0 var(--card-highlight);
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--ring);
    box-shadow: var(--focus-ring)
}

.field select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer
}

.field textarea {
    font-family: var(--mono);
    min-height: 160px;
    resize: vertical;
    white-space: pre;
    line-height: 1.5
}

.field.checkbox {
    grid-template-columns: auto 1fr;
    align-items: center
}

.config-form .field.checkbox {
    grid-template-columns: 18px minmax(0, 1fr);
    column-gap: 10px
}

.config-form .field.checkbox input[type=checkbox] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--accent)
}

.form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))
}

:root[data-theme=light] .field input,
:root[data-theme=light] .field textarea,
:root[data-theme=light] .field select {
    background: var(--card);
    border-color: var(--input)
}

:root[data-theme=light] .btn {
    background: var(--bg);
    border-color: var(--input)
}

:root[data-theme=light] .btn:hover {
    background: var(--bg-hover)
}

:root[data-theme=light] .btn.primary {
    background: var(--accent);
    border-color: var(--accent)
}

.muted {
    color: var(--muted)
}

.mono {
    font-family: var(--mono)
}

.callout {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--secondary);
    border: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.5;
    position: relative
}

.callout.danger {
    border-color: #ef444440;
    background: linear-gradient(135deg, #ef444414, #ef44440a);
    color: var(--danger)
}

.callout.info {
    border-color: #3b82f640;
    background: linear-gradient(135deg, #3b82f614, #3b82f60a);
    color: var(--info)
}

.callout.success {
    border-color: #22c55e40;
    background: linear-gradient(135deg, #22c55e14, #22c55e0a);
    color: var(--ok)
}

.compaction-indicator {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 1.2;
    padding: 6px 14px;
    margin-bottom: 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-strong);
    color: var(--text);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    animation: fade-in .2s var(--ease-out)
}

.compaction-indicator svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5px;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0
}

.compaction-indicator--active {
    color: var(--info);
    border-color: #3b82f659
}

.compaction-indicator--active svg {
    animation: compaction-spin 1s linear infinite
}

.compaction-indicator--complete {
    color: var(--ok);
    border-color: #22c55e59
}

.compaction-indicator--fallback {
    color: #d97706;
    border-color: #d9770659
}

.compaction-indicator--fallback-cleared {
    color: var(--ok);
    border-color: #22c55e59
}

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

.code-block {
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.5;
    background: var(--secondary);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    max-height: 360px;
    overflow: auto;
    max-width: 100%
}

:root[data-theme=light] .code-block,
:root[data-theme=light] .list-item,
:root[data-theme=light] .table-row,
:root[data-theme=light] .chip {
    background: var(--bg)
}

.list {
    display: grid;
    gap: 8px;
    container-type: inline-size
}

.list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
    gap: 16px;
    align-items: start;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    background: var(--card);
    transition: border-color var(--duration-fast) ease
}

.list-item-clickable {
    cursor: pointer
}

.list-item-clickable:hover {
    border-color: var(--border-strong)
}

.list-item-selected {
    border-color: var(--accent);
    box-shadow: var(--focus-ring)
}

.list-main {
    display: grid;
    gap: 4px;
    min-width: 0
}

.list-title {
    font-weight: 500
}

.list-sub {
    color: var(--muted);
    font-size: 12px
}

.list-meta {
    text-align: right;
    color: var(--muted);
    font-size: 12px;
    display: grid;
    gap: 4px;
    min-width: 200px
}

.list-meta .btn {
    padding: 6px 10px
}

.list-meta .field input,
.list-meta .field textarea,
.list-meta .field select {
    width: 100%
}

.cron-job-payload,
.cron-job-agent,
.cron-job-state {
    overflow-wrap: anywhere;
    word-break: break-word
}

.cron-job .list-title {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -.015em
}

.cron-job {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    grid-template-areas: "main meta" "footer footer";
    row-gap: 10px
}

.cron-job .list-main {
    grid-area: main
}

.cron-job .list-meta {
    grid-area: meta;
    min-width: 240px;
    gap: 8px
}

.cron-job-footer {
    grid-area: footer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 10px
}

.cron-job-chips {
    flex: 1 1 auto
}

.cron-job-detail {
    display: grid;
    gap: 3px;
    margin-top: 2px
}

.cron-job-detail-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase
}

.cron-job-detail-value {
    font-size: 13px;
    line-height: 1.35
}

.cron-job-state {
    display: grid;
    gap: 4px
}

.cron-job-state-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px
}

.cron-job-state-key {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase
}

.cron-job-state-value {
    color: var(--text);
    font-size: 12px;
    white-space: nowrap
}

.cron-job-status-pill {
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 2px 8px;
    text-transform: lowercase
}

.cron-job-status-ok {
    color: var(--ok);
    border-color: #22c55e59;
    background: var(--ok-subtle)
}

.cron-job-status-error {
    color: var(--danger);
    border-color: #ef444459;
    background: var(--danger-subtle)
}

.cron-job-status-skipped {
    color: var(--warn);
    border-color: #f59e0b59;
    background: var(--warn-subtle)
}

.cron-job-status-na {
    color: var(--muted)
}

.cron-job-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 0
}

.cron-job-actions .btn {
    flex: 0 0 auto
}

@container (max-width: 560px) {
    .list-item {
        grid-template-columns: 1fr
    }

    .list-meta {
        min-width: 0;
        text-align: left
    }

    .cron-job-actions {
        justify-content: flex-start
    }

    .cron-job {
        grid-template-columns: 1fr;
        grid-template-areas: "main" "meta" "footer"
    }

    .cron-job-footer {
        flex-direction: column;
        align-items: stretch
    }
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.chip {
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 5px 12px;
    color: var(--muted);
    background: var(--secondary);
    transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out)
}

.chip:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px)
}

.chip input {
    margin-right: 6px
}

.chip-ok {
    color: var(--ok);
    border-color: #22c55e4d;
    background: var(--ok-subtle)
}

.chip-warn {
    color: var(--warn);
    border-color: #f59e0b4d;
    background: var(--warn-subtle)
}

.chip-danger {
    color: var(--danger);
    border-color: #ef44444d;
    background: var(--danger-subtle)
}

.table {
    display: grid;
    gap: 6px
}

.table-head,
.table-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr .8fr .7fr .8fr .8fr .8fr .8fr .6fr;
    gap: 12px;
    align-items: center
}

.table-head {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    padding: 0 12px
}

.table-row {
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--card);
    transition: border-color var(--duration-fast) ease
}

.table-row:hover {
    border-color: var(--border-strong)
}

.session-link {
    text-decoration: none;
    color: var(--accent);
    font-weight: 500
}

.session-link:hover {
    text-decoration: underline
}

.session-key-cell {
    display: grid;
    gap: 4px;
    min-width: 0
}

.session-key-cell .session-link,
.session-key-display-name {
    overflow-wrap: anywhere;
    word-break: break-word
}

.session-key-display-name {
    font-size: 11px
}

.log-stream {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    max-height: 500px;
    overflow: auto;
    container-type: inline-size
}

.log-row {
    display: grid;
    grid-template-columns: 90px 70px minmax(140px, 200px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    transition: background var(--duration-fast) ease
}

.log-row:hover {
    background: var(--bg-hover)
}

.log-row:last-child {
    border-bottom: none
}

.log-time {
    color: var(--muted);
    font-family: var(--mono)
}

.log-level {
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    width: fit-content
}

.log-level.trace,
.log-level.debug {
    color: var(--muted)
}

.log-level.info {
    color: var(--info);
    border-color: #3b82f64d
}

.log-level.warn {
    color: var(--warn);
    border-color: var(--warn-subtle)
}

.log-level.error,
.log-level.fatal {
    color: var(--danger);
    border-color: var(--danger-subtle)
}

.log-chip.trace,
.log-chip.debug {
    color: var(--muted)
}

.log-chip.info {
    color: var(--info);
    border-color: #3b82f64d
}

.log-chip.warn {
    color: var(--warn);
    border-color: var(--warn-subtle)
}

.log-chip.error,
.log-chip.fatal {
    color: var(--danger);
    border-color: var(--danger-subtle)
}

.log-subsystem {
    color: var(--muted);
    font-family: var(--mono)
}

.log-message {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--mono)
}

@container (max-width: 620px) {
    .log-row {
        grid-template-columns: 70px 60px minmax(0, 1fr)
    }

    .log-subsystem {
        display: none
    }
}

.chat {
    display: flex;
    flex-direction: column;
    min-height: 0
}

.shell--chat .chat {
    flex: 1
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap
}

.chat-header__left {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0
}

.chat-header__right {
    display: flex;
    align-items: center;
    gap: 8px
}

.chat-session {
    min-width: 240px
}

.chat-thread {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
    min-width: 0;
    border-radius: 0;
    border: none;
    background: transparent
}

.chat-queue {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
    display: grid;
    gap: 8px
}

.chat-queue__title {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--muted)
}

.chat-queue__list {
    display: grid;
    gap: 8px
}

.chat-queue__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-strong);
    background: var(--secondary)
}

.chat-queue__text {
    color: var(--chat-text);
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical
}

.chat-queue__remove {
    align-self: start;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1
}

.chat-new-messages {
    align-self: center;
    margin: 8px auto 0;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1
}

.chat-line {
    display: flex
}

.chat-line.user {
    justify-content: flex-end
}

.chat-line.assistant,
.chat-line.other {
    justify-content: flex-start
}

.chat-msg {
    display: grid;
    gap: 6px;
    max-width: min(700px, 82%)
}

.chat-line.user .chat-msg {
    justify-items: end
}

.chat-bubble {
    border: 1px solid transparent;
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    min-width: 0
}

:root[data-theme=light] .chat-bubble {
    border-color: var(--border);
    background: var(--bg)
}

.chat-line.user .chat-bubble {
    border-color: transparent;
    background: var(--accent-subtle)
}

:root[data-theme=light] .chat-line.user .chat-bubble {
    border-color: #ea580c33;
    background: #fb923c1f
}

.chat-line.assistant .chat-bubble {
    border-color: transparent;
    background: var(--secondary)
}

:root[data-theme=light] .chat-line.assistant .chat-bubble {
    border-color: var(--border);
    background: var(--bg-muted)
}

@keyframes chatStreamPulse {

    0%,
    to {
        border-color: var(--border)
    }

    50% {
        border-color: var(--accent)
    }
}

.chat-bubble.streaming {
    animation: chatStreamPulse 1.5s ease-in-out infinite
}

@media(prefers-reduced-motion:reduce) {
    .chat-bubble.streaming {
        animation: none;
        border-color: var(--accent)
    }
}

.chat-bubble.chat-reading-indicator {
    width: fit-content;
    padding: 10px 16px
}

.chat-reading-indicator__dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 12px
}

.chat-reading-indicator__dots>span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--muted);
    opacity: .6;
    transform: translateY(0);
    animation: chatReadingDot 1.2s ease-in-out infinite;
    will-change: transform, opacity
}

.chat-reading-indicator__dots>span:nth-child(2) {
    animation-delay: .15s
}

.chat-reading-indicator__dots>span:nth-child(3) {
    animation-delay: .3s
}

@keyframes chatReadingDot {

    0%,
    80%,
    to {
        opacity: .4;
        transform: translateY(0)
    }

    40% {
        opacity: 1;
        transform: translateY(-3px)
    }
}

@media(prefers-reduced-motion:reduce) {
    .chat-reading-indicator__dots>span {
        animation: none;
        opacity: .6
    }
}

.chat-text {
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--chat-text);
    line-height: 1.5
}

.chat-text :where(p, ul, ol, pre, blockquote, table) {
    margin: 0
}

.chat-text :where(p+p, p+ul, p+ol, p+pre, p+blockquote, p+table) {
    margin-top: .75em
}

.chat-text :where(ul, ol) {
    padding-left: 1.2em
}

.chat-text :where(li+li) {
    margin-top: .25em
}

.chat-text :where(a) {
    color: var(--accent)
}

.chat-text :where(a:hover) {
    text-decoration: underline
}

.chat-text :where(blockquote) {
    border-left: 2px solid var(--border-strong);
    padding-left: 12px;
    color: var(--muted)
}

.chat-text :where(hr) {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1em 0
}

.chat-text :where(code) {
    font-family: var(--mono);
    font-size: .9em
}

.chat-text :where(:not(pre)>code) {
    padding: .15em .35em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--secondary)
}

:root[data-theme=light] .chat-text :where(:not(pre)>code) {
    background: var(--bg-muted)
}

.chat-text :where(pre) {
    margin-top: .75em;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--secondary);
    overflow: auto
}

:root[data-theme=light] .chat-text :where(pre) {
    background: var(--bg-muted)
}

.chat-text :where(pre code) {
    font-size: 12px;
    white-space: pre
}

.chat-text :where(table) {
    margin-top: .75em;
    border-collapse: collapse;
    width: 100%;
    font-size: 13px
}

.chat-text :where(th, td) {
    border: 1px solid var(--border);
    padding: 6px 10px;
    vertical-align: top
}

.chat-text :where(th) {
    font-family: var(--mono);
    font-weight: 500;
    color: var(--muted);
    background: var(--secondary)
}

.chat-tool-card {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--secondary);
    display: grid;
    gap: 4px
}

:root[data-theme=light] .chat-tool-card {
    background: var(--bg-muted)
}

.chat-tool-card__title {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text)
}

.chat-tool-card__detail {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted)
}

.chat-tool-card__details {
    margin-top: 6px
}

.chat-tool-card__summary {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.chat-tool-card__summary::-webkit-details-marker {
    display: none
}

.chat-tool-card__summary-meta {
    color: var(--muted);
    opacity: .7
}

.chat-tool-card__details[open] .chat-tool-card__summary {
    color: var(--text)
}

.chat-tool-card__output {
    margin-top: 8px;
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    color: var(--chat-text);
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card)
}

:root[data-theme=light] .chat-tool-card__output {
    background: var(--bg)
}

.chat-stamp {
    font-size: 11px;
    color: var(--muted)
}

.chat-line.user .chat-stamp {
    text-align: right
}

.chat-compose {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px
}

.shell--chat .chat-compose {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 0;
    padding-top: 12px;
    background: linear-gradient(180deg, transparent 0%, var(--bg) 40%)
}

.shell--chat-focus .chat-compose {
    bottom: calc(var(--shell-pad) + 8px);
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg)
}

.chat-compose__field {
    gap: 4px
}

.chat-compose__field textarea {
    min-height: 72px;
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    resize: vertical;
    white-space: pre-wrap;
    font-family: var(--font-body);
    line-height: 1.5;
    border: 1px solid var(--input);
    background: var(--card);
    box-shadow: inset 0 1px 0 var(--card-highlight);
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease
}

.chat-compose__field textarea:focus {
    border-color: var(--ring);
    box-shadow: var(--focus-ring)
}

.chat-compose__field textarea:disabled {
    opacity: .5;
    cursor: not-allowed
}

.chat-compose__actions {
    justify-content: flex-end;
    align-self: end
}

@media(max-width:900px) {
    .chat-session {
        min-width: 180px
    }

    .chat-compose {
        grid-template-columns: 1fr
    }
}

.qr-wrap {
    margin-top: 16px;
    border-radius: var(--radius-md);
    background: var(--card);
    border: 1px dashed var(--border-strong);
    padding: 16px;
    display: inline-flex
}

.qr-wrap img {
    width: 160px;
    height: 160px;
    border-radius: var(--radius-sm);
    image-rendering: pixelated
}

.exec-approval-overlay {
    position: fixed;
    inset: 0;
    background: #000c;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 200
}

.exec-approval-card {
    width: min(540px, 100%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    animation: scale-in .2s var(--ease-out)
}

.exec-approval-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px
}

.exec-approval-title {
    font-size: 14px;
    font-weight: 600
}

.exec-approval-sub {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px
}

.exec-approval-queue {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 4px 10px
}

.exec-approval-command {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    word-break: break-word;
    white-space: pre-wrap;
    font-family: var(--mono);
    font-size: 13px
}

.exec-approval-meta {
    margin-top: 12px;
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--muted)
}

.exec-approval-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px
}

.exec-approval-meta-row span:last-child {
    color: var(--text);
    font-family: var(--mono)
}

.exec-approval-error {
    margin-top: 10px;
    font-size: 13px;
    color: var(--danger)
}

.exec-approval-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.agents-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 16px
}

.agents-sidebar {
    display: grid;
    gap: 12px;
    align-self: start
}

.agents-main {
    display: grid;
    gap: 16px
}

.agent-list {
    display: grid;
    gap: 8px
}

.agent-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color var(--duration-fast) ease
}

.agent-row:hover {
    border-color: var(--border-strong)
}

.agent-row.active {
    border-color: var(--accent);
    box-shadow: var(--focus-ring)
}

.agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--secondary);
    display: grid;
    place-items: center;
    font-weight: 600
}

.agent-avatar--lg {
    width: 48px;
    height: 48px;
    font-size: 20px
}

.agent-info {
    display: grid;
    gap: 2px;
    min-width: 0
}

.agent-title {
    font-weight: 600
}

.agent-sub {
    color: var(--muted);
    font-size: 12px
}

.agent-pill {
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 4px 10px;
    font-size: 11px;
    color: var(--muted);
    background: var(--secondary);
    text-transform: uppercase;
    letter-spacing: .04em
}

.agent-pill.warn {
    color: var(--warn);
    border-color: var(--warn)
}

.agent-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center
}

.agent-header-main {
    display: flex;
    gap: 16px;
    align-items: center
}

.agent-header-meta {
    display: grid;
    justify-items: end;
    gap: 6px;
    color: var(--muted)
}

.agent-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.agent-tab {
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    background: var(--secondary);
    cursor: pointer;
    transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease
}

.agent-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff
}

.agents-overview-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))
}

.agent-kv {
    display: grid;
    gap: 6px;
    min-width: 0
}

.agent-kv>div {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word
}

.agent-kv-sub {
    font-size: 12px
}

.agent-model-select {
    display: grid;
    gap: 12px
}

.agent-model-meta {
    display: grid;
    gap: 6px;
    min-width: 200px
}

.agent-files-grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 16px
}

.agent-files-list {
    display: grid;
    gap: 8px
}

.agent-file-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color var(--duration-fast) ease
}

.agent-file-row:hover {
    border-color: var(--border-strong)
}

.agent-file-row.active {
    border-color: var(--accent);
    box-shadow: var(--focus-ring)
}

.agent-file-name {
    font-weight: 600
}

.agent-file-meta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px
}

.agent-files-editor {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    background: var(--card)
}

.agent-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap
}

.agent-file-title {
    font-weight: 600
}

.agent-file-sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px
}

.agent-file-actions {
    display: flex;
    gap: 8px
}

.agent-tools-meta {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr))
}

.agent-tools-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px
}

.agent-tools-grid {
    display: grid;
    gap: 16px
}

.agent-tools-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    background: var(--bg-elevated)
}

.agent-tools-header {
    font-weight: 600;
    margin-bottom: 10px
}

.agent-tools-list {
    display: grid;
    gap: 8px 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr))
}

.agent-tool-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card)
}

.agent-tool-title {
    font-weight: 600;
    font-size: 13px
}

.agent-tool-sub {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px
}

.agent-skills-groups {
    display: grid;
    gap: 16px
}

.agent-skills-group {
    display: grid;
    gap: 10px
}

.agent-skills-group summary {
    list-style: none
}

.agent-skills-header {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    cursor: pointer;
    gap: 8px
}

.agent-skills-header>span:last-child {
    margin-left: auto
}

.agent-skills-group summary::-webkit-details-marker {
    display: none
}

.agent-skills-group summary::marker {
    content: ""
}

.agent-skills-header:after {
    content: "▸";
    font-size: 12px;
    color: var(--muted);
    transition: transform var(--duration-fast) ease;
    margin-left: 8px
}

.agent-skills-group[open] .agent-skills-header:after {
    transform: rotate(90deg)
}

.agent-skill-row {
    align-items: flex-start;
    gap: 18px
}

.agent-skill-row .list-meta {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    min-width: auto
}

.skills-grid {
    grid-template-columns: 1fr
}

@container (min-width: 900px) {
    .skills-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(max-width:980px) {

    .agents-layout,
    .agent-header {
        grid-template-columns: 1fr
    }

    .agent-header-meta {
        justify-items: start
    }

    .agent-files-grid,
    .agent-tools-list {
        grid-template-columns: 1fr
    }
}

.config-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 0;
    height: calc(100vh - 160px);
    margin: -16px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--panel)
}

.config-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--bg-accent);
    border-right: 1px solid var(--border);
    min-height: 0;
    overflow: hidden
}

:root[data-theme=light] .config-sidebar {
    background: var(--bg-hover)
}

.config-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
    border-bottom: 1px solid var(--border)
}

.config-sidebar__title {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -.01em
}

.config-sidebar__footer {
    margin-top: auto;
    padding: 14px;
    border-top: 1px solid var(--border)
}

.config-search {
    position: relative;
    padding: 14px;
    border-bottom: 1px solid var(--border)
}

.config-search__icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none
}

.config-search__input {
    width: 100%;
    padding: 11px 36px 11px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    font-size: 13px;
    outline: none;
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease
}

.config-search__input::placeholder {
    color: var(--muted)
}

.config-search__input:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
    background: var(--bg-hover)
}

:root[data-theme=light] .config-search__input {
    background: #fff
}

:root[data-theme=light] .config-search__input:focus {
    background: #fff
}

.config-search__clear {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--bg-hover);
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease
}

.config-search__clear:hover {
    background: var(--border-strong);
    color: var(--text)
}

.config-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px
}

.config-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease
}

.config-nav__item:hover {
    background: var(--bg-hover);
    color: var(--text)
}

:root[data-theme=light] .config-nav__item:hover {
    background: #0000000a
}

.config-nav__item.active {
    background: var(--accent-subtle);
    color: var(--accent)
}

.config-nav__icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    opacity: .7
}

.config-nav__item:hover .config-nav__icon,
.config-nav__item.active .config-nav__icon {
    opacity: 1
}

.config-nav__icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none
}

.config-nav__label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.config-mode-toggle {
    display: flex;
    padding: 4px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border)
}

:root[data-theme=light] .config-mode-toggle {
    background: #fff
}

.config-mode-toggle__btn {
    flex: 1;
    padding: 9px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease
}

.config-mode-toggle__btn:hover {
    color: var(--text)
}

.config-mode-toggle__btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm)
}

.config-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    background: var(--panel);
    overflow: hidden
}

.config-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 22px;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border)
}

:root[data-theme=light] .config-actions {
    background: var(--bg-hover)
}

.config-actions__left,
.config-actions__right {
    display: flex;
    align-items: center;
    gap: 10px
}

.config-changes-badge {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--accent-subtle);
    border: 1px solid rgba(255, 77, 77, .3);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600
}

.config-status {
    font-size: 13px;
    color: var(--muted)
}

.config-diff {
    margin: 18px 22px 0;
    border: 1px solid rgba(255, 77, 77, .25);
    border-radius: var(--radius-lg);
    background: var(--accent-subtle);
    overflow: hidden
}

.config-diff__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    list-style: none
}

.config-diff__summary::-webkit-details-marker {
    display: none
}

.config-diff__chevron {
    width: 16px;
    height: 16px;
    transition: transform var(--duration-normal) var(--ease-out)
}

.config-diff__chevron svg {
    width: 100%;
    height: 100%
}

.config-diff[open] .config-diff__chevron {
    transform: rotate(180deg)
}

.config-diff__content {
    padding: 0 18px 18px;
    display: grid;
    gap: 10px
}

.config-diff__item {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    font-size: 12px;
    font-family: var(--mono)
}

:root[data-theme=light] .config-diff__item {
    background: #fff
}

.config-diff__path {
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0
}

.config-diff__values {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap
}

.config-diff__from {
    color: var(--danger);
    opacity: .85
}

.config-diff__arrow {
    color: var(--muted)
}

.config-diff__to {
    color: var(--ok)
}

.config-section-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-accent)
}

:root[data-theme=light] .config-section-hero {
    background: var(--bg-hover)
}

.config-section-hero__icon {
    width: 30px;
    height: 30px;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center
}

.config-section-hero__icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none
}

.config-section-hero__text {
    display: grid;
    gap: 3px;
    min-width: 0
}

.config-section-hero__title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.config-section-hero__desc {
    font-size: 13px;
    color: var(--muted)
}

.config-subnav {
    display: flex;
    gap: 8px;
    padding: 12px 22px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-accent);
    overflow-x: auto
}

:root[data-theme=light] .config-subnav {
    background: var(--bg-hover)
}

.config-subnav__item {
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: var(--bg-elevated);
    cursor: pointer;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease, border-color var(--duration-fast) ease;
    white-space: nowrap
}

:root[data-theme=light] .config-subnav__item {
    background: #fff
}

.config-subnav__item:hover {
    color: var(--text);
    border-color: var(--border)
}

.config-subnav__item.active {
    color: var(--accent);
    border-color: #ff4d4d66;
    background: var(--accent-subtle)
}

.config-content {
    flex: 1;
    overflow-y: auto;
    padding: 22px
}

.config-raw-field textarea {
    min-height: 500px;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.55
}

.config-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 80px 24px;
    color: var(--muted)
}

.config-loading__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: var(--radius-full);
    animation: spin .75s linear infinite
}

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

.config-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 80px 24px;
    text-align: center
}

.config-empty__icon {
    font-size: 56px;
    opacity: .35
}

.config-empty__text {
    color: var(--muted);
    font-size: 15px
}

.config-form--modern {
    display: grid;
    gap: 26px
}

.config-section-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    overflow: hidden;
    transition: border-color var(--duration-fast) ease
}

.config-section-card:hover {
    border-color: var(--border-strong)
}

:root[data-theme=light] .config-section-card {
    background: #fff
}

.config-section-card__header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border)
}

:root[data-theme=light] .config-section-card__header {
    background: var(--bg-hover)
}

.config-section-card__icon {
    width: 34px;
    height: 34px;
    color: var(--accent);
    flex-shrink: 0
}

.config-section-card__icon svg {
    width: 100%;
    height: 100%
}

.config-section-card__titles {
    flex: 1;
    min-width: 0
}

.config-section-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.config-section-card__desc {
    margin: 5px 0 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.45
}

.config-section-card__content {
    padding: 22px
}

.cfg-fields {
    display: grid;
    gap: 22px
}

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

.cfg-field--error {
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--danger-subtle);
    border: 1px solid rgba(239, 68, 68, .3)
}

.cfg-field__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text)
}

.cfg-field__help {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45
}

.cfg-field__error {
    font-size: 12px;
    color: var(--danger)
}

.cfg-input-wrap {
    display: flex;
    gap: 10px
}

.cfg-input {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-accent);
    font-size: 14px;
    outline: none;
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease
}

.cfg-input::placeholder {
    color: var(--muted);
    opacity: .7
}

.cfg-input:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
    background: var(--bg-hover)
}

:root[data-theme=light] .cfg-input {
    background: #fff
}

:root[data-theme=light] .cfg-input:focus {
    background: #fff
}

.cfg-input--sm {
    padding: 9px 12px;
    font-size: 13px
}

.cfg-input__reset {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease
}

.cfg-input__reset:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text)
}

.cfg-input__reset:disabled {
    opacity: .5;
    cursor: not-allowed
}

.cfg-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-accent);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.55;
    resize: vertical;
    outline: none;
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease
}

.cfg-textarea:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring)
}

:root[data-theme=light] .cfg-textarea {
    background: #fff
}

.cfg-textarea--sm {
    padding: 10px 12px;
    font-size: 12px
}

.cfg-number {
    display: inline-flex;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-accent)
}

:root[data-theme=light] .cfg-number {
    background: #fff
}

.cfg-number__btn {
    width: 44px;
    border: none;
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 18px;
    font-weight: 300;
    cursor: pointer;
    transition: background var(--duration-fast) ease
}

.cfg-number__btn:hover:not(:disabled) {
    background: var(--bg-hover)
}

.cfg-number__btn:disabled {
    opacity: .4;
    cursor: not-allowed
}

:root[data-theme=light] .cfg-number__btn {
    background: var(--bg-hover)
}

:root[data-theme=light] .cfg-number__btn:hover:not(:disabled) {
    background: var(--border)
}

.cfg-number__input {
    width: 85px;
    padding: 11px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: transparent;
    font-size: 14px;
    text-align: center;
    outline: none;
    -moz-appearance: textfield
}

.cfg-number__input::-webkit-outer-spin-button,
.cfg-number__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0
}

.cfg-select {
    padding: 11px 40px 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background-color: var(--bg-accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    appearance: none;
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease
}

.cfg-select:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring)
}

:root[data-theme=light] .cfg-select {
    background-color: #fff
}

.cfg-segmented {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-accent)
}

:root[data-theme=light] .cfg-segmented {
    background: var(--bg-hover)
}

.cfg-segmented__btn {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease
}

.cfg-segmented__btn:hover:not(:disabled):not(.active) {
    color: var(--text)
}

.cfg-segmented__btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm)
}

.cfg-segmented__btn:disabled {
    opacity: .5;
    cursor: not-allowed
}

.cfg-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-accent);
    cursor: pointer;
    transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease
}

.cfg-toggle-row:hover:not(.disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong)
}

.cfg-toggle-row.disabled {
    opacity: .55;
    cursor: not-allowed
}

:root[data-theme=light] .cfg-toggle-row {
    background: #fff
}

:root[data-theme=light] .cfg-toggle-row:hover:not(.disabled) {
    background: var(--bg-hover)
}

.cfg-toggle-row__content {
    flex: 1;
    min-width: 0
}

.cfg-toggle-row__label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text)
}

.cfg-toggle-row__help {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45
}

.cfg-toggle {
    position: relative;
    flex-shrink: 0
}

.cfg-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0
}

.cfg-toggle__track {
    display: block;
    width: 50px;
    height: 28px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    position: relative;
    transition: background var(--duration-normal) ease, border-color var(--duration-normal) ease
}

:root[data-theme=light] .cfg-toggle__track {
    background: var(--border)
}

.cfg-toggle__track:after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--text);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-normal) var(--ease-out), background var(--duration-normal) ease
}

.cfg-toggle input:checked+.cfg-toggle__track {
    background: var(--ok-subtle);
    border-color: #22c55e66
}

.cfg-toggle input:checked+.cfg-toggle__track:after {
    transform: translate(22px);
    background: var(--ok)
}

.cfg-toggle input:focus+.cfg-toggle__track {
    box-shadow: var(--focus-ring)
}

.cfg-object {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-accent);
    overflow: hidden
}

:root[data-theme=light] .cfg-object {
    background: #fff
}

.cfg-object__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    transition: background var(--duration-fast) ease
}

.cfg-object__header:hover {
    background: var(--bg-hover)
}

.cfg-object__header::-webkit-details-marker {
    display: none
}

.cfg-object__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text)
}

.cfg-object__chevron {
    width: 18px;
    height: 18px;
    color: var(--muted);
    transition: transform var(--duration-normal) var(--ease-out)
}

.cfg-object__chevron svg {
    width: 100%;
    height: 100%
}

.cfg-object[open] .cfg-object__chevron {
    transform: rotate(180deg)
}

.cfg-object__help {
    padding: 0 18px 14px;
    font-size: 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--border)
}

.cfg-object__content {
    padding: 18px;
    display: grid;
    gap: 18px
}

.cfg-array {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden
}

.cfg-array__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border)
}

:root[data-theme=light] .cfg-array__header {
    background: var(--bg-hover)
}

.cfg-array__label {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text)
}

.cfg-array__count {
    font-size: 12px;
    color: var(--muted);
    padding: 4px 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full)
}

:root[data-theme=light] .cfg-array__count {
    background: #fff
}

.cfg-array__add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--duration-fast) ease
}

.cfg-array__add:hover:not(:disabled) {
    background: var(--bg-hover)
}

.cfg-array__add:disabled {
    opacity: .5;
    cursor: not-allowed
}

.cfg-array__add-icon {
    width: 14px;
    height: 14px
}

.cfg-array__add-icon svg {
    width: 100%;
    height: 100%
}

.cfg-array__help {
    padding: 12px 18px;
    font-size: 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--border)
}

.cfg-array__empty {
    padding: 36px 18px;
    text-align: center;
    color: var(--muted);
    font-size: 13px
}

.cfg-array__items {
    display: grid;
    gap: 1px;
    background: var(--border)
}

.cfg-array__item {
    background: var(--panel)
}

.cfg-array__item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border)
}

:root[data-theme=light] .cfg-array__item-header {
    background: var(--bg-hover)
}

.cfg-array__item-index {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em
}

.cfg-array__item-remove {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease
}

.cfg-array__item-remove svg {
    width: 16px;
    height: 16px
}

.cfg-array__item-remove:hover:not(:disabled) {
    background: var(--danger-subtle);
    color: var(--danger)
}

.cfg-array__item-remove:disabled {
    opacity: .4;
    cursor: not-allowed
}

.cfg-array__item-content {
    padding: 18px
}

.cfg-map {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden
}

.cfg-map__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border)
}

:root[data-theme=light] .cfg-map__header {
    background: var(--bg-hover)
}

.cfg-map__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted)
}

.cfg-map__add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--duration-fast) ease
}

.cfg-map__add:hover:not(:disabled) {
    background: var(--bg-hover)
}

.cfg-map__add-icon {
    width: 14px;
    height: 14px
}

.cfg-map__add-icon svg {
    width: 100%;
    height: 100%
}

.cfg-map__empty {
    padding: 28px 18px;
    text-align: center;
    color: var(--muted);
    font-size: 13px
}

.cfg-map__items {
    display: grid;
    gap: 10px;
    padding: 14px
}

.cfg-map__item {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 10px;
    align-items: start
}

.cfg-map__item-key,
.cfg-map__item-value {
    min-width: 0
}

.cfg-map__item-remove {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease
}

.cfg-map__item-remove svg {
    width: 16px;
    height: 16px
}

.cfg-map__item-remove:hover:not(:disabled) {
    background: var(--danger-subtle);
    color: var(--danger)
}

.pill--sm {
    padding: 5px 12px;
    font-size: 11px
}

.pill--ok {
    border-color: #22c55e59;
    color: var(--ok)
}

.pill--danger {
    border-color: #ef444459;
    color: var(--danger)
}

@media(max-width:768px) {
    .config-layout {
        grid-template-columns: 1fr
    }

    .config-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border)
    }

    .config-sidebar__header {
        padding: 14px 16px
    }

    .config-nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 10px 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch
    }

    .config-nav__item {
        flex: 0 0 auto;
        padding: 9px 14px;
        white-space: nowrap
    }

    .config-nav__label {
        display: inline
    }

    .config-sidebar__footer {
        display: none
    }

    .config-actions {
        flex-wrap: wrap;
        padding: 14px 16px
    }

    .config-actions__left,
    .config-actions__right {
        width: 100%;
        justify-content: center
    }

    .config-section-hero {
        padding: 14px 16px
    }

    .config-subnav {
        padding: 10px 16px 12px
    }

    .config-content {
        padding: 18px
    }

    .config-section-card__header {
        padding: 16px 18px
    }

    .config-section-card__content {
        padding: 18px
    }

    .cfg-toggle-row {
        padding: 14px 16px
    }

    .cfg-map__item {
        grid-template-columns: 1fr;
        gap: 10px
    }

    .cfg-map__item-remove {
        justify-self: end
    }
}

@media(max-width:480px) {
    .config-nav__icon {
        width: 26px;
        height: 26px;
        font-size: 17px
    }

    .config-nav__label {
        display: none
    }

    .config-section-card__icon {
        width: 30px;
        height: 30px
    }

    .config-section-card__title {
        font-size: 16px
    }

    .cfg-segmented {
        flex-wrap: wrap
    }

    .cfg-segmented__btn {
        flex: 1 0 auto;
        min-width: 70px
    }
}

/* --- CYBER-SPARK AESTHETIC --- */
:root {
    --accent-glow: rgba(255, 63, 63, 0.18);
}

body {
    background-image: radial-gradient(circle at 0% 0%, var(--accent-glow) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Typography Enhancements */
h1,
.page-title,
.brand-title,
strong {
    font-family: var(--font-display) !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase;
}

.mono,
.chat-stamp,
.nav-label,
.log-time,
.status-pill span {
    font-family: var(--font-mono) !important;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Sidebar & Topbar */
.nav,
.topbar {
    background: var(--bg-accent) !important;
    border-color: var(--border) !important;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

/* Navigation items */
.nav-item.active {
    background: linear-gradient(90deg, rgba(255, 63, 63, 0.15), rgba(255, 63, 63, 0.05)) !important;
    border-left: 2px solid var(--accent) !important;
    color: var(--text) !important;
}

/* Chat Bubbles */
.chat-line.user .chat-bubble {
    background: linear-gradient(135deg, #c0392b, var(--accent)) !important;
    border-top-right-radius: 4px !important;
    color: #fff !important;
    box-shadow: 0 4px 20px rgba(255, 63, 63, 0.25) !important;
}

.chat-line.assistant .chat-bubble {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-top-left-radius: 4px !important;
}

/* Status Dot Pulse */
.statusDot {
    background: var(--ok) !important;
    box-shadow: 0 0 6px var(--ok) !important;
    animation: pulse-spark 2s infinite !important;
}

@keyframes pulse-spark {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Buttons */
.btn.primary {
    background: var(--accent) !important;
    border: none !important;
    box-shadow: 0 2px 12px rgba(255, 63, 63, 0.35) !important;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn.primary:hover {
    background: #e63535 !important;
    box-shadow: 0 4px 18px rgba(255, 63, 63, 0.45) !important;
    transform: translateY(-1px);
}