body,
html {
    overflow-x: hidden !important;
    max-width: 100vw
}

.jarvis-layout {
    overflow-x: hidden
}

body {
    overflow-y: hidden
}

@media (max-width:1100px) {
    body {
        overflow-y: auto
    }
}

.jarvis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: rgba(7, 5, 15, .18);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, .03);
    position: relative;
    z-index: 5
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(74, 222, 128, .06);
    border: 1px solid rgba(74, 222, 128, .25);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--green);
    letter-spacing: .06em;
    transition: all .3s
}

.header-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse-dot 1.5s infinite;
    transition: all .3s
}

@keyframes pulse-dot {
    50% {
        opacity: .4
    }
}

#introSoundBtn.intro-on {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, .6)
}

#introSoundBtn.intro-off {
    opacity: .4
}

#sidePanelsBtn.panels-on {
    color: #a78bfa;
    text-shadow: 0 0 8px rgba(167, 139, 250, .6)
}

#sidePanelsBtn.panels-off {
    opacity: .4
}

#extBtn.ext-on {
    color: #4ade80;
    text-shadow: 0 0 8px rgba(74, 222, 128, .6)
}

#extBtn.ext-off {
    opacity: .4
}

#extBtn.ext-none {
    opacity: .2
}

.clock {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text);
    letter-spacing: .1em;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border)
}

.clock .date {
    color: var(--text-dim);
    font-size: 11px;
    margin-left: 8px
}

.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto
}

.jarvis-layout {
    display: grid;
    grid-template-columns: 240px 1fr 220px;
    grid-template-rows: 1fr 220px;
    gap: 14px;
    padding: 14px;
    height: calc(100vh - 65px);
    position: relative;
    z-index: 1
}

.panel-left {
    grid-column: 1;
    grid-row: 1;
    overflow-y: auto
}

.panel-center {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden
}

.panel-right {
    grid-column: 3;
    grid-row: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0
}

.panel-foot {
    grid-column: 1/-1;
    grid-row: 2
}

.panel {
    padding: 16px
}

.chat-history::-webkit-scrollbar,
.panel-left::-webkit-scrollbar,
.panel-right::-webkit-scrollbar {
    width: 6px
}

.chat-history::-webkit-scrollbar-thumb,
.panel-left::-webkit-scrollbar-thumb,
.panel-right::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, .25);
    border-radius: 6px
}

.panel-title {
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center
}

.panel-title .ct {
    font-family: var(--font-mono);
    color: var(--purple-light);
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: none
}

.group-head {
    font-size: 11px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--purple-light);
    margin: 14px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px
}

.group-head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border)
}

.device {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 8px;
    border-radius: 8px;
    transition: background .15s ease;
    margin-bottom: 2px;
    cursor: pointer
}

.device:hover {
    background: rgba(255, 255, 255, .025)
}

.device .ic {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    font-size: 12px;
    flex-shrink: 0
}

.device.lights .ic {
    background: rgba(251, 191, 36, .1);
    color: var(--amber);
    border: 1px solid rgba(251, 191, 36, .3)
}

.device.switch .ic {
    background: rgba(139, 92, 246, .1);
    color: var(--purple-light);
    border: 1px solid rgba(139, 92, 246, .3)
}

.device.climate .ic {
    background: rgba(56, 189, 248, .1);
    color: var(--cyan);
    border: 1px solid rgba(56, 189, 248, .3)
}

.device.off {
    opacity: .5
}

.device .name {
    flex: 1;
    font-size: 12px;
    line-height: 1.2
}

.device .name .sub {
    color: var(--text-dim);
    font-size: 11px;
    font-family: var(--font-mono);
    display: block
}

.center-stack {
    width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    gap: 18px;
    position: relative
}

.response-text {
    font-family: var(--font-display);
    font-size: clamp(17px, 2vw, 26px);
    font-weight: 700;
    line-height: 1.3;
    max-width: 660px;
    color: #fff;
    transition: opacity .3s, font-size .3s, color .3s;
    text-align: center;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden
}

.response-text.is-state {
    font-size: clamp(14px, 1.6vw, 20px);
    color: rgba(255, 255, 255, .35);
    font-weight: 500;
    letter-spacing: .05em
}

.response-text .accent {
    color: var(--purple-light);
    font-weight: 700
}

.center-orb-wrap {
    position: relative;
    width: 380px;
    height: 380px
}

