/* CIHA Results & Official Results Sheet styles (CIHA Blue theme, strict CSP, all cells left-aligned) */
.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 1rem;
}

.results-print-bar {
  margin-bottom: 1rem;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.results-table th,
.results-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #D4E0EC;
}

.results-table th {
  background: #F0F5FA;
  color: #055B93;
  font-weight: 700;
  border-bottom: 2px solid #055B93;
}

/* Compact CIHA Blue Official Results layout */
.official-result-card {
  background: #FFFFFF;
  border: 1px solid #D4E0EC;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.official-result-header {
  background: #F0F5FA;
  border-bottom: 1px solid #D4E0EC;
  padding: 0.85rem 1rem;
}

.official-result-header-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.official-result-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: #055B93;
}

.official-result-meta {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: #13222E;
}

.official-result-sponsors {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: #4A5C6B;
}

.official-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  background: #FFFFFF;
}

.official-results-table th,
.official-results-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid #E2E8F0;
}

.official-results-table th {
  background: #F0F5FA;
  color: #055B93;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #055B93;
  white-space: nowrap;
}

.official-results-table tbody tr:hover {
  background: #F5F7FA;
}

.pos-cell {
  font-weight: 700;
  color: #055B93;
  white-space: nowrap;
}

.pos-judge {
  display: block;
  font-weight: 400;
  font-size: 0.76rem;
  color: #5A6B7B;
}

.dist-cell {
  white-space: nowrap;
  color: #13222E;
  font-weight: 600;
}

.dist-cum {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  color: #5A6B7B;
}

.horse-cell-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.horse-cell-text {
  min-width: 0;
}

.horse-main-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.horse-cloth {
  font-weight: 700;
  color: #055B93;
}

.horse-name {
  font-weight: 700;
  color: #13222E;
}

.headgear-pill {
  display: inline-block;
  padding: 0.05rem 0.38rem;
  border-radius: 4px;
  background: #F0F5FA;
  border: 1px solid #D4E0EC;
  color: #055B93;
  font-size: 0.74rem;
  font-weight: 600;
}

.sp-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: #03416B;
}

.horse-sub-line {
  display: block;
  font-size: 0.78rem;
  color: #5A6B7B;
  margin-top: 0.12rem;
}

.jt-stack {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-size: 0.84rem;
}

.jt-label {
  font-weight: 700;
  color: #055B93;
}

.jt-trainer {
  color: #4A5C6B;
}

.official-result-footer {
  background: #F0F5FA;
  border-top: 1px solid #D4E0EC;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: #13222E;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.official-result-footer p {
  margin: 0;
  text-align: left;
}

.official-footer-key {
  font-weight: 700;
  color: #055B93;
}

.official-stewards-note {
  padding: 0.6rem 1rem;
  background: #FEF7E6;
  border-bottom: 1px solid #F5D999;
  font-size: 0.86rem;
  color: #13222E;
}

.badge-draft {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #E2E8F0;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-submitted {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #FEF7E6;
  color: #925400;
  border: 1px solid #F5D999;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-official {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #F0F5FA;
  color: #055B93;
  border: 1px solid #D4E0EC;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-amended {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: #FEF7E6;
  color: #925400;
  border: 1px solid #F5D999;
  font-size: 0.74rem;
  font-weight: 600;
}

.badge-altered {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #FEF2F2;
  color: #A61B1B;
  border: 1px solid #F7C6C6;
  font-size: 0.82rem;
  font-weight: 600;
}

.private-panel {
  border-left: 4px solid #A61B1B;
}

.silk-thumb {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.silk-thumb-sm {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}

.field-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.88rem;
}

.compact-input {
  width: 100%;
  min-width: 4.5rem;
  box-sizing: border-box;
}

.narrow-input {
  width: 4.2rem;
}

.dist-select {
  min-width: 7.5rem;
  font-size: 0.84rem;
}

/* Official Results Sheet Print Layout */
.official-sheet-page {
  background: #FFFFFF;
  border: 1px solid #D4E0EC;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  page-break-after: always;
}

.official-sheet-header {
  background: #F0F5FA;
  border: 1px solid #D4E0EC;
  border-left: 4px solid #055B93;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.9rem;
  text-align: left;
}

.official-sheet-header h1,
.official-sheet-header h2 {
  margin: 0.1rem 0;
  font-size: 1.08rem;
  color: #055B93;
}

.official-sheet-header p {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  color: #4A5C6B;
}

.official-footer-lines {
  margin-top: 0.6rem;
  font-size: 0.84rem;
  color: #4A5C6B;
}

.official-footer-lines p {
  margin: 0.18rem 0;
}

.draft-watermark {
  border: 1px solid #F5D999;
  background: #FEF7E6;
  color: #925400;
  padding: 0.35rem 0.7rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  border-radius: 4px;
}

@media print {
  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }
  .official-sheet-page {
    border: none;
    padding: 0;
    margin: 0;
  }
}

.jt-owner {
  color: #4A5C6B;
}

.going-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0 1rem;
  background: #F0F5FA;
  border: 1px solid #D4E0EC;
  border-left: 4px solid #055B93;
  border-radius: 6px;
}

.going-bar-label {
  font-weight: 700;
  color: #055B93;
  font-size: 0.9rem;
}

.going-bar-input {
  flex: 1 1 220px;
  max-width: 320px;
  padding: 0.42rem 0.65rem;
  border: 1px solid #D4E0EC;
  border-radius: 5px;
  font: inherit;
  background: #FFFFFF;
  color: #13222E;
}

.going-bar-hint {
  font-size: 0.82rem;
  color: #4A5C6B;
}
