/* Shared components: search, ticker, boxes, tables, forms, details. */

.searchrow {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  padding: 9px 12px 2px;
}

.search-field { position: relative; width: min(520px, 100%); }

.searchrow input,
.search-panel input,
.search-panel select,
.form input,
.form textarea,
.form select {
  width: 100%;
  padding: 10px;
  border: 1px solid #888;
  font: inherit;
  background: #fff;
  color: var(--text);
}

.searchrow button,
.btn {
  border: 0;
  background: var(--navy);
  color: #fff;
  padding: 0 18px;
  min-height: 41px;
  font-weight: bold;
  cursor: pointer;
  font: inherit;
}

.searchrow button:hover,
.btn:hover { background: var(--red); color: #fff; }

.btn.secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--navy);
}

.btn.secondary:hover { background: var(--light); color: var(--navy); }

.suggest {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  background: #fff;
  border: 1px solid #888;
  box-shadow: 0 4px 12px #0002;
  max-height: 260px;
  overflow: auto;
}

.suggest ul { list-style: none; margin: 0; padding: 0; }

.suggest a {
  display: block;
  padding: 8px 10px;
  text-decoration: none;
  border-bottom: 1px solid #eee;
  color: var(--text);
}

.suggest a strong { display: block; }
.suggest a span { display: block; color: var(--muted); font-size: 12px; font-weight: normal; }
.suggest a:hover,
.suggest a:focus { background: var(--light); color: var(--text); }

.noticebar {
  background: #fff;
  border: 1px solid #bbb;
  margin: 10px 12px 8px;
  padding: 8px 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: bold;
  min-height: 42px;
}

.notice-label {
  background: var(--red);
  color: #fff;
  padding: 5px 8px;
  white-space: nowrap;
  font-size: 12px;
}

.ticker { overflow: hidden; flex: 1; min-width: 0; }

.ticker-track {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: ticker 36s linear infinite;
  margin: 0;
}

.ticker-track a { margin-right: 28px; font-size: 13px; }

.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track { animation-play-state: paused; }

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.quicklinks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding: 8px 12px 12px;
}

.quicklinks a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  padding: 12px 6px;
  border: 2px solid #222;
  min-height: 48px;
  line-height: 1.2;
}

.quicklinks a:hover { color: #fff; filter: brightness(1.08); }

.q1 { background: #0867a8; }
.q2 { background: #16813c; }
.q3 { background: #d00000; }
.q4 { background: #5c3194; }
.q5 { background: #c65f00; }
.q6 { background: #007f83; }
.q7 { background: #333; }
.q8 { background: #9b194b; }

.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}

.box,
.fullbox {
  border: 1px solid #777;
  background: #fff;
  min-width: 0;
}

.fullbox { margin: 0 12px 12px; }

.box-title,
.full-title {
  background: var(--red);
  color: #fff;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  padding: 8px 5px;
  margin: 0;
  border-bottom: 1px solid #777;
}

.full-title { background: var(--navy); }

.box-title.blue { background: var(--blue); }
.box-title.green { background: var(--green); }
.box-title.orange { background: var(--orange); }

.box ul,
.notice-list {
  margin: 0;
  padding: 9px 12px 10px 28px;
}

.box li,
.notice-list li {
  padding: 6px 0;
  line-height: 1.35;
  border-bottom: 1px dotted #ddd;
  font-size: 13px;
}

.box li:last-child,
.notice-list li:last-child { border-bottom: 0; }

.box li a,
.notice-list li a { font-weight: bold; }

.new {
  color: #d00000;
  font-weight: bold;
  font-size: 10px;
  letter-spacing: 0.3px;
  margin-left: 4px;
}

.date { font-size: 11px; color: #555; font-weight: normal; margin-top: 2px; }

.more {
  margin: 0;
  padding: 8px 10px 10px;
  text-align: right;
  font-size: 12px;
  font-weight: bold;
  border-top: 1px solid #eee;
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; min-width: 620px; }

.facts + .table-scroll table,
.detail .table-scroll table { min-width: 480px; }

th { background: var(--light); color: #111; }

th, td {
  border: 1px solid #aaa;
  padding: 9px 10px;
  text-align: left;
  font-size: 12px;
  vertical-align: top;
}

td:first-child { font-weight: bold; }
td a { font-weight: bold; }
tbody tr:hover { background: #fafafa; }

.scroll-hint {
  display: none;
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  color: #333;
  background: var(--light);
}

.states {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  padding: 12px;
}

.states a {
  background: #f2f2f2;
  border: 1px solid #aaa;
  padding: 8px 11px;
  text-decoration: none;
  font-weight: bold;
  font-size: 12px;
  color: var(--navy);
  min-height: 36px;
}

.states a:hover,
.states a.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.list-meta {
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--light);
  border-bottom: 1px solid #ddd;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 12px;
}

.pager a,
.pager span {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #888;
  text-decoration: none;
  font-weight: bold;
  padding: 0 10px;
  background: #fff;
  color: var(--navy);
}

.pager a[aria-current="page"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.notice-list li.empty { list-style: none; margin-left: -16px; }

.detail { padding-bottom: 8px; }
.detail h1 { padding: 8px 12px 0; }
.detail .summary { margin: 0; padding: 6px 12px 0; font-size: 14px; line-height: 1.5; }
.detail .status {
  display: inline-block;
  margin-left: 8px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  vertical-align: middle;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px;
}

.facts div { border: 1px solid #ccc; background: var(--light); padding: 8px 10px; }
.facts dt { font-size: 11px; font-weight: bold; color: var(--navy); text-transform: uppercase; }
.facts dd { margin: 3px 0 0; font-size: 14px; }

.detail h2 {
  margin: 0;
  padding: 8px 12px;
  font-size: 16px;
  color: var(--navy);
}

.detail .table-scroll { margin: 0 12px 12px; }
.unavailable { color: #555; font-weight: normal; }

.search-panel {
  margin: 0 12px 12px;
  border: 1px solid #777;
  background: #fff;
  padding: 12px;
}

.search-panel h2 { margin: 12px 0 6px; font-size: 15px; color: var(--navy); }

.filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-grid label { font-weight: bold; font-size: 13px; display: flex; gap: 6px; align-items: center; }

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.field-row label { font-weight: bold; font-size: 13px; display: grid; gap: 4px; }

.search-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.search-actions .btn { min-height: 44px; padding: 0 16px; text-decoration: none; display: inline-flex; align-items: center; }

.search-suggest { position: relative; }

.form { display: grid; gap: 10px; max-width: 640px; }
.form label { font-weight: bold; font-size: 13px; display: grid; gap: 4px; }
.form textarea { min-height: 140px; resize: vertical; }
.form .btn { justify-self: start; padding: 0 18px; }
.form-status { min-height: 1.4em; font-weight: bold; }

.editor-list { max-height: 280px; overflow: auto; border: 1px solid #ccc; }
.editor-list button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #eee;
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
}
.editor-list button:hover { background: var(--light); }

.preview-mount { margin-top: 12px; }
