/* page frame and control rows, shared by both pages; desktop first, then narrower screens */
.app { position: relative; padding: 16px; max-width: 1900px; margin: 0 auto; box-sizing: border-box; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.controls + .controls { margin-top: 8px; }
.field { flex: 1 1 auto; }
.field-note { display: flex; flex-wrap: wrap; gap: 3px; margin: 1px 0 4px; }  /* tags under a label: what the control affects */
.field-label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.field-label-row .field-label { margin-bottom: 0; }
.help-btn { cursor: pointer; display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 50%; background: #e4e7ec; color: #555;
            font: 600 11px system-ui, sans-serif; user-select: none; }
.help-btn:hover { background: #cfd4dc; }
.notice { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; padding: 8px 12px; border: 1px solid #f0d08a; border-radius: 6px; background: #fff8e6; color: #5c4400; font-size: 12px; line-height: 1.4; }
.notice[hidden] { display: none; }
.notice span { flex: 1 1 auto; }
.app .notice button { flex: none; padding: 0 8px; min-height: 0; font-size: 16px; line-height: 1.4; border: 0; background: transparent; color: inherit; }
.hint { font-size: 11px; color: #595959; line-height: 1.3; }  /* a sentence under a label */
.tag { font: 10px/1.5 system-ui, sans-serif; padding: 0 6px; border-radius: 8px; background: #eef0f4; color: #4a4a4a; white-space: nowrap; }
.field-label { display: block; font-size: 12px; color: #595959; margin-bottom: 2px; }
.refresh-box { position: absolute; top: 14px; right: 16px; z-index: 5; display: flex; gap: 10px; align-items: center; }
.status { font-size: 12px; color: #595959; max-width: 46ch; text-align: right; }
.info { font-size: 12px; color: #595959; margin: 8px 0; }
.summary { cursor: pointer; font-size: 13px; padding: 6px 0; }
.app button { font: 14px system-ui, sans-serif; padding: 6px 14px; border: 1px solid #bbb; border-radius: 6px; background: #f6f7f9; color: #222; cursor: pointer; }
.app button:hover:not(:disabled) { background: #eceef2; }
.app button:disabled { opacity: .6; cursor: progress; }

/* keyboard users get a visible focus ring everywhere */
.app :focus-visible, .nav summary:focus-visible { outline: 2px solid #1a56db; outline-offset: 2px; border-radius: 3px; }

@media (max-width: 700px) {
  .app { padding: 10px; }
  .refresh-box { position: static; justify-content: space-between; margin-bottom: 8px; }  /* in the flow: no overlap with the menu or the controls */
  .status { text-align: left; max-width: none; flex: 1 1 auto; }
  .controls { gap: 8px; }
  .field { flex: 1 1 100%; }                                     /* one control per line on a phone, except... */
  .field.half { flex: 1 1 45%; min-width: 0 !important; }        /* ...fields marked `half`, which pair up with their neighbour on one row */
  .xh-head { font-size: 11px; }
}

/* touch screens: finger-sized targets, and a vertical swipe over a chart scrolls the page instead of being swallowed by zoom */
@media (pointer: coarse) {
  .app button, .nav-menu a { min-height: 44px; display: inline-flex; align-items: center; }
  .nav-menu a { display: flex; }
  .app label:has(input[type=checkbox]) { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
  .app input[type=checkbox] { width: 20px; height: 20px; }
  .js-plotly-plot .nsewdrag, .js-plotly-plot .draglayer .drag { touch-action: pan-y pinch-zoom !important; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.help-close { font: 14px system-ui, sans-serif; padding: 6px 14px; border: 1px solid #bbb; border-radius: 6px; background: #f6f7f9; color: #222; cursor: pointer; }
.help-close:hover { background: #eceef2; }

/* loading: a block that has no content yet keeps a height (so the spinner has somewhere to sit and the page does not jump), and no-data results say so */
.su-pending:not(:has(*)), .mx-wrap:not(:has(*)) { min-height: 160px; color: #888; font-size: 14px; text-align: center; padding-top: 60px; box-sizing: border-box; }
.mx-loading { min-height: 160px; }
.su-none, .mx-none { padding: 60px 0; text-align: center; color: #888; font-size: 14px; }
.rv-runner { width: 110px; height: auto; display: block; }
/* Reset (apps/pages/market.py, token.py: Transactions): every control back to its default; quiet, at the top right of the controls */
.app .rv-reset, .rv-reset { margin-left: auto; align-self: flex-start; min-height: 0; padding: 2px 4px; border: 0; background: none; color: var(--rv-mute, #777);
  font: 400 12px/1.4 var(--rv-font, sans-serif); cursor: pointer; }
.app .rv-reset:hover:not(:disabled), .rv-reset:hover { background: none; color: var(--rv-ink, #111); text-decoration: underline; }
