/* Independent market, workspace and search bands share the original controls. */
body.compact-workspace-chrome { --compact-control-size:34px;--compact-row-size:44px;--compact-ticker-size:32px; }
body.compact-workspace-chrome > #chrome-panel-ticker {
  position:relative;z-index:99998;isolation:isolate;flex:0 0 auto;display:flex;width:100%;min-width:0;
  box-sizing:border-box;height:calc(var(--compact-ticker-size) + var(--sat,0px));
  padding:var(--sat,0px) var(--sar,0px) 0 var(--sal,0px);overflow:hidden;
  background:var(--surface-2,#070b12);border-bottom:1px solid var(--card-border);
}
body.compact-workspace-chrome #chrome-panel-ticker > .ticker-bar { width:100%;min-width:0;min-height:0;height:var(--compact-ticker-size);max-height:var(--compact-ticker-size);padding:0;border:0;background:transparent; }
body.compact-workspace-chrome #chrome-panel-ticker .marquee-container { width:100%;min-width:0;max-width:100%;padding:0; }
/* Reserve the real touch target height in the permanent ticker band. */
@media (any-pointer:coarse) {
  body.compact-workspace-chrome { --compact-ticker-size:44px; }
  body.compact-workspace-chrome #chrome-panel-ticker .marquee-item { height:44px;min-height:44px; }
}
body.compact-workspace-chrome > #chrome-panel-header { display:flex;align-items:center;box-sizing:border-box;min-width:0;width:100%;padding:0 calc(6px + var(--sar,0px)) 0 calc(6px + var(--sal,0px));background:var(--surface-2,#070b12);border-bottom:1px solid var(--card-border);z-index:2500; }
body.compact-workspace-chrome #chrome-panel-header > .top-os-bar { display:flex!important;flex-flow:row nowrap!important;align-items:center;gap:10px;flex:1;min-width:0;width:auto;max-width:100%;height:var(--compact-row-size);min-height:var(--compact-row-size);padding:0!important;border:0;box-shadow:none;overflow:visible;background:transparent;backdrop-filter:none; }
body.compact-workspace-chrome #chrome-panel-header > .top-os-bar[hidden] { display:none!important; }
body.compact-workspace-chrome #chrome-panel-header > .chrome-placement-controls { position:static;flex:0 0 auto;margin:0;padding:0 0 0 6px;transform:none; }
body.compact-workspace-chrome #chrome-panel-header > .chrome-placement-controls button:not([hidden]) { width:var(--compact-control-size);min-width:var(--compact-control-size);height:var(--compact-control-size);min-height:var(--compact-control-size);padding:2px;font-size:14px; }
body.compact-workspace-chrome > #chrome-panel-header.chrome-collapsed-to-tab { min-height:0;height:0;padding:0;border:0; }
body.compact-workspace-chrome > #chrome-panel-header.chrome-collapsed-to-tab > .chrome-placement-controls { display:none; }
body.compact-workspace-chrome #chrome-panel-header .brand-section { flex:0 0 auto;min-width:0;margin:0;padding:0;gap:5px; }
body.compact-workspace-chrome #chrome-panel-header .brand-logo-icon { width:24px;height:24px;flex:0 0 24px; }
body.compact-workspace-chrome #chrome-panel-header .brand-logo-icon svg { width:24px!important;height:24px!important; }
body.compact-workspace-chrome #chrome-panel-header .brand-word { font-size:14px;white-space:nowrap; }
body.compact-workspace-chrome #chrome-panel-header .compact-clocks { position:relative;flex:0 0 164px;height:var(--compact-control-size);min-width:0;--compact-clock-line:15px; }
body.compact-workspace-chrome #chrome-panel-header .compact-clocks > :is(.os-clock-section,.os-worldclock-section) { display:flex;flex-direction:row;align-items:center;justify-content:flex-end;gap:5px;font-size:11px;line-height:15px;height:15px;min-height:0;margin:0;padding:0;border:0;white-space:nowrap;min-width:0; }
body.compact-workspace-chrome #chrome-panel-header .compact-clocks > #os-worldclock { position:absolute;inset:0;width:100%;height:100%;box-sizing:border-box;align-items:flex-start;padding-top:calc(var(--compact-control-size)/2 - var(--compact-clock-line));cursor:pointer; }
body.compact-workspace-chrome #chrome-panel-header .compact-clocks > .os-clock-section { position:absolute;right:0;top:calc(50% + 1px);pointer-events:none; }
body.compact-workspace-chrome #chrome-panel-header .compact-clocks span { font-size:inherit;line-height:inherit;white-space:nowrap; }
body.compact-workspace-chrome #chrome-panel-header #os-time::before { content:none; }
body.compact-workspace-chrome #chrome-panel-header #os-worldclock:focus-visible { outline:2px solid var(--accent-gold);outline-offset:-2px; }
body.compact-workspace-chrome .compact-header-row { display:flex;align-items:center;margin-left:auto;min-width:0; }
body.compact-workspace-chrome .compact-header-row .top-actions { display:flex!important;align-items:center;gap:5px;margin:0; }
body.compact-workspace-chrome .compact-header-row .top-action { display:flex;align-items:center;gap:5px;width:auto!important;height:var(--compact-control-size);min-height:var(--compact-control-size);padding:4px 8px;white-space:nowrap;font-size:12px;color:var(--text-main);background:var(--surface-raise,#101b2b); }
body.compact-workspace-chrome .compact-header-row .top-action span { display:inline; }
#workspace-tools-toggle { position:relative;flex:0 0 auto;min-width:52px;height:var(--compact-control-size);min-height:var(--compact-control-size);padding:4px 8px;border:1px solid var(--card-border);border-radius:8px;background:var(--surface-raise,#101b2b);color:var(--text-main);font:700 12px Inter,sans-serif;cursor:pointer; }
#workspace-tools-unread { position:absolute;top:0;right:0;min-width:14px;height:14px;box-sizing:border-box;padding:1px 3px;border-radius:8px;background:var(--accent-gold,#ffd166);color:#07101b;font:800 9px/12px Inter,sans-serif; }
#workspace-tools-unread[hidden] { display:none; }
.compact-sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0; }
#workspace-tools-panel { position:fixed;z-index:98000;box-sizing:border-box;padding:12px;border:1px solid var(--accent-cyan);border-radius:12px;background:var(--surface-raise,#101b2b);color:var(--text-main);box-shadow:0 14px 48px #0009;display:flex;flex-direction:column;gap:12px;overflow:auto;overscroll-behavior:contain; }
#workspace-tools-panel[hidden] { display:none!important; }
#workspace-tools-panel > header { display:flex;align-items:center;justify-content:space-between;font:700 14px Inter,sans-serif; }
#workspace-tools-panel button { cursor:pointer; }
#workspace-tools-panel > button,#workspace-tools-close { color:var(--text-main);background:var(--surface-2);border:1px solid var(--card-border);border-radius:8px;padding:8px;min-height:36px;font:600 13px Inter,sans-serif; }
#workspace-tools-panel > .top-actions { display:flex!important;flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:6px;width:100%;margin:0; }
#workspace-tools-panel .top-actions > .top-action { width:auto!important;max-width:100%;height:auto;min-height:36px!important;display:flex;gap:5px;padding:7px 9px; }
#workspace-tools-panel .top-action span { display:inline; }
#workspace-tools-panel #scan-data-source { display:block!important;max-width:100%;min-width:0;white-space:normal;font-size:11px!important; }
#workspace-tools-panel .compact-ticker-controls { display:flex;align-items:center;gap:8px;font:600 12px Inter,sans-serif; }
#workspace-tools-panel .chrome-placement-controls { position:static;transform:none;display:flex; }
#workspace-tools-panel #ticker-customization { width:100%;font:12px Inter,sans-serif; }
#workspace-tools-panel .ticker-customization-fields { flex-direction:column;gap:8px; }
#workspace-tools-panel .ticker-customization-fields label { white-space:normal; }
#workspace-tools-panel .compact-ticker-controls .chrome-placement-controls button:not([hidden]) { display:block!important;opacity:1;min-width:32px;width:auto;height:32px;cursor:pointer; }
#workspace-tools-panel :is(button,input,summary):focus-visible,#workspace-tools-toggle:focus-visible { outline:2px solid var(--accent-gold);outline-offset:2px; }
/* Search can leave its row, collapse to an edge and retain its position on reload. */
.workspace-search-home { position:relative;z-index:2501;flex:0 0 auto;box-sizing:border-box;padding:4px calc(6px + var(--sar,0px)) 4px calc(6px + var(--sal,0px));width:100%;min-width:0;background:var(--surface-2,#070b12);border-bottom:1px solid var(--card-border); }
.workspace-search-home:not(:has(.omnibox-wrap:not([hidden]))) { display:none; }
body.compact-workspace-chrome .workspace-search-home .omnibox-wrap,
body.compact-workspace-chrome .floating-search { display:flex;align-items:center;flex-wrap:nowrap;box-sizing:border-box;gap:4px;min-width:0;max-width:100%;margin:0; }
body.compact-workspace-chrome .workspace-search-home .omnibox-wrap { width:min(620px,100%); }
body.compact-workspace-chrome .search-placement-controls { display:flex!important;flex:0 0 auto;gap:2px; }
body.compact-workspace-chrome .search-placement-controls button { width:32px;height:32px;min-width:32px;min-height:32px;touch-action:none;font-size:16px; }
body.compact-workspace-chrome .omnibox-wrap #scan-omnibox { flex:1 1 80px;min-width:0;max-width:none!important;width:0;height:34px;padding:6px 8px;font-size:13px; }
body.compact-workspace-chrome .omnibox-wrap #scan-copy-link { min-width:32px;min-height:32px; }
body.compact-workspace-chrome .search-toolbar-plane { z-index:22009; }
body.compact-workspace-chrome .floating-search { padding:5px; }
@media(max-width:1000px) {
  body.compact-workspace-chrome .compact-header-row .top-action span { display:none; }
  body.compact-workspace-chrome #chrome-panel-header .compact-clocks { flex-basis:144px; }
}
@media(pointer:coarse) {
  body.compact-workspace-chrome { --compact-control-size:44px;--compact-row-size:48px; }
  body.compact-workspace-chrome .search-placement-controls button { width:44px;height:44px;min-width:44px;min-height:44px; }
}
@media(max-width:600px) {
  body.compact-workspace-chrome #chrome-panel-header > .top-os-bar { gap:6px; }
  body.compact-workspace-chrome #chrome-panel-header .brand-word { display:inline; }
  body.compact-workspace-chrome .workspace-search-home { padding-top:3px;padding-bottom:3px; }
  body.compact-workspace-chrome .omnibox-wrap #scan-omnibox { font-size:16px!important;height:44px!important;min-height:44px; }
  body.compact-workspace-chrome .omnibox-wrap :is(#scan-copy-link,#scan-mech-toggle) { min-width:44px!important;min-height:44px!important;height:44px!important; }
  body.compact-workspace-chrome .search-placement-controls button { width:44px;height:44px;min-width:44px;min-height:44px; }
}
/* Native title-bar buttons remain outside painted market content and controls. */
body.compact-workspace-chrome.window-controls-overlay > #chrome-panel-ticker {
  padding-left:calc(var(--titlebar-x,0px) + 4px);padding-right:calc(100vw - var(--titlebar-x,0px) - var(--titlebar-width,100vw) + 4px);
  min-height:var(--titlebar-height,0px);-webkit-app-region:drag;app-region:drag;
}
@media(display-mode:window-controls-overlay) {
  body.compact-workspace-chrome > #chrome-panel-ticker { padding-left:calc(env(titlebar-area-x,0px) + 4px);padding-right:calc(100vw - env(titlebar-area-x,0px) - env(titlebar-area-width,100vw) + 4px);min-height:env(titlebar-area-height,0px);-webkit-app-region:drag;app-region:drag; }
}
body.compact-workspace-chrome #chrome-panel-ticker .marquee-container { -webkit-app-region:no-drag;app-region:no-drag; }
/* The market band paints across a fold; live text and controls stay in a pane. */
@media(horizontal-viewport-segments:2) {
  body.compact-workspace-chrome #chrome-panel-ticker > .ticker-bar { margin-left:env(viewport-segment-left 1 0);width:env(viewport-segment-width 1 0); }
  body.compact-workspace-chrome > #chrome-panel-header { width:env(viewport-segment-width 0 0); }
  body.compact-workspace-chrome .workspace-search-home .omnibox-wrap { width:calc(env(viewport-segment-width 0 0) - 12px); }
}

/* Decorative dark glass must not cover the selected theme's readable controls. */
body.compact-workspace-chrome .top-os-bar > :is(.topbar-shader,.topbar-shader-scrim) { display:none; }
body.compact-workspace-chrome .omnibox-wrap #scan-omnibox { background:var(--surface-2,#070b12);color:var(--text-main); }
body.compact-workspace-chrome #scan-omnibox::placeholder { color:var(--text-muted);opacity:1; }
body.compact-workspace-chrome #chrome-panel-ticker .marquee-item > span { color:var(--text-main)!important; }

.compact-copy-label { display:none; }
#workspace-tools-panel #scan-copy-link { display:flex;align-items:center;gap:8px;color:var(--text-main);background:var(--surface-2);border:1px solid var(--card-border);border-radius:8px;min-height:44px;padding:8px;font:600 14px Inter,sans-serif; }
#workspace-tools-panel .compact-copy-label { display:inline; }
@media(max-width:600px) {
  body.compact-workspace-chrome .floating-search { flex-wrap:wrap; }
  body.compact-workspace-chrome .floating-search #scan-omnibox { min-width:120px; }
}
body.compact-workspace-chrome.window-controls-overlay > #chrome-panel-header { -webkit-app-region:drag;app-region:drag; }
body.compact-workspace-chrome.window-controls-overlay > #chrome-panel-header :is(button,a,input,select,textarea,[role=button],.compact-clocks,.brand-section) { -webkit-app-region:no-drag;app-region:no-drag; }
@media(display-mode:window-controls-overlay) {
  body.compact-workspace-chrome > #chrome-panel-header { -webkit-app-region:drag;app-region:drag; }
  body.compact-workspace-chrome > #chrome-panel-header :is(button,a,input,select,textarea,[role=button],.compact-clocks,.brand-section) { -webkit-app-region:no-drag;app-region:no-drag; }
}

@media(pointer:coarse) {
  body.compact-workspace-chrome .omnibox-wrap :is(#scan-mech-toggle,#scan-copy-link) { min-width:44px!important;min-height:44px!important;height:44px!important;font-size:max(14px,.875rem)!important; }
  body.compact-workspace-chrome .compact-header-row .top-action { min-width:44px!important;min-height:44px!important; }
}

@media(max-width:600px) {
  body.compact-workspace-chrome .workspace-search-home .omnibox-wrap { flex-wrap:wrap;gap:3px; }
  body.compact-workspace-chrome .workspace-search-home #scan-omnibox { min-width:120px; }
}

body.compact-workspace-chrome .omnibox-wrap :is(#scan-mech-toggle,#scan-copy-link) { color:var(--text-main)!important;background:var(--surface-raise,#101b2b)!important; }

body.compact-workspace-chrome #scan-omnibox-menu { background:var(--surface-raise,#101b2b);color:var(--text-main); }
@media(pointer:coarse) {
  body.compact-workspace-chrome #scan-omnibox-menu :is(button,select) { min-height:44px; }
}

/* A short code keeps both clocks labeled where full exchange names cannot fit. */
@media(max-width:880px) {
  body.compact-workspace-chrome #chrome-panel-header #wc-market { display:flex!important;max-width:none;gap:3px;overflow:visible; }
  body.compact-workspace-chrome #chrome-panel-header #wc-market .wc-name,
  body.compact-workspace-chrome #chrome-panel-header #os-date { display:none; }
  body.compact-workspace-chrome #chrome-panel-header #wc-market::before,
  body.compact-workspace-chrome #chrome-panel-header .compact-clocks > .os-clock-section::before { content:attr(data-market-code);font:700 11px/1 Inter,sans-serif;color:var(--text-muted);white-space:nowrap; }
  body.compact-workspace-chrome #chrome-panel-header .compact-clocks > .os-clock-section::before { content:'LOCAL'; }
}
