.histi-utility-dock { position:fixed; z-index:85; left:max(18px,env(safe-area-inset-left)); right:auto; bottom:calc(var(--settings-bottom,20px) + env(safe-area-inset-bottom)); display:flex; align-items:center; }
.histi-language-trigger { display:inline-flex; align-items:center; gap:8px; height:44px; padding:10px 14px; border:1px solid #7e9bb0; border-radius:999px; background:var(--palette-card,#fffdf8); color:var(--palette-blue-ink,#234c71); box-shadow:0 5px 18px #203b4f18; font-size:14px; cursor:pointer; transition:background-color 180ms,transform 180ms; }
.histi-language-trigger svg { width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:1.6; }
.histi-language-cycle { position:relative; display:block; width:66px; height:22px; overflow:hidden; }
.histi-language-words { display:block; direction:ltr; animation:histi-language-roll 32s cubic-bezier(.22,1,.36,1) infinite; }
.histi-language-word { display:flex; align-items:center; justify-content:center; height:22px; line-height:22px; }
.histi-language-word:lang(zh-CN) { font-family:"PingFang SC","Microsoft YaHei",sans-serif; }
@keyframes histi-language-roll {
 0%,9.375% { transform:translateY(0); }
 12.5%,21.875% { transform:translateY(-22px); }
 25%,34.375% { transform:translateY(-44px); }
 37.5%,46.875% { transform:translateY(-66px); }
 50%,59.375% { transform:translateY(-88px); }
 62.5%,71.875% { transform:translateY(-110px); }
 75%,84.375% { transform:translateY(-132px); }
 87.5%,96.875% { transform:translateY(-154px); }
 100% { transform:translateY(-176px); }
}
.histi-language-dialog { position:fixed; inset:auto; left:max(18px,env(safe-area-inset-left)); right:auto; bottom:calc(16px + env(safe-area-inset-bottom)); width:min(390px,calc(100vw - 28px)); max-height:calc(100svh - 32px - env(safe-area-inset-bottom)); overflow-y:auto; overscroll-behavior:contain; margin:0; padding:24px; border:1px solid #8ea7bb; border-radius:26px; background:var(--palette-card,#fffdf8); color:var(--palette-ink,#25323b); box-shadow:0 16px 52px #23394c24; transform-origin:bottom left; }
.histi-language-dialog:not([open]),.histi-settings-dialog:not([open]) { display:none!important; }
.histi-language-dialog::backdrop { background:#182b4030; }
.histi-language-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.histi-language-head h2 { margin:0; font-size:32px; line-height:1.3; }
.histi-language-close { min-height:40px; padding:8px 12px; border:1px solid #a9b5bf; border-radius:999px; background:transparent; color:inherit; cursor:pointer; }
.histi-language-intro { margin:10px 0 20px; color:var(--palette-muted,#50626c); font-size:15px; }
.histi-language-options { display:grid; gap:9px; margin:0; padding:3px; border:0; min-width:0; max-height:min(42svh,340px); overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.histi-language-option { position:relative; display:grid; grid-template-columns:minmax(0,1fr) 24px; align-items:center; column-gap:10px; min-height:68px; padding:12px 16px; border:1px solid #b4c3cf; border-radius:17px; cursor:pointer; transition:background-color 160ms,border-color 160ms; }
.histi-language-option:has(input:checked) { background:#e4edf9; border-color:#42668e; }
.histi-language-option input { position:absolute; width:1px; height:1px; opacity:0; }
.histi-language-name { grid-column:1; font-size:18px; line-height:1.5; }
.histi-language-option small { grid-column:1; font-size:12px; line-height:1.5; color:var(--palette-muted,#50626c); }
.histi-language-check { grid-column:2; grid-row:1 / 3; opacity:0; transform:scale(.8); color:#294f76; font-size:19px; transition:opacity 180ms ease,transform 220ms cubic-bezier(.16,1,.3,1); }
.histi-language-option:has(input:checked) .histi-language-check { opacity:1; transform:none; }
.histi-language-availability { margin:12px 0; min-height:20px; font-size:12px; line-height:1.5; color:var(--palette-muted,#50626c); }
.histi-language-apply { display:flex; align-items:center; justify-content:center; min-height:46px; padding:12px 18px; border:1px solid #365e86; border-radius:999px; background:#d6e7ff; color:#213950; font-size:15px; text-decoration:none; text-align:center; }
.histi-language-apply[aria-disabled="true"] { opacity:.65; background:transparent; }
.histi-language-note { margin:13px 0 0; color:var(--palette-muted,#50626c); font-size:12px; line-height:1.65; }
.histi-settings-language { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; margin:0 0 18px; min-height:46px; padding:10px 12px; border:1px solid #a1b3c3; border-radius:12px; background:transparent; color:inherit; font-size:14px; cursor:pointer; }
.histi-settings-language :is(small,bdi) { font-size:12px; }
.histi-language-dialog .visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
:is(.histi-language-trigger,.histi-language-close,.histi-language-apply,.histi-settings-language):focus-visible,.histi-language-option:has(input:focus-visible) { outline:3px solid #1e557e; outline-offset:3px; }
html:is(.histi-intro-active,.histi-intro-pending,.histi-url-covered) .histi-utility-dock { visibility:hidden; }
html[data-performance="on"] .histi-language-words,body:is(.reduce-motion,.visitor-motion-paused) .histi-language-words { animation:none!important; transform:none!important; }
html[data-performance="on"] .histi-language-word,body:is(.reduce-motion,.visitor-motion-paused) .histi-language-word { display:none; }
html[data-performance="on"] .histi-language-word[data-current],body:is(.reduce-motion,.visitor-motion-paused) .histi-language-word[data-current] { display:flex; }
html[data-contrast="high"] :is(.histi-language-dialog,.histi-language-trigger,.histi-language-option) { border-color:#425a70; }
@media(hover:hover) { .histi-language-trigger:hover { background:#edf5fc; transform:translateY(-2px); } .histi-language-option:hover { border-color:#42668e; } }
@media(prefers-reduced-motion:reduce) { .histi-language-words { animation:none; transform:none; } .histi-language-word { display:none; } .histi-language-word[data-current] { display:flex; } }
@media(max-width:600px) {
 .histi-utility-dock { left:max(14px,env(safe-area-inset-left)); bottom:calc(14px + env(safe-area-inset-bottom)); }
 body.histi-has-fixed-footer .histi-utility-dock { bottom:calc(var(--h4-footer-height,76px) + 12px + env(safe-area-inset-bottom)); }
 body.histi-has-fixed-footer .histi-settings-trigger { bottom:calc(var(--h4-footer-height,76px) + 12px + env(safe-area-inset-bottom)); }
 .histi-language-trigger { padding-inline:12px; }
 .histi-language-dialog { left:max(14px,env(safe-area-inset-left)); padding:20px; }
 .histi-language-head h2 { font-size:28px; }
}
/* Long translated labels wrap instead of widening cards, navigation, or controls. */
html:lang(es) :is(.h4-status,.h4-yn,.result-actions,.histi-nav) { flex-wrap:wrap; }
html:lang(es) .h4-status button { white-space:normal; }
html:lang(es) .histi-nav { gap:18px; }
html:lang(es).histi-url-motion::before,html:lang(es) .histi-history-veil::before { content:'Un poco de espacio. Solo para ti.'; }
html:is(:lang(es),:lang(zh-CN)) :is(.home-process-grid>*,.selector-card-grid>*,.home-area-row>*) { min-width:0; }
.translation-note { max-width:1200px; margin:14px auto; padding:10px 16px; color:var(--palette-muted,#50626c); font-size:13px; line-height:1.75; }
@media(max-width:680px) { html:lang(es) .histi-start-label { font-size:11px; } html:lang(es) .histi-start-label::after { content:none; } }
@media(max-width:380px) {
 html:lang(es) .histi-header #privacy-live-label { font-size:0!important; }
 html:lang(es) .histi-header #privacy-live-label::after { content:'Privacidad'; font-size:10px; }
}
