:root {
    --studio-blue: #075bb5;
    --studio-border: #28487825;
    --studio-width: 1280px;
    scroll-behavior: smooth;
}
.roadbook-status {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 99px;
    background: #fff0d9;
    color: #784209;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.4;
}
.roadbook-card .roadbook-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.roadbook-gallery .media-box { min-width: 0; display: flex; flex-direction: column; }
.roadbook-gallery .catalog-zoom { flex: none; width: 100%; }
.roadbook-gallery figcaption { padding: 8px; text-align: center; font-size: .88rem; color: #25435d; }
.catalog-detail .roadbook-gallery .media-box img { height: 230px; object-fit: contain; padding: 5px; }
.roadbook-versions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.roadbook-versions .roadbook-version { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 8px; padding: 12px; }
.roadbook-version p { font-size: .9rem; color: #334b63; line-height: 1.45; }
.roadbook-version .platform-chip { cursor: default; }
.roadbook-version .platform-chip:hover { transform: none; }
.roadbook-version .roadbook-status { margin-top: auto; }
@media (max-width: 600px) {
    .roadbook-card .roadbook-gallery, .roadbook-versions { grid-template-columns: minmax(0, 1fr); }
    .catalog-detail .roadbook-gallery .media-box img { height: 270px; }
}

body, body.catalog-ready {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    background: radial-gradient(ellipse 900px 420px at 50% 100px, #dfeeff, transparent), #f5f7fb;
    overflow-x: clip;
}

body.catalog-ready { --catalog-width: var(--studio-width); }

.catalog-ready .header-banner {
    background: #ffffffdc;
    box-shadow: 0 1px 0 var(--studio-border);
    padding-block: 9px;
}
.catalog-ready .banner-content img { max-width: 300px; border-radius: 10px; }
.catalog-ready .language-tabs {
    top: 10px;
    right: max(12px, calc((100% - var(--studio-width)) / 2 + 22px));
    box-shadow: 0 4px 14px #172f4a14;
    border: 1px solid var(--studio-border);
}
.catalog-ready .language-tabs a.active { background: #16385e; color: #fff; box-shadow: none; }
.catalog-ready .intro-section { margin: 0 auto; padding: 24px 16px 15px; }
.catalog-ready .intro-section h1 {
    font-family: inherit;
    font-weight: 780;
    font-size: clamp(2rem, 5.3vw, 4rem);
    line-height: 1.06;
    letter-spacing: -.05em;
    margin-bottom: 12px;
}
.catalog-ready .intro-section p { max-width: 690px; }
.studio-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 17px;
    border-radius: 100px;
    background: var(--studio-blue);
    color: white;
    text-decoration: none;
    font-weight: 700;
}
.studio-cta:hover { background: #094987; }
.catalog-ready .store-notice { margin-bottom: 20px; }

.catalog-ready .catalog-toolbar {
    position: sticky;
    top: 0;
    z-index: 8;
    width: min(calc(100% - 26px), calc(var(--studio-width) - 44px));
    margin: 0 auto 14px;
    padding: 9px;
    border: 1px solid var(--studio-border);
    border-radius: 18px;
    background: #f9fbffef;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 6px 22px #20395712;
}
.catalog-toolbar .catalog-heading { font-size: clamp(1rem, 2vw, 1.3rem); }
.catalog-toolbar .catalog-controls { min-width: 0; }
.catalog-toolbar .catalog-search, .catalog-toolbar .catalog-device { min-height: 36px; font-size: .9rem; }
.studio-filters {
    flex: 0 0 100%;
    min-width: 0;
    display: flex;
    gap: 6px;
    padding: 2px 3px 4px;
    overflow-x: auto;
}
.studio-filter {
    border: 1px solid #cbd8e8;
    border-radius: 100px;
    padding: 7px 11px;
    min-height: 34px;
    background: #fff;
    color: #203b59;
    font: inherit;
    font-size: .82rem;
    font-weight: 660;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .18s, color .18s, border-color .18s;
}
.studio-filter:hover { border-color: #739bc6; }
.studio-filter[aria-pressed="true"] { background: #15395f; color: #fff; border-color: #15395f; }
.studio-filter:focus-visible, .studio-back:focus-visible, .studio-cta:focus-visible {
    outline: 2px solid var(--studio-blue);
    outline-offset: 2px;
}
#catalogue { scroll-margin-top: 145px; }
.catalog-ready #catalogue { grid-template-columns: minmax(0, 1fr); gap: 11px; }

.catalog-ready .catalog-tile {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    grid-template-areas: "logos info preview";
    gap: 9px;
    min-height: 112px;
    padding: 12px 13px;
    border-radius: 20px;
    border-color: var(--studio-border);
    background: linear-gradient(125deg, #fff, var(--studio-tint, #eff6ff));
    box-shadow: 0 4px 14px #213c6510;
    transition: transform .22s, box-shadow .22s, border-color .22s;
}
.catalog-tile[data-category="tournaments"] { --studio-tint: #eef6ff; }
.catalog-tile[data-category="orienteering"] { --studio-tint: #edf8f2; }
.catalog-tile[data-category="timing"] { --studio-tint: #f5f2ff; }
.catalog-tile[data-category="class"] { --studio-tint: #fff4eb; }
.catalog-tile[data-category="mac"] { --studio-tint: #eef3f9; }
.catalog-ready .catalog-tile[hidden], .studio-tools-heading[hidden], .studio-back[hidden] { display: none; }
.catalog-tile .catalog-logos { height: auto; gap: 4px; }
.catalog-tile .catalog-logos .app-logo { width: 50px; height: 50px; border-radius: 12px; }
.catalog-tile .catalog-logos .app-logo:not(:only-child) { width: 34px; height: 34px; border-radius: 9px; }
.catalog-tile .catalog-name { font-size: 1rem; }
.catalog-tile .catalog-summary { font-size: .85rem; }
.catalog-tile .catalog-info { gap: 5px; }
.catalog-tile .catalog-arrow { right: 6px; top: 5px; }
.catalog-tile .catalog-preview:not([hidden]) {
    grid-area: preview;
    display: grid;
    place-items: center;
    width: 100%;
    margin: 0;
    padding: 3px;
    overflow: hidden;
    border: 1px solid var(--studio-border);
    border-radius: 9px;
    background: #e6edf6;
}
.catalog-tile .catalog-preview img { height: 50px; }
.catalog-preview img, .catalog-detail .catalog-zoom img { transition: transform .24s; }
.catalog-detail .media-box { background: #dfe9f5; }
.catalog-detail .field-highlight { border-left-width: 4px; border-radius: 12px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .catalog-ready .catalog-tile:hover { transform: translateY(-4px); box-shadow: 0 12px 24px #213c6525; border-color: #8bb6ed; }
    .catalog-tile:hover .catalog-preview img, .catalog-detail .catalog-zoom:hover img { transform: scale(1.04); }
}
.studio-tools-heading {
    grid-column: 1 / -1;
    padding: 14px 0 5px;
    border-top: 1px solid var(--studio-border);
    color: #193b61;
    font-size: 1.2rem;
    letter-spacing: -.02em;
}

.studio-trust {
    max-width: calc(var(--studio-width) - 44px);
    margin: 24px auto 14px;
    padding: 17px;
    border: 1px solid var(--studio-border);
    border-radius: 20px;
    background: linear-gradient(125deg, #e5effb, #e6f3ee);
    color: #203957;
}
.studio-trust h2 { font-size: 1.25rem; margin-bottom: 10px; letter-spacing: -.025em; }
.studio-trust ul { list-style: none; display: grid; gap: 8px; }
.studio-trust li { padding: 10px 12px; border: 1px solid var(--studio-border); border-radius: 13px; background: #ffffffb5; }
.studio-trust h3 { font-size: .96rem; margin-bottom: 4px; }
.studio-trust p { font-size: .85rem; line-height: 1.45; }
.studio-back {
    position: fixed;
    z-index: 10;
    inset: auto max(13px, env(safe-area-inset-right)) max(13px, env(safe-area-inset-bottom)) auto;
    width: 44px;
    height: 44px;
    border: 1px solid #a5b9d1;
    border-radius: 50%;
    background: #f8fbff;
    color: #16385e;
    box-shadow: 0 4px 18px #213c6529;
    font: 700 20px/1 system-ui;
    cursor: pointer;
}
@keyframes studio-enter {
    from { transform: translateY(8px); opacity: .72; }
    to { transform: translateY(0); opacity: 1; }
}
.studio-enter { animation: studio-enter .32s ease-out; }

@media (max-width: 1320px) { .studio-trust { margin-inline: 22px; } }
@media (max-width: 720px) {
    .studio-trust { margin-inline: 13px; }
    .catalog-ready .store-notice-box { gap: 5px; }
}
@media (min-width: 721px) {
    .catalog-ready #catalogue { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .catalog-ready .catalog-tile { grid-template-columns: 62px minmax(0, 1fr) 70px; padding: 15px; }
    .catalog-tile .catalog-logos .app-logo { width: 60px; height: 60px; }
    .catalog-tile .catalog-logos .app-logo:not(:only-child) { width: 40px; height: 40px; }
    .catalog-tile .catalog-preview img { height: 60px; }
    .studio-trust ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1080px) {
    .catalog-ready #catalogue { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    :root { scroll-behavior: auto; }
    .studio-enter { animation: none; }
    .catalog-ready .catalog-tile, .studio-filter, .catalog-preview img, .catalog-detail .catalog-zoom img { transition: none; }
}
