:root {
    --bg: #08151c;
    --bg-deep: #051016;
    --surface: #f3f7f8;
    --surface-soft: #e3edf0;
    --panel: #102a37;
    --panel-strong: #173848;
    --ink: #10212a;
    --text: #edf8fb;
    --muted: #9db2bb;
    --line: rgba(196, 226, 235, 0.18);
    --line-light: #c9d8dc;
    --cyan: #42b6e4;
    --cyan-soft: #bfe9f6;
    --coral: #f27661;
    --amber: #f0c861;
    --green: #61c5a7;
    --danger: #df6b66;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    background: var(--bg-deep);
    color: var(--text);
    color-scheme: dark;
    font-family: Manrope, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background: var(--bg-deep);
}

button,
input,
textarea,
select {
    font: inherit;
    letter-spacing: 0;
}

button {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.app-shell {
    width: min(100%, 520px);
    min-height: 100vh;
    margin: 0 auto;
    padding: env(safe-area-inset-top) 16px calc(94px + env(safe-area-inset-bottom));
    background: var(--bg);
}

.topbar {
    display: flex;
    min-height: 88px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 2px 8px;
}

.brand-lockup {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 1px solid rgba(66, 182, 228, 0.5);
    border-radius: 50%;
    background: #123241;
    color: var(--cyan);
    box-shadow: inset 0 0 0 4px rgba(66, 182, 228, 0.08);
}

.brand-mark svg {
    width: 21px;
    height: 21px;
    stroke-width: 1.9;
}

.topbar h1,
.section-heading h2,
.sheet-title h2 {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 760;
    line-height: 1.25;
}

.topbar h1 {
    margin-top: 3px;
    overflow: hidden;
    font-size: 1.34rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eyebrow,
.section-kicker {
    margin: 0;
    color: var(--cyan-soft);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.35;
    text-transform: uppercase;
}

.icon-button,
.primary-icon-button,
.send-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(18, 50, 65, 0.92);
    color: var(--text);
    cursor: pointer;
}

.primary-icon-button {
    border-color: var(--cyan);
    background: var(--cyan);
    color: #05212c;
}

.icon-button svg,
.primary-icon-button svg,
.send-button svg,
.save-button svg {
    width: 19px;
    height: 19px;
    stroke-width: 2.1;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.hero-stage {
    position: relative;
    min-height: 316px;
    overflow: hidden;
    border: 1px solid rgba(126, 200, 226, 0.22);
    border-radius: 8px;
    background: #0d2a38;
    isolation: isolate;
}

.hero-art,
.hero-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-art {
    object-fit: cover;
    object-position: center;
}

.hero-shade {
    z-index: 1;
    background: rgba(4, 19, 27, 0.44);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: 316px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 24px 22px 28px;
}

.hero-status {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 7px;
    margin-bottom: 16px;
    padding: 5px 9px;
    border: 1px solid rgba(192, 233, 246, 0.34);
    border-radius: 6px;
    background: rgba(5, 25, 35, 0.74);
    color: var(--cyan-soft);
    font-size: 0.67rem;
    font-weight: 800;
}

.hero-status span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(97, 197, 167, 0.16);
}

.hero-date {
    margin: 0 0 7px;
    color: var(--cyan-soft);
    font-size: 0.76rem;
    font-weight: 750;
}

.hero-content h2 {
    max-width: 330px;
    margin: 0;
    color: #fff;
    font-size: 2.18rem;
    font-weight: 820;
    line-height: 1.12;
    text-wrap: balance;
}

.hero-summary {
    max-width: 355px;
    margin: 13px 0 18px;
    color: #e4f1f5;
    font-size: 0.88rem;
    line-height: 1.65;
}

.hero-cta {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid #eef9fc;
    border-radius: 7px;
    background: #eef9fc;
    color: #0a2632;
    font-size: 0.84rem;
    font-weight: 820;
    cursor: pointer;
}

.hero-cta svg {
    width: 18px;
    height: 18px;
}

.hero-actions {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 8px;
}

.hero-secondary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(220, 241, 247, 0.46);
    border-radius: 7px;
    background: rgba(5, 25, 35, 0.72);
    color: #eef9fc;
    font-size: 0.8rem;
    font-weight: 780;
    cursor: pointer;
}

.hero-secondary svg {
    width: 17px;
    height: 17px;
}

.hero-cta[aria-pressed="true"] {
    border-color: var(--cyan);
    background: var(--cyan);
    color: #06222d;
}

.hero-cta[aria-pressed="true"] svg {
    animation: voice-pulse 1.4s ease-in-out infinite;
}

.hero-index {
    position: absolute;
    z-index: 2;
    top: 18px;
    right: 17px;
    color: rgba(230, 246, 250, 0.72);
    font-size: 0.65rem;
    font-weight: 800;
    writing-mode: vertical-rl;
}

