.catt-lookup-tool {
  color: #222;
  margin: 0 0 24px;
}
.catt-lookup-filters {
  align-items: end;
  background: #f7f7f7;
  border: 1px solid #e5e5e5;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
}
.catt-lookup-filters label {
  display: flex;
  flex: 1 1 170px;
  flex-direction: column;
  font-size: 14px;
  font-weight: 600;
  gap: 5px;
  margin: 0;
}
.catt-lookup-filters select {
  margin: 0;
  min-height: 42px;
  width: 100%;
}
.catt-lookup-filters button {
  margin: 0;
  min-height: 42px;
}
.catt-lookup-scope {
  align-items: baseline;
  background: #fff;
  border: 1px solid #e5e5e5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 12px;
  padding: 11px 13px;
}
.catt-lookup-note {
  color: #444;
  font-size: 14px;
  line-height: 1.55;
  margin: 10px 0 14px;
}
.catt-lookup-table-wrap,
.catt-station-history .table-responsive {
  margin: 0 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}
.catt-lookup-table,
.catt-draw-table {
  border-collapse: collapse;
  margin: 0;
  table-layout: fixed;
  width: 100%;
}
.catt-lookup-table th,
.catt-lookup-table td,
.catt-draw-table th,
.catt-draw-table td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  vertical-align: middle;
}
.catt-lookup-table thead th,
.catt-draw-table thead th {
  background: #a5121a;
  color: #fff;
  font-weight: 700;
  text-align: center;
}
.catt-lookup-table tbody tr:nth-child(even),
.catt-draw-table tbody tr:nth-child(even) {
  background: #f7f7f7;
}
.catt-lookup-table tbody th {
  background: #f0f0f0;
  font-weight: 700;
  text-align: center;
}
.catt-logan-table th:first-child,
.catt-logan-table td:first-child { width: 15%; }
.catt-logan-table th:nth-child(2),
.catt-logan-table td:nth-child(2) { width: 43%; }
.catt-logan-table th:nth-child(3),
.catt-logan-table td:nth-child(3) { width: 42%; }
.catt-station-draw {
  margin: 0 0 22px;
}
.catt-station-draw h2 {
  background: #a5121a;
  color: #fff;
  font-size: 18px;
  line-height: 1.35;
  margin: 0;
  padding: 10px 12px;
}
.catt-draw-table th:first-child { width: 28%; }
.catt-draw-table tbody th {
  background: #f0f0f0;
  font-weight: 700;
}
.catt-draw-numbers {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}
.catt-number {
  display: inline-block;
  margin: 0 7px;
  white-space: nowrap;
}
.catt-number-special { color: #c4161c; font-size: 20px; }
.catt-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 12px 0 16px;
}
.catt-related-links a,
.catt-history-pagination a {
  display: inline-block;
  font-weight: 600;
  padding: 5px 0;
}
.catt-history-pagination {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 12px 0 20px;
}
.catt-headtail-views {
  border-bottom: 2px solid #a5121a;
  display: flex;
  margin: 0 0 14px;
}
.catt-headtail-views a {
  background: #f0f0f0;
  color: #222;
  display: block;
  font-weight: 700;
  min-width: 115px;
  padding: 10px 18px;
  text-align: center;
  text-decoration: none;
}
.catt-headtail-views a.is-active {
  background: #a5121a;
  color: #fff;
}
.catt-headtail-period-table {
  min-width: 800px;
}
.catt-headtail-period-table th:first-child,
.catt-headtail-period-table td:first-child {
  width: 115px;
}
.catt-headtail-period-table thead th {
  background: #a5121a;
}
.catt-headtail-period-row th {
  background: #eee !important;
  color: #222;
  font-weight: 700;
  white-space: nowrap;
}
.catt-headtail-period-row td {
  padding: 2px !important;
}
.catt-headtail-count {
  align-items: center;
  background: #fff;
  border: 0;
  color: #222;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  min-height: 48px;
  padding: 5px 2px;
  width: 100%;
}
.catt-headtail-count:hover,
.catt-headtail-count:focus-visible,
.catt-headtail-mobile-count:hover,
.catt-headtail-mobile-count:focus-visible {
  background: #fff6f6;
  outline: 2px solid #a5121a;
  outline-offset: -2px;
}
.catt-headtail-count strong {
  font-size: 18px;
  font-weight: 800;
}
.catt-headtail-count span {
  color: #666;
  font-size: 11px;
}
.catt-headtail-detail-row > td {
  background: #eee;
  padding: 9px !important;
}
.catt-headtail-detail-row[hidden] { display: none !important; }
.catt-headtail-pairs-panel[hidden] {
  display: none !important;
}
.catt-headtail-pair-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.catt-headtail-pair-group {
  background: #fff;
  border: 1px solid #d8d8d8;
  min-width: 0;
  padding: 7px;
}
.catt-headtail-pair-heading {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin: 0 0 6px;
}
.catt-headtail-pair-heading span {
  color: #555;
  font-size: 13px;
  white-space: nowrap;
}
.catt-headtail-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.catt-headtail-pairs > span {
  background: #fff;
  border: 1px solid #ccc;
  color: #555;
  font-weight: 700;
  min-width: 28px;
  padding: 3px 4px;
  text-align: center;
}
.catt-headtail-zero {
  color: #666;
  font-size: 12px;
  margin: 0;
}
.catt-headtail-mobile-view {
  display: none;
}
.catt-headtail-pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 12px 0 18px;
}
.catt-headtail-pagination a,
.catt-headtail-pagination .is-disabled {
  border: 1px solid #ccc;
  display: inline-block;
  font-weight: 700;
  padding: 8px 10px;
  text-decoration: none;
  white-space: nowrap;
}
.catt-headtail-pagination a { color: #222; }
.catt-headtail-pagination .is-disabled { color: #999; }
.catt-headtail-draw-card { display: none; }
.catt-headtail-pairs-toggle { display: none; }
@media (max-width: 549px) {
  .catt-lookup-filters { align-items: stretch; gap: 10px; padding: 11px; }
  .catt-lookup-filters label { flex-basis: 100%; }
  .catt-lookup-filters button { width: 100%; }
  .catt-lookup-scope { display: grid; gap: 5px; padding: 10px; }
  .catt-lookup-table th,
  .catt-lookup-table td,
  .catt-draw-table th,
  .catt-draw-table td { padding: 7px 6px; }
  .catt-station-draw h2 { font-size: 16px; }
  .catt-draw-numbers { font-size: 16px; }
  .catt-number { margin: 0 4px; }
  .catt-number-special { font-size: 19px; }
  .catt-related-links { display: grid; gap: 4px; }
  .catt-history-pagination { gap: 10px; }
}
@media (max-width: 767px) {
  .catt-headtail-views a { flex: 1 1 50%; min-width: 0; padding: 10px 8px; }
  .catt-headtail-desktop-view { display: none !important; }
  .catt-headtail-mobile-view { display: grid; gap: 12px; }
  .catt-headtail-draw-card {
    background: #fff;
    border: 1px solid #ddd;
    display: block;
    margin: 0;
  }
  .catt-headtail-draw-card h3 {
    background: #a5121a;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    padding: 9px 11px;
  }
  .catt-headtail-mobile-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }
  .catt-headtail-mobile-count {
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    color: #222;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    justify-content: space-between;
    min-height: 44px;
    padding: 8px 9px;
    text-align: left;
  }
  .catt-headtail-mobile-count:nth-child(odd) { border-right: 0; }
  .catt-headtail-mobile-count:nth-child(n+3) { border-top: 0; }
  .catt-headtail-mobile-count span { font-weight: 700; }
  .catt-headtail-mobile-count strong { white-space: nowrap; }
  .catt-headtail-pairs-toggle {
    background: #f7f7f7;
    border: 1px solid #ddd;
    color: #222;
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin: 0 8px 8px;
    min-height: 42px;
    padding: 8px 12px;
    width: calc(100% - 16px);
  }
  .catt-headtail-mobile-pairs-panel { padding: 0 8px 8px; }
  .catt-headtail-pair-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catt-headtail-pair-group { padding: 7px; }
  .catt-headtail-pair-heading { flex-wrap: wrap; }
  .catt-headtail-pagination { flex-wrap: wrap; justify-content: center; }
  .catt-headtail-pagination > span:not(.is-disabled) { flex: 1 0 100%; order: -1; text-align: center; }
  .catt-headtail-pagination a,
  .catt-headtail-pagination .is-disabled { font-size: 13px; padding: 8px; }
}

/* Exact-date navigation and saved draw loto for the five audited lookup pages. */
.duy-history-date-controls {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  margin-left: auto;
  white-space: nowrap;
}
.duy-history-date-controls__caption {
  color: #fff;
  font-size: 13px;
}
.duy-history-date-controls__previous,
.duy-history-date-controls__current,
.duy-history-date-controls__form {
  align-items: center;
  border: 1px solid #aaa;
  border-radius: 4px;
  display: inline-flex;
  justify-content: center;
  min-height: 38px;
  padding: 7px 10px;
}
.duy-history-date-controls__previous {
  color: #222;
  gap: 5px;
  text-decoration: none;
}
.duy-history-date-controls__previous:hover { text-decoration: underline; }
.duy-history-date-controls__previous.is-disabled { color: #999; }
.duy-history-date-controls__current {
  background: #a90000;
  border-color: #a90000;
  color: #fff;
  font-weight: 700;
}
.duy-history-date-controls__form {
  background: #fff;
  color: #222;
  cursor: pointer;
  margin: 0;
  padding: 0;
  position: relative;
}
.duy-history-date-controls__form label {
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  margin: 0;
  padding: 8px 11px;
}
.duy-history-date-controls__form input[type="date"] {
  cursor: pointer;
  height: 100%;
  inset: 0;
  margin: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
}
.duy-station-loto {
  background: #fff;
  border: 1px solid #ddd;
  margin: 14px 0 18px;
}
.duy-station-loto__title {
  background: #a90000;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  padding: 10px 14px;
}
.duy-station-loto__note {
  color: #555;
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
  padding: 9px 12px 2px;
}
.duy-station-loto__pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 12px;
}
.duy-station-loto__pair {
  background: #f6f6f6;
  border: 1px solid #ccc;
  font-size: 16px;
  font-weight: 700;
  min-width: 52px;
  padding: 7px 10px;
  text-align: center;
}
.duy-station-loto__stats {
  border-top: 1px solid #ddd;
  display: block;
  font-size: 14px;
  padding: 9px 12px;
  text-decoration: none;
}
.duy-station-loto__stats:hover { text-decoration: underline; }
.duy-station-loto__missing {
  background: #f7f7f7;
  border-left: 3px solid #a90000;
  color: #444;
  font-size: 14px;
  margin: 10px 0 14px;
  padding: 9px 11px;
}
@media (max-width: 767px) {
  .duy-history-date-controls {
    align-items: stretch;
    gap: 6px;
    margin: 8px 0 0;
    width: 100%;
  }
  .duy-history-date-controls__caption { display: none; }
  .duy-history-date-controls__previous,
  .duy-history-date-controls__current,
  .duy-history-date-controls__form {
    flex: 1 1 0;
    min-width: 0;
    min-height: 42px;
    padding: 6px 5px;
    text-align: center;
  }
  .duy-history-date-controls__previous {
    gap: 2px;
    overflow: hidden;
  }
  .duy-history-date-controls__previous-label { display: none; }
  .duy-history-date-controls__current { font-size: 14px; }
  .duy-history-date-controls__form label {
    font-size: 13px;
    padding: 8px 4px;
  }
  .duy-station-loto { margin: 12px 0 16px; }
  .duy-station-loto__title { font-size: 16px; padding: 9px 11px; }
  .duy-station-loto__pairs {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 8px;
  }
  .duy-station-loto__pair {
    min-width: 0;
    padding: 8px 4px;
  }
}
