:root {
    color-scheme: dark;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #061019;
    color: #eafcff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(17, 197, 209, .18), transparent 28rem),
        radial-gradient(circle at 85% 80%, rgba(12, 111, 159, .18), transparent 30rem),
        linear-gradient(145deg, #030910, #071722 58%, #041019);
}

button,
textarea {
    font: inherit;
}

.yarvis-shell {
    width: min(1440px, calc(100% - 32px));
    min-height: calc(100vh - 32px);
    margin: 16px auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 14px;
}

.yarvis-card,
.yarvis-inspector {
    border: 1px solid rgba(78, 211, 221, .32);
    background: rgba(5, 19, 28, .90);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .34);
    backdrop-filter: blur(15px);
}

.yarvis-card {
    min-height: calc(100vh - 32px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    border-radius: 18px;
    overflow: hidden;
}

.yarvis-header {
    min-height: 84px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    background:
        linear-gradient(90deg, rgba(6, 69, 82, .96), rgba(6, 93, 107, .91), rgba(9, 69, 101, .93));
    border-bottom: 1px solid rgba(87, 221, 229, .32);
}

.yarvis-header h1 {
    margin: 0;
    font-size: 24px;
    letter-spacing: .18em;
}

.yarvis-header p {
    margin: 3px 0 0;
    color: #9bd7df;
    font-size: 12px;
    font-weight: 600;
}

.yarvis-orb {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(123, 241, 249, .72);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(181, 252, 255, .95) 0 8%, rgba(29, 211, 226, .65) 9% 25%, rgba(8, 76, 101, .28) 26% 50%, transparent 51%);
    box-shadow:
        0 0 14px rgba(42, 218, 231, .48),
        inset 0 0 18px rgba(67, 234, 244, .38);
}

.yarvis-orb span {
    width: 38px;
    height: 38px;
    border: 1px dashed rgba(207, 253, 255, .86);
    border-radius: 50%;
    animation: spin 9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.yarvis-status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #c8fbdd;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.yarvis-status span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22d477;
    box-shadow: 0 0 10px rgba(34, 212, 119, .88);
}

.yarvis-chat {
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
}