.center-orb-wrap .orb {
    --orb-size: 380px
}

.kg-canvas {
    position: absolute;
    inset: -20px;
    pointer-events: none
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    background: rgba(14, 9, 25, .8);
    border: 1px solid var(--border-2);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 12px;
    backdrop-filter: blur(20px)
}

.status-bar .label {
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--text-muted)
}

.status-bar .val {
    color: var(--purple-light)
}

.status-bar .sep {
    width: 1px;
    height: 14px;
    background: var(--border)
}

#sr-debug-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 18px
}

#sr-mic-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #555;
    transition: background .2s
}

#sr-mic-dot.sr-audio {
    background: #22c55e;
    animation: mic-pulse 1.1s infinite
}

#sr-mic-dot.sr-start {
    background: #f59e0b
}

#sr-mic-dot.sr-error {
    background: #ef4444;
    animation: none
}

#sr-mic-dot.sr-off {
    background: #444;
    animation: none
}

@keyframes mic-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, .55)
    }

    50% {
        box-shadow: 0 0 0 5px rgba(34, 197, 94, 0)
    }
}

#sr-mic-label {
    font-size: 9px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: .1em;
    text-transform: uppercase;
    flex-shrink: 0
}

#sr-debug {
    font-size: 11px;
    color: rgba(251, 191, 36, .8);
    font-family: var(--font-mono);
    min-height: 14px;
    letter-spacing: .06em
}

.sensor {
    margin-bottom: 14px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .015);
    border: 1px solid var(--border)
}

.sensor .lbl {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px
}

.sensor .val {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    display: flex;
    align-items: baseline;
    gap: 4px
}

.sensor .val .unit {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400
}

.sensor .progress {
    height: 4px
}

.sensor.cyan .progress>.fill {
    background: linear-gradient(90deg, var(--cyan), var(--purple-light))
}

.sensor.amber .progress>.fill {
    background: linear-gradient(90deg, var(--amber), var(--pink))
}

.sensor.green .progress>.fill {
    background: linear-gradient(90deg, var(--green), var(--cyan))
}

.sensor.red .progress>.fill {
    background: linear-gradient(90deg, var(--red), var(--amber))
}

.mini-bars {
    display: flex;
    align-items: end;
    gap: 3px;
    height: 32px;
    margin-top: 8px
}

.mini-bars .b {
    flex: 1;
    background: linear-gradient(180deg, var(--purple-light), rgba(99, 102, 241, .3));
    border-radius: 2px 2px 0 0;
    min-height: 4px;
    opacity: .85
}

.chat-foot {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    height: 100%
}

.chat-history {
    background: rgba(255, 255, 255, .015);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    max-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.4) transparent
}

.chat-history::-webkit-scrollbar {
    width: 4px
}

.chat-history::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, .35);
    border-radius: 999px
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, .6)
}

.msg {
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 85%;
    line-height: 1.5;
    font-size: 14px
}

.msg.user {
    align-self: flex-end;
    background: rgba(99, 102, 241, .12);
    border: 1px solid rgba(99, 102, 241, .3);
    color: var(--text)
}

.msg.assistant,
.msg.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--border)
}

.msg.system {
    align-self: center;
    background: 0 0;
    border: none;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-dim);
    max-width: 100%;
    padding: 4px 0
}

.maps-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    padding: 6px 13px;
    background: rgba(66, 133, 244, .12);
    border: 1px solid rgba(66, 133, 244, .3);
    border-radius: 8px;
    color: #5a9cf8;
    font-size: 12px;
    letter-spacing: .06em;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s
}

.maps-link-btn:hover {
    background: rgba(66, 133, 244, .22)
}

.msg .who {
    font-size: 9px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 3px
}

.chat-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 380px
}

.chat-input-row {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 6px 6px 6px 14px
}

.chat-input-row input {
    flex: 1;
    min-width: 0;
    background: 0 0;
    border: none;
    outline: 0;
    color: var(--text);
    font-size: 14px;
    padding: 8px 0;
    font-family: var(--font-mono)
}

.chat-input-row input::placeholder {
    color: #6b7280
}

.attach-btn {
    background: rgba(139, 92, 246, .12);
    border: 1px solid rgba(139, 92, 246, .35);
    color: var(--purple-light);
    cursor: pointer;
    padding: 6px 10px;
    font-size: 17px;
    border-radius: 8px;
    transition: background .2s, border-color .2s, box-shadow .2s, transform .15s;
    flex-shrink: 0;
    line-height: 1
}

