.layout-view-options{display:flex;gap:3px;padding:3px;background:var(--subtle);border:1px solid var(--border);border-radius:9px}.layout-view-options button{border:0;background:transparent;color:var(--secondary);font:inherit;font-size:calc(13px);min-height:36px;padding:6px 11px;border-radius:6px;cursor:pointer}.layout-view-options button[aria-pressed=true]{background:var(--blue-50);color:var(--accent,var(--blue));font-weight:700}.layout-view-options button:focus-visible{outline:3px solid var(--accent,var(--blue));outline-offset:2px}.layout-settings-card{grid-column:1/-1}.layout-settings-card p{line-height:1.8;color:var(--secondary)}.layout-settings-card .layout-view-options{width:fit-content}.layout-settings-card .layout-view-options button{font-size:var(--reading-size,18px);min-height:44px}.layout-view-status{position:fixed;bottom:90px;left:50%;transform:translateX(-50%);padding:12px 18px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:10px;z-index:100;max-width:90vw}.mobile-work-tabs,.mobile-feature-actions,.ml-pattern-summary,.ml-sheet-head,.ml-sheet-backdrop{display:none}
html[data-app-layout=mobile]{--mobile-header-height:64px;--mobile-bottom-height:72px}html[data-app-layout=mobile] .ml-inactive{display:none!important}html[data-app-layout=mobile] .mobile-work-tabs{display:flex;position:sticky;top:var(--mobile-header-height);z-index:15;gap:4px;padding:8px 0;background:var(--bg);border-bottom:1px solid var(--border);margin:12px 0 16px}html[data-app-layout=mobile] .mobile-work-tabs button{flex:1;min-width:0;min-height:48px;padding:10px 4px;font:inherit;font-size:clamp(14px,calc(var(--reading-size,18px)*.85),21px);line-height:1.5;word-break:keep-all;border:1px solid transparent;background:var(--surface);color:var(--secondary);border-radius:8px;cursor:pointer}html[data-app-layout=mobile] .mobile-work-tabs button[aria-selected=true]{background:var(--blue-50);color:var(--accent,var(--blue));border-color:var(--accent,var(--blue));font-weight:700}html[data-app-layout=mobile] .mobile-work-tabs button:focus-visible{outline:3px solid var(--accent,var(--blue));outline-offset:2px}html[data-app-layout=mobile] .layout-header-switch .layout-view-options button{font-size:calc(12px);min-height:34px;padding:6px 8px}html[data-app-layout=mobile] .topbar-account-actions{gap:5px}html[data-app-layout=mobile] .topbar{z-index:25}html[data-app-layout=mobile] #featureView{padding-top:12px}html[data-app-layout=mobile] .feature-header{margin-bottom:10px}html[data-app-layout=mobile] .feature-header h2{margin-bottom:5px}html[data-app-layout=mobile] .feature-header p{margin:0;line-height:1.6}html[data-app-layout=mobile] .analysis-toolbar{padding:12px;border-radius:12px;gap:8px}html[data-app-layout=mobile] .analysis-toolbar .indicator-toggles{display:none}html[data-app-layout=mobile] .analysis-layout{display:block}html[data-app-layout=mobile] .analysis-layout .summary-metrics{grid-template-columns:1fr}html[data-app-layout=mobile] #technicalDetails{scroll-margin-top:calc(var(--mobile-header-height) + 90px)}html[data-app-layout=mobile] .technical-tools-drawer:not([hidden]){position:fixed;bottom:var(--mobile-bottom-height);left:10px;right:10px;max-height:75dvh;overflow:auto;z-index:62;background:var(--surface);box-shadow:0 0 0 100vmax #0006;border-radius:18px;padding:18px}html[data-app-layout=mobile] .technical-tools-drawer .tool-settings-grid{grid-template-columns:1fr}html[data-app-layout=mobile] .technical-tools-drawer .tools-drawer-head{position:sticky;top:-18px;background:var(--surface);z-index:1;padding:8px 0}html[data-app-layout=mobile] .mobile-feature-actions{display:flex;position:fixed;left:0;right:0;bottom:var(--mobile-bottom-height);padding:10px 12px;background:var(--surface);border-top:1px solid var(--border);gap:8px;z-index:24}html[data-app-layout=mobile] .mobile-feature-actions button{height:auto;min-height:48px;padding:10px 12px;line-height:1.4;font-size:clamp(14px,calc(var(--reading-size,18px)*.85),21px);white-space:normal;word-break:keep-all}html[data-app-layout=mobile] .mobile-feature-actions .primary-button{flex:1}html[data-app-layout=mobile].has-mobile-actions main{padding-bottom:170px}html[data-app-layout=mobile] .bottom-nav{height:var(--mobile-bottom-height);padding-bottom:env(safe-area-inset-bottom)}html[data-app-layout=mobile] .ml-pattern-summary{display:block}html[data-app-layout=mobile] .pattern-search-controls:not(.ml-sheet-target){display:none!important}html[data-app-layout=mobile] .pattern-easy-workspace{display:block!important}html[data-app-layout=mobile] .pattern-reference{margin-top:0}html[data-app-layout=mobile] #featureView:has(.pattern-search-live) .pattern-easy-workspace{display:block!important}html[data-app-layout=mobile] .pattern-live-context [data-pattern-setup-toggle]{display:none}html[data-app-layout=mobile] .pattern-results-tabs{top:calc(var(--mobile-header-height) + 72px);background:var(--bg);z-index:14}html[data-app-layout=mobile] .pattern-candidate-scroll{max-height:none;overflow:visible}html[data-app-layout=mobile] .financial-score-grid{display:block}html[data-app-layout=mobile] .financial-area-grid{display:grid;grid-template-columns:1fr}html[data-app-layout=mobile] .financial-detail-grid{grid-template-columns:1fr}html[data-app-layout=mobile] .btv-reference{grid-template-columns:1fr}html[data-app-layout=mobile] .btv .results-actions{flex-wrap:wrap}html[data-app-layout=mobile] .ml-sheet-target{display:block!important;position:fixed;inset:auto 8px calc(var(--mobile-bottom-height) + 4px);max-height:76dvh;overflow:auto;z-index:65;border-radius:18px 18px 12px 12px;background:var(--surface);color:var(--text);border:1px solid var(--border);padding:16px;box-shadow:var(--shadow);margin:0}html[data-app-layout=mobile] .ml-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:-16px;background:var(--surface);padding:12px 0;z-index:2;border-bottom:1px solid var(--border);margin-bottom:14px}html[data-app-layout=mobile] .ml-sheet-head button{border:1px solid var(--border);background:var(--subtle);color:var(--text);border-radius:8px;min-width:44px;min-height:44px;display:grid;place-items:center}html[data-app-layout=mobile] .ml-sheet-backdrop{display:block;position:fixed;inset:0;z-index:60;border:0;background:#0006;cursor:pointer}html.ml-sheet-open{overflow:hidden}html[data-app-layout=mobile] .ml-sheet-target .results-actions{position:sticky;bottom:-16px;background:var(--surface);padding:12px 0}html[data-app-layout=mobile] .pattern-weight-grid{grid-template-columns:1fr}html[data-app-layout=mobile] .trade-page .explorer{display:block}html[data-app-layout=mobile] .trade-page .theme-pane,html[data-app-layout=mobile] .trade-page .detail{margin-top:12px}
html[data-app-layout=pc] .ml-pattern-summary,html[data-app-layout=pc] .mobile-work-tabs,html[data-app-layout=pc] .mobile-feature-actions{display:none!important}html[data-app-layout=pc][data-layout-forced=pc] body{min-width:1200px}html[data-app-layout=pc][data-layout-forced=pc] .page-shell{min-width:980px}html[data-app-layout=mobile] .page-shell{min-width:0}html[data-app-layout=mobile] .home-dashboard{min-width:0}

