.fml-team-profile {
    --team-gold: #f7ce4d;
    --team-ink: #13151b;
    --team-muted: #555965;
    --team-paper: #fff;
    --team-surface: #f6f5f1;
    --team-line: #dedfe2;
    --team-wash: #fdf3d4;
    width: 100%;
    min-width: 0;
    color: var(--team-ink);
    font-family: system-ui, sans-serif;
}

.fml-team-detail-page .site-main > .page-header:has(+ .page-content .fml-team-profile) { display: none; }
.fml-team-profile [hidden] { display: none !important; }

.fml-team-profile :is(.fml-team-breadcrumb, .fml-team-hero) a,
.fml-team-profile :is(.fml-team-action, .fml-team-timeline a) {
    color: inherit;
    text-underline-offset: .16em;
}

.fml-team-profile :is(a, button, summary):focus-visible {
    outline: 2px solid #b71e2d;
    outline-offset: -3px;
}

.fml-team-breadcrumb,
.fml-team-profile .fml-team-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin: 0;
    font-size: .86rem;
    font-weight: 700;
}
.fml-team-breadcrumb { color: var(--team-muted); margin-bottom: 4px; }
.fml-team-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }

.fml-team-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(10px, 2vw, 24px);
    min-height: clamp(155px, 18vw, 225px);
    padding: clamp(18px, 4vw, 40px);
    border-radius: 15px 15px 0 0;
    background: var(--team-gold);
    color: var(--team-ink);
}
.fml-team-pitch {
    position: absolute;
    z-index: -1;
    inset: -16% -4% auto auto;
    width: max(46%, 220px);
    height: 132%;
    border: 2px solid currentColor;
    opacity: .15;
    pointer-events: none;
    transform: rotate(-23deg);
    background: radial-gradient(circle at center, transparent 0 14%, currentColor 14.5% 15.3%, transparent 16%),
        linear-gradient(90deg, transparent 49.6%, currentColor 49.7% 50.3%, transparent 50.4%);
}
.fml-team-pitch::after {
    content: "";
    position: absolute;
    inset: 23% -2px 23% auto;
    width: 20%;
    border: 2px solid currentColor;
}
.fml-team-profile .fml-team-hero h1 {
    margin: .3rem 0 .15rem;
    max-width: 19ch;
    color: var(--team-ink);
    font: 850 clamp(1.55rem, 5.8vw, 3.8rem)/1.04 system-ui, sans-serif;
    letter-spacing: -.056em;
    overflow-wrap: anywhere;
}
.fml-team-meta strong {
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--team-ink);
    color: #fff;
    letter-spacing: .06em;
}
.fml-team-crest {
    display: block;
    width: clamp(54px, 12vw, 104px);
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    padding: clamp(5px, 1.3vw, 12px);
    background: var(--team-paper);
    border-radius: 12px;
}
.fml-team-profile .fml-team-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 44px;
    font-weight: 750;
    font-size: .87rem;
}
.fml-team-sheet > .fml-team-action { margin-inline: 14px; }
.fml-team-tabs {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    padding: 5px;
    border: 1px solid var(--team-line);
    border-radius: 0 0 12px 12px;
    background: var(--team-surface);
}
.fml-team-profile .fml-team-tabs a {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 4px;
    background: transparent;
    border-radius: 7px;
    color: var(--team-ink);
    font: 750 .89rem/1.15 system-ui, sans-serif;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.fml-team-profile .fml-team-tabs a:hover { background: var(--team-paper); }
.fml-team-profile .fml-team-tabs a[aria-selected="true"] { background: var(--team-gold); }

.fml-team-panel, .fml-team-tabs, .fml-team-profile [data-fml-inline-report] { scroll-margin-top: 90px; }
.fml-team-panel { min-width: 0; padding: clamp(14px, 3vw, 25px) 0 0; }
.fml-team-profile .fml-team-panel-title,
.fml-team-profile .fml-team-overview-section > h2 {
    margin: 0 0 .55rem;
    font: 830 clamp(1.35rem, 3vw, 2rem)/1.13 system-ui, sans-serif;
    letter-spacing: -.04em;
}
.fml-team-profile .fml-team-overview-section > h2 { font-size: clamp(1.15rem, 2.6vw, 1.6rem); }
.fml-team-overview-section { margin-top: 22px; }
.fml-team-profile .fml-team-caption { color: var(--team-muted); margin: 0 0 1rem; }

.fml-team-figures {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
}
.fml-team-figures > div {
    min-width: 0;
    padding: 11px clamp(9px, 2vw, 15px);
    border: 1px solid var(--team-line);
    border-radius: 10px;
    background: var(--team-surface);
}
.fml-team-figures dt { font-size: .82rem; color: var(--team-muted); font-weight: 700; }
.fml-team-figures dd {
    margin: 3px 0 0;
    font-size: clamp(1.05rem, 3vw, 1.55rem);
    font-weight: 850;
    line-height: 1.15;
    letter-spacing: -.04em;
    overflow-wrap: anywhere;
}
.fml-team-profile :is(dd, time, .fml-team-result-score, .fml-team-rating-badge) { font-variant-numeric: tabular-nums; }

.fml-team-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}
.fml-team-stack { display: grid; gap: 12px; min-width: 0; }
.fml-team-sheet,
.fml-team-archive,
.fml-team-panel > .fml-public-section:not(:has(.fml-match-list)),
.fml-team-panel > .fml-match-evidence-profile,
.fml-team-panel .fml-profile-chart {
    min-width: 0;
    border: 1px solid var(--team-line);
    border-radius: 12px;
    background: var(--team-paper);
}
.fml-team-sheet > header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px 12px;
    padding: 11px 14px;
    background: var(--team-surface);
    border-bottom: 1px solid var(--team-line);
    border-radius: 11px 11px 0 0;
}
.fml-team-profile .fml-team-sheet h2,
.fml-team-profile .fml-team-sheet h3,
.fml-team-profile .fml-team-panel > .fml-public-section > h3,
.fml-team-profile .fml-team-panel--matches .fml-match-status-section > h4 {
    margin: 0;
    font: 800 1.06rem/1.2 system-ui, sans-serif;
    letter-spacing: -.02em;
}
.fml-team-profile .fml-team-sheet :is(time, header > span) { color: var(--team-muted); font-size: .8rem; }
.fml-team-profile .fml-team-sheet-body { padding: 12px 14px; margin: 0; }
.fml-team-sheet-body p { margin: 3px 0 0; }
.fml-team-sheet > .fml-result-scoreboard { margin: 10px 10px 0; }
.fml-team-kit-card .fml-kit-tile { margin: 12px auto; }
.fml-team-big-number { font-size: 1.48rem; letter-spacing: -.035em; }