.message {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.message.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(145deg, #0d8392, #07536e);
    color: white;
    font-size: 12px;
    font-weight: 900;
}

.message.user .avatar {
    background: linear-gradient(145deg, #20764e, #12523a);
}

.bubble {
    max-width: min(78%, 760px);
    padding: 10px 13px;
    border: 1px solid rgba(75, 185, 199, .24);
    border-radius: 5px 14px 14px 14px;
    background: rgba(15, 41, 55, .86);
}

.message.user .bubble {
    border-radius: 14px 5px 14px 14px;
    background: rgba(17, 66, 51, .78);
}

.bubble strong {
    display: block;
    margin-bottom: 4px;
    color: #83edf4;
    font-size: 10px;
    letter-spacing: .07em;
}

.message.user .bubble strong {
    color: #9df1bd;
}

.bubble p {
    margin: 0;
    line-height: 1.5;
    font-size: 13px;
}

.yarvis-command-panel {
    padding: 12px 14px;
    display: flex;
    align-items: stretch;
    gap: 8px;
    border-top: 1px solid rgba(76, 185, 199, .22);
    background: rgba(2, 11, 17, .82);
}

.yarvis-command-panel textarea {
    flex: 1;
    min-height: 54px;
    max-height: 140px;
    resize: vertical;
    padding: 10px 12px;
    color: #eaffff;
    background: rgba(10, 30, 42, .92);
    border: 1px solid #326a7d;
    border-radius: 11px;
    outline: none;
}

.yarvis-command-panel textarea:focus {
    border-color: #36d9e4;
    box-shadow: 0 0 0 3px rgba(54, 217, 228, .12);
}

.yarvis-command-panel button {
    width: 58px;
    min-width: 58px;
    display: grid;
    place-items: center;
    color: white;
    border: 1px solid #43e4a5;
    border-radius: 11px;
    background: linear-gradient(145deg, #11b96c, #087d52);
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}

.yarvis-command-panel button:hover,
.yarvis-command-panel button:focus-visible {
    filter: brightness(1.1);
    transform: translateY(-1px);
    outline: none;
}

.yarvis-command-panel button:disabled {
    opacity: .55;
    cursor: wait;
}

.yarvis-command-panel svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.yarvis-footer {
    min-height: 31px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #6fa5ae;
    border-top: 1px solid rgba(76, 185, 199, .16);
    font-size: 10px;
}

.yarvis-inspector {
    align-self: start;
    position: sticky;
    top: 16px;
    border-radius: 15px;
    overflow: hidden;
}

.yarvis-inspector > header {
    padding: 14px;
    background: linear-gradient(90deg, #0b4152, #0a5662);
    border-bottom: 1px solid rgba(103, 222, 230, .28);
}

.yarvis-inspector header strong {
    display: block;
    font-size: 14px;
}

.yarvis-inspector header small {
    display: block;
    margin-top: 3px;
    color: #91c8d0;
}

.yarvis-inspector dl {
    margin: 0;
    padding: 10px 13px;
}

.yarvis-inspector dl > div {
    padding: 9px 0;
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 6px;
    border-bottom: 1px solid rgba(88, 164, 176, .15);
}

.yarvis-inspector dt {
    color: #7daab2;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.yarvis-inspector dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #effeff;
    font-size: 11px;
    font-weight: 700;
}

.yarvis-inspector section {
    padding: 4px 13px 15px;
}

.yarvis-inspector h2 {
    margin: 8px 0 8px;
    color: #9ecdd3;
    font-size: 11px;
    text-transform: uppercase;
}

.entity-row {
    margin-bottom: 6px;
    padding: 8px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid rgba(70, 169, 181, .20);
    border-radius: 7px;
    background: rgba(15, 44, 58, .78);
    font-size: 11px;
}

.entity-row span:first-child {
    color: #87c2ca;
}

.entity-row strong {
    text-align: right;
    color: #dfffff;
}

.entities-empty {
    color: #6f99a0;
    font-size: 11px;
}

@media (max-width: 980px) {
    .yarvis-shell {
        grid-template-columns: 1fr;
    }

    .yarvis-inspector {
        position: static;
    }

    .yarvis-card {
        min-height: 72vh;
    }
}

/* YARVIS_GPS_VOICE_V1 */
.yarvis-command-panel .yarvis-mic,
.yarvis-command-panel .yarvis-send {
    width:58px;min-width:58px;display:grid;place-items:center;
    border-radius:11px;cursor:pointer;
}
.yarvis-command-panel .yarvis-mic {
    color:#c9fbff;border:1px solid #36cddb;
    background:linear-gradient(145deg,#0d5f70,#083d54);
}
.yarvis-command-panel .yarvis-mic.listening {
    color:#fff;border-color:#ff795f;
    background:linear-gradient(145deg,#ef6249,#a9362b);
    box-shadow:0 0 0 4px rgba(255,99,71,.14),0 0 22px rgba(255,99,71,.35);
}
.voice-state {
    min-height:27px;padding:4px 15px 6px;color:#79aeb7;
    background:rgba(2,11,17,.82);font-size:10px;font-weight:700;
}
.voice-state.active { color:#9df1bd; }
.voice-state.error { color:#ff9d8c; }
/* Reposo is distinct from active listening, including background wake transcription. */
body[data-conversation-state="resting"] .yarvis-status { color: #b8c3d2; }
body[data-conversation-state="resting"] .yarvis-status > span:first-child { background: #94a3b8; box-shadow: none; }
body[data-conversation-state="resting"] .yarvis-orb { filter: grayscale(1); opacity: .55; }
body[data-conversation-state="resting"] .yarvis-orb::before,
body[data-conversation-state="resting"] .yarvis-orb::after { animation-play-state: paused; }
body[data-conversation-state="resting"] .yarvis-command-panel .yarvis-mic,
body[data-conversation-state="resting"] .yarvis-command-panel .yarvis-mic.listening { color: #b8c3d2; background: #25303e; border-color: #64748b; box-shadow: none; animation: none; }
.voice-state.resting { color: #b8c3d2; }
