/* Trab – Rennprogramm, Starter und Formverlauf.
   Fachlich getrennt von Galopp, visuell auf derselben Portal-Skala. */
@media (min-width: 901px) {
  .portal-trab-card {
    margin: 12px 0 20px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
    background: var(--ts-surface);
    overflow: hidden;
  }

  .portal-trab-card__head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 17px;
    border-bottom: 1px solid #dfca9e;
    background: linear-gradient(105deg, #fffdf8 0%, #fbf3e3 100%);
  }

  .portal-trab-card__raceid {
    width: 68px;
    min-height: 70px;
    flex: 0 0 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    box-sizing: border-box;
    padding: 7px 5px;
    border: 1px solid #b9d8c8;
    border-radius: 10px;
    background: #edf7f2;
  }
  .portal-trab-card__number { color: var(--ts-green-900); font-size: 25px; line-height: 1; font-weight: 850; }
  .portal-trab-card__raceid small { color: var(--ts-green-800); font-size: 7px; line-height: 1.2; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
  .portal-trab-card__time { margin-top: 5px; color: var(--ts-green-900); font-size: 11px; line-height: 1; font-weight: 850; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .portal-trab-card__title { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
  .portal-trab-card__title > strong {
    color: var(--ts-green-900);
    font-size: 18px;
    font-weight: 750;
    line-height: 1.25;
  }
  .portal-trab-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #485950; font-size: 11px; line-height: 1.25; }
  .portal-trab-card__meta span { display: inline-flex; min-height: 25px; align-items: center; box-sizing: border-box; padding: 4px 8px; border: 1px solid #ded8cc; border-radius: 999px; background: rgba(255,255,255,.78); font-weight: 700; white-space: nowrap; }
  .portal-trab-card__meta span.portal-trab-card__meta--distance { border-color: #b9d8c8; background: #edf7f2; color: var(--ts-green-900); font-weight: 850; }
  .portal-trab-card__meta span.portal-trab-card__meta--type,
  .portal-trab-card__meta span.portal-trab-card__meta--classification { border-color: #d7b766; background: #f6e4b8; color: #66480e; font-weight: 900; }
  .portal-trab-card__meta span.portal-trab-card__meta--prize { color: var(--ts-green-900); font-weight: 850; }

  .portal-trab-tablewrap { width: 100%; overflow-x: auto; }
  .portal-trab-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
  }

  .portal-trab-table th,
  .portal-trab-table td {
    padding: 9px 7px;
    border-bottom: 1px solid var(--ts-border);
    vertical-align: middle;
    text-align: left;
  }

  .portal-trab-table th {
    background: #f1f6f3;
    color: var(--ts-green-900);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .015em;
    white-space: nowrap;
  }

  .portal-trab-table td {
    color: var(--ts-text);
    font-size: 12px;
    line-height: 1.25;
  }

  .portal-trab-table tbody tr:hover > td { background: #fafcfb; }

  .portal-trab-table__col-starter { width: 82px; }
  .portal-trab-table__col-horse { width: 205px; }
  .portal-trab-table__col-age { width: 62px; }
  .portal-trab-table__col-driver { width: 150px; }
  .portal-trab-table__col-gains { width: 104px; }
  .portal-trab-table__col-record { width: 92px; }
  .portal-trab-table__col-weight { width: 76px; }
  .portal-trab-table__col-quote { width: 66px; }

  .portal-trab-table__starterhead,
  .portal-trab-table__starter { text-align: center !important; }

  .portal-trab-table__starter { padding: 7px 5px !important; }

  .portal-trab-startermark {
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
  }

  .portal-trab-startermark__silk {
    width: 48px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .portal-trab-startermark__silk img {
    display: block;
    width: 44px;
    height: 40px;
    max-width: 44px;
    max-height: 40px;
    object-fit: contain;
    margin: 0 auto;
  }

  .portal-trab-startermark__silk span {
    display: block;
    width: 34px;
    height: 32px;
    border: 1px dashed #d5dfda;
    border-radius: 6px;
    background: #fbfcfb;
  }

  .portal-trab-startermark__number {
    color: var(--ts-green-900);
    font-size: 20px;
    line-height: 1.05;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  .portal-trab-startermark__distance {
    margin-top: 1px;
    color: var(--ts-text-muted);
    font-size: 10px;
    line-height: 1.1;
    font-weight: 500;
    white-space: nowrap;
  }

  .portal-trab-table__horse > div {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .portal-trab-table__horse strong {
    color: var(--ts-green-900);
    font-size: 13px;
    font-weight: 700;
  }

  .portal-trab-table__horse > small,
  .portal-trab-table td small {
    display: block;
    margin-top: 4px;
    color: var(--ts-text-muted);
    font-size: 10.5px;
    line-height: 1.2;
    font-weight: 500;
  }

  .portal-trab-table__horse em {
    display: inline-flex;
    align-items: center;
    margin-left: 7px;
    padding: 1px 5px;
    border: 1px solid #d8aaa2;
    border-radius: 4px;
    color: #9b3f34;
    background: #fff7f5;
    font-size: 10px;
    line-height: 1.2;
    font-style: normal;
    font-weight: 700;
  }

  .portal-trab-table__quote {
    color: var(--ts-green-800);
    font-weight: 700;
    text-align: right;
  }

  .portal-trab-table__quote .portal-quote { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; }
  .portal-trab-table__quote .portal-quote__current {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 27px;
    padding: 5px 12px 5px 10px;
    border: 1px solid rgba(39,105,72,.18);
    border-radius: 7px;
    background: #edf6f0;
    white-space: nowrap;
    overflow: hidden;
  }
  .portal-trab-table__quote .portal-quote__current strong {
    color: var(--ts-green-900);
    font-size: 13px;
    line-height: 1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }
  .portal-trab-table__quote .portal-quote__trend {
    position: absolute; width: 0; height: 0; padding: 0; border: 0; font-size: 0; line-height: 0; pointer-events: none;
  }
  .portal-trab-table__quote .portal-quote__trend--up { top: 0; right: 0; border-left: 8px solid transparent; border-bottom: 8px solid transparent; border-top: 8px solid #c89427; }
  .portal-trab-table__quote .portal-quote__trend--down { right: 0; bottom: 0; border-left: 8px solid transparent; border-top: 8px solid transparent; border-bottom: 8px solid #c89427; }
  .portal-trab-table__quote .portal-quote__history { display: flex; align-items: center; justify-content: flex-end; gap: 4px; max-width: 100%; white-space: nowrap; color: var(--ts-text-muted); font-size: 8.5px; line-height: 1; font-weight: 550; font-variant-numeric: tabular-nums; }
  .portal-trab-table__quote .portal-quote__history span + span::before { content: '·'; margin-right: 4px; color: rgba(181,145,58,.72); }

  .portal-trab-table tr.is-nonrunner td { color: #7d8782; background: #fbfbfb; }

  .portal-trab-shoes {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    margin-left: 3px;
    vertical-align: -2px;
  }

  .portal-trab-shoe {
    position: relative;
    display: inline-flex;
    width: 13px;
    height: 15px;
    color: #0b6a46;
  }

  .portal-trab-shoe svg { width: 13px; height: 15px; fill: currentColor; }
  .portal-trab-shoe--protected { color: #8b6a16; }

  .portal-trab-shoe--bare i {
    position: absolute;
    left: 0;
    top: 7px;
    width: 14px;
    height: 1.5px;
    background: #b53939;
    transform: rotate(-45deg);
    border-radius: 2px;
  }

  .portal-trab-table tr.is-distance-break > td {
    border-top: 4px solid var(--ts-green-700);
  }

  .portal-trab-table tr.is-distance-break .portal-trab-table__starter {
    position: relative;
  }

  .portal-trab-table tr.is-distance-break .portal-trab-table__starter::before {
    content: "Zulage";
    position: absolute;
    top: -13px;
    left: 8px;
    padding: 0 5px;
    background: #fff;
    color: var(--ts-green-700);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
  }

  .portal-trab-formtoggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ts-green-700);
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
  }

  .portal-trab-formtoggle__icon {
    display: inline-flex;
    width: 17px;
    height: 17px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(181,145,58,.48);
    border-radius: 50%;
    background: #fff6df;
    color: #8b6a16;
    font-size: 11px;
    line-height: 1;
    transition: transform .15s ease;
  }

  .portal-trab-formtoggle.is-open .portal-trab-formtoggle__icon { transform: rotate(180deg); }
  .portal-trab-formrow[hidden] { display: none; }



@media (min-width: 901px) {
  .portal-trab-history {
    overflow: hidden;
    width: 100%;
    border: 1px solid #e4d1a5;
    border-radius: 11px;
    background: #fffdf8;
  }

  .portal-trab-history__head,
  .portal-trab-history__row {
    display: grid;
    grid-template-columns: 76px 62px minmax(135px,1.2fr) 86px 94px minmax(130px,1fr) 64px 76px;
    align-items: stretch;
  }

  .portal-trab-history__head {
    min-height: 25px;
    background: #f4ecdc;
    border-bottom: 1px solid #e4d1a5;
    color: #79571e;
    font-size: 9.8px;
    font-weight: 900;
    letter-spacing: .025em;
    text-transform: uppercase;
  }

  .portal-trab-history__head span,
  .portal-trab-history__row span {
    display: flex;
    min-width: 0;
    align-items: center;
    padding: 8px 7px;
  }

  .portal-trab-history__row {
    min-height: 54px;
    border-bottom: 1px solid #e8ddca;
    background: #fffdf9;
    color: #29332d;
    font-size: 11.2px;
    line-height: 1.24;
    font-weight: 700;
  }

  .portal-trab-history__row:last-child { border-bottom: 0; }
  .portal-trab-history__row:hover { background: #fffbf3; }

  .portal-trab-history__row span:nth-child(3) strong {
    color: #0b5137;
    font-weight: 900;
  }
}
