/* Stock screener query builder — screener.in/screen/new/ look, self-contained. */
.scr-wrap { max-width: 880px; margin: 0 auto; padding: 0 16px 64px; }
.scr-wrap .breadcrumb { min-height: 8px; }
.scr-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
  padding: 28px 28px 24px;
  margin: 12px 0 24px;
}
.scr-card h3 { margin: 0 0 20px; font-size: 1.15rem; font-weight: 600; color: #111827; }
.scr-form-field { margin-bottom: 20px; }
.scr-form-field > label { display: block; font-weight: 600; font-size: 0.9rem; color: #111827; margin-bottom: 8px; }
.scr-form-field label input[type="checkbox"] { margin-right: 8px; accent-color: #1a9e4b; }
.scr-flex-row { display: flex; flex-direction: row; }
.scr-space-between { justify-content: space-between; }
.scr-gap-16 { gap: 16px; }
.scr-gap-8 { gap: 8px; }
.scr-grow { flex-grow: 4; flex-shrink: 1; min-width: 15rem; max-width: 100%; }
.scr-query-box { position: relative; }
#query-builder {
  width: 100%;
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #111827;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 0;
  resize: vertical;
  background: #fff;
}
#query-builder:focus { outline: none; border-color: #1a9e4b; box-shadow: 0 0 0 3px rgba(26, 158, 75, 0.12); }
.scr-typeahead {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  list-style: none; margin: 4px 0 0; padding: 4px; max-height: 260px; overflow: auto;
  display: none;
}
.scr-typeahead.open { display: block; }
.scr-typeahead li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.scr-typeahead li small { color: #6b7280; margin-left: 8px; }
.scr-typeahead li:hover, .scr-typeahead li.sel { background: #f0fdf4; }
.scr-callout {
  flex-grow: 1; flex-shrink: 2; min-width: 14rem;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  padding: 14px 16px; font-size: 0.85rem; color: #14532d; align-self: flex-start;
}
.scr-callout .bigger { font-weight: 600; font-size: 0.95rem; margin: 0 0 8px; color: #14532d; }
.scr-callout p { margin: 0 0 8px; white-space: pre-line; }
.scr-callout .sub { font-size: 0.78rem; }
.scr-callout .sub a { color: #15803d; }
.scr-run-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.scr-btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: #1a9e4b; color: #fff; border: none; border-radius: 8px;
  padding: 10px 22px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.scr-btn-primary:hover { background: #178542; }
.scr-btn-primary:disabled { opacity: 0.6; cursor: wait; }
.scr-btn-plain {
  background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 9px 16px; font-size: 0.85rem; cursor: pointer;
}
.scr-btn-plain:hover { background: #e5e7eb; text-decoration: none; }
#ratio-gallery h2 { margin: 32px 0 4px; font-size: 1.25rem; color: #111827; }
.scr-op-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.scr-op-row button {
  min-width: 44px; padding: 7px 12px; border: 1px solid #d1d5db; background: #fff;
  border-radius: 8px; font-size: 0.85rem; font-weight: 600; color: #374151; cursor: pointer;
}
.scr-op-row button:hover { background: #f0fdf4; border-color: #1a9e4b; }
.scr-tabs-row { display: flex; justify-content: space-between; gap: 16px; margin: 24px 0; flex-wrap: wrap; align-items: flex-end; }
.scr-tabs-row .options { display: flex; gap: 4px; flex-wrap: wrap; }
.scr-tabs-row .options button {
  border: 1px solid transparent; background: transparent; border-radius: 8px;
  padding: 7px 12px; font-size: 0.85rem; color: #4b5563; cursor: pointer;
}
.scr-tabs-row .options button:hover { background: #f3f4f6; }
.scr-tabs-row .options button.active { background: #111827; color: #fff; font-weight: 600; }
.scr-search-ratio { font-size: 0.85rem; color: #374151; }
.scr-search-ratio input.small {
  border: 1px solid #d1d5db; border-radius: 8px; padding: 7px 10px; font-size: 0.85rem; margin-left: 8px;
}
.scr-gal-section { margin-top: 16px; }
.scr-gal-section .title { font-weight: 600; font-size: 0.95rem; color: #111827; margin-bottom: 10px; }
.scr-gal-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-button {
  border: 1px solid #d1d5db; background: #fff; border-radius: 999px;
  padding: 6px 14px; font-size: 0.82rem; color: #1f2937; cursor: pointer;
}
.gallery-button:hover { border-color: #1a9e4b; background: #f0fdf4; }
.scr-results { margin-top: 24px; }
.scr-results table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.scr-results th, .scr-results td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; }
.scr-results th { background: #f9fafb; font-weight: 600; color: #374151; position: sticky; top: 0; }
.scr-results tr:hover td { background: #f0fdf4; }
.scr-results a { color: #15803d; font-weight: 600; }
.scr-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  border-radius: 8px; padding: 12px 16px; font-size: 0.87rem; margin-top: 16px;
}
.scr-footnote { margin-top: 16px; font-size: 0.8rem; color: #6b7280; }
.scr-footnote a { color: #15803d; }
.res-head h1 { margin: 0; font-size: 1.4rem; color: #111827; }
.res-head p.sub { color: #6b7280; font-size: 0.87rem; margin: 6px 0 0; }
.res-meta { color: #6b7280; font-size: 0.85rem; margin: 14px 0; }
.res-table-wrap { overflow: auto; border: 1px solid #e5e7eb; border-radius: 10px; }
table.res-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; white-space: nowrap; }
table.res-table th, table.res-table td { padding: 8px 12px; border-bottom: 1px solid #eef0f3; text-align: left; }
table.res-table thead th { background: #f9fafb; font-weight: 600; }
table.res-table thead th a { color: #374151; text-decoration: none; }
table.res-table thead th a:hover { color: #1a9e4b; }
table.res-table thead th a.sorted { color: #1a9e4b; }
table.res-table thead .unit { color: #737373; font-weight: 400; font-size: 0.75rem; }
table.res-table tbody tr:nth-child(even) td { background: #fafbfc; }
table.res-table tbody tr:hover td { background: #f0fdf4; }
table.res-table td a { color: #15803d; font-weight: 600; }
.pager { display: flex; gap: 6px; align-items: center; margin: 16px 0; flex-wrap: wrap; }
.pager a, .pager span.cur { border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px 12px; font-size: 0.83rem; color: #374151; text-decoration: none; background: #fff; }
.pager span.cur { background: #111827; color: #fff; border-color: #111827; font-weight: 600; }
.ind-chip { display: inline-block; background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; border-radius: 999px; padding: 4px 12px; font-size: 0.8rem; margin-top: 8px; }
@media (max-width: 760px) {
  .scr-flex-row { flex-direction: column; }
  .scr-card { padding: 20px 16px; }
  .scr-callout { min-width: 0; }
}