.signal-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.signal-item {
    display: grid;
    min-width: 0;
    min-height: 92px;
    grid-template-columns: 32px minmax(0, 1fr) 14px;
    gap: 8px;
    align-items: center;
    padding: 12px 10px;
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.signal-item:last-child {
    border-right: 0;
}

.signal-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(66, 182, 228, 0.24);
    border-radius: 7px;
    background: rgba(66, 182, 228, 0.12);
    color: var(--cyan);
}

.signal-icon svg,
.signal-arrow {
    width: 16px;
    height: 16px;
}

.signal-item strong,
.signal-item small {
    display: block;
    min-width: 0;
}

.signal-item strong {
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.25;
}

.signal-item small {
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.62rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.signal-arrow {
    color: #75919b;
}

.assistant-card {
    margin-top: 12px;
    padding: 17px;
    border: 1px solid var(--line-light);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
}

.section-heading,
.sheet-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.section-heading .section-kicker {
    color: #22779a;
}

.list-heading {
    margin-top: 8px;
}

.provider-badge,
.save-state,
.task-category,
.schedule-chip {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid var(--line-light);
    border-radius: 6px;
    background: var(--surface-soft);
    color: #47616c;
    font-size: 0.7rem;
    font-weight: 780;
    white-space: nowrap;
}

.provider-badge.demo {
    border-color: #d6b34e;
    background: #fff1b9;
    color: #6d5613;
}

.provider-badge.live {
    border-color: #67b9a5;
    background: #d9f2ea;
    color: #126654;
}

.messages {
    display: grid;
    height: 72px;
    min-height: 72px;
    max-height: 390px;
    gap: 10px;
    margin: 12px -2px 6px;
    padding: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #aac2ca transparent;
}

.messages.expanded {
    height: 230px;
}

.message {
    max-width: 89%;
    padding: 11px 13px;
    border: 1px solid #cad8dc;
    border-radius: 8px;
    background: #fff;
    font-size: 0.89rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.message.user {
    justify-self: end;
    border-color: var(--panel-strong);
    background: var(--panel-strong);
    color: #fff;
}

.message p {
    margin: 0;
}

.message-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    color: #71848c;
    font-size: 0.7rem;
}

.message.user .message-meta {
    color: #b9d8e3;
}

.message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}

.message-actions span {
    padding: 5px 8px;
    border: 1px solid #c7d7dc;
    border-radius: 5px;
    background: #eef5f7;
    color: var(--ink);
    font-size: 0.7rem;
}

.risk-notice {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #c7d7dc;
    color: var(--danger);
    font-size: 0.72rem;
}

.quick-actions {
    display: flex;
    gap: 7px;
    padding-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar {
    display: none;
}

.quick-actions button {
    min-height: 34px;
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid #c7d7dc;
    border-radius: 6px;
    background: #eef5f7;
    color: #24434f;
    font-size: 0.76rem;
    cursor: pointer;
}

.composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
    align-items: end;
    padding: 7px;
    border: 1px solid #c7d7dc;
    border-radius: 8px;
    background: #e7f0f2;
}

.composer textarea {
    width: 100%;
    min-height: 42px;
    max-height: 112px;
    padding: 10px;
    resize: none;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    line-height: 1.45;
}

.composer textarea::placeholder {
    color: #758991;
}

.send-button {
    border-color: var(--panel-strong);
    background: var(--panel-strong);
    color: #fff;
}

.send-button:disabled,
.save-button:disabled {
    cursor: wait;
    opacity: 0.58;
}

#view-automations,
#view-profile {
    padding-top: 4px;
}

#view-automations .section-kicker,
#view-profile .section-kicker {
    color: var(--cyan);
}

.section-intro {
    margin: 10px 0 17px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.65;
}

.automation-list {
    display: grid;
    gap: 10px;
}

.automation-empty {
    padding: 30px 18px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
}

.task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--line-light);
    border-left: 4px solid var(--cyan);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
}

.task-card.disabled {
    border-left-color: #98a9ae;
    opacity: 0.68;
}

.task-card h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.task-card p {
    margin: 0;
    color: #5c717a;
    font-size: 0.81rem;
    line-height: 1.55;
}

.task-meta,
.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.task-meta {
    margin-top: 11px;
}

.task-actions {
    align-content: start;
}

.task-action {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--line-light);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--ink);
    cursor: pointer;
}

.task-action svg {
    width: 17px;
    height: 17px;
}

.task-action.delete {
    color: var(--danger);
}

.profile-form {
    display: grid;
    gap: 12px;
}

.field-row {
    display: grid;
    gap: 7px;
}

.field-row label {
    color: var(--text);
    font-size: 0.81rem;
    font-weight: 760;
}

