:root { --ai-ink: #634A2E; --ai-sub: #8A7A66; --ai-accent: #C8323A; }
body.ai-page { background: linear-gradient(180deg, #2f3953, #7d4f6e 55%, #d9824f); }

.ai-full { --kb: 0px; position: fixed; z-index: 30; top: 10px; bottom: var(--kb); left: var(--app-x, 0px); right: var(--app-x, 0px); display: flex; flex-direction: column; min-height: 0; margin: 0; padding: 0; overflow: hidden; background: var(--grain), radial-gradient(70% 28% at 10% 4%, #6b5fa8 0%, transparent 70%), radial-gradient(60% 26% at 92% 30%, #d8457f 0%, transparent 70%), radial-gradient(70% 30% at 12% 70%, #e2622e 0%, transparent 70%), linear-gradient(180deg, #2f3953 0%, #6a4a78 40%, #b95a63 75%, #e59a58 100%); color: #fff; font-family: var(--text-font); font-weight: 500; }
@media (min-width: 1000px) { .ai-full { top: 0; border-radius: 0; } }
.ai-full .mido-close.ai-new { right: auto; left: calc(18 * var(--u)); cursor: pointer; padding: 0; border: 0; background: none; }
.ai-full .mido-close[hidden] { display: none; }

.ai-av { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: #FEEBC4; color: #634A2E; font-style: normal; }
.ai-av.is-big { width: 64px; height: 64px; }
.ai-av .rb { width: 72%; height: 72%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-av .rb-dot, .ai-av .rb-eye { fill: currentColor; stroke: none; }
.ai-av .rb-head { fill: #FFFBF2; }
.ai-av .rb-cheek { fill: #E98FA6; stroke: none; opacity: 0.85; }

.ai-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: calc(78 * var(--u)) 16px 0; scroll-behavior: smooth; }
.ai-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: 0 0 40px; text-align: center; }
.ai-empty h1 { margin: 16px 0 4px; font-family: var(--hud-font); font-weight: 400; font-size: 26px; line-height: 1.3; color: #fff; text-shadow: 0 1px 8px rgba(30, 24, 48, 0.35); }
.ai-empty p { margin: 0; color: rgba(255, 255, 255, 0.85); font-size: 14px; }
.ai-empty[hidden] { display: none; }
.ai-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 360px; margin-top: 26px; }
.ai-chips button { padding: 8px 14px; border: 1.5px solid #634A2E; border-radius: 999px; background: var(--grain), #FFFBF2; color: #634A2E; font: 700 13px var(--text-font); cursor: pointer; box-shadow: -3px 2px 0 rgba(48, 44, 41, 0.45); transition: translate 0.1s, box-shadow 0.1s; }
.ai-chips button:active { translate: -3px 2px; box-shadow: none; }

.ai-log { display: flex; flex-direction: column; gap: 22px; padding: 6px 0 16px; }
.ai-log:empty { display: none; }
.ai-user { align-self: flex-end; max-width: 84%; padding: 9px 14px; border-radius: 18px 18px 4px 18px; background: #634A2E; color: #FEEBC4; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.ai-row .ai-av { margin-top: 1px; }
.ai-body { flex: 1; min-width: 0; padding: 10px 14px; border: 1.5px solid #634A2E; border-radius: 4px 18px 18px 18px; background: var(--grain), linear-gradient(115deg, rgba(216, 69, 127, 0.2), rgba(226, 98, 46, 0.15) 35%, rgba(227, 164, 58, 0.15) 65%, rgba(223, 194, 122, 0.2)), #FFFBF2; color: var(--ai-ink); box-shadow: -4px 3px 0 rgba(48, 44, 41, 0.45); font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; word-break: auto-phrase; }
.ai-body:empty { display: none; }
.ai-body p { margin: 0 0 0.7em; }
.ai-body p:last-child { margin-bottom: 0; }
.ai-body ul { margin: 0 0 0.7em; padding-left: 1.3em; }
.ai-body li { margin: 0 0 0.25em; }
.ai-body b { font-weight: 900; }
.ai-body h3 { margin: 0.9em 0 0.3em; font-family: var(--hud-font); font-weight: 400; font-size: 17px; letter-spacing: 0.03em; color: var(--ai-accent); }
.ai-body h3:first-child { margin-top: 0; }
.ai-caret::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--ai-ink); vertical-align: 0.02em; animation: ai-pulse 1s ease-in-out infinite; }
@keyframes ai-pulse { 0%, 100% { opacity: 0.25; scale: 0.8; } 50% { opacity: 1; scale: 1.15; } }
.ai-typing { display: inline-flex; gap: 5px; padding: 9px 0 3px; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ai-sub); animation: ai-bounce 1.2s ease-in-out infinite; }
.ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.ai-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-bounce { 0%, 60%, 100% { translate: 0 0; opacity: 0.4; } 30% { translate: 0 -5px; opacity: 1; } }
.ai-acts { display: flex; gap: 2px; margin: 4px 0 -4px -10px; }
.ai-acts button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ai-sub); cursor: pointer; }
.ai-acts button:hover { background: rgba(99, 74, 46, 0.08); color: var(--ai-ink); }
.ai-acts svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ai-err { margin: 6px 0 0; color: var(--ai-accent); font-size: 13.5px; }
.ai-err button { margin-left: 8px; padding: 3px 10px; border: 1px solid currentColor; border-radius: 999px; background: none; color: inherit; font: 700 12.5px var(--text-font); cursor: pointer; }
.ai-stopped { margin: 4px 0 0; color: var(--ai-sub); font-size: 12.5px; }
.ai-links { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; }
.ai-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 12px 6px 9px; border: 1px solid #E0CFA9; border-radius: 999px; background: #FEEBC4; color: #634A2E; font-size: 13px; font-weight: 700; line-height: 1.3; text-decoration: none; }
.ai-link:active { background: #F6DCA2; }
.ai-link svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-link small { flex: none; font-size: 11px; font-weight: 500; opacity: 0.7; }

.ai-down { position: absolute; left: 50%; bottom: 96px; translate: -50% 0; z-index: 3; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1.5px solid #634A2E; border-radius: 50%; background: var(--grain), #FFFBF2; color: #634A2E; box-shadow: -3px 2px 0 rgba(48, 44, 41, 0.45); cursor: pointer; }
.ai-down[hidden] { display: none; }
.ai-down svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ai-foot { flex: none; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); }
.ai-form { display: flex; align-items: flex-end; gap: 8px; max-width: 560px; margin: 0 auto; padding: 4px 6px 4px 14px; border: 1.5px solid #634A2E; border-radius: 26px; background: var(--grain), linear-gradient(115deg, rgba(216, 69, 127, 0.2), rgba(226, 98, 46, 0.15) 35%, rgba(227, 164, 58, 0.15) 65%, rgba(223, 194, 122, 0.2)), #FFFBF2; box-shadow: -4px 3px 0 rgba(48, 44, 41, 0.45); }
.ai-glass { flex: none; align-self: center; width: 21px; height: 21px; fill: none; stroke: #634A2E; stroke-width: 2.4; stroke-linecap: round; }
.ai-form textarea { flex: 1; min-width: 0; max-height: 132px; padding: 9px 0; border: 0; outline: none; resize: none; background: none; color: #634A2E; font: 700 16px/1.5 var(--text-font); }
.ai-form textarea::placeholder { color: #8A7A66; font-weight: 700; }
.ai-send { flex: none; align-self: center; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: #634A2E; color: #FEEBC4; cursor: pointer; transition: opacity 0.15s, scale 0.1s; }
.ai-send:disabled { opacity: 0.28; cursor: default; }
.ai-send:active:not(:disabled) { scale: 0.92; }
.ai-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ai-send.is-stop svg { fill: currentColor; stroke: none; width: 14px; height: 14px; }
.ai-note { margin: 8px 8px 0; color: rgba(255, 255, 255, 0.85); font-size: 11.5px; line-height: 1.5; text-align: center; }
.ai-note a { color: inherit; }

.ai-msg-in { animation: ai-in 0.25s ease both; }
@keyframes ai-in { from { opacity: 0; translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { .ai-msg-in, .ai-caret::after, .ai-typing i { animation: none; } .ai-scroll { scroll-behavior: auto; } }
.ai-tomap { display: inline-flex; align-items: center; gap: 6px; margin: 0 auto 8px; padding: 7px 14px; border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; font: 700 13px var(--text-font); text-decoration: none; }
.ai-tomap svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-foot { display: flex; flex-direction: column; align-items: center; }
.ai-foot .ai-form { width: 100%; }
.ai-link.is-tour { border-color: #d9602b; background: #FFE3D2; }
.ai-link.is-hq { background: #634A2E; border-color: #634A2E; color: #FEEBC4; }
.ai-link.is-hq svg { stroke: #FEEBC4; }
.ai-hq-link { display: inline-block; margin-left: 6px; color: #fff; font-weight: 900; }
.ai-hq-cta { flex: 1 0 calc(100% - 38px); display: flex; align-items: center; gap: 12px; box-sizing: border-box; min-height: 64px; margin: 6px 0 0 38px; padding: 10px 16px; border: 1.5px solid #4a1015; border-radius: 18px; background: var(--grain), linear-gradient(110deg, #C8323A 0%, #E2622E 100%); color: #fff; text-decoration: none; box-shadow: -5px 4px 0 rgba(48, 44, 41, 0.55); animation: ai-cta-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.ai-hq-cta svg { flex: none; width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ai-hq-cta span { flex: 1; display: grid; gap: 2px; text-align: left; }
.ai-hq-cta b { font-family: var(--hud-font); font-weight: 400; font-size: 22px; letter-spacing: 0.03em; line-height: 1.15; }
.ai-hq-cta small { font-size: 12px; font-weight: 700; opacity: 0.92; }
.ai-hq-cta i { font-style: normal; font-size: 30px; line-height: 1; }
.ai-hq-cta:active { translate: -5px 4px; box-shadow: none; }
@keyframes ai-cta-in { from { opacity: 0; scale: 0.92; } }
@media (prefers-reduced-motion: reduce) { .ai-hq-cta { animation: none; } }
.ai-next { flex: 1 0 calc(100% - 38px); display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 0 38px; }
.ai-next button { padding: 8px 14px; border: 1.5px solid #634A2E; border-radius: 999px; background: var(--grain), #FFFBF2; color: #634A2E; font: 700 13.5px/1.3 var(--text-font); text-align: left; cursor: pointer; box-shadow: -3px 2px 0 rgba(48, 44, 41, 0.45); animation: ai-cta-in 0.4s both; }
.ai-next button:active { translate: -3px 2px; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .ai-next button { animation: none; } }
.ai-sug { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 0 2px; }
.ai-sug[hidden] { display: none; }
.ai-sug button { padding: 8px 14px; border: 1.5px solid #634A2E; border-radius: 999px; background: var(--grain), #FFFBF2; color: #634A2E; font: 700 13px/1.3 var(--text-font); text-align: left; cursor: pointer; box-shadow: -3px 2px 0 rgba(48, 44, 41, 0.45); animation: ai-cta-in 0.25s both; }
.ai-sug button:active { translate: -3px 2px; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .ai-sug button { animation: none; } }
.ai-minimap { margin: 12px 0 2px; border: 1.5px solid #634A2E; border-radius: 14px; background: #f3e7c6; overflow: hidden; }
.ai-mm-map { position: relative; display: block; aspect-ratio: 1.7; background: #efe2bd; }
.ai-mm-map svg { display: block; width: 100%; height: 100%; }
.ai-mm-map .ar { fill: #cfdcae; opacity: 0.7; }
.ai-mm-map .bd { fill: #e4cf9f; stroke: #c3a56c; stroke-width: 0.6; }
.ai-mm-map .bd.c { fill: #eddcb4; }
.ai-mm-map .dest { fill: rgba(200, 50, 58, 0.22); stroke: #C8323A; }
.ai-mm-map .pin circle { fill: #C8323A; stroke: #fff; }
.ai-mm-map .pin text { fill: #fff; font-family: var(--text-font); font-weight: 900; text-anchor: middle; }
.ai-mm-open { position: absolute; right: 8px; bottom: 8px; padding: 4px 10px; border-radius: 999px; background: rgba(99, 74, 46, 0.88); color: #FEEBC4; font: 700 11.5px var(--text-font); }
.ai-mm-list { display: grid; }
.ai-mm-list a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid rgba(99, 74, 46, 0.22); color: #634A2E; text-decoration: none; font-size: 13.5px; font-weight: 700; }
.ai-mm-list a:active { background: rgba(99, 74, 46, 0.1); }
.ai-mm-list b { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #C8323A; color: #fff; font-size: 12px; font-weight: 900; }
.ai-mm-list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-mm-list em { flex: none; padding: 1px 7px; border-radius: 999px; background: rgba(99, 74, 46, 0.14); font-style: normal; font-size: 11px; }
.ai-mm-list i { flex: none; font-style: normal; opacity: 0.5; font-size: 18px; }

body.ai-page:not(.hq-page) { background: linear-gradient(180deg, #1f3a4d, #2f6a80 55%, #5fa7b0); }
.ai-page:not(.hq-page) .ai-full { background: var(--grain), radial-gradient(70% 28% at 10% 4%, #3F9F99 0%, transparent 70%), radial-gradient(60% 26% at 92% 30%, #5BB8D4 0%, transparent 70%), radial-gradient(70% 30% at 12% 70%, #8E7CC3 0%, transparent 70%), linear-gradient(180deg, #1f3a4d 0%, #2f6a80 45%, #4a8f9f 78%, #8ec3c9 100%); }
