/* Shared market browser (phase 9.7): used by the Bot page and the Settings page.
   Depends on the tokens in app.css and the pill / risk colours in profile.css. */
.panel .mono { font-variant-numeric: tabular-nums; }
.panel .muted { color: var(--muted); }
.panel .small { font-size: 12px; }
.panel .field label { margin-top: 12px; }
.panel .field label .hint { color: var(--muted); font-size: 12px; }
.panel .message:empty { display: none; }
.panel .message.ok { color: var(--ok); font-weight: 600; }
.panel .message.bad { color: var(--bad); font-weight: 600; }
.panel .tap-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; }
.panel #markets-table tr.selectable { cursor: pointer; }
.panel #markets-table tr.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.panel .picker { display: grid; grid-template-columns: 1fr; gap: 0 16px; align-items: end; }
@media (min-width: 640px) { .panel .picker { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .panel .picker { grid-template-columns: minmax(150px, 1fr) 2fr minmax(150px, 1fr) auto; } }
.panel .filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.panel .chip { min-height: 44px; padding: 4px 12px; background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; font-weight: 600; font-size: 12px; }
.panel .chip.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.panel .chip .count { font-weight: 500; opacity: 0.8; }
.panel .chip .count:empty { display: none; }
.panel .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.panel .star { min-width: 44px; min-height: 44px; width: 44px; height: 44px; padding: 0; background: transparent; border: 0; color: var(--muted); font-size: 22px; line-height: 1; border-radius: 50%; }
.panel .star.on { color: var(--warn); }
.panel .star:hover, .panel .star:focus-visible { background: var(--muted-bg); outline: none; }
.panel .star:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.panel .pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.panel .pager button { min-height: 44px; padding: 4px 14px; }
.panel .pager-text { color: var(--muted); font-size: 12px; text-align: center; flex: 1 1 auto; }
.panel .details-row td { background: var(--muted-bg); border-radius: 6px; }
/* The inline profile editor row: the Bot panel's #profile-panel, placed under the market it edits. */
/* The editor never widens the table: its cell contributes no intrinsic width (contain) and the panel
   takes the width the columns give it (width 0 + min-width 100%). */
.panel .editor-row td { padding: 0 0 10px; white-space: normal; background: transparent; contain: inline-size; }
.panel .inline-profile { width: 0; min-width: 100%; box-sizing: border-box; margin: 4px 0 0; padding: 12px 14px 14px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.panel .inline-profile-head { margin-bottom: 6px; }
.panel .inline-profile-head h2 { margin: 0; font-size: 14px; }
.panel .inline-profile-head button { min-height: 44px; }
.panel .status-lines .pd { font-size: 11px; font-weight: 400; margin-top: 1px; }
.panel .details-list { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; padding: 6px 4px; font-size: 12px; white-space: normal; }
.panel .details-list dt { color: var(--muted); }
.panel .details-list dd { margin: 0; white-space: normal; }
.panel .test-cell.pos { color: var(--ok); font-weight: 600; }
.panel .test-cell.neg { color: var(--bad); font-weight: 600; }
.panel .picker-action { padding-top: 12px; }
.panel .picker-action button { width: 100%; min-height: 44px; }
.panel #markets-meta { margin-top: 8px; }
.panel #markets-table { margin-top: 10px; font-size: 12px; }
.panel #markets-table th, .panel #markets-table td { white-space: nowrap; vertical-align: middle; }
.panel #markets-table td.profile-cell { white-space: normal; min-width: 120px; max-width: 220px; }
.panel #markets-table th.actions-col { width: 1%; }
.panel #markets-table td.star-cell, .panel #markets-table th.star-col { width: 44px; padding-left: 0; padding-right: 0; }
.panel #markets-table td .sym { font-weight: 700; font-size: 13px; }
.panel #markets-table .row-actions { display: flex; gap: 2px; align-items: center; justify-content: flex-end; }
.panel #markets-table .row-actions button { min-height: 44px; padding: 4px 12px; white-space: nowrap; }
/* Icon actions: a 44px target around an 18px icon; the name is the title and the aria-label. */
.panel #markets-table .row-actions button.icon { width: 44px; height: 44px; min-width: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 8px; }
.panel #markets-table .row-actions button.icon svg { width: 18px; height: 18px; display: block; }
.panel #markets-table .row-actions button.icon:hover { color: var(--text); background: var(--muted-bg); }
.panel #markets-table .row-actions button.icon:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); color: var(--text); }
.panel #markets-table .row-actions button.icon.toggle.on { color: var(--ok); }
.panel #markets-table .row-actions button.icon.toggle:not(.on):hover { color: var(--ok); background: var(--ok-bg); }
.panel #markets-table .row-actions button.icon.toggle.on:hover { color: var(--bad); background: var(--bad-bg); }
.panel #markets-table .row-actions button.icon.details.active, .panel #markets-table .row-actions button.icon.configure.active { color: var(--accent); background: var(--accent-bg); border-color: var(--accent); }
.panel #markets-table .row-actions button.icon.configure { color: var(--accent); }
.panel .ok-cell { color: var(--ok); font-weight: 600; }
.panel .dead-cell { color: var(--bad); font-weight: 600; }
/* Narrow screens: each market becomes a labelled card so nothing scrolls out of view. */
@media (max-width: 767px) {
  .panel #markets-table, .panel #markets-table tbody { display: block; }
  .panel #markets-table thead { display: none; }
  .panel #markets-table tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
  .panel #markets-table td, .panel #markets-table td.profile-cell { display: block; border: 0; padding: 2px 0; white-space: normal; min-width: 0; max-width: none; overflow-wrap: anywhere; }
  .panel #markets-table tr.editor-row { display: block; padding: 0; border: 0; margin-top: 0; }
  .panel #markets-table tr.editor-row td { padding: 0; }
  .panel #markets-table .row-actions { justify-content: flex-start; }
  .panel #markets-table td::before { content: attr(data-label); display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .panel #markets-table td.star-cell { grid-column: 1; grid-row: 1 / span 4; width: 44px; }
  .panel #markets-table td.star-cell::before, .panel #markets-table td.actions-cell::before { display: none; }
  .panel #markets-table td.market-cell { grid-column: 2 / -1; grid-row: 1; }
  .panel #markets-table td.actions-cell { grid-column: 1 / -1; }
  
  
  .panel #markets-table .row-actions { flex-wrap: wrap; gap: 4px; }
  .panel #markets-table .row-actions button { flex: 1 1 30%; }
  .panel #markets-table .row-actions button.icon { flex: 0 0 44px; }   /* icons keep their square */
  .panel #markets-table tr.details-row { display: block; margin-top: 4px; padding: 4px 8px; }
  .panel #markets-table tr.details-row td { display: block; }
}