.field-row input,
.field-row textarea,
.field-row select {
    width: 100%;
    min-height: 45px;
    padding: 11px 12px;
    border: 1px solid var(--line-light);
    border-radius: 7px;
    outline: 0;
    background: var(--surface);
    color: var(--ink);
    line-height: 1.55;
}

.field-row textarea {
    resize: vertical;
}

.field-row input:focus,
.field-row textarea:focus,
.field-row select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(66, 182, 228, 0.18);
}

.save-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
    padding: 11px 16px;
    border: 1px solid var(--cyan);
    border-radius: 8px;
    background: var(--cyan);
    color: #05202b;
    font-weight: 820;
    cursor: pointer;
}

.save-button:active,
.send-button:active,
.primary-icon-button:active {
    background: var(--coral);
    color: #fff;
}

.bottom-nav {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    width: min(100%, 520px);
    grid-template-columns: repeat(3, 1fr);
    margin: 0 auto;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(5, 16, 22, 0.96);
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.18);
}

.nav-item {
    display: grid;
    min-height: 54px;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.nav-item svg {
    width: 21px;
    height: 21px;
}

.nav-item span {
    font-size: 0.71rem;
    font-weight: 760;
}

.nav-item.active {
    background: rgba(66, 182, 228, 0.13);
    color: var(--cyan-soft);
}

.sheet {
    width: min(calc(100% - 20px), 500px);
    max-height: calc(100vh - 32px);
    margin: auto auto 10px;
    padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 1px solid var(--line-light);
    border-radius: 8px 8px 0 0;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.sheet::backdrop {
    background: rgba(1, 9, 13, 0.7);
}

.sheet form {
    display: grid;
    gap: 13px;
}

.sheet-title .section-kicker {
    color: #22779a;
}

.sheet-handle {
    width: 42px;
    height: 4px;
    margin: 3px auto 11px;
    border-radius: 4px;
    background: #b7c7cb;
}

.sheet .field-row label {
    color: var(--ink);
}

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

.toast {
    position: fixed;
    z-index: 50;
    right: 18px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    left: 18px;
    width: min(calc(100% - 36px), 484px);
    margin: 0 auto;
    padding: 11px 14px;
    transform: translateY(20px);
    border: 1px solid rgba(189, 226, 238, 0.2);
    border-radius: 7px;
    background: #133441;
    color: #fff;
    font-size: 0.81rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.voice-console {
    position: fixed;
    z-index: 35;
    right: 18px;
    bottom: calc(150px + env(safe-area-inset-bottom));
    left: 18px;
    display: grid;
    width: min(calc(100% - 36px), 484px);
    min-height: 72px;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 11px;
    align-items: center;
    margin: 0 auto;
    padding: 11px;
    border: 1px solid rgba(102, 198, 233, 0.38);
    border-radius: 8px;
    background: #102f3d;
    color: var(--text);
    box-shadow: var(--shadow);
}

.voice-console[hidden] {
    display: none;
}

.voice-console-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(66, 182, 228, 0.34);
    border-radius: 8px;
    background: rgba(66, 182, 228, 0.14);
    color: var(--cyan);
}

.voice-console-icon svg {
    width: 21px;
    height: 21px;
}

.voice-console-copy {
    min-width: 0;
}

.voice-console-copy strong,
.voice-console-copy span {
    display: block;
}

.voice-console-copy strong {
    font-size: 0.83rem;
}

.voice-console-copy span {
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-fab {
    position: fixed;
    z-index: 30;
    right: max(18px, calc((100vw - 520px) / 2 + 18px));
    bottom: calc(92px + env(safe-area-inset-bottom));
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(225, 245, 250, 0.72);
    border-radius: 50%;
    background: var(--coral);
    color: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.voice-fab svg {
    width: 22px;
    height: 22px;
}

.voice-fab.is-listening {
    border-color: var(--cyan-soft);
    background: var(--cyan);
    color: #06222d;
}

.voice-fab.is-listening svg {
    animation: voice-pulse 1.4s ease-in-out infinite;
}

body.voice-active .toast {
    bottom: calc(232px + env(safe-area-inset-bottom));
}

@keyframes voice-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
}

@media (min-width: 700px) {
    body {
        padding: 22px 0;
    }

    .app-shell {
        min-height: calc(100vh - 44px);
        border: 1px solid var(--line);
        box-shadow: var(--shadow);
    }

    .bottom-nav {
        bottom: 22px;
        border-right: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
        border-left: 1px solid var(--line);
    }
}

@media (max-width: 340px) {
    .signal-board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .signal-item {
        min-height: 78px;
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 6px;
        padding: 9px 7px;
        border-right: 1px solid var(--line);
        border-bottom: 0;
    }

    .signal-item:last-child {
        border-right: 0;
    }

    .signal-icon {
        width: 28px;
        height: 28px;
    }

    .signal-icon svg {
        width: 14px;
        height: 14px;
    }

    .signal-arrow {
        display: none;
    }

    .signal-item strong {
        font-size: 0.76rem;
    }

    .signal-item small {
        font-size: 0.58rem;
    }
}

@media (max-width: 370px) {
    .app-shell {
        padding-right: 12px;
        padding-left: 12px;
    }

    .hero-stage,
    .hero-content {
        min-height: 322px;
    }

    .hero-content {
        padding: 20px 17px 23px;
    }

    .hero-content h2 {
        font-size: 1.95rem;
    }

    .assistant-card {
        padding: 14px;
    }

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

body.home-active {
    overflow: hidden;
}

body.home-active .app-shell {
    width: 100%;
    min-height: 100dvh;
    padding: 0;
}

body.home-active .topbar,
body.home-active .bottom-nav {
    display: none;
}

body.home-active #view-overview.active {
    display: block;
    height: 100dvh;
    min-height: 100dvh;
}

.ironman-stage {
    position: relative;
    width: 100%;
    height: 100dvh;
    min-height: 620px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 41%, rgba(33, 111, 139, 0.3), transparent 31%),
        radial-gradient(circle at 50% 108%, rgba(181, 45, 34, 0.24), transparent 39%),
        linear-gradient(180deg, #061117 0%, #071821 50%, #03090d 100%);
    isolation: isolate;
    perspective: 1000px;
}

.ironman-stage::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 49.8%, rgba(98, 196, 226, 0.12) 50%, transparent 50.2%),
        linear-gradient(0deg, transparent 49.8%, rgba(98, 196, 226, 0.07) 50%, transparent 50.2%);
    background-size: 72px 72px;
    content: "";
    opacity: 0.25;
    mask-image: radial-gradient(circle at center, #000, transparent 68%);
}

.stage-aura {
    position: absolute;
    top: 47%;
    left: 50%;
    width: min(120vw, 610px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(80, 190, 227, 0.13);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(61, 188, 230, 0.17) 0, rgba(61, 188, 230, 0.05) 38%, transparent 67%);
    box-shadow:
        0 0 0 34px rgba(68, 183, 221, 0.025),
        0 0 0 76px rgba(68, 183, 221, 0.018);
}

.stage-grid {
    position: absolute;
    right: -32%;
    bottom: -11%;
    left: -32%;
    height: 44%;
    transform: rotateX(66deg);
    transform-origin: center bottom;
    background:
        linear-gradient(rgba(77, 181, 216, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77, 181, 216, 0.16) 1px, transparent 1px);
    background-size: 34px 34px;
    opacity: 0.36;
    mask-image: linear-gradient(to top, #000, transparent 90%);
}

.stage-status {
    position: absolute;
    z-index: 8;
    top: max(19px, env(safe-area-inset-top));
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(189, 230, 241, 0.72);
    font-size: 0.62rem;
    font-weight: 800;
}

.stage-status span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 13px rgba(97, 197, 167, 0.9);
    animation: status-pulse 2.2s ease-in-out infinite;
}

.ironman-model {
    position: absolute;
    z-index: 3;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    cursor: pointer;
    perspective: 980px;
    -webkit-tap-highlight-color: transparent;
}

.ironman-model:focus-visible {
    outline: 1px solid rgba(83, 198, 235, 0.72);
    outline-offset: -8px;
}

.model-shadow {
    position: absolute;
    bottom: 12.5%;
    left: 50%;
    width: min(68vw, 310px);
    height: 38px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.66);
    filter: blur(16px);
    box-shadow: 0 0 54px rgba(58, 179, 217, 0.18);
}

.model-halo {
    position: absolute;
    top: 47%;
    left: 50%;
    width: min(78vw, 350px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(88, 197, 232, 0.2);
    border-radius: 50%;
    box-shadow:
        inset 0 0 42px rgba(65, 183, 220, 0.08),
        0 0 42px rgba(65, 183, 220, 0.08);
}

.model-halo::before,
.model-halo::after {
    position: absolute;
    inset: 13%;
    border: 1px dashed rgba(99, 202, 235, 0.18);
    border-radius: 50%;
    content: "";
    animation: halo-spin 18s linear infinite;
}

.model-halo::after {
    inset: 28%;
    border-style: solid;
    border-color: rgba(242, 118, 97, 0.16);
    animation-direction: reverse;
    animation-duration: 12s;
}

.model-float {
    position: absolute;
    top: 48%;
    left: 50%;
    width: min(112vw, 620px);
    aspect-ratio: 1;
    transform: translate(-50%, -51%) rotateX(2deg) rotateY(-4deg);
    transform-style: preserve-3d;
    scale: 1;
    animation: armor-float 5.8s ease-in-out infinite;
}

.photo-glow {
    position: absolute;
    z-index: -1;
    inset: 5%;
    border-radius: 28%;
    background: url("/static/desktop-1.jpg") center / cover no-repeat;
    filter: blur(32px) saturate(1.35);
    opacity: 0.52;
    transform: scale(1.12);
}

.photo-frame {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border: 1px solid rgba(188, 229, 241, 0.3);
    border-radius: 24px;
    background: #091820;
    box-shadow:
        0 32px 70px rgba(0, 0, 0, 0.48),
        0 0 42px rgba(57, 174, 213, 0.16),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    transform: translateZ(28px);
}

.ironman-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter: saturate(1.04) contrast(1.03);
    transform: scale(1.015);
    transition: filter 220ms ease, transform 220ms ease;
}

.photo-sheen {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(118deg, transparent 26%, rgba(255, 255, 255, 0.16) 43%, transparent 57%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 28%, rgba(2, 9, 13, 0.13));
    transform: translateX(-86%) skewX(-10deg);
    mix-blend-mode: screen;
    animation: photo-sheen 7.2s ease-in-out infinite;
    pointer-events: none;
}

.ironman-head {
    position: absolute;
    z-index: 5;
    top: 25px;
    left: 50%;
    width: 232px;
    height: 294px;
    transform: translateX(-50%) translateZ(42px);
    border: 1px solid rgba(255, 177, 158, 0.34);
    border-radius: 48% 48% 41% 41% / 35% 35% 55% 55%;
    background:
        linear-gradient(112deg, rgba(255, 255, 255, 0.23) 0 7%, transparent 8% 22%, rgba(255, 255, 255, 0.1) 23% 29%, transparent 30%),
        linear-gradient(145deg, #e04c3d 0%, #9c1f1c 28%, #5b1113 62%, #24090c 100%);
    box-shadow:
        inset 17px 8px 22px rgba(255, 168, 143, 0.18),
        inset -22px -18px 30px rgba(23, 3, 6, 0.48),
        0 31px 55px rgba(0, 0, 0, 0.5),
        0 0 34px rgba(218, 68, 50, 0.18);
}

.head-crown {
    position: absolute;
    top: -7px;
    left: 50%;
    width: 126px;
    height: 75px;
    transform: translateX(-50%);
    border-radius: 50% 50% 32% 32%;
    background:
        linear-gradient(110deg, rgba(255, 255, 255, 0.17), transparent 32%),
        linear-gradient(180deg, #7b1b1b, #3a0c10);
    box-shadow: inset 0 -8px 16px rgba(27, 3, 6, 0.34);
    clip-path: polygon(8% 0, 92% 0, 82% 100%, 18% 100%);
}

.head-ear {
    position: absolute;
    z-index: -1;
    top: 118px;
    width: 38px;
    height: 84px;
    border: 1px solid rgba(255, 184, 164, 0.2);
    background: linear-gradient(145deg, #b62d28, #4a0c10);
    box-shadow: inset 0 0 13px rgba(255, 172, 146, 0.13);
}

.head-ear-left {
    left: -15px;
    transform: rotate(-8deg) translateZ(-8px);
    border-radius: 56% 16% 32% 54%;
}

.head-ear-right {
    right: -15px;
    transform: rotate(8deg) translateZ(-8px);
    border-radius: 16% 56% 54% 32%;
}

.face-plate {
    position: absolute;
    z-index: 2;
    top: 37px;
    left: 50%;
    width: 178px;
    height: 231px;
    transform: translateX(-50%) translateZ(19px);
    border: 1px solid rgba(255, 239, 174, 0.46);
    border-radius: 45% 45% 37% 37% / 29% 29% 58% 58%;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.3) 0 6%, transparent 7% 36%, rgba(255, 255, 255, 0.11) 37% 42%, transparent 43%),
        linear-gradient(145deg, #ffe190 0%, #d69b38 42%, #8d551c 77%, #4c2c13 100%);
    box-shadow:
        inset 12px 8px 17px rgba(255, 252, 214, 0.3),
        inset -14px -16px 22px rgba(82, 40, 8, 0.32),
        0 15px 24px rgba(43, 12, 4, 0.32);
    clip-path: polygon(50% 0, 83% 8%, 98% 28%, 92% 66%, 73% 91%, 50% 100%, 27% 91%, 8% 66%, 2% 28%, 17% 8%);
}

.face-brow {
    position: absolute;
    top: 49px;
    left: 50%;
    width: 145px;
    height: 32px;
    transform: translateX(-50%);
    border-top: 3px solid rgba(91, 53, 18, 0.42);
    border-radius: 50%;
}

.face-ridge {
    position: absolute;
    top: 31px;
    left: 50%;
    width: 22px;
    height: 137px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(110, 63, 16, 0.12), rgba(255, 242, 181, 0.33), rgba(110, 63, 16, 0.15));
    clip-path: polygon(37% 0, 63% 0, 100% 100%, 0 100%);
}

.armor-eye {
    position: absolute;
    z-index: 3;
    top: 87px;
    width: 61px;
    height: 26px;
    overflow: hidden;
    border: 1px solid rgba(198, 246, 255, 0.78);
    background:
        linear-gradient(180deg, #eaffff 0%, #72ddff 38%, #27a7d7 100%);
    box-shadow:
        0 0 8px rgba(116, 223, 255, 0.96),
        0 0 22px rgba(62, 187, 230, 0.82),
        inset 0 0 8px rgba(255, 255, 255, 0.9);
    clip-path: polygon(0 22%, 84% 0, 100% 39%, 87% 100%, 13% 83%);
}

.armor-eye span {
    position: absolute;
    top: 8px;
    right: 7px;
    left: 7px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    filter: blur(1px);
}

.armor-eye-left {
    left: 16px;
    transform: rotate(4deg);
}

.armor-eye-right {
    right: 16px;
    transform: scaleX(-1) rotate(4deg);
}

.face-nose {
    position: absolute;
    top: 112px;
    left: 50%;
    width: 34px;
    height: 57px;
    transform: translateX(-50%);
    border-right: 1px solid rgba(107, 62, 17, 0.3);
    border-bottom: 1px solid rgba(107, 62, 17, 0.34);
    border-left: 1px solid rgba(255, 243, 184, 0.25);
    background: linear-gradient(90deg, rgba(116, 68, 18, 0.17), rgba(255, 239, 168, 0.16));
    clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%);
}

.face-mouth {
    position: absolute;
    bottom: 38px;
    left: 50%;
    width: 82px;
    height: 18px;
    transform: translateX(-50%);
    border-radius: 8px 8px 18px 18px;
    background:
        linear-gradient(180deg, rgba(73, 39, 11, 0.56), rgba(32, 17, 7, 0.8));
    box-shadow: inset 0 3px 0 rgba(255, 227, 152, 0.18);
    clip-path: polygon(9% 0, 91% 0, 79% 100%, 21% 100%);
}

.face-mouth::before {
    position: absolute;
    top: 5px;
    right: 12px;
    left: 12px;
    height: 1px;
    background: rgba(255, 229, 157, 0.34);
    content: "";
}

.face-jaw-left,
.face-jaw-right {
    position: absolute;
    bottom: 10px;
    width: 57px;
    height: 75px;
    border-bottom: 2px solid rgba(102, 55, 14, 0.35);
}

.face-jaw-left {
    left: 12px;
    transform: rotate(-24deg);
    border-left: 1px solid rgba(255, 235, 168, 0.2);
    border-radius: 0 0 0 70%;
}

.face-jaw-right {
    right: 12px;
    transform: rotate(24deg);
    border-right: 1px solid rgba(255, 235, 168, 0.2);
    border-radius: 0 0 70% 0;
}

.head-glint {
    position: absolute;
    z-index: 6;
    inset: 8px 18px 26px;
    overflow: hidden;
    border-radius: inherit;
    background: linear-gradient(112deg, transparent 28%, rgba(255, 255, 255, 0.18) 42%, transparent 55%);
    transform: translateX(-80%) skewX(-12deg);
    mix-blend-mode: screen;
    animation: armor-glint 6.8s ease-in-out infinite;
}

.armor-torso {
    position: absolute;
    z-index: 3;
    bottom: 0;
    left: 50%;
    width: 286px;
    height: 278px;
    transform: translateX(-50%) translateZ(22px);
    border: 1px solid rgba(255, 168, 148, 0.25);
    border-radius: 38% 38% 16% 16% / 24% 24% 12% 12%;
    background:
        linear-gradient(116deg, rgba(255, 255, 255, 0.14) 0 8%, transparent 9% 28%, rgba(255, 255, 255, 0.07) 29% 34%, transparent 35%),
        linear-gradient(155deg, #b62f2a 0%, #7c1a1c 42%, #310b10 100%);
    box-shadow:
        inset 17px 12px 22px rgba(255, 166, 141, 0.12),
        inset -21px -19px 30px rgba(25, 4, 8, 0.42),
        0 33px 58px rgba(0, 0, 0, 0.46);
    clip-path: polygon(17% 2%, 83% 2%, 96% 23%, 100% 100%, 0 100%, 4% 23%);
}

.armor-neck {
    position: absolute;
    z-index: -1;
    top: -47px;
    left: 50%;
    width: 102px;
    height: 92px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 176, 151, 0.19);
    border-radius: 30px 30px 17px 17px;
    background: linear-gradient(90deg, #471116, #a12a27 52%, #451015);
    box-shadow: inset 0 0 18px rgba(13, 2, 5, 0.56);
}

.armor-chest-line {
    position: absolute;
    top: 74px;
    left: 50%;
    width: 184px;
    height: 105px;
    transform: translateX(-50%);
    border: 2px solid rgba(231, 161, 61, 0.46);
    border-bottom: 0;
    border-radius: 48% 48% 0 0;
    clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}

.arc-reactor {
    position: absolute;
    z-index: 4;
    top: 83px;
    left: 50%;
    display: grid;
    width: 66px;
    height: 66px;
    transform: translateX(-50%) translateZ(16px);
    place-items: center;
    border: 2px solid rgba(197, 242, 255, 0.8);
    border-radius: 50%;
    background:
        repeating-conic-gradient(from 0deg, rgba(195, 243, 255, 0.8) 0 7deg, transparent 7deg 29deg),
        radial-gradient(circle, #eaffff 0 12%, #61d7ff 13% 31%, #1b7193 32% 53%, #0a2734 54%);
    box-shadow:
        0 0 13px rgba(129, 225, 255, 0.96),
        0 0 33px rgba(74, 192, 232, 0.72),
        inset 0 0 15px rgba(255, 255, 255, 0.72);
}

.arc-reactor span {
    width: 21px;
    height: 21px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    background: #dfffff;
    box-shadow: 0 0 18px #fff;
}

.armor-shoulder {
    position: absolute;
    z-index: 2;
    bottom: 16px;
    width: 132px;
    height: 177px;
    border: 1px solid rgba(255, 167, 145, 0.22);
    background:
        linear-gradient(125deg, rgba(255, 255, 255, 0.14), transparent 28%),
        linear-gradient(155deg, #8d2222, #4b1015 58%, #22080d);
    box-shadow: inset -15px -18px 24px rgba(22, 4, 8, 0.37), 0 24px 38px rgba(0, 0, 0, 0.32);
}

.armor-shoulder-left {
    left: -8px;
    transform: rotate(17deg) translateZ(-4px);
    border-radius: 68% 27% 20% 38%;
    clip-path: polygon(26% 0, 100% 15%, 83% 100%, 0 82%);
}

.armor-shoulder-right {
    right: -8px;
    transform: rotate(-17deg) translateZ(-4px);
    border-radius: 27% 68% 38% 20%;
    clip-path: polygon(0 15%, 74% 0, 100% 82%, 17% 100%);
}

.model-caption {
    position: absolute;
    z-index: 8;
    bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
    left: 50%;
    transform: translateX(-50%);
    color: rgba(183, 221, 232, 0.5);
    font-size: 0.58rem;
    font-weight: 800;
    white-space: nowrap;
}

.home-dock {
    position: absolute;
    z-index: 15;
    right: max(15px, calc((100vw - 520px) / 2 + 15px));
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 14px));
    display: grid;
    gap: 9px;
}

.dock-button {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid rgba(163, 218, 235, 0.28);
    border-radius: 50%;
    background: rgba(9, 30, 40, 0.76);
    color: rgba(224, 246, 251, 0.9);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
    cursor: pointer;
    backdrop-filter: blur(14px);
}

.dock-button svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.9;
}

.dock-button:active {
    transform: scale(0.94);
}

#voice-toggle[aria-pressed="true"] {
    border-color: rgba(143, 229, 255, 0.76);
    background: var(--cyan);
    color: #06222d;
    box-shadow: 0 0 26px rgba(66, 182, 228, 0.42);
}

#voice-toggle[aria-pressed="true"] svg {
    animation: voice-pulse 1.3s ease-in-out infinite;
}

