/* ---------- Reset / base ---------- */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

.page {
  position: relative;
  width: 100%;
  overflow-x: hidden;
}

body {
  background: #fff;
  color: #222;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: #1a4f8b;
}

a:visited {
  color: #6a3a8b;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em 0;
  font-weight: bold;
}

p {
  margin: 0 0 0.75em 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout shell ---------- */

.topbar {
  background: #002676;
  color: #fff;
  border-bottom: 3px solid #F37021;
}

.topbar__inner,
.footer__inner,
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
}

@media (min-width: 1200px) {
  .topbar__inner,
  .footer__inner,
  .container {
    max-width: 1280px;
  }
}

.topbar__title {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}

.topbar__title:visited {
  color: #fff;
}

.container {
  padding-top: 16px;
  padding-bottom: 32px;
}

.footer {
  border-top: 1px solid #ccc;
  background: #f4f4f4;
  color: #555;
  font-size: 12px;
  margin-top: 32px;
}

/* ---------- Sections ---------- */

.section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e3e3e3;
}

.section:last-of-type {
  border-bottom: none;
}

.section__title {
  font-size: 16px;
  color: #F37021;
  margin-bottom: 8px;
}

.section__hint {
  color: #555;
  font-size: 13px;
}

/* ---------- Form fields ---------- */

.field-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  flex: 1 1 160px;
  min-width: 0;
}

.field label {
  font-weight: bold;
  margin-bottom: 4px;
}

/* font-size: 16px on form controls prevents iOS Safari from auto-zooming on focus. */

input[type="text"] {
  font-family: inherit;
  font-size: 16px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #888;
  background: #fff;
  color: #222;
  border-radius: 0;
}

input[type="text"]:focus {
  outline: none;
  border-color: #1a4f8b;
}

input[type="date"] {
  font-family: inherit;
  font-size: 16px;
  max-width: 100%;
}

/* ---------- Ticker search ---------- */

.ticker-search {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

.ticker-search label {
  font-weight: bold;
  margin-bottom: 4px;
}

.ticker-suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #1a4f8b;
  border-top: none;
  z-index: 10;
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ticker-suggestions li {
  padding: 6px 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  font-size: 13px;
}

.ticker-suggestions li:last-child {
  border-bottom: none;
}

.ticker-suggestions li[aria-selected="true"] {
  background: #eaf2fb;
}

.ticker-suggestions__empty {
  color: #777;
  font-style: italic;
  cursor: default !important;
}

.ticker-suggestions__empty:hover {
  background: transparent !important;
}

.suggestion__primary {
  display: flex;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 0;
  flex-wrap: wrap;
}

.suggestion__code {
  font-weight: bold;
  color: #222;
}

.suggestion__name {
  color: #444;
}

.suggestion__meta {
  margin-top: 1px;
  color: #777;
  font-size: 11px;
}

/* ---------- Tables ---------- */

.table-wrap {
  margin-top: 12px;
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border: 0;
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.data-table thead th {
  border-top: 1px solid #ccc;
}

.data-table th:first-child,
.data-table td:first-child {
  border-left: 1px solid #ccc;
}

.data-table thead th {
  background: #002676;
  color: #fff;
  font-weight: bold;
}

.table-sort-button {
  font: inherit;
  font-weight: inherit;
  color: inherit;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
}

.table-sort-button:hover {
  text-decoration: underline;
}

.table-sort-button:focus {
  outline: none;
}

.table-sort-button:focus-visible {
  box-shadow: 0 0 0 2px #fff;
}

.sort-indicator {
  display: inline-block;
  width: 1ch;
  text-align: center;
}

.data-table thead th:first-child {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 3;
  background-clip: padding-box;
}

.data-table tbody tr:nth-child(even) {
  background: #f4f7fa;
}

.data-table tbody td:first-child {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  background-clip: padding-box;
}

.data-table tbody tr:nth-child(even) td:first-child {
  background: #f4f7fa;
}

.empty-state {
  color: #777;
  font-style: italic;
  margin: 12px 0 0 0;
}

.data-table__action {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.btn-remove {
  font: inherit;
  font-size: 20px;
  line-height: 1;
  background: transparent;
  border: none;
  color: #b00020;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.btn-remove:hover {
  color: #b00020;
  text-decoration: underline;
}

.btn-remove:focus {
  outline: 2px solid #1a4f8b;
  outline-offset: 1px;
}

/* ---------- Buttons ---------- */

.actions {
  margin-top: 16px;
}

.btn-primary {
  font: inherit;
  font-weight: bold;
  background: #F37021;
  color: #fff;
  border: 1px solid #B85214;
  padding: 12px 20px;
  cursor: pointer;
  border-radius: 0;
  width: 100%;
}

.btn-primary:hover {
  background: #D85F18;
}

.btn-primary:disabled {
  background: #F37021;
  border-color: #B85214;
  color: #fff;
  cursor: not-allowed;
}

.btn-primary:disabled:hover {
  background: #F37021;
}

.btn-primary:focus {
  outline: 2px solid #1a4f8b;
  outline-offset: 2px;
}

.btn-link {
  font: inherit;
  background: none;
  border: none;
  color: #F37021;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
