/* Shared mobile/desktop control system. No evaluation or source changes. */
:root { --control-height: 44px; }
.topbar :is(button, select), .workspace-controls :is(button, select, input[type="date"]),
.account-tools .profile-button { box-sizing: border-box; min-height: var(--control-height); border-radius: 10px; }
.topbar .badge-sim { box-sizing: border-box; min-height: var(--control-height); display: inline-flex; align-items: center; justify-content: center; }
.topbar .logo { height: 58px; max-width: 172px; object-fit: contain; }
.layout-picker { align-items: center; }
.chart-toolbar .layout-picker button { width: 40px; min-height: 40px; }
.chart-cell .head { flex-wrap: wrap; gap: 6px; }
.chart-cell .head :is(.focus-btn,.fullscreen-btn) { min-height: 36px; padding: 6px 10px; border: 1px solid #464959; border-radius: 8px; background: #292c38; color: #dadada; cursor: pointer; }
.chart-cell.chart-expanded, .chart-cell:fullscreen {
  position: fixed; inset: 0; z-index: 1500; width: 100vw; height: 100dvh;
  box-sizing: border-box; margin: 0; border-radius: 0; background: #22242f;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  display: flex; flex-direction: column;
}
.chart-expanded .canvas { flex: 1; min-height: 0; }
.chart-expanded .head .fullscreen-btn { min-height: 44px; }
.history-toolbar label { align-items: center; }
.history-toolbar input[type="date"] { min-height: 44px; padding: 8px; }
.history-panel { margin: 0 12px 8px; }
.history-panel > summary { cursor: pointer; color: #b2b2b2; min-height: 36px; display: flex; align-items: center; gap: 8px; }
.history-panel > summary::before { content: '›'; font-size: 22px; }
.history-panel[open] > summary::before { content: '⌄'; }
.history-panel[open] { padding: 8px 12px; border: 1px solid #414554; border-radius: 12px; }
.shell-dialog > .btn.secondary { width: 100%; min-height: 44px; text-align: left; margin: 5px 0; }
@media (max-width: 680px) {
  .topbar .brand .logo { height: 58px; max-width: 154px; }
  .topbar { gap: 8px; }
  .account-tools { gap: 4px; }
  .account-tools :is(.icon-btn,.profile-button) { width: 44px; height: 44px; min-width: 44px; padding: 10px; }
  .profile-button #profile-button-label, .profile-button .local-tag { display: none; }
  .topbar-feed { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; width: 100%; }
  .topbar-feed .select { width: 100%; max-width: none; font-size: 14px; }
  .topbar-feed .badge-sim { font-size: 10px; padding: 0 8px; }
  .topbar-feed #btn-broker { font-size: 13px; padding: 0 10px; }
  .workspace-controls { padding: 8px; }
  .chart-toolbar { flex-wrap: wrap; gap: 8px; }
  .chart-toolbar .layout-picker { order: 1; flex: 1 0 100%; justify-content: space-between; }
  .chart-toolbar .layout-picker button { flex: 1; min-height: 44px; }
  .chart-toolbar .panel-toggles { margin-left: auto; }
  #btn-autofollow, #btn-reset-view { font-size: 13px; padding: 8px; }
  .history-toolbar { gap: 8px; }
  .history-toolbar label { flex: 1 1 42%; display: grid; gap: 4px; }
  .history-toolbar input[type="date"] { width: 100%; min-width: 0; }
  .chart-cell .head :is(.focus-btn,.fullscreen-btn) { min-height: 44px; }
  .chart-tf { max-width: 100%; overflow-x: auto; }
  .chart-tf button { min-width: 40px; min-height: 40px; }
  .foot #scan-n, .foot #notices { display: none; }
  /* Grid is an overview within the viewport; detail controls stay in full screen. */
  body > .layout .chart-cell { min-width: 0; min-height: 0; }
  .chart-cell .canvas { min-height: 0; }
  .chart-grid:not(.layout-1) .chart-cell:not(.chart-expanded) .head {
    display: flex; flex-wrap: nowrap; padding: 2px 3px; gap: 2px; min-width: 0;
  }
  .chart-grid:not(.layout-1) .chart-cell:not(.chart-expanded) .chart-symbol {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 10px;
  }
  .chart-grid:not(.layout-1) .chart-cell:not(.chart-expanded) :is(.chart-price,.head .st,.focus-btn,.chart-tools) { display: none; }
  .chart-grid:not(.layout-1) .chart-cell:not(.chart-expanded) .fullscreen-btn {
    flex: 0 0 44px; width: 44px; height: 44px; padding: 0; font-size: 0;
  }
  .chart-grid:not(.layout-1) .chart-cell:not(.chart-expanded) .fullscreen-btn::after { content: '⛶'; font-size: 22px; }
  .chart-grid:not(.layout-1) .placeholder-body { padding: 4px; min-width: 0; }
  .chart-grid:not(.layout-1) .placeholder-body .placeholder-title { display: none; }
  .chart-grid:not(.layout-1) .placeholder-body select { padding: 4px; width: 100%; }
}
