:root{
    --accent: #1d4ed8;
    --ink: #111827;
    --muted: #475569;
    --line: #d6d6d6;
}

.appbar{
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    background: #fff;
    border-bottom: 1px solid #d6d6d6;
}
.appbtn{
    width: 44px;
    height: 44px;
    border: 1px solid #d6d6d6;
    background: #fff;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
}
.apptitles{ flex: 1; min-width: 0; }
.apptitle{
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.appsub{
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* home */
.homescreen{
    padding: 12px 12px 28px 12px;
    max-width: 980px;
    margin: 0 auto;
}
.homehead{ padding: 6px 0 10px 0; }
.seriesbuttons{
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.seriesbtn{
    border: 1px solid #d6d6d6;
    border-radius: 12px;
    padding: 12px 12px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
}

/* main */
.mainscreen{
    padding: 10px 10px 30px 10px;
    max-width: 1200px;
    margin: 0 auto;
}
.filterblock{
    padding: 6px 0 4px 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.filterlabel{
    margin: 10px 0 6px 0;
    text-align: left;
}

/* Fleet buttons */
.fleetrow{
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    justify-content: flex-start;
}
.fleetbtn{
    border: 1px solid #d6d6d6;
    background: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: transform 0.05s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.fleetbtn:active{ transform: translateY(1px); }
.fleetbtn.on{
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.25);
}

/* Race links */
.racerow{
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 6px 2px 8px 2px;
    justify-content: flex-start;
    align-items: center;
}
.racelink{
    position: relative;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 8px 3px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}
.racelink:hover{ text-decoration: underline; }
.racelink.on{
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
}
.racelink.on::after{
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 6px;
    height: 6px;
    border-radius: 99px;
    background: var(--accent);
    transform: translateX(-50%);
}
.racelink.overall{
    padding: 6px 10px;
    border: 1px solid #d6d6d6;
    border-radius: 999px;
    background: #fff;
}
.racelink.overall.on{
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    text-decoration: none;
}
.racelink.overall.on::after{ display:none; }

/* Result options: raised tabs */
.tabrow{
    display: flex;
    gap: 6px;
    align-items: flex-end;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0;
    margin-top: 6px;
    overflow-x: auto;
}
.tabbtn{
    position: relative;
    border: 1px solid #d1d5db;
    border-bottom: 0;
    background: #f8fafc;
    padding: 8px 14px 9px 14px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 10px 10px 0 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.tabbtn:hover{
    background: #f1f5f9;
    color: #111827;
}
.tabbtn.on{
    background: #ffffff;
    color: #111827;
    font-weight: 600;
    border-color: #d1d5db;
    border-bottom: 1px solid #ffffff;
}
.tabbtn.entrants{ margin-left: auto; }  /* Rod 260119 */
.tabbtn.entrants.on{
    background: #111827;
    color: #ffffff;
    border-color: #111827;
    border-bottom: 1px solid #111827;
}

/* panel + caption */
.panel{ margin-top: 12px; }
.tablewrap{ overflow-x: auto; }

/* centre tables on desktop but don't force full width */
@media (min-width: 900px) {
    /* Centre narrow tables, but do NOT centre wide (scrolling) tables. */
    #mainScreen .tablewrap{
        display: block;
    }
    #mainScreen .tablewrap table{
        width: auto !important;
        margin-left: auto;
        margin-right: auto;
    }
}

.capSeries{ font-weight: 700; }
.capMeta{ color: var(--muted); }
.capPill{
    font-weight: 700;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f8fafc;
}
.capPill.opt-AMS   { border-color: #94a3b8; background: #f1f5f9; color: #0f172a; }
.capPill.opt-PHS   { border-color: #1d4ed8; background: rgba(29,78,216,.10); color: #1d4ed8; }
.capPill.opt-ORCAP { border-color: #0ea5e9; background: rgba(14,165,233,.10); color: #0369a1; }
.capPill.opt-Entrants { border-color: #111827; background: #111827; color: #fff; }

/* flash */
@keyframes pillFlash {
    0%   { box-shadow: 0 0 0 0 rgba(29,78,216,.0); transform: translateY(0); }
    25%  { box-shadow: 0 0 0 6px rgba(29,78,216,.18); transform: translateY(-1px); }
    60%  { box-shadow: 0 0 0 3px rgba(29,78,216,.10); transform: translateY(0); }
    100% { box-shadow: 0 0 0 0 rgba(29,78,216,.0); }
}
.capPill.flash{ animation: pillFlash 420ms ease-out; }

/* search */
.searchbar{
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px auto 10px auto;
    max-width: 900px;
    padding: 0 10px;
}
.searchinput{
    flex: 1;
    min-width: 160px;
    height: 38px;
    padding: 8px 10px;
    border: 1px solid #d6d6d6;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
}
.searchclear{
    width: 38px;
    height: 38px;
    border: 1px solid #d6d6d6;
    background: #fff;
    border-radius: 10px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}


#mainSearchHost{ width: 100%; }

/* appbar layout groups */
.appbar{ justify-content: space-between; }
.appbar-left, .appbar-right{ display:flex; align-items:center; gap:8px; }
.appbar-mid{
    flex: 1;
    min-width: 0;
    display:flex;
    align-items:center;
    justify-content:center;
    gap: 10px;
}

/* event logo */
.eventlogo{
    max-height: 100px; /* 40px  */
    max-width: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
}
@media (max-width: 520px){
    .eventlogo{ max-width: 160px; max-height: 100px; }  /* mh 34px */
}

/* caption bar */
.panel .caption{
    margin: 10px auto 8px auto;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    font-style: normal;
    color: var(--ink);
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 878px;
}


.logo-btn{
    border: none;
    background: transparent;
    padding: 0;
    cursor: default;
}


/* --- TopYacht footer (v10.68.7) --- */
.ty_footer{
    width: 100%;
    max-width: 900px;
    /*background: rgba(55, 123, 202, 0.16);*/ /* pale blue to complement logo */
    /*padding: 10px 8px;*/
    padding: 3px 8px;
    box-sizing: border-box;
    margin: -10px auto 0 auto;
/*    border-radius: 10px;
    border-color: rgba(55, 123, 202, 0.16);*/
}
.ty_footer_inner{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.ty_footer_text{
    font-size: 0.9rem;
    /*color: #377bca;*/
    line-height: 1.2;
    font-weight: 600;
}
.ty_footer_logo{
    height: 1.6rem;
    width: auto;
    display: inline-block;
}
