/* Web adaptations of Android's tested presentation, never its native bridges. */
.silicio-line-icon { display:inline-flex !important;align-items:center;justify-content:center;line-height:1 !important;vertical-align:middle;text-shadow:none !important; }
.silicio-line-icon > svg { display:block;width:24px;height:24px;flex:none; }
:is(.memory-result-icon,.position-memory-result-icon,.reflex-training-result-icon).silicio-line-icon {
    width:64px;height:64px;padding:0;margin:0 auto 8px;border-radius:18px;
    color:var(--theme-accent-primary);background:var(--theme-bg-secondary);border:1px solid var(--theme-border);box-shadow:none;animation:none;
}
:is(.memory-result-icon,.position-memory-result-icon,.reflex-training-result-icon).silicio-line-icon > svg {width:34px;height:34px;}
.mobile-header.silicio-has-notice .mobile-header-title {visibility:hidden;}
#silicioHeaderNotice {
    position:absolute;inset:4px 62px;z-index:1;box-sizing:border-box;
    display:grid;grid-template-columns:20px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 12px;
    align-items:center;column-gap:7px;min-width:0;min-height:44px;margin:0;padding:3px 8px;
    color:var(--theme-text-primary);background:var(--theme-bg-secondary);border:1px solid var(--theme-accent-primary);border-radius:10px;
    font-family:inherit;text-align:center;cursor:pointer;letter-spacing:normal;text-transform:none;
}
#silicioHeaderNotice > svg {grid-row:1 / -1;width:20px;height:20px;color:var(--theme-accent-primary);}
#silicioHeaderNotice .silicio-notice-text {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;font-size:12px;font-weight:600;line-height:15px;}
#silicioHeaderNotice > small {font-size:10px;line-height:12px;font-weight:600;color:var(--theme-text-secondary);}
#silicioHeaderNotice:is([data-tone="error"],[data-tone="warning"]) {border-inline-width:3px;}
#silicioHeaderNotice:focus-visible,#silicioNoticeDetail button:focus-visible {outline:3px solid var(--theme-accent-primary);outline-offset:2px;}
#silicioNoticeDetail {
    box-sizing:border-box;width:min(480px,calc(100% - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:20px;
    border:1px solid var(--theme-border);border-radius:18px;color:var(--theme-text-primary);background:var(--theme-bg-primary);
    font-family:inherit;overflow:hidden;z-index:1000000;
}
#silicioNoticeDetail[open] {display:flex;flex-direction:column;gap:16px;}
#silicioNoticeDetail::backdrop {background:#000b;}
#silicioNoticeDetail h2 {margin:0;font-size:18px;line-height:1.35;color:var(--theme-text-primary);flex-shrink:0;}
#silicioNoticeDetail p {margin:0;min-height:0;overflow:auto;overflow-wrap:anywhere;white-space:pre-wrap;font-size:15px;line-height:1.6;overscroll-behavior:contain;}
#silicioNoticeDetail button {flex-shrink:0;min-height:48px;padding:10px 18px;border:1px solid var(--theme-accent-primary);border-radius:10px;background:var(--theme-bg-secondary);color:var(--theme-text-primary);font-family:inherit;font-weight:600;font-size:14px;line-height:1.5;cursor:pointer;}
/* Keep the existing header sticky without breaking the explicit modal locks. */
@media (max-width:768px),(max-width:1180px) and (orientation:portrait) {
    html[data-responsive-workspace="v2"]:has(.mobile-header) body:not([style*="overflow"]):not(.mobile-workspace-overlay-open):not(.settings-focus-mode):not(.mobile-orientation-locked),
    html[data-responsive-workspace="v2"] body:not(.settings-focus-mode) > .chess-layout:has(> .mobile-header) {overflow-x:clip !important;overflow-y:visible !important;}
    html[data-responsive-workspace="v2"] .mobile-header {position:sticky;top:0;}
}
html[data-responsive-workspace="v2"] #pgn-viewer .move-number {color:var(--theme-text-secondary);opacity:1;}
.position-games__preview-loading {display:inline-flex !important;align-items:center;justify-content:center;gap:8px;cursor:progress;}
.position-games__preview-loading .silicio-task-spinner {width:16px;height:16px;flex:0 0 16px;color:currentColor;}
/* The disabled navigation has no purpose during recall; use its row for time. */
html[data-responsive-workspace="v2"] body.position-memory-active .navigation-section > .navigation-buttons-redesigned {display:none !important;}
html[data-responsive-workspace="v2"] .navigation-section > #positionMemoryTimer {
    width:100%;min-height:56px;order:0;justify-content:space-between;margin:0;padding:8px 12px;
}
.silicio-memory-timer-label {font:500 13px/1.3 Poppins,sans-serif;}
.navigation-section > #positionMemoryTimer .position-memory-timer-icon {display:none;}
.navigation-section > #positionMemoryTimer .position-memory-timer-text {font-size:18px;font-variant-numeric:tabular-nums;}
/* Preserve the user's zoom factor, while reserving room below a portrait tablet. */
@media (min-width:769px) and (max-width:1180px) and (orientation:portrait) {
    html[data-responsive-workspace="v2"][data-tablet-experience="portrait-mobile"] body .chess-layout > .chess-container {
        --tablet-portrait-board-base:min(calc(100vw - 48px),57svh,max(280px,calc(100svh - 500px)));
    }
    html[data-tablet-experience="portrait-mobile"] .mobile-workspace[data-mobile-workspace-size="compact"] .mobile-workspace__handle {min-height:44px;min-width:128px;padding-inline:10px;gap:8px;}
    html[data-tablet-experience="portrait-mobile"] .mobile-workspace[data-mobile-workspace-size="compact"] .mobile-workspace__handle::after {content:'Ampliar panel';font-size:12px;letter-spacing:0;white-space:nowrap;}
}
@media (max-width:1180px) and (orientation:portrait) {
    html[data-responsive-workspace="v2"] body .editor-workbench > .chess-layout.chess-layout:not(:has(.icons-sidebar)) > .chess-container.chess-container > .editor-board-stage.editor-board-stage {
        width:min(calc(100vw - 48px),var(--web-editor-max-side,820px),820px) !important;justify-self:center !important;
    }
}
/* Only a bounded analysis pane scrolls; its heading and navigation stay put. */
html[data-responsive-workspace="v2"][data-workbench="v3"] body .controls-container[data-workbench-tab="engine"][data-engine-active="true"] > #stockfish-panel:not(.hidden) {
    display:flex !important;flex-direction:column !important;align-self:stretch !important;height:100% !important;min-height:0 !important;max-height:100% !important;min-width:0 !important;overflow:hidden !important;box-sizing:border-box;
}
html[data-responsive-workspace="v2"][data-workbench="v3"] body .controls-container > #stockfish-panel:not(.hidden) > .stockfish-header {flex:0 0 auto !important;}
html[data-responsive-workspace="v2"][data-workbench="v3"] body .controls-container > #stockfish-panel:not(.hidden) > .stockfish-content {
    flex:1 1 0 !important;height:auto !important;min-height:0 !important;max-height:none !important;min-width:0 !important;
    overflow-x:hidden !important;overflow-y:auto !important;overscroll-behavior-y:contain;touch-action:pan-y;scrollbar-gutter:stable;transition:none !important;will-change:auto;
}
/* Previews use their analysis pane, never the main board at any desktop width. */
    html[data-workbench="v3"] #stockfish-panel .engine-pv-viewer:not([hidden]) {position:static !important;inset:auto !important;transform:none !important;width:100% !important;max-width:100% !important;max-height:none !important;margin:0;box-shadow:none;}
    html[data-workbench="v3"] #stockfish-panel:has(#enginePvViewer:not([hidden])) > .stockfish-header,
    html[data-workbench="v3"] #stockfish-panel:has(#enginePvViewer:not([hidden])) .stockfish-content > .analysis-line {display:none !important;}
    html[data-workbench="v3"] .controls-container[data-workbench-tab="engine"]:has(#enginePvViewer:not([hidden])) > .navigation-section {display:none !important;}
    html[data-workbench="v3"] #stockfish-panel .engine-pv-board-shell {width:min(100%,clamp(120px,calc(100dvh - 400px),300px)) !important;}
@media (max-width:1439px),(max-height:700px) {
    html[data-workbench="v3"] #stockfish-panel .engine-pv-board-shell {width:min(100%,clamp(120px,calc(100dvh - 380px),238px)) !important;}
}
@media (pointer:coarse) {
    html[data-responsive-workspace="v2"] #stockfish-panel :is(.line-control,.stockfish-panel-close) {width:44px !important;height:44px !important;min-width:44px !important;min-height:44px !important;flex-shrink:0;font-size:16px !important;}
    html[data-responsive-workspace="v2"] #stockfish-panel .engine-pv-move {min-width:44px !important;min-height:44px !important;padding:6px 8px !important;font-size:13px !important;line-height:1.3 !important;box-sizing:border-box;touch-action:pan-y;}
    html[data-responsive-workspace="v2"] #stockfish-panel :is(.engine-pv-toggle,.engine-pv-viewer button) {min-height:44px !important;}
}
.silicio-rail-caption {display:none;}
@media (max-width:1180px),(pointer:coarse) {
    #manual-pgn-paste-modal[data-keyboard-viewport] {top:calc(var(--dialog-visible-top) + 12px) !important;transform:translateX(-50%) !important;max-height:calc(var(--dialog-visible-height) - 24px) !important;}
    #manual-pgn-paste-modal[data-keyboard-viewport] .paste-confirmation-content {max-height:calc(var(--dialog-visible-height) - 24px) !important;}
    #manual-pgn-paste-modal .paste-confirmation-content {display:flex;flex-direction:column;gap:12px;padding:16px;max-height:calc(100dvh - 24px);box-sizing:border-box;overflow:auto;}
    #manual-pgn-paste-modal :is(.paste-confirmation-header,.paste-confirmation-message) {flex:0 0 auto;margin:0 !important;}
    #manual-pgn-paste-modal .paste-confirmation-header span {font-size:18px !important;line-height:1.3;}
    #manual-pgn-paste-modal .paste-confirmation-message {font-size:13px !important;line-height:1.45;}
    #manual-pgn-paste-modal .manual-pgn-paste-textarea {flex:1 1 240px;min-height:72px;font-size:16px;margin:0;resize:none;}
    #manual-pgn-paste-modal .paste-confirmation-buttons {display:grid;grid-template-columns:1fr 1fr;flex:0 0 auto;gap:10px;margin:0 !important;}
    #manual-pgn-paste-modal .paste-confirmation-btn {min-height:44px;padding:10px 8px;font-size:14px;}
}
html[data-responsive-workspace="v2"] .workbench-rail-personalization {grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
html[data-responsive-workspace="v2"] .workbench-rail-personalization .workbench-rail-action {grid-column:auto !important;text-align:center;}
/* Touch rail: named commands, stable icon slots, two training columns in low height. */
@media (min-width:769px) and (orientation:landscape) and (pointer:coarse) {
    html[data-responsive-workspace="v2"][data-workbench="v3"] body .chess-layout {--icons-sidebar-w:132px;}
    html[data-responsive-workspace="v2"][data-workbench="v3"] body .workbench-command-button {min-height:44px !important;height:auto !important;padding-block:6px !important;}
    html[data-responsive-workspace="v2"] .icons-sidebar .workbench-rail-action {min-height:44px !important;}
    html[data-responsive-workspace="v2"][data-workbench="v3"] body:not([data-tablet-fix]) .icons-sidebar {padding:4px 6px !important;overflow-y:auto !important;overflow-x:hidden !important;}
    html[data-responsive-workspace="v2"][data-workbench="v3"] body:not([data-tablet-fix]) .icons-sidebar .icon-buttons-container {height:auto !important;min-height:0 !important;padding:0 !important;justify-content:flex-start !important;gap:3px !important;overflow:visible !important;}
    html[data-responsive-workspace="v2"][data-workbench="v3"] body:not([data-tablet-fix]) .icons-sidebar .icon-button {min-height:50px !important;height:auto !important;width:100% !important;min-width:44px !important;flex:0 0 auto !important;display:flex !important;flex-direction:column !important;justify-content:center !important;gap:2px;padding:4px !important;}
    html[data-responsive-workspace="v2"] .icons-sidebar .icon-button .icon-svg {width:24px !important;height:24px !important;flex:0 0 24px;position:static !important;inset:auto !important;transform:none !important;display:block !important;}
    html[data-responsive-workspace="v2"] .icons-sidebar .icon-button:not(.active):not(.disabled-by-other) > .icon-svg {visibility:visible !important;opacity:1 !important;}
    html[data-responsive-workspace="v2"] .icons-sidebar .icon-svg,html[data-responsive-workspace="v2"] .icons-sidebar .icon-svg * {filter:none !important;animation:none !important;transition:none !important;}
    html[data-responsive-workspace="v2"][data-workbench="v3"] body:not([data-tablet-fix]) .icons-sidebar .icon-button.active[data-icon-stop="stop"] {position:relative !important;padding-top:26px !important;padding-bottom:3px !important;}
    html[data-responsive-workspace="v2"] .icons-sidebar .icon-button.active[data-icon-stop="stop"] > .icon-svg {display:none !important;}
    html[data-responsive-workspace="v2"] .icons-sidebar .icon-button.active[data-icon-stop="stop"]::after {position:absolute !important;top:6px !important;left:50% !important;width:18px !important;height:18px !important;transform:translateX(-50%) !important;}
    .silicio-rail-caption {display:block;font:500 11px/1.25 Poppins,sans-serif;}
    html[data-responsive-workspace="v2"] .icons-sidebar .workbench-rail-label {margin:0 2px !important;font-size:9px !important;line-height:1 !important;}
    html[data-responsive-workspace="v2"][data-workbench="v3"] body:not([data-tablet-fix]) .icons-sidebar .workbench-rail-dock {display:flex !important;flex-direction:column;align-items:stretch;gap:3px;width:100%;min-width:0;}
    html[data-responsive-workspace="v2"] .workbench-rail-personalization {gap:3px !important;}
    html[data-responsive-workspace="v2"] .workbench-rail-personalization .workbench-rail-action {min-width:44px;min-height:44px;font-size:11px !important;padding-inline:4px !important;letter-spacing:0;white-space:normal;}
    html[data-responsive-workspace="v2"][data-workbench="v3"] #workbenchSettingsPanel.desktop-settings-panel.is-open {bottom:calc(var(--workbench-tablet-footer,42px) + 12px) !important;height:auto !important;max-height:calc(100dvh - var(--workbench-tablet-header,54px) - var(--workbench-tablet-footer,42px) - 28px) !important;}
    html[data-responsive-workspace="v2"] #stockfish-panel .stockfish-header {flex-wrap:wrap;gap:6px;}
    html[data-responsive-workspace="v2"] #stockfish-panel .stockfish-title {flex:1 0 100%;}
    html[data-responsive-workspace="v2"] #stockfish-panel .stockfish-controls {flex-wrap:nowrap;gap:6px;max-width:100%;}
    html[data-responsive-workspace="v2"][data-workbench="v3"] .controls-container[data-workbench-tab]:not([data-workbench-tab="pgn"]) > .fen-section {display:none !important;}
}
@media (min-width:769px) and (orientation:landscape) and (pointer:coarse) and (max-height:820px) {
    html[data-responsive-workspace="v2"][data-workbench="v3"] body:not([data-tablet-fix]) .icons-sidebar .icon-buttons-container {display:grid !important;grid-template-columns:repeat(2,minmax(44px,1fr));align-content:start !important;gap:2px !important;}
    html[data-responsive-workspace="v2"] .icon-buttons-container > * {grid-column:1 / -1;}
    html[data-responsive-workspace="v2"] .icon-buttons-container > :is(#blindTrainingBtn,#memoryTrainingBtn,#positionMemoryBtn,#reflexTrainingBtn) {grid-column:auto;}
    html[data-responsive-workspace="v2"][data-workbench="v3"] body:not([data-tablet-fix]) .icons-sidebar .icon-button {min-height:46px !important;padding:2px 1px !important;gap:1px;}
}
@media (max-width:1100px) and (pointer:coarse) {
    html[data-responsive-workspace="v2"] #stockfish-panel #enginePvToggle {flex:0 1 72px;min-width:60px !important;max-width:72px !important;padding-inline:4px !important;font-size:0 !important;}
    html[data-responsive-workspace="v2"] #stockfish-panel #enginePvToggle::after {content:'Tablero';font-size:11px;}
}