.attach-btn:hover {
    background: rgba(139, 92, 246, .22);
    border-color: rgba(139, 92, 246, .6);
    box-shadow: 0 0 10px rgba(139, 92, 246, .3);
    transform: scale(1.08)
}

.attach-btn:active {
    transform: scale(.96)
}

.attach-preview {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, .08);
    border: 1px solid rgba(139, 92, 246, .25);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--purple-light);
    font-family: var(--font-mono);
    margin-bottom: 4px
}

.attach-preview.show {
    display: flex
}

.attach-preview span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.attach-preview button {
    background: 0 0;
    border: none;
    color: #f87171;
    cursor: pointer;
    font-size: 14px;
    padding: 0
}

.attach-chips {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0 2px
}

.attach-chips.show {
    display: flex
}

.attach-chip {
    background: rgba(139, 92, 246, .1);
    border: 1px solid rgba(139, 92, 246, .3);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: #c4b5fd;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap
}

.attach-chip:hover {
    background: rgba(139, 92, 246, .25);
    border-color: rgba(139, 92, 246, .6);
    color: #e9d5ff;
    transform: translateY(-1px)
}

#attachOnboardModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 16px
}

#attachOnboardModal.open {
    display: flex
}

.aob-box {
    background: rgba(18, 10, 35, .97);
    border: 1px solid rgba(139, 92, 246, .3);
    border-radius: 18px;
    padding: 28px 26px 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .55), 0 0 50px rgba(139, 92, 246, .08);
    animation: fadeInUp .22s ease;
    position: relative
}

.aob-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    color: var(--text-dim);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    line-height: 1
}

.aob-close:hover {
    background: rgba(255, 255, 255, .14)
}

.aob-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 22px;
    padding-right: 28px
}

.aob-title span:first-child {
    font-size: 26px
}

.aob-steps {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 18px
}

.aob-step {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.5
}

.aob-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(139, 92, 246, .25);
    border: 1px solid rgba(139, 92, 246, .4);
    color: var(--purple-light);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono)
}

.aob-step em {
    color: var(--text);
    font-style: normal
}

.aob-tip {
    background: rgba(251, 191, 36, .06);
    border: 1px solid rgba(251, 191, 36, .22);
    border-radius: 10px;
    padding: 11px 13px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #d1a832;
    line-height: 1.55;
    margin-bottom: 20px
}

.aob-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--purple), var(--purple-light));
    color: #fff;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: opacity .2s, transform .15s
}

.aob-btn:hover {
    opacity: .87;
    transform: scale(1.02)
}

.aob-btn:active {
    transform: scale(.98)
}

.chat-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px
}

.ctrl-btn {
    padding: 9px 6px;
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    color: #fff;
    transition: all .2s ease;
    cursor: pointer
}

.ctrl-btn:hover {
    color: var(--text);
    border-color: rgba(167, 139, 250, .4);
    background: rgba(139, 92, 246, .08)
}

.ctrl-btn.active {
    background: rgba(139, 92, 246, .18);
    border-color: var(--purple-light);
    color: #fff;
    box-shadow: 0 0 14px rgba(139, 92, 246, .4)
}

.ctrl-btn.danger {
    color: var(--red);
    border-color: rgba(248, 113, 113, .3)
}

.ctrl-btn.danger:hover {
    background: rgba(248, 113, 113, .08)
}

.ctrl-btn[data-act=live].preset {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, .5);
    box-shadow: 0 0 10px rgba(251, 191, 36, .3)
}

.ctrl-btn[data-act=live].active {
    background: rgba(74, 222, 128, .15);
    border-color: rgba(74, 222, 128, .6);
    color: #4ade80;
    box-shadow: 0 0 16px rgba(74, 222, 128, .45)
}

body.mode-focus {
    overflow: hidden
}

body.mode-focus .jarvis-header,
body.mode-focus .panel-foot,
body.mode-focus .panel-left,
body.mode-focus .panel-right {
    display: none !important;
    transform: none !important;
    transition: none !important
}

body.mode-focus .jarvis-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100vh;
    width: 100vw;
    padding: 0;
    margin: 0
}

body.mode-focus .panel-center {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center
}