html[data-app-layout=mobile] .bottom-nav{grid-template-columns:repeat(5,minmax(0,1fr))}html[data-app-layout=mobile] .bottom-nav .mobile-all-menu{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;border:0;background:transparent;color:var(--secondary);font:inherit;font-size:calc(12px);min-width:0;min-height:48px;padding:4px;cursor:pointer}html[data-app-layout=pc] .mobile-all-menu{display:none}

html[data-app-layout=mobile] .bottom-nav>:is(a,.mobile-all-menu){font-size:clamp(12px,calc(var(--reading-size,18px)*.75),18px)}html[data-app-layout=mobile][data-reading-size] .bottom-nav>:is(a,.mobile-all-menu){font-size:16px!important}

html[data-app-layout=mobile] .pattern-search-live .pattern-live-footer [data-live-stop]{display:none}

.ml-analysis-options{display:none}html[data-app-layout=mobile] .ml-analysis-options{display:inline-flex}html[data-app-layout=mobile] #featureView:has(#technicalChart) .header-actions:not(.ml-sheet-target){display:none}html[data-app-layout=mobile] .bottom-nav a{font-size:clamp(12px,calc(var(--reading-size,18px)*.75),18px)}html[data-app-layout=mobile] .topbar-account-actions{min-width:0}html[data-app-layout=mobile] .topbar .layout-view-options button{font-size:calc(12px);padding:6px 8px}html[data-app-layout=mobile] .topbar .theme-toggle{min-width:36px}html[data-app-layout=mobile] .topbar{padding-inline:12px}
/* Home is a grid: span every column, including mobile mode on a wide screen. */
html[data-app-layout=mobile] #mobileHomeWorkTabs{grid-column:1/-1;justify-self:stretch;width:100%;min-width:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;padding:0;margin:0;background:var(--bg);border-bottom:1px solid var(--border)}
html[data-app-layout=mobile] #mobileHomeWorkTabs button{position:relative;display:flex;align-items:center;justify-content:center;min-height:52px;padding:12px 8px;border:0;border-radius:0;background:transparent;color:var(--secondary);font-size:clamp(15px,calc(var(--reading-size,18px)*.85),21px);line-height:1.4;white-space:nowrap;word-break:keep-all}
html[data-app-layout=mobile] #mobileHomeWorkTabs button[aria-selected=true]{background:transparent;color:var(--accent,var(--blue));font-weight:700}
html[data-app-layout=mobile] #mobileHomeWorkTabs button[aria-selected=true]::after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:3px;border-radius:3px 3px 0 0;background:currentColor}
html[data-app-layout=mobile] #mobileHomeWorkTabs button:focus-visible{outline-offset:-3px}
html[data-app-layout=mobile] .btv-settings:not(.ml-sheet-target){display:none!important}.ml-backtest-summary,.ml-backtest-progress-note{display:none}html[data-app-layout=mobile] .ml-backtest-summary,html[data-app-layout=mobile] .ml-backtest-progress-note{display:block}html[data-app-layout=mobile] .ml-backtest-summary p{line-height:1.8;overflow-wrap:anywhere}
html[data-app-layout=pc][data-layout-viewport=narrow] .layout-header-switch{position:fixed;top:10px;right:10px;z-index:100;background:var(--surface);border-radius:10px;box-shadow:var(--shadow)}
html[data-app-layout=mobile] #featureView:has(#financialActions:not([hidden])) .financial-search:not(.ml-sheet-target){display:none}
html[data-app-layout=mobile] .mobile-work-tabs{flex-wrap:wrap}html[data-app-layout=mobile] .mobile-work-context{flex:0 0 100%;line-height:1.5;font-size:clamp(14px,var(--reading-size,18px),20px);font-weight:700;color:var(--text);padding:2px 4px 6px;overflow-wrap:anywhere}html[data-app-layout=mobile] .pattern-results-tabs{top:calc(var(--mobile-header-height) + var(--mobile-tabs-height,72px))}

