/* Stormy's own space in the page: never a floating obstruction over tools or sponsors. */
#stormy-companion-slot { position:relative;min-width:0; }
.stormy-companion { --companion-accent:#567a92;--companion-tint:#edf3f6;color:var(--ink);max-width:1360px;margin:0 auto;padding:30px var(--space,24px) 0; }
.stormy-companion[data-tone=sunny] { --companion-accent:#8a6c15;--companion-tint:#f5f2df; }
.stormy-companion[data-tone=rain] { --companion-accent:#346b9a;--companion-tint:#e9f1f8; }
.stormy-companion[data-tone=snow] { --companion-accent:#377983;--companion-tint:#e8f4f5; }
.stormy-companion[data-tone=caution],.stormy-companion[data-tone=alert] { --companion-accent:#8b6027;--companion-tint:#faf0df; }
.stormy-companion[data-tone=severe] { --companion-accent:#a0352d;--companion-tint:#f9e9e7; }
.stormy-perch { position:relative;display:flex;align-items:center;gap:18px;min-height:116px;border-bottom:1px solid var(--line);isolation:isolate; }
.stormy-perch::before { content:'';position:absolute;left:148px;right:0;bottom:16px;height:72px;background:var(--companion-tint);border-radius:3px;z-index:-1; }
.stormy-character-button { position:relative;flex:0 0 138px;width:138px;height:148px;margin-top:-27px;align-self:flex-end;border:0;background:none;padding:0;border-radius:50%; }
.stormy-character-button:hover { background:transparent; }
.stormy-free-art { position:absolute;left:4px;bottom:0;display:block;width:130px;height:148px;overflow:hidden;transform-origin:center bottom; }
.stormy-free-sprite { position:absolute;left:-23px;top:-27px;display:block;width:176px;height:191px;background:url('/next/assets/storm/storm-default.png') 0 0 / 100% 100% no-repeat; }
.stormy-companion[data-frame=calm] .stormy-free-sprite { background-image:url('/next/assets/storm/storm-calm.png'); }
.stormy-companion[data-frame=blink] .stormy-free-sprite { --companion-sprite-end:120%;background-image:url('/next/assets/storm/storm-idle.png');background-size:600% 100%;animation:companion-sprite .68s steps(6) 1; }
.stormy-companion[data-frame=wave] .stormy-free-sprite { --companion-sprite-end:133.333333%;background-image:url('/next/assets/storm/storm-wave.png');background-size:400% 100%;animation:companion-sprite .68s steps(4) 2; }
.stormy-companion[data-motion=on] .stormy-free-art { animation:companion-presence 3.8s ease-in-out infinite; }
@keyframes companion-presence { 0%,100% { transform:translateY(0) rotate(-.7deg); } 50% { transform:translateY(-3px) rotate(.7deg); } }
@keyframes companion-sprite { from { background-position:0 0; } to { background-position:var(--companion-sprite-end) 0; } }
.stormy-perch-copy { flex:1;min-width:0;padding:7px 0 19px; }
.stormy-wordmark { font-size:21px;line-height:1.3;font-weight:750;letter-spacing:-.5px; }
.stormy-wordmark>span { display:inline-block;margin-left:9px;font-size:10px;font-weight:650;letter-spacing:.7px;text-transform:uppercase;color:var(--companion-accent); }
.stormy-perch-greeting { margin-top:6px;font-size:14px;line-height:1.45; }
.stormy-perch-place { margin-top:4px;font-size:10px;line-height:1.5;color:var(--muted); }
.stormy-ask-button { flex-shrink:0;display:flex;align-items:center;justify-content:center;gap:18px;min-height:44px;margin:0 18px 16px 0;padding:9px 16px;border:1px solid var(--companion-accent);border-radius:4px;background:var(--surface);color:var(--ink);font-size:13px;font-weight:650; }
.stormy-ask-button:hover { background:var(--blue-soft); }
.stormy-ask-button span { font-size:19px; }
.stormy-dialog { width:min(620px,calc(100vw - 32px));max-width:620px;max-height:min(800px,calc(100dvh - 40px));padding:0;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);box-shadow:0 18px 70px #05152440;overflow:hidden; }
.stormy-dialog[open] { display:flex;flex-direction:column; }
.stormy-dialog::backdrop { background:#0b223b80; }
.stormy-dialog-header { display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 20px;border-bottom:1px solid var(--line);flex-shrink:0;background:var(--paper); }
.stormy-dialog-brand { display:flex;align-items:center;gap:12px;min-width:0; }
.stormy-dialog-portrait { width:46px;height:53px;flex-shrink:0;background:url('/next/assets/storm/storm-default.png') center / 66px 71px no-repeat; }
.stormy-dialog[data-calm-ready=true]:is([data-tone=severe],[data-tone=alert],[data-tone=caution],[data-tone=unavailable],[data-confidence=limited]) .stormy-dialog-portrait { background-image:url('/next/assets/storm/storm-calm.png'); }
.stormy-dialog-eyebrow { font-size:9px;letter-spacing:1px;line-height:1.5;text-transform:uppercase;color:var(--muted);font-weight:650; }
.stormy-dialog h2 { margin-top:3px;font-size:25px; }
.stormy-close { width:44px;height:44px;flex-shrink:0;border:1px solid var(--line);border-radius:4px;background:var(--surface);font-size:28px;line-height:1; }
.stormy-dialog-body { min-height:0;overflow:auto;overscroll-behavior:contain;padding:20px; }
.stormy-current-place { font-size:13px;font-weight:650; }
.stormy-scope { margin-top:7px;font-size:12px;line-height:1.6;color:var(--muted); }
.stormy-question-examples { display:flex;flex-wrap:wrap;gap:7px;margin:16px 0; }
.stormy-question-examples button { max-width:100%;min-height:40px;padding:8px 11px;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--blue);font-size:12px;text-align:left;line-height:1.4; }
.stormy-question-examples button:hover { background:var(--blue-soft); }
.stormy-conversation { display:grid;gap:20px; }
.stormy-exchange { min-width:0; }
.stormy-question { margin-left:30px;padding:11px 14px;background:var(--blue-soft);border-radius:5px 5px 0 5px;font-size:13px;overflow-wrap:anywhere; }
.stormy-answer { padding:15px 0 0 12px;border-left:2px solid var(--line);margin-top:12px; }
.stormy-exchange[data-tone=severe] .stormy-answer { border-color:#b1483c; }
.stormy-exchange[data-tone=alert] .stormy-answer,.stormy-exchange[data-tone=caution] .stormy-answer { border-color:#9a722d; }
.stormy-answer-byline { display:block;font-size:10px;font-weight:650;color:var(--muted);margin-bottom:7px; }
.stormy-answer h3 { font-size:18px;margin-bottom:7px; }
.stormy-answer>p,.stormy-answer li { font-size:13px;line-height:1.65;overflow-wrap:anywhere; }
.stormy-answer ul { padding-left:19px;margin:10px 0 0; }
.stormy-answer li+li { margin-top:5px; }
.stormy-answer .stormy-answer-source { margin-top:10px;color:var(--muted);font-size:10px;line-height:1.6; }
.stormy-answer-actions { display:flex;flex-wrap:wrap;gap:8px;margin-top:9px; }
.stormy-answer-actions button,.stormy-panel-tools button { padding:0;min-height:40px;border:0;background:none;color:var(--blue);font-size:12px;font-weight:650; }
.stormy-answer-actions button { padding-right:10px; }
.stormy-conversation-notice { margin-top:12px;font-size:12px;line-height:1.5;color:var(--muted); }
.stormy-conversation-notice:empty { display:none; }
.stormy-question-form { flex-shrink:0;padding:16px 20px 12px;border-top:1px solid var(--line);background:var(--surface); }
.stormy-question-form>label { display:block;margin-bottom:7px;font-size:12px;font-weight:650; }
.stormy-input-row { display:flex;gap:8px; }
.stormy-input-row input { width:0;min-width:0;flex:1;min-height:46px;padding:10px 11px;border:1px solid var(--muted);border-radius:4px;background:var(--surface);color:var(--ink);font-size:14px; }
.stormy-send { min-width:60px;padding:9px 14px;border:1px solid var(--nav);border-radius:4px;background:var(--nav);color:var(--nav-ink);font-weight:650; }
.stormy-privacy { margin-top:8px;font-size:10px;line-height:1.5;color:var(--muted); }
.stormy-panel-tools { display:flex;justify-content:space-between;flex-wrap:wrap;gap:4px 16px; }
[data-theme=dark] .stormy-companion { --companion-accent:#98b7cb;--companion-tint:#1d3443; }
[data-theme=dark] .stormy-companion[data-tone=sunny] { --companion-accent:#dac87f;--companion-tint:#303222; }
[data-theme=dark] .stormy-companion[data-tone=rain] { --companion-accent:#93c5ef;--companion-tint:#21394d; }
[data-theme=dark] .stormy-companion[data-tone=snow] { --companion-accent:#91cfd5;--companion-tint:#203e42; }
[data-theme=dark] .stormy-companion[data-tone=caution],[data-theme=dark] .stormy-companion[data-tone=alert] { --companion-accent:#e0ba85;--companion-tint:#3b3124; }
[data-theme=dark] .stormy-companion[data-tone=severe] { --companion-accent:#efa69f;--companion-tint:#432b2a; }
@media(max-width:760px) {
  .stormy-companion { padding-top:24px; }
  .stormy-perch { gap:8px;display:grid;grid-template-columns:96px minmax(0,1fr);padding-bottom:12px; }
  .stormy-perch::before { left:92px;bottom:12px;top:4px;height:auto; }
  .stormy-character-button { grid-column:1;grid-row:1 / span 2;width:96px;height:130px;margin-top:-20px;align-self:start; }
  .stormy-free-art { left:-6px;bottom:0;width:108px;height:130px; }
  .stormy-free-sprite { width:148px;height:161px;left:-19px;top:-19px; }
  .stormy-perch-copy { grid-column:2;grid-row:1;padding:7px 9px 0 0; }
  .stormy-wordmark { font-size:23px; }
  .stormy-wordmark>span { display:none; }
  .stormy-perch-greeting { font-size:12px;margin-top:4px; }
  .stormy-perch-place { font-size:9px; }
  .stormy-ask-button { grid-column:2;grid-row:2;justify-self:start;gap:14px;margin:0 9px 0 0;padding:7px 12px;font-size:12px;min-height:42px; }
}
@media(max-width:480px) {
  .stormy-dialog { width:calc(100vw - 16px);max-height:calc(100dvh - 16px);margin:8px auto;border-radius:6px; }
  .stormy-dialog-header { padding:10px 14px; }
  .stormy-dialog-body { padding:14px; }
  .stormy-question-form { padding:12px 14px calc(8px + env(safe-area-inset-bottom,0px)); }
  .stormy-dialog h2 { font-size:22px; }
  .stormy-input-row input { font-size:16px; }
}
@media(prefers-reduced-motion:reduce) { .stormy-free-art,.stormy-free-sprite { animation:none!important; } }

/* The chat owns its visible viewport, including keyboards that overlay the layout
   viewport. ID specificity avoids generic dialog padding/safe-area overrides. */
#stormy-dialog.stormy-dialog{position:fixed;inset:auto;top:calc(var(--stormy-vv-top,0px) + 8px);left:calc(var(--stormy-vv-left,0px) + var(--stormy-vv-width,100vw)/2);transform:translateX(-50%);margin:0!important;padding:0!important;box-sizing:border-box;width:min(620px,calc(var(--stormy-vv-width,100vw) - 16px));max-width:calc(var(--stormy-vv-width,100vw) - 16px);height:min(760px,calc(var(--stormy-vv-height,100dvh) - 16px));max-height:calc(var(--stormy-vv-height,100dvh) - 16px);border-radius:16px;overflow:hidden}
#stormy-dialog .stormy-dialog-header{padding:10px 14px;gap:10px}
#stormy-dialog .stormy-dialog-portrait{width:32px;height:38px;background-size:48px 52px}
#stormy-dialog h2{font-size:22px;line-height:1.2;overflow-wrap:anywhere}
#stormy-dialog .stormy-dialog-body{flex:1 1 auto;min-height:0;padding:12px 14px;scroll-padding-block:12px;overflow-y:auto;overflow-x:hidden}
#stormy-dialog .stormy-question-form{padding:10px 14px max(10px,env(safe-area-inset-bottom,0px));flex:0 0 auto;min-width:0}
#stormy-dialog .stormy-input-row{align-items:stretch;min-width:0}
#stormy-dialog .stormy-input-row input{font-size:16px;min-height:48px;min-width:0}
#stormy-dialog .stormy-send{flex:0 0 auto;min-height:48px;min-width:60px;font-size:16px}
#stormy-dialog .stormy-answer>p,#stormy-dialog .stormy-answer li,#stormy-dialog .stormy-question{font-size:15px}
#stormy-dialog .stormy-chat-details{margin-top:16px;border-top:1px solid var(--line);font-size:13px}
#stormy-dialog .stormy-chat-details>summary{min-height:44px;padding:12px 0;cursor:pointer;color:var(--muted)}
#stormy-dialog .stormy-question-examples button{min-height:44px}
#stormy-dialog[data-compact=true] .stormy-scope,#stormy-dialog[data-compact=true] .stormy-question-examples,#stormy-dialog[data-compact=true] .stormy-dialog-portrait{display:none}
#stormy-dialog[data-compact=true] .stormy-current-place{margin:0 0 10px;font-size:12px}
#stormy-dialog[data-compact=true] .stormy-question-form>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#stormy-dialog[data-compact=true] .stormy-dialog-header{padding-block:6px}