.assistant-sheet {
    position: fixed;
    z-index: 80;
    right: 0;
    bottom: 0;
    left: 0;
    width: min(100%, 520px);
    max-width: 520px;
    max-height: min(88dvh, 760px);
    margin: auto auto 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(162, 215, 231, 0.22);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.46);
}

.assistant-sheet::backdrop,
.menu-sheet::backdrop,
.sheet::backdrop {
    background: rgba(2, 9, 13, 0.72);
    backdrop-filter: blur(7px);
}

.assistant-sheet[open] {
    animation: sheet-rise 220ms ease-out both;
}

.assistant-sheet .assistant-card {
    max-height: min(88dvh, 760px);
    margin: 0;
    padding: 7px 16px calc(15px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 0;
    border-radius: 18px 18px 0 0;
    background: var(--surface);
}

.assistant-heading-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.assistant-heading-actions .icon-button {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
}

.assistant-heading-actions .icon-button svg {
    width: 17px;
    height: 17px;
}

.assistant-sheet .messages {
    height: min(43dvh, 330px);
    min-height: 176px;
    max-height: 430px;
    margin-top: 14px;
    overscroll-behavior: contain;
}

.assistant-sheet .messages.expanded {
    height: min(43dvh, 330px);
}

.menu-sheet {
    width: min(calc(100% - 28px), 460px);
    margin: auto;
    padding: 8px 16px 18px;
}

.menu-sheet[open] {
    animation: menu-pop 180ms ease-out both;
}

.menu-grid {
    display: grid;
    gap: 9px;
    margin-top: 17px;
}

.menu-item {
    display: grid;
    min-height: 72px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 11px;
    border: 1px solid var(--line-light);
    border-radius: 8px;
    background: #edf4f6;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.menu-item > svg {
    width: 21px;
    height: 21px;
    color: #257b9d;
}

.menu-item strong,
.menu-item small {
    display: block;
}

.menu-item strong {
    font-size: 0.91rem;
}

.menu-item small {
    margin-top: 3px;
    color: #687d85;
    font-size: 0.71rem;
}

body.home-active.voice-active .stage-aura {
    border-color: rgba(104, 216, 250, 0.34);
    background: radial-gradient(circle, rgba(75, 201, 239, 0.27) 0, rgba(61, 188, 230, 0.08) 40%, transparent 68%);
    animation: aura-breathe 1.8s ease-in-out infinite;
}

body.home-active.voice-active .armor-eye {
    box-shadow:
        0 0 12px rgba(203, 249, 255, 1),
        0 0 34px rgba(71, 202, 242, 1),
        inset 0 0 10px #fff;
}

body.home-active.voice-active .arc-reactor {
    animation: reactor-pulse 1.4s ease-in-out infinite;
}

body.home-active.voice-active .ironman-photo {
    filter: saturate(1.16) contrast(1.07) brightness(1.06);
    transform: scale(1.035);
}

body.home-active.voice-active .photo-glow {
    opacity: 0.72;
    animation: photo-glow-pulse 1.8s ease-in-out infinite;
}

body.home-active.voice-active .voice-console {
    bottom: calc(174px + env(safe-area-inset-bottom));
}

body.home-active .toast {
    bottom: calc(132px + env(safe-area-inset-bottom));
}

.voice-console {
    right: max(18px, calc((100vw - 520px) / 2 + 18px));
    left: max(18px, calc((100vw - 520px) / 2 + 18px));
}

@keyframes status-pulse {
    0%, 100% {
        opacity: 0.55;
    }
    50% {
        opacity: 1;
    }
}

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

@keyframes armor-float {
    0%, 100% {
        transform: translate(-50%, -51%) rotateX(2deg) rotateY(-4deg);
    }
    50% {
        transform: translate(-50%, -53%) rotateX(1deg) rotateY(4deg);
    }
}

@keyframes armor-glint {
    0%, 28% {
        transform: translateX(-90%) skewX(-12deg);
    }
    52%, 100% {
        transform: translateX(95%) skewX(-12deg);
    }
}

@keyframes photo-sheen {
    0%, 28% {
        transform: translateX(-86%) skewX(-10deg);
    }
    52%, 100% {
        transform: translateX(88%) skewX(-10deg);
    }
}

@keyframes photo-glow-pulse {
    0%, 100% {
        transform: scale(1.12);
    }
    50% {
        transform: scale(1.18);
    }
}

@keyframes aura-breathe {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.98);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.04);
    }
}