body.mode-focus .center-stack {
    width: 100%;
    height: 100%;
    max-height: none;
    padding: 40px 20px
}

body.mode-focus .center-orb-wrap {
    width: min(540px, 80vmin);
    height: min(540px, 80vmin)
}

body.mode-focus .center-orb-wrap .orb {
    --orb-size: min(540px, 80vmin)
}

body.mode-focus .response-text {
    font-size: clamp(18px, 3vw, 32px);
    max-width: 90vw
}

#focus-chat-bar {
    display: none
}

body.mode-focus.mode-chat #focus-chat-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    width: min(320px, 65vw);
    order: 3
}

body.mode-focus.mode-chat .center-orb-wrap {
    order: 1
}

body.mode-focus.mode-chat #response-text {
    order: 2;
    margin-top: 12px;
    font-size: clamp(12px, 1.4vw, 15px) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    max-width: min(520px, 82vw);
    line-height: 1.55;
    font-weight: 400;
    color: rgba(255, 255, 255, .88)
}

body.mode-focus.mode-chat #response-sub {
    display: none
}

body.mode-focus.mode-chat #focus-chat-bar input {
    flex: 1;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 20px;
    padding: 9px 16px;
    color: #fff;
    font-size: 14px;
    font-family: var(--font-mono);
    outline: 0;
    transition: border-color .2s
}

body.mode-focus.mode-chat #focus-chat-bar input::placeholder {
    color: #6b7280
}

body.mode-focus.mode-chat #focus-chat-bar input:focus {
    border-color: rgba(74, 222, 128, .4)
}

body.mode-focus.mode-chat #focus-chat-bar button {
    background: 0 0;
    border: none;
    color: #4ade80;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    opacity: .8;
    transition: opacity .2s
}

body.mode-focus.mode-chat #focus-chat-bar button:hover {
    opacity: 1
}

@media (max-width:720px) {
    body.mode-focus .center-orb-wrap {
        width: 70vmin;
        height: 70vmin
    }

    body.mode-focus .center-orb-wrap .orb {
        --orb-size: 70vmin
    }

    body.mode-focus .response-text {
        font-size: 16px
    }

    body.mode-focus .status-bar {
        font-size: 9px;
        padding: 6px 10px;
        flex-wrap: wrap;
        justify-content: center
    }
}

.focus-top-bar {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 101;
    display: none;
    gap: 8px;
    align-items: center
}

body.mode-focus .focus-top-bar {
    display: flex
}

.focus-ind-btn {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .5);
    color: #ef4444;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all .2s;
    line-height: 1.4
}

.focus-ind-btn:hover {
    background: rgba(239, 68, 68, .22)
}

.focus-ind-btn.active {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .25);
    color: #fff
}

.focus-ind-btn.active:hover {
    background: rgba(255, 255, 255, .13)
}

.focus-ind-btn.warn {
    background: rgba(251, 191, 36, .12);
    border-color: rgba(251, 191, 36, .5);
    color: #fbbf24
}

.focus-ind-btn.warn:hover {
    background: rgba(251, 191, 36, .22)
}

body.mode-day {
    --bg: #e8eaf0;
    --surface: rgba(255, 255, 255, 0.75);
    --border: rgba(0, 0, 0, 0.1);
    --text: #1a1a2e;
    --text-muted: #4a4a6a;
    --text-dim: #7a7a9a
}

body.mode-day .jarvis-header {
    background: rgba(180, 185, 200, .45);
    border-color: rgba(0, 0, 0, .06)
}

body.mode-day .panel {
    background: rgba(255, 255, 255, .7);
    border-color: rgba(0, 0, 0, .08)
}

body.mode-day .orb {
    filter: brightness(1.1) saturate(1.2)
}

body.mode-day .bg-blobs {
    opacity: .15
}

body.mode-day .bg-canvas {
    opacity: .2
}

body.mode-day .chat-history {
    background: rgba(255, 255, 255, .5)
}

body.mode-day .msg.user {
    background: rgba(99, 102, 241, .15)
}

body.mode-day .msg.assistant {
    background: rgba(0, 0, 0, .04)
}

body.mode-day #themeBtn {
    color: #f59e0b
}

body.mode-day .status-bar {
    background: rgba(255, 255, 255, .75);
    border-color: rgba(0, 0, 0, .08)
}

body.mode-day .status-bar .label {
    color: #88a
}

