:root {
    color-scheme: dark;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #0b0d0f;
    color: #f5f1e8;
    --acid: #d8ff3e;
    --orange: #ff6947;
    --panel: #171a1d;
    --muted: #969b9d;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 80% 10%, rgba(216, 255, 62, .12), transparent 30rem),
        linear-gradient(145deg, #101315, #08090a 70%);
}
button, input { font: inherit; }
button { touch-action: manipulation; }

.assistant-shell {
    width: min(760px, 100%);
    min-height: 100vh;
    margin: auto;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    display: grid;
    align-content: start;
    gap: 1.4rem;
}

.topline { display: flex; justify-content: space-between; align-items: start; }
.eyebrow { color: var(--acid); font-size: .72rem; font-weight: 800; letter-spacing: .22em; margin: 0 0 .5rem; }
h1 { font-family: Impact, "Arial Narrow", sans-serif; font-size: clamp(2rem, 8vw, 4rem); line-height: .98; margin: 0; letter-spacing: -.035em; }
.quiet-button { color: var(--muted); background: transparent; border: 0; padding: .75rem; }

.voice-zone { display: grid; justify-items: center; padding: clamp(1rem, 5vh, 3rem) 0 .5rem; }
.voice-button {
    width: clamp(13rem, 56vw, 19rem);
    aspect-ratio: 1;
    border: 0;
    border-radius: 50%;
    background: var(--acid);
    color: #10120d;
    box-shadow: 0 0 0 .65rem rgba(216,255,62,.07), 0 1.5rem 4rem rgba(0,0,0,.45);
    display: grid;
    place-content: center;
    gap: 1rem;
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease;
}
.voice-button:active { transform: scale(.96); }
.voice-button:disabled { filter: grayscale(.8); opacity: .45; }
.voice-button.listening { animation: pulse 1.2s infinite; background: var(--orange); }
.mic-shape { width: 2.2rem; height: 3.2rem; border: .28rem solid currentColor; border-radius: 1.4rem; margin: auto; position: relative; }
.mic-shape::after { content: ""; position: absolute; left: 50%; top: 3.1rem; width: 2.8rem; height: 1.35rem; border: .25rem solid currentColor; border-top: 0; border-radius: 0 0 1.5rem 1.5rem; transform: translateX(-50%); }
.voice-hint { color: var(--muted); text-align: center; margin: 1.6rem 0 0; }

.command-panel, .status-card { background: rgba(23,26,29,.88); border: 1px solid #2b3033; border-radius: 1.2rem; padding: 1rem; }
.command-panel label { display: block; color: var(--muted); font-size: .8rem; font-weight: 700; margin: 0 0 .7rem .2rem; text-transform: uppercase; letter-spacing: .08em; }
.command-row { display: grid; grid-template-columns: 1fr auto; gap: .65rem; }
input { width: 100%; min-width: 0; color: #fff; background: #0c0e0f; border: 1px solid #363b3e; border-radius: .85rem; padding: 1rem; outline: 0; }
input:focus { border-color: var(--acid); box-shadow: 0 0 0 3px rgba(216,255,62,.12); }
.send-button, .login-button { border: 0; border-radius: .85rem; background: #f5f1e8; color: #111; font-weight: 800; padding: 0 1.2rem; }
.send-button:disabled, .login-button:disabled { opacity: .4; }

.status-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .9rem; }
.status-mark { width: .9rem; height: .9rem; border-radius: 50%; background: #72787b; box-shadow: 0 0 0 .3rem rgba(114,120,123,.13); }
.status-label { font-weight: 800; margin: 0 0 .15rem; }
.status-message { color: var(--muted); margin: 0; line-height: 1.45; }
.status-success .status-mark { background: var(--acid); }
.status-error .status-mark { background: var(--orange); }
.status-unknown .status-mark { background: #f1be48; }
.status-working .status-mark, .status-listening .status-mark { background: #72b8ff; animation: blink 1s infinite; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: min(440px, 100%); background: var(--panel); border: 1px solid #2b3033; border-radius: 1.5rem; padding: clamp(1.5rem, 7vw, 3rem); box-shadow: 0 2rem 8rem #000; }
.login-card h1 { font-size: clamp(2.5rem, 12vw, 4.5rem); }
.login-copy { color: var(--muted); line-height: 1.6; margin: 1.7rem 0; }
.login-card label { display: block; margin: 0 0 .5rem; font-weight: 700; }
.login-button { width: 100%; min-height: 3.5rem; margin-top: .8rem; background: var(--acid); }
.login-error { color: #ff927a; margin-bottom: 0; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; width: 100%; padding: 1rem; background: var(--orange); color: #111; }
.loading-progress { position: absolute; width: 7rem; height: 7rem; inset: 30vh 0 auto; margin: auto; }
.loading-progress circle { fill: none; stroke: #303538; stroke-width: .6rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--acid); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%; }
.loading-progress-text { position: absolute; inset: calc(30vh + 8rem) 0 auto; text-align: center; color: var(--muted); }
.loading-progress-text::after { content: "Загрузка " var(--blazor-load-percentage-text, ""); }

@keyframes pulse { 50% { box-shadow: 0 0 0 1.4rem rgba(255,105,71,.12), 0 1.5rem 4rem rgba(0,0,0,.45); } }
@keyframes blink { 50% { opacity: .35; } }
@media (max-width: 520px) {
    .assistant-shell { gap: 1rem; }
    .command-row { grid-template-columns: 1fr; }
    .send-button { min-height: 3.2rem; }
    .voice-zone { padding-top: 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