.fml-team-profile .fml-team-form {
    display: flex;
    gap: 4px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.fml-team-profile .fml-team-form li {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 5px;
    background: #e7e7e8;
    color: var(--team-ink);
    font: 800 .76rem/1 system-ui, sans-serif;
}
.fml-team-profile .fml-team-form .is-w { background: #dceee4; color: #18563c; }
.fml-team-profile .fml-team-form .is-l { background: #f7e4e1; color: #8b2e27; }
.fml-team-profile .fml-team-result {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 56px;
    padding: 9px 14px;
    color: inherit;
    text-decoration: none;
    line-height: 1.22;
}
.fml-team-result + .fml-team-result { border-top: 1px solid var(--team-line); }
.fml-team-result:is(:hover, :focus-visible) { background: var(--team-surface); }
.fml-team-result-logo img { display: block; width: 32px; height: 32px; object-fit: contain; }
.fml-team-result-logo .fml-team-mini-portrait { border-radius: 5px; object-fit: cover; object-position: 50% 22%; }
.fml-team-result > span { min-width: 0; overflow-wrap: anywhere; }
.fml-team-result small { display: block; margin-top: 3px; color: var(--team-muted); font-size: .77rem; }
.fml-team-result-score { white-space: nowrap; }
.fml-team-rating-badge { background: var(--team-gold); border-radius: 5px; padding: 4px 7px; font-size: .9rem; }
.fml-team-facts { margin: 0; }
.fml-team-facts > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 9px 14px;
    font-size: .89rem;
}
.fml-team-facts > div + div { border-top: 1px solid var(--team-line); }
.fml-team-facts dd { margin: 0; text-align: right; font-weight: 780; overflow-wrap: anywhere; }
.fml-team-facts small { display: block; color: var(--team-muted); }
.fml-team-facts .is-gain { color: #18563c; }
.fml-team-facts .is-loss { color: #8b2e27; }
.fml-team-archive { margin-top: 15px; }
.fml-team-archive > summary { min-height: 44px; padding: 11px 14px; border-radius: 10px; font-weight: 750; cursor: pointer; }
.fml-team-archive[open] > summary { background: var(--team-surface); border-radius: 10px 10px 0 0; }
.fml-team-archive > div { padding: 12px 14px; }

.fml-team-roster + .fml-team-roster { margin-top: 19px; }
.fml-team-profile .fml-team-roster > h3 {
    display: flex;
    gap: .65em;
    align-items: baseline;
    margin: 0 0 8px;
    font: 800 1.08rem/1.2 system-ui, sans-serif;
}
.fml-team-roster > h3 small { color: var(--team-muted); font-size: .78rem; }
.fml-team-profile .fml-team-roster .fml-directory-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 175px), 1fr));
    gap: 10px;
    margin: 0;
    align-items: start;
}
.fml-team-profile .fml-directory-card { --directory-accent: var(--team-gold); background: var(--team-paper); }
.fml-team-profile .fml-directory-portrait {
    grid-template-columns: minmax(3.6rem, .7fr) minmax(0, 1fr);
    min-height: 106px;
    border-top: 0;
    border-bottom: 1px solid var(--team-line);
    background: var(--team-surface);
}
.fml-team-profile .fml-directory-rating {
    position: relative;
    z-index: 1;
    align-self: start;
    justify-self: start;
    gap: 3px;
    margin: 8px 0 3px 8px;
    padding: 5px 7px;
    border-radius: 6px;
    background: var(--team-gold);
    color: var(--team-ink);
}
.fml-team-profile .fml-directory-rating strong { font-size: 1.3rem; }
.fml-team-profile .fml-directory-rating .fml-eafc-missing small { color: var(--team-ink); }
.fml-team-profile .fml-directory-photo {
    width: 100%;
    height: 106px;
    background: none;
}
.fml-team-profile .fml-directory-photo img { object-fit: cover; object-position: 50% 23%; }
.fml-team-profile .fml-directory-identity { min-height: 104px; }
.fml-team-profile .fml-directory-country-name { overflow-wrap: anywhere; }
.fml-team-profile .fml-directory-meta > .fml-directory-country-name::before { content: none; }
.fml-team-profile .fml-directory-back { min-height: 210px; }
.fml-team-profile .fml-directory-back h2:focus { outline: none; }
body .fml-team-profile .fml-directory-card .fml-directory-flip:is(:hover, :focus-visible) {
    background: var(--team-wash) !important;
    color: var(--team-ink) !important;
}