body.mode-day .status-bar .sep {
    background: rgba(0, 0, 0, .1)
}

body.mode-chat .ctrl-btn[data-act=chat] {
    color: #4ade80;
    border-color: rgba(74, 222, 128, .4)
}

#orb-elem .core {
    transition: background 1s ease, box-shadow 1s ease
}

#orb-elem.state-listening .core {
    background: radial-gradient(circle at 30% 30%, rgba(74, 222, 128, .95) 0, rgba(16, 185, 129, .85) 35%, rgba(5, 150, 105, .55) 65%, rgba(5, 150, 105, .08) 100%);
    box-shadow: 0 0 60px rgba(16, 185, 129, .75), 0 0 120px rgba(5, 150, 105, .4), inset 0 0 30px rgba(255, 255, 255, .2)
}

#orb-elem.state-thinking .core {
    background: radial-gradient(circle at 30% 30%, rgba(252, 165, 165, .95) 0, rgba(239, 68, 68, .85) 35%, rgba(185, 28, 28, .55) 65%, rgba(185, 28, 28, .08) 100%);
    box-shadow: 0 0 60px rgba(239, 68, 68, .75), 0 0 120px rgba(185, 28, 28, .4), inset 0 0 30px rgba(255, 255, 255, .2)
}

body.mode-chat #orb-elem .core {
    background: radial-gradient(circle at 30% 30%, rgba(148, 163, 184, .6) 0, rgba(100, 116, 139, .5) 35%, rgba(71, 85, 105, .3) 65%, rgba(71, 85, 105, .04) 100%);
    box-shadow: 0 0 30px rgba(100, 116, 139, .25), 0 0 60px rgba(71, 85, 105, .15), inset 0 0 20px rgba(255, 255, 255, .08)
}

@media (min-width:1101px) {

    body:not(.panels-visible) .panel-left,
    body:not(.panels-visible) .panel-right {
        display: none !important
    }

    body:not(.panels-visible) .jarvis-layout {
        grid-template-columns: 1fr
    }

    body:not(.panels-visible) .panel-center {
        grid-column: 1
    }

    body.ui-boot.panels-visible .panel-left {
        transform: translateX(-110%);
        pointer-events: none
    }

    body.ui-boot.panels-visible .panel-right {
        transform: translateX(110%);
        pointer-events: none
    }

    body.ui-boot .jarvis-header {
        transform: translateY(-110%);
        pointer-events: none
    }

    body.ui-boot .panel-foot {
        transform: translateY(110%);
        pointer-events: none
    }

    body:not(.mode-focus).panels-visible .panel-left {
        transition: transform 1.4s cubic-bezier(.16, 1, .3, 1)
    }

    body:not(.mode-focus).panels-visible .panel-right {
        transition: transform 1.4s cubic-bezier(.16, 1, .3, 1) .12s
    }

    body:not(.mode-focus) .jarvis-header {
        transition: transform 1.2s cubic-bezier(.16, 1, .3, 1) .55s
    }

    body:not(.mode-focus) .panel-foot {
        transition: transform 1.2s cubic-bezier(.16, 1, .3, 1) .65s
    }
}

.activate-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(7, 5, 15, .85);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    transition: opacity .5s ease
}

.activate-overlay.hidden {
    opacity: 0;
    pointer-events: none
}

.activate-overlay h2 {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 800
}

.activate-overlay p {
    color: var(--text-muted);
    margin-top: -20px;
    font-family: var(--font-mono);
    font-size: 14px
}

.activate-orb {
    width: 280px;
    height: 280px
}

#start-wake-hint {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, .18);
    font-family: var(--font-mono);
    pointer-events: none
}

#start-wake-hint strong {
    color: rgba(255, 255, 255, .28)
}

#upgrade-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(7, 5, 15, .98);
    display: none;
    align-items: center;
    justify-content: center
}

.upgrade-modal {
    text-align: center;
    max-width: 440px;
    padding: 40px;
    border: 1px solid var(--border-2);
    background: var(--surface);
    border-radius: 20px
}

.upgrade-modal h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--purple-light);
    margin-bottom: 12px
}

.upgrade-modal p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
    font-family: var(--font-mono)
}

#webcam-video {
    display: none
}