/* Chart and finance mobile refinement. PC rules remain untouched. */
html[data-app-layout=mobile] .mobile-work-tabs{position:static;top:auto;z-index:auto;margin:4px 0 12px}
html[data-app-layout=mobile] .mobile-work-tabs button{min-height:44px;line-height:1.35}
html[data-app-layout=mobile] .mobile-feature-actions{position:static;left:auto;right:auto;bottom:auto;display:flex;margin:14px 0 8px;padding:0;background:transparent;border:0;gap:8px;z-index:auto}
html[data-app-layout=mobile] .mobile-feature-actions button{flex:1;min-width:0;border-radius:10px}
html[data-app-layout=mobile] .mobile-feature-actions .secondary-button{flex:0 1 auto}
html[data-app-layout=mobile].has-mobile-actions main{padding-bottom:calc(var(--mobile-bottom-height) + env(safe-area-inset-bottom) + 20px)}
html[data-app-layout=mobile] .bottom-nav{height:calc(var(--mobile-bottom-height) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom)}
html[data-app-layout=mobile] .analysis-toolbar{display:flex;flex-wrap:wrap;gap:8px;padding:10px;border-radius:12px}
html[data-app-layout=mobile] .analysis-toolbar .chart-type-toggle{flex:1 0 100%;width:100%;min-height:42px}
html[data-app-layout=mobile] .analysis-toolbar .chart-type-toggle button{flex:1;min-height:40px;padding-inline:8px}
html[data-app-layout=mobile] .analysis-toolbar [aria-label="주기 선택"]{flex:1;min-height:42px}
html[data-app-layout=mobile] .analysis-toolbar [aria-label="주기 선택"] button{flex:1;min-height:40px;padding-inline:8px}
html[data-app-layout=mobile] .analysis-toolbar #downloadChart,html[data-app-layout=mobile] .ml-analysis-options{min-height:42px;padding:8px 10px;border-radius:9px;font-size:13px}
html[data-app-layout=mobile] .analysis-toolbar .indicator-toggles{display:none}
html[data-app-layout=mobile] .analysis-layout .summary-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
html[data-app-layout=mobile] .analysis-layout .summary-metrics>div{padding:9px 8px}
html[data-app-layout=mobile] .chart-context{margin:5px 0 8px;font-size:12px;line-height:1.4}
html[data-app-layout=mobile] #technicalDetails{scroll-margin-top:calc(var(--mobile-header-height) + 12px)}
html[data-app-layout=mobile] .technical-tools-drawer:not([hidden]){bottom:calc(var(--mobile-bottom-height) + env(safe-area-inset-bottom) + 4px);max-height:min(72dvh,620px)}
html[data-app-layout=mobile] .ml-sheet-target{bottom:calc(var(--mobile-bottom-height) + env(safe-area-inset-bottom) + 4px);max-height:min(72dvh,620px)}
html[data-app-layout=mobile] #featureView:has(#financialActions:not([hidden])) #financialActions:not(.ml-sheet-target){display:none}
html[data-app-layout=mobile] #financialBody .financial-detail-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
html[data-app-layout=mobile] #financialBody .financial-table-scroll{overflow:visible;max-width:100%}
html[data-app-layout=mobile] #financialBody .financial-table-scroll table{display:block;min-width:0;width:100%;font-size:14px}
html[data-app-layout=mobile] #financialBody .financial-table-scroll thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
html[data-app-layout=mobile] #financialBody .financial-table-scroll tbody{display:grid;gap:8px}
html[data-app-layout=mobile] #financialBody .financial-table-scroll tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 8px;padding:10px 12px;border:1px solid var(--border);border-radius:11px;background:var(--surface)}
html[data-app-layout=mobile] #financialBody .financial-table-scroll tbody th[scope=row]{grid-column:1/-1;padding:2px 0 9px;border:0;text-align:left;font-size:14px;font-weight:700;color:var(--text);white-space:normal}
html[data-app-layout=mobile] #financialBody .financial-table-scroll tbody td{display:flex;flex-direction:column;gap:3px;min-width:0;padding:8px 0;border-top:1px solid var(--border);text-align:left;white-space:normal;font-size:14px;font-variant-numeric:tabular-nums}
html[data-app-layout=mobile] #financialBody .financial-table-scroll tbody td:nth-of-type(1)::before,html[data-app-layout=mobile] #financialBody .financial-table-scroll tbody td:nth-of-type(2)::before{color:var(--secondary);font-size:11px}
html[data-app-layout=mobile] #financialBody .financial-table-scroll tbody td:nth-of-type(1)::before{content:"현재 연간"}
html[data-app-layout=mobile] #financialBody .financial-table-scroll tbody td:nth-of-type(2)::before{content:"전년 연간"}
html[data-app-layout=mobile] #financialBody .financial-table-scroll tbody td:nth-of-type(3){grid-column:1/-1;flex-direction:row;justify-content:space-between;align-items:center;font-size:12px;color:var(--secondary)}
html[data-app-layout=mobile] #financialBody .financial-table-scroll tbody td:nth-of-type(3)::before{content:"변화"}
html[data-app-layout=mobile] #financialBenchmark .financial-table-scroll{position:relative}
html[data-app-layout=mobile] #financialBenchmark .financial-table-scroll::before{content:"표를 좌우로 밀어 비교";display:block;position:sticky;left:0;width:max-content;padding:5px 8px;margin-bottom:6px;border-radius:7px;background:var(--subtle);color:var(--text);font-size:11px}
html[data-app-layout=mobile] #financialBenchmark .financial-table-scroll th:first-child,html[data-app-layout=mobile] #financialBenchmark .financial-table-scroll td:first-child{position:sticky;left:0;z-index:1;background:var(--surface)}
html[data-app-layout=mobile] #financialBenchmark .financial-table-scroll thead th:first-child{z-index:2}
@media(max-width:380px){html[data-app-layout=mobile] .analysis-layout .summary-metrics{grid-template-columns:1fr}html[data-app-layout=mobile] .analysis-layout .summary-metrics>div{padding:10px}html[data-app-layout=mobile] .mobile-feature-actions{gap:6px}html[data-app-layout=mobile] .mobile-feature-actions button{padding-inline:8px;font-size:13px}}