.fml-team-panel > .fml-public-section,
.fml-team-panel > .fml-match-evidence-profile,
.fml-team-panel .fml-profile-chart { margin: 11px 0; padding: clamp(10px, 2vw, 16px); }
.fml-team-panel--matches > .fml-public-section { padding: 0; }
.fml-team-panel--matches .fml-match-status-section + .fml-match-status-section { margin-top: 17px; }
.fml-team-panel--matches .fml-match-status-section > h4 { padding-bottom: 8px; }
.fml-team-panel--matches .fml-match-list .fml-match-row { min-width: 0; border-color: var(--team-line); }
.fml-team-panel .fml-public-wrap { max-width: 100%; }
.fml-team-panel .fml-public-wrap table { margin-bottom: 0; }
.fml-team-panel > .fml-public-section .fml-public-wrap .fml-public-data-table td { border-color: var(--team-line) !important; }
.fml-team-panel > .fml-public-section .fml-public-wrap .fml-public-data-table tbody tr:nth-child(even) td { background: var(--team-surface) !important; }
.fml-team-profile :is(.fml-public-grid, .fml-public-summary) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
    gap: 7px;
}
.fml-team-profile :is(.fml-public-grid .fml-public-stat, .fml-public-summary > div) {
    min-width: 0;
    border-radius: 7px;
    border: 1px solid var(--team-line);
    background: var(--team-surface);
    overflow-wrap: anywhere;
}
.fml-team-panel .fml-profile-chart figcaption { font-weight: 800; }
.fml-team-panel .fml-profile-chart svg { display: block; width: 100%; max-height: 185px; }
.fml-team-panel .fml-profile-chart-grid { fill: none; stroke: var(--team-line); }
.fml-team-panel .fml-profile-chart polyline { fill: none; stroke: var(--team-ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.fml-team-panel .fml-profile-chart circle { fill: var(--team-gold); stroke: #765500; }
.fml-team-panel .fml-profile-chart-values {
    display: grid;
    grid-template-columns: repeat(var(--profile-point-count), minmax(0, 1fr));
    gap: 4px;
    padding: 0;
    margin: 3px 0 0;
    list-style: none;
    text-align: center;
}
.fml-team-panel .fml-profile-chart-values li { display: grid; align-content: start; color: var(--team-muted); font-size: clamp(.56rem, 2vw, .81rem); overflow-wrap: anywhere; }
.fml-team-panel .fml-profile-chart-values strong { color: var(--team-ink); }

.fml-team-panel .fml-team-timeline { margin: 13px 0; padding: 0 0 0 9px; list-style: none; }
.fml-team-timeline > li { position: relative; border-inline-start: 1px solid var(--team-line); padding: 0 0 13px 15px; }
.fml-team-timeline > li:last-child { padding-bottom: 0; }
.fml-team-timeline > li::before {
    content: "";
    position: absolute;
    inset: 6px auto auto -5px;
    width: 9px;
    height: 9px;
    border: 1px solid #765500;
    border-radius: 50%;
    background: var(--team-gold);
}
.fml-team-timeline time { display: block; color: var(--team-muted); font-size: .82rem; }

@media (max-width: 720px) {
    .fml-team-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .fml-team-profile .fml-team-tabs a { font-size: .79rem; }
    .fml-team-split { grid-template-columns: minmax(0, 1fr); }
    .fml-team-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fml-team-panel, .fml-team-tabs, .fml-team-profile [data-fml-inline-report] { scroll-margin-top: 18px; }
    .fml-team-panel:is(.fml-team-panel--ratings, .fml-team-panel--value, .fml-team-panel--transfers) .fml-public-data-table {
        min-width: 510px;
    }
}
@media (max-width: 420px) {
    .fml-team-profile .fml-team-roster .fml-directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .fml-team-profile .fml-directory-identity { padding-inline: 8px; }
}

.fml-team-hero-links { display: flex; flex-wrap: wrap; column-gap: 16px; }
.fml-club-detail .fml-team-tabs { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
.fml-club-detail .fml-team-panel--overview > .fml-team-figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fml-club-overview-grid { margin-top: 12px; }
.fml-club-detail .fml-club-squad-tools > details { background: var(--team-paper); border-color: var(--team-line); border-radius: 12px; }
.fml-club-detail .fml-club-squad-tools .fml-team-figures { margin-bottom: 0; }
.fml-club-detail .fml-club-squad-tools > details > summary { cursor: pointer; }
@media (max-width: 720px) {
    .fml-club-detail .fml-team-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fml-club-detail .fml-team-panel--overview > .fml-team-figures dt { font-size: .75rem; }
}
@media (max-width: 420px) {
    .fml-club-detail .fml-team-panel--overview > .fml-team-figures {
        grid-template-columns: minmax(0, .7fr) repeat(2, minmax(0, 1fr));
    }
}