#cam-preview-wrap {
    display: none;
    position: fixed;
    z-index: 200;
    top: 45%;
    left: calc(50% + 260px);
    transform: translate(-50%, -50%);
    width: 320px;
    height: 245px;
    background: url('/assets/layer.png') center/contain no-repeat;
    pointer-events: none
}

#webcam-preview {
    position: absolute;
    top: 24%;
    left: 20%;
    width: 58%;
    height: 52%;
    object-fit: cover;
    border-radius: 4px
}

@media (max-width:1100px) {
    #cam-preview-wrap {
        top: 39%;
        left: 50%;
        width: 220px;
        height: 157px
    }
}

@media (max-width:1100px) {
    .jarvis-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 65px);
        padding: 10px;
        gap: 10px
    }

    .panel-center {
        order: 1
    }

    .panel-foot {
        order: 2
    }

    .panel-left {
        order: 3
    }

    .panel-right {
        order: 4
    }

    body:not(.panels-visible) .panel-left,
    body:not(.panels-visible) .panel-right {
        display: none !important
    }

    body.panels-visible .panel-left,
    body.panels-visible .panel-right {
        display: block;
        min-height: 220px;
        max-height: 320px;
        overflow-y: auto
    }

    .panel-center {
        flex: 1;
        min-height: 60vh
    }

    .panel-foot {
        flex-shrink: 0;
        height: auto
    }

    .chat-foot {
        height: auto
    }

    .chat-history {
        height: 180px;
        min-height: 120px;
        overflow-y: auto
    }

    .response-text {
        font-size: 22px
    }

    .center-orb-wrap {
        width: 280px;
        height: 280px
    }

    .center-orb-wrap .orb {
        --orb-size: 280px
    }

    .chat-controls {
        width: 200px
    }

    .clock {
        font-size: 12px;
        padding: 5px 10px
    }

    .clock .date {
        display: none
    }

    .header-status {
        font-size: 11px;
        padding: 5px 10px
    }
}

@media (max-width:720px) {
    .jarvis-header {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 8px
    }

    .header-left .nav-logo {
        font-size: 14px
    }

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

    .header-status span:not(.dot) {
        display: none
    }

    .header-status::after {
        content: attr(data-short-label);
        font-weight: 700
    }

    .jarvis-layout {
        grid-template-rows: 1fr 220px;
        height: calc(100vh - 60px)
    }

    .response-text {
        font-size: 18px
    }

    .center-orb-wrap {
        width: 220px;
        height: 220px
    }

    .center-orb-wrap .orb {
        --orb-size: 220px
    }

    .status-bar {
        font-size: 9px;
        padding: 8px 12px;
        gap: 8px
    }

    .status-bar .label {
        letter-spacing: .08em
    }

    .chat-foot {
        grid-template-columns: 1fr;
        grid-template-rows: 175px auto;
        gap: 8px
    }

    .chat-buttons {
        padding-bottom: max(22px, env(safe-area-inset-bottom, 22px))
    }

    .chat-controls {
        width: 100%
    }

    .chat-buttons {
        grid-template-columns: repeat(6, 1fr)
    }

    .ctrl-btn {
        padding: 8px 4px;
        font-size: 9px;
        letter-spacing: .06em
    }

    .chat-history {
        font-size: 12px;
        padding: 8px 10px
    }

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

    .activate-overlay h2 {
        font-size: 28px
    }

    .activate-orb {
        width: 200px;
        height: 200px
    }

    .activate-orb .orb {
        --orb-size: 200px
    }
}

.info-card {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .015);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center
}

.info-card .ic-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px
}

.info-card .ic-badge {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-size: 12px;
    flex-shrink: 0
}

.info-card .ic-title {
    font-size: 9px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: var(--font-mono)
}

.info-card .ic-val {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.1
}

.info-card .ic-sub {
    font-size: 11px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    margin-top: 2px
}

.info-card .progress {
    height: 4px;
    background: rgba(255, 255, 255, .05);
    border-radius: 99px;
    margin-top: 10px;
    overflow: hidden
}

.info-card .progress .fill {
    height: 100%;
    border-radius: 99px;
    transition: width .6s ease
}

.style-bars {
    display: flex;
    gap: 6px;
    margin-top: 10px
}

.style-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px
}

.style-bar .sb {
    height: 5px;
    border-radius: 3px
}

.style-bar .sl {
    font-size: 8px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-family: var(--font-mono);
    text-align: center
}

.style-bar.active .sl {
    color: var(--text-muted)
}