.home-display-shortcut{display:none}
html[data-app-layout=mobile] .topbar-account-actions .home-display-shortcut{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;flex:none;width:42px;height:42px;min-width:42px;min-height:42px;padding:0;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);cursor:pointer}
.home-display-shortcut-icon{display:contents}
.home-display-shortcut:focus-visible{outline:3px solid var(--blue);outline-offset:1px}
.home-display-shortcut-mark{color:var(--blue);font-size:13px;font-weight:800;letter-spacing:-.5px;line-height:1}
.home-display-shortcut-label{display:block;color:var(--text);font-size:9px;font-weight:600;letter-spacing:-.25px;line-height:1;white-space:nowrap}
.home-display-dialog{position:fixed;inset:auto 0 0;margin:0 auto;width:min(100%,560px);max-width:none;max-height:min(88dvh,700px);overflow-y:auto;border:1px solid var(--border);border-bottom:0;border-radius:20px 20px 0 0;padding:18px 16px calc(16px + env(safe-area-inset-bottom));background:var(--surface);color:var(--text);box-shadow:0 -14px 40px rgba(8,21,37,.16)}
.home-display-dialog::backdrop{background:rgba(8,21,37,.52);backdrop-filter:blur(2px)}
.home-display-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.home-display-dialog-head h2{margin:3px 0 0;font-size:21px;line-height:1.35}
.home-display-close{display:grid;place-items:center;flex:none;width:44px;height:44px;border:1px solid var(--border);border-radius:50%;background:var(--subtle);color:var(--text);cursor:pointer}
.home-display-close:focus-visible,.home-display-apply:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
.home-display-close>.material-symbols-rounded{font-size:22px}
.home-display-help{margin:8px 0 14px;color:var(--secondary);font-size:15px;line-height:1.6}
.home-display-options{display:grid;gap:8px}
.home-display-option{display:grid;grid-template-columns:22px 58px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:56px;padding:7px 11px;border:1px solid var(--border);border-radius:10px;background:var(--surface);cursor:pointer}
.home-display-option:has(input:checked){border-color:var(--blue);background:var(--blue-50)}
.home-display-option:focus-within{outline:3px solid var(--blue);outline-offset:2px}
.home-display-option input{width:20px;height:20px;margin:0;accent-color:var(--blue)}
.home-display-option-sample{color:var(--blue);font-size:var(--option-font-size)!important;font-weight:700;line-height:1.2;text-align:center}
.home-display-option-label{min-width:0;font-size:16px;font-weight:600;line-height:1.35}
.home-display-option>small{color:var(--secondary);font-size:14px;white-space:nowrap}
.home-display-preview{margin:14px 0;padding:12px;border-radius:10px;background:var(--blue-50)}
.home-display-preview>span{color:var(--secondary);font-size:14px}
.home-display-preview p{margin:5px 0 0;font-size:18px;line-height:1.5;overflow-wrap:anywhere}
.home-display-status{min-height:0;margin:0 0 8px;color:var(--secondary);font-size:14px;line-height:1.5}
.home-display-status:empty{display:none}
.home-display-apply{width:100%;min-height:52px;border:0;border-radius:10px;background:var(--blue);color:#fff;font-size:17px;font-weight:700;cursor:pointer}
.home-display-apply:hover{background:var(--blue-dark)}

/* Mobile analysis controls stay on clear, separate rows. */
html[data-app-layout=mobile] .analysis-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center}
html[data-app-layout=mobile] .analysis-toolbar>.chart-type-toggle{grid-column:1/-1;width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex-wrap:nowrap!important}
html[data-app-layout=mobile] .analysis-toolbar>.chart-type-toggle button{white-space:nowrap;word-break:keep-all;min-width:0}
html[data-app-layout=mobile] .analysis-toolbar>.toolbar-group[aria-label="주기 선택"]{grid-column:1/-1;width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex-wrap:nowrap!important;min-width:0}
html[data-app-layout=mobile] .analysis-toolbar>.toolbar-group[aria-label="주기 선택"] button{min-width:0;white-space:nowrap;word-break:keep-all;line-height:1.2;padding-inline:8px}
html[data-app-layout=mobile] .analysis-toolbar>.price-line-color{grid-column:1;white-space:nowrap}
html[data-app-layout=mobile] .analysis-toolbar>#downloadChart{grid-column:2;justify-self:end;white-space:nowrap}
html[data-app-layout=mobile] .analysis-toolbar>.ml-analysis-options{grid-column:3;white-space:nowrap}
html[data-app-layout=mobile] .analysis-toolbar:has(>.price-line-color[hidden])>#downloadChart{grid-column:1/3;justify-self:center}
html[data-app-layout=mobile] .pattern-results-tabs{position:static;top:auto;z-index:auto}

/* A persistent header control works independently of the dynamically added mobile navigation. */
.topbar-account-actions .layout-mode-toggle{display:none;flex-direction:column;align-items:center;justify-content:center;gap:0;flex:none;width:42px;height:42px;min-width:42px;min-height:42px;padding:0;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);font:inherit;cursor:pointer;white-space:nowrap}
.topbar-account-actions .layout-mode-toggle>.material-symbols-rounded{font-size:18px;line-height:1;color:var(--blue)}
.layout-mode-toggle>[data-layout-mode-label]{font-size:9px;font-weight:600;line-height:1;letter-spacing:-.25px}
html[data-app-layout=mobile] .layout-mode-toggle,html[data-app-layout=pc][data-layout-viewport=narrow] .layout-mode-toggle{display:inline-flex}
html[data-app-layout=mobile] .layout-header-switch,html[data-layout-viewport=narrow] .layout-header-switch{display:none!important}
.layout-mode-toggle:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