@keyframes reactor-pulse {
    0%, 100% {
        box-shadow: 0 0 13px rgba(129, 225, 255, 0.96), 0 0 33px rgba(74, 192, 232, 0.72), inset 0 0 15px rgba(255, 255, 255, 0.72);
    }
    50% {
        box-shadow: 0 0 22px rgba(173, 240, 255, 1), 0 0 52px rgba(74, 192, 232, 0.95), inset 0 0 19px #fff;
    }
}

@keyframes sheet-rise {
    from {
        transform: translateY(28px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes menu-pop {
    from {
        transform: scale(0.96);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 370px) {
    .model-float {
        width: min(118vw, 560px);
        scale: 0.94;
    }

    .model-caption {
        bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px));
        left: 20px;
        transform: none;
    }

    .assistant-sheet .assistant-card {
        padding-right: 13px;
        padding-left: 13px;
    }

    .assistant-heading-actions .provider-badge {
        display: none;
    }
}

@media (max-height: 700px) {
    .model-float {
        top: 46%;
        scale: 0.84;
    }

    .model-caption {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .model-float,
    .head-glint,
    .photo-sheen,
    .model-halo::before,
    .model-halo::after,
    .stage-status span,
    body.home-active.voice-active .stage-aura,
    body.home-active.voice-active .arc-reactor {
        animation: none;
    }
}
