:root {
    color-scheme: dark;
    --bg: #030b15;
    --bg-soft: #071422;
    --panel: #081a2a;
    --panel-strong: #0b2235;
    --panel-soft: #0d293d;
    --line: #1b4c67;
    --line-soft: rgba(91, 184, 222, .19);
    --text: #edf7ff;
    --muted: #9cb6c8;
    --cyan: #62d6f6;
    --cyan-strong: #27bfe8;
    --violet: #b06aff;
    --purple-dark: #2a184b;
    --gold: #f4b63e;
    --gold-soft: #ffe39a;
    --green: #55c978;
    --green-dark: #155b3f;
    --red: #eb6673;
    --orange: #f29c38;
    --shadow: 0 22px 60px rgba(0, 0, 0, .32);
    --glow: 0 0 32px rgba(54, 194, 235, .11);
    --radius: 16px;
    --radius-small: 11px;
    --sidebar: 246px;
    --topbar: 82px;
    --footer: 38px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Boss 1.7.1.15 — galerie plein cadre, lisible et sans panneau latéral. */
.boss-gallery-tools {
    display: flex;
    align-items: end;
    gap: 12px;
}

.boss-gallery-tools label {
    display: grid;
    gap: 4px;
    color: #9eb5bd;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.boss-gallery-tools select {
    min-width: 176px;
    padding: 8px 30px 8px 10px;
    border: 1px solid rgba(192, 139, 59, .58);
    border-radius: 7px;
    background: #071522;
    color: #ead6aa;
    font: 700 11px/1.2 Inter, sans-serif;
}

.boss-card-art {
    display: grid;
    overflow: hidden;
    place-items: center;
}

.boss-rarity {
    justify-self: center;
    min-width: 96px;
    padding: 2px 11px;
    border: 1px solid rgba(130, 169, 188, .55);
    border-radius: 999px;
    background: rgba(17, 48, 66, .76);
    color: #9bc5df;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.boss-rarity.rarity-4 { border-color: rgba(169, 96, 208, .68); background: rgba(73, 32, 89, .72); color: #d5a1ef; }
.boss-rarity.rarity-5 { border-color: rgba(206, 134, 42, .72); background: rgba(89, 45, 14, .72); color: #f1b45d; }
.boss-card-stats { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.boss-project-name { overflow: hidden; color: #9eafb6 !important; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 1101px) {
    .fa-body[data-current-page="bosses"] .boss-gallery-screen {
        display: flex;
        height: 100%;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
        background:
            linear-gradient(180deg, rgba(2, 10, 17, .1), rgba(2, 10, 17, .52)),
            url("../images/immersive/boss-gallery-v1.png") center / cover no-repeat;
    }

    .fa-body[data-current-page="bosses"] .boss-gallery-screen .immersive-heading {
        min-height: 94px;
        flex: 0 0 94px;
        padding: 11px 18px;
        background: linear-gradient(90deg, rgba(3, 15, 24, .96), rgba(6, 22, 32, .82));
    }

    .fa-body[data-current-page="bosses"] .boss-gallery-screen .immersive-heading h1 {
        color: #ead2a1;
        font-size: clamp(30px, 2.55vw, 43px);
    }

    .fa-body[data-current-page="bosses"] .boss-gallery-layout {
        display: block !important;
        min-height: 0;
        flex: 1;
        overflow: hidden;
    }

    .fa-body[data-current-page="bosses"] .boss-grid {
        display: grid;
        height: 100%;
        max-height: none;
        grid-template-rows: none;
        grid-auto-rows: minmax(254px, auto);
        grid-auto-flow: row;
        grid-template-columns: repeat(3, minmax(220px, 1fr));
        gap: 12px;
        padding: 11px 14px 15px;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-gutter: stable;
        overscroll-behavior: contain;
    }

    .fa-body[data-current-page="bosses"] .boss-card {
        display: flex;
        min-height: 254px;
        flex-direction: column;
        overflow: hidden;
        border: 1px solid rgba(181, 127, 50, .67);
        border-radius: 9px;
        background: linear-gradient(180deg, rgba(8, 23, 32, .97), rgba(4, 15, 23, .99));
        box-shadow: inset 0 0 0 1px rgba(242, 202, 124, .06), 0 10px 20px rgba(0, 0, 0, .23);
    }

    .fa-body[data-current-page="bosses"] .boss-card:hover,
    .fa-body[data-current-page="bosses"] .boss-card.is-selected {
        border-color: #5cd4cf;
        box-shadow: inset 0 0 0 1px rgba(116, 232, 221, .22), 0 0 22px rgba(40, 186, 189, .19);
        transform: none;
    }

    .fa-body[data-current-page="bosses"] .boss-card-art {
        height: 168px;
        flex: 0 0 168px;
        background:
            radial-gradient(circle at 50% 46%, rgba(52, 91, 106, .24), transparent 64%),
            linear-gradient(180deg, rgba(3, 13, 22, .18), rgba(2, 9, 16, .64));
    }

    .fa-body[data-current-page="bosses"] .boss-card-art img {
        width: 100% !important;
        height: 100% !important;
        padding: 4px 8px 0 !important;
        object-fit: contain !important;
        object-position: center !important;
        background: transparent !important;
        filter: drop-shadow(0 12px 13px rgba(0, 0, 0, .58));
    }

    .fa-body[data-current-page="bosses"] .boss-card-content {
        display: grid;
        flex: 1;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 8px;
        align-content: center;
        padding: 7px 12px 10px;
        border-top: 1px solid rgba(192, 139, 59, .3);
    }

    .fa-body[data-current-page="bosses"] .boss-card-content strong {
        overflow: visible;
        align-self: center;
        color: #efd29b;
        font: 600 18px/1.08 Georgia, serif;
        text-align: left;
        text-overflow: initial;
        white-space: normal;
    }

    .fa-body[data-current-page="bosses"] .boss-rarity { align-self: center; }
    .fa-body[data-current-page="bosses"] .standard-progress,
    .fa-body[data-current-page="bosses"] .boss-card-stats,
    .fa-body[data-current-page="bosses"] .boss-project-name { grid-column: 1 / -1; }
    .fa-body[data-current-page="bosses"] .boss-card-stats :is(em, b) { font-size: 9px; }
    .fa-body[data-current-page="bosses"] .boss-project-name { font-size: 8.5px; text-align: left; }
    .fa-body[data-current-page="bosses"] .boss-inspection-panel { display: none !important; }
}

/* ChronoQuest 1.7.1.11 — sanctuaire du temps calé sur la maquette validée. */
@media (min-width: 1101px) {
    .fa-body[data-current-page="timer"] {
        overflow: hidden;
    }

    .fa-body[data-current-page="timer"] .app-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .fa-body[data-current-page="timer"] .community-rail,
    .fa-body[data-current-page="timer"] .topbar,
    .fa-body[data-current-page="timer"] .bottom-mantra {
        display: none;
    }

    .fa-body[data-current-page="timer"] .app-column,
    .fa-body[data-current-page="timer"] .main-viewport,
    .fa-body[data-current-page="timer"] .page-root {
        width: 100%;
        height: 100dvh;
        min-height: 0;
    }

    .fa-body[data-current-page="timer"] .main-viewport {
        padding: 0;
        overflow: hidden;
    }

    .fa-body[data-current-page="timer"] .focus-orchestration {
        width: 100%;
        height: 100dvh;
        min-height: 0;
        border: 0;
        border-radius: 0;
        background: url("../images/immersive/focus-sanctum-v1.png") center / 100% 100% no-repeat;
        box-shadow: none;
    }

    .fa-body[data-current-page="timer"] .focus-orchestration > .immersive-heading {
        display: none;
    }

    .fa-body[data-current-page="timer"] .focus-orchestration-grid {
        height: 100%;
        grid-template-columns: minmax(270px, 31.5%) minmax(340px, 36.5%) minmax(290px, 32%);
        background: linear-gradient(90deg, rgba(1, 7, 12, .08), transparent 33%, rgba(255, 239, 196, .02) 65%, rgba(1, 7, 12, .12));
    }

    .fa-body[data-current-page="timer"] .focus-orchestration-grid > section {
        padding: 28px 22px 20px;
        border: 0;
        background: transparent;
    }

    .fa-body[data-current-page="timer"] .focus-orchestration-grid h2 {
        margin-bottom: 16px;
        font-size: 24px;
        letter-spacing: .01em;
    }

    .fa-body[data-current-page="timer"] .focus-orchestration-grid h2 > span {
        width: 42px;
        height: 42px;
        border-width: 2px;
        font-size: 22px;
        box-shadow: 0 0 0 4px rgba(6, 13, 18, .42);
    }

    .fa-body[data-current-page="timer"] .focus-project-rail {
        display: flex;
        min-height: 0;
        flex-direction: column;
        padding-inline: 18px 24px;
    }

    .fa-body[data-current-page="timer"] .focus-project-rail > div {
        display: grid;
        max-height: 43vh;
        gap: 10px;
        overflow-y: auto;
        scrollbar-width: thin;
    }

    .fa-body[data-current-page="timer"] .focus-quest-choice {
        display: grid;
        min-height: 76px;
        grid-template-columns: minmax(0, 1fr) 82px;
        align-items: stretch;
        gap: 8px;
        padding: 0 0 0 14px;
        overflow: hidden;
        border-color: rgba(202, 153, 76, .62);
        background: linear-gradient(90deg, rgba(7, 16, 23, .96), rgba(8, 20, 30, .82));
    }

    .fa-body[data-current-page="timer"] .focus-quest-choice.is-active {
        border-color: #f3c766;
        box-shadow: 0 0 0 2px rgba(245, 193, 83, .2), inset 0 0 26px rgba(214, 151, 47, .13);
    }

    .fa-body[data-current-page="timer"] .focus-quest-copy {
        display: grid;
        min-width: 0;
        align-content: center;
        gap: 9px;
    }

    .fa-body[data-current-page="timer"] .focus-quest-copy > strong {
        overflow: hidden;
        color: #f4ddad;
        font: 600 18px/1.1 Georgia, serif;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .fa-body[data-current-page="timer"] .focus-quest-copy > span {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
    }

    .fa-body[data-current-page="timer"] .focus-quest-choice img {
        width: 82px;
        height: 74px;
        object-fit: cover;
        object-position: center 24%;
        filter: brightness(.82) saturate(.82);
        mask-image: linear-gradient(90deg, transparent, #000 26%);
    }

    .fa-body[data-current-page="timer"] .focus-quest-choice > b {
        display: grid;
        color: #b39154;
        font-size: 30px;
        place-items: center;
    }

    .fa-body[data-current-page="timer"] .focus-free-choice {
        margin-top: 10px;
        padding: 10px;
        font-size: 14px;
    }

    .fa-body[data-current-page="timer"] .focus-selected-project {
        display: grid;
        min-height: 150px;
        grid-template-columns: 116px minmax(0, 1fr);
        align-items: end;
        gap: 10px;
        margin-top: auto;
        padding: 10px 12px 12px 4px;
        border: 1px solid rgba(203, 154, 75, .66);
        border-radius: 8px;
        background: linear-gradient(90deg, rgba(5, 14, 21, .94), rgba(9, 20, 27, .83));
        box-shadow: 0 15px 28px rgba(0, 0, 0, .38);
    }

    .fa-body[data-current-page="timer"] .focus-selected-project > img {
        width: 116px;
        height: 134px;
        object-fit: contain;
        object-position: center bottom;
        filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .65));
    }

    .fa-body[data-current-page="timer"] .focus-selected-project > span {
        display: grid;
        height: 100%;
        color: #d9b76e;
        font-size: 54px;
        place-items: center;
    }

    .fa-body[data-current-page="timer"] .focus-selected-project div {
        display: grid;
        align-content: end;
        gap: 5px;
        min-width: 0;
    }

    .fa-body[data-current-page="timer"] .focus-selected-project small { color: #d6a54f; font-size: 11px; }
    .fa-body[data-current-page="timer"] .focus-selected-project strong { overflow: hidden; color: #f5dfb1; font: 600 20px/1.1 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
    .fa-body[data-current-page="timer"] .focus-selected-project div > span { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
    .fa-body[data-current-page="timer"] .focus-selected-project i { position: relative; height: 7px; overflow: hidden; border-radius: 99px; background: rgba(0, 0, 0, .55); }
    .fa-body[data-current-page="timer"] .focus-selected-project i::after { display: block; width: var(--quest-progress); height: 100%; content: ""; background: linear-gradient(90deg, #d99c34, #f2d775); }
    .fa-body[data-current-page="timer"] .focus-selected-project b { color: #efc96d; font-size: 12px; }
    .fa-body[data-current-page="timer"] .focus-selected-project p { display: -webkit-box; margin: 0; overflow: hidden; color: #b8c4c5; font-size: 10px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

    .fa-body[data-current-page="timer"] .focus-task-scroll {
        min-height: 0;
        padding: 28px 30px 20px;
        background: transparent;
    }

    .fa-body[data-current-page="timer"] .focus-task-scroll h2 {
        color: #49351f;
        font-size: 24px;
    }

    .fa-body[data-current-page="timer"] .focus-target-list {
        min-height: 0;
        flex: 1 1 auto;
        border: 0;
        border-radius: 0;
        background: transparent;
        scrollbar-color: #8a6938 transparent;
    }

    .fa-body[data-current-page="timer"] .focus-target-choice {
        min-height: 64px;
        grid-template-columns: 31px minmax(0, 1fr) 24px;
        padding: 9px 13px;
        border-bottom-color: rgba(85, 61, 32, .26);
    }

    .fa-body[data-current-page="timer"] .focus-target-choice strong { font-size: 16px; }
    .fa-body[data-current-page="timer"] .focus-target-choice small { font-size: 10px; }
    .fa-body[data-current-page="timer"] .focus-target-choice b { font-size: 18px; }

    .fa-body[data-current-page="timer"] .focus-preparation-fields {
        display: block;
        margin-top: 12px;
    }

    .fa-body[data-current-page="timer"] .focus-hidden-select {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .fa-body[data-current-page="timer"] .focus-preparation-fields .button {
        width: 100%;
        min-height: 48px;
        border-color: rgba(139, 91, 29, .75);
        background: linear-gradient(180deg, #14314a, #071a2b);
        color: #f0d9a5;
        font: 600 16px Georgia, serif;
    }

    .fa-body[data-current-page="timer"] .focus-time-console {
        position: relative;
        display: block;
        min-height: 0;
        padding: 28px 24px 18px;
        background: transparent;
        text-align: center;
    }

    .fa-body[data-current-page="timer"] .focus-time-console h2 {
        justify-content: center;
        color: #efd6a0;
    }

    .fa-body[data-current-page="timer"] .focus-time-console .focus-clock {
        margin-top: clamp(190px, 31vh, 320px);
        color: #ffe8aa;
        font-size: clamp(68px, 7vw, 104px);
        text-shadow: 0 0 18px rgba(250, 192, 78, .75), 0 3px 4px #000;
    }

    .fa-body[data-current-page="timer"] .focus-time-console .focus-task {
        margin-top: 8px;
        color: #f3dfb7;
        font: 600 17px/1.25 Georgia, serif;
    }

    .fa-body[data-current-page="timer"] .focus-time-console .focus-next {
        margin: 5px auto 8px;
        color: #b9c7c8;
        font-size: 10px;
    }

    .fa-body[data-current-page="timer"] .focus-time-console [data-task-time-slot] {
        max-width: 100%;
        margin-inline: auto;
    }

    .fa-body[data-current-page="timer"] .focus-mode-row {
        margin-top: 10px;
    }

    .fa-body[data-current-page="timer"] .focus-time-console .focus-controls {
        margin-top: 11px;
    }

    .fa-body[data-current-page="timer"] .focus-time-console .focus-controls .button {
        min-height: 46px;
        font-size: 14px;
    }

    .fa-body[data-current-page="timer"] .focus-orchestration.is-configuring .focus-companion-strip {
        display: none;
    }

    .fa-body[data-current-page="timer"] .focus-orchestration.is-running .focus-orchestration-grid {
        height: calc(100% - 84px);
    }

    .fa-body[data-current-page="timer"] .focus-orchestration.is-running .focus-companion-strip {
        min-height: 84px;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-stage {
        display: flex;
        width: 100%;
        height: 100dvh;
        min-height: 0;
        flex-direction: column;
        border: 0;
        border-radius: 0;
        background:
            linear-gradient(90deg, rgba(2, 10, 17, .88), rgba(2, 9, 16, .18) 28%, rgba(2, 9, 16, .16) 72%, rgba(2, 10, 17, .88)),
            url("../images/immersive/focus-sanctum-v1.png") center / cover no-repeat;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-stage > header {
        display: flex;
        min-height: 72px;
        align-items: center;
        justify-content: space-between;
        padding: 10px 24px;
        border-bottom: 1px solid rgba(207, 157, 73, .55);
        background: rgba(2, 11, 19, .9);
    }

    .fa-body[data-current-page="timer"] .focus-expanded-stage > header h1 {
        margin: 1px 0 0;
        color: #f2d79c;
        font: 600 30px Georgia, serif;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-grid {
        display: grid;
        min-height: 0;
        flex: 1 1 auto;
        grid-template-columns: 250px minmax(0, 1fr) 250px;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-rail {
        display: flex;
        min-height: 0;
        flex-direction: column;
        gap: 12px;
        padding: 18px 14px;
        background: rgba(3, 14, 23, .88);
    }

    .fa-body[data-current-page="timer"] .focus-expanded-rail:first-child { border-right: 1px solid rgba(202, 151, 69, .42); }
    .fa-body[data-current-page="timer"] .focus-expanded-rail:last-child { border-left: 1px solid rgba(202, 151, 69, .42); }
    .fa-body[data-current-page="timer"] .focus-expanded-rail h2 { margin: 0; color: #f0d69e; font: 600 20px Georgia, serif; }
    .fa-body[data-current-page="timer"] .focus-expanded-rail > div { display: grid; gap: 8px; min-height: 0; overflow-y: auto; }
    .fa-body[data-current-page="timer"] .focus-expanded-rail > div > button { display: grid; min-height: 62px; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 8px; border: 1px solid rgba(119, 165, 184, .34); border-radius: 9px; background: rgba(12, 34, 51, .82); color: #e5eef2; text-align: left; }
    .fa-body[data-current-page="timer"] .focus-expanded-rail button strong,
    .fa-body[data-current-page="timer"] .focus-expanded-rail button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .fa-body[data-current-page="timer"] .focus-expanded-rail button small { margin-top: 3px; color: #9db2bf; font-size: 9px; }
    .fa-body[data-current-page="timer"] .focus-expanded-parking form { display: grid; gap: 7px; margin-top: auto; }

    .fa-body[data-current-page="timer"] .focus-expanded-center {
        position: relative;
        display: flex;
        min-width: 0;
        min-height: 0;
        align-items: center;
        flex-direction: column;
        justify-content: center;
        padding: 34px 245px 32px 28px;
        overflow: hidden;
        text-align: center;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-center > aside {
        position: absolute;
        right: 5px;
        bottom: 0;
        width: 235px;
        height: 88%;
        pointer-events: none;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-center > aside img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center bottom;
        filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .68));
    }

    .fa-body[data-current-page="timer"] .focus-expanded-center > aside blockquote {
        position: absolute;
        top: 16%;
        right: 80%;
        width: 210px;
        margin: 0;
        padding: 15px;
        border-radius: 13px;
        background: #f4efdf;
        color: #243038;
        font-size: 12px;
        line-height: 1.45;
        text-align: left;
        box-shadow: 0 10px 24px rgba(0, 0, 0, .42);
    }

    .fa-body[data-current-page="timer"] .focus-expanded-center > .focus-clock {
        margin: 12px 0 6px;
        color: #fff1bd;
        font: 600 clamp(94px, 11vw, 160px)/.9 Georgia, serif;
        letter-spacing: -.05em;
        text-shadow: 0 0 28px rgba(240, 180, 63, .55);
    }

    .fa-body[data-current-page="timer"] .focus-expanded-center > h2 {
        max-width: 680px;
        margin: 9px 0 0;
        color: #f5e5c5;
        font: 600 25px Georgia, serif;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-center > p { max-width: 640px; margin: 7px 0 16px; color: #b9c9d1; font-size: 13px; }
    .fa-body[data-current-page="timer"] .focus-expanded-center [data-task-time-slot] { width: min(620px, 100%); }
    .fa-body[data-current-page="timer"] .focus-expanded-center .focus-controls { width: min(650px, 100%); margin-top: 18px; }
}

/* === ChronoQuest 1.6 · écrans immersifs fonctionnels ====================== */
.immersive-screen {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(218, 166, 76, .55);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .42), inset 0 0 0 1px rgba(255, 230, 169, .05);
}

.immersive-screen::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, rgba(2, 10, 18, .1), rgba(2, 10, 18, .42));
    pointer-events: none;
}

.immersive-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 72px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(215, 164, 77, .38);
    background: linear-gradient(90deg, rgba(4, 16, 29, .94), rgba(7, 22, 34, .78), rgba(4, 15, 26, .9));
}

.immersive-heading h1,
.immersive-heading h2,
.trophy-feature h2,
.boss-inspection-panel h2 {
    margin: 2px 0;
    color: #f4d89c;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    letter-spacing: .015em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .76);
}

.immersive-heading h1 { font-size: clamp(28px, 3vw, 44px); }
.immersive-heading p { margin: 0; color: #b9c4c8; font-size: 11px; }
.immersive-heading .eyebrow { color: #58c6c7; }

/* ChronoQuest / orchestration du focus */
.focus-orchestration {
    display: flex;
    min-height: 650px;
    flex-direction: column;
    background:
        linear-gradient(90deg, rgba(3, 11, 20, .2), rgba(3, 11, 20, .08)),
        url("../images/immersive/focus-sanctum-v1.png") center / cover no-repeat;
}

.focus-orchestration-grid {
    display: grid;
    min-height: 0;
    flex: 1;
    grid-template-columns: minmax(210px, 30%) minmax(280px, 36%) minmax(250px, 34%);
}

.focus-orchestration-grid > section {
    min-width: 0;
    min-height: 0;
    padding: 14px;
}

.focus-orchestration-grid > section + section {
    border-left: 1px solid rgba(200, 149, 70, .42);
}

.focus-orchestration-grid h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 12px;
    color: #f2d69e;
    font: 500 18px/1.1 Georgia, serif;
}

.focus-orchestration-grid h2 > span {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border: 1px solid #bb8436;
    border-radius: 50%;
    background: rgba(4, 15, 25, .86);
    color: #f4d28b;
    place-items: center;
}

.focus-project-rail,
.focus-time-console {
    background: rgba(3, 13, 23, .82);
}

.focus-project-rail > div {
    display: grid;
    gap: 8px;
    max-height: 300px;
    overflow: auto;
}

.focus-quest-choice,
.focus-free-choice,
.focus-target-choice {
    border: 1px solid rgba(182, 132, 65, .55);
    background: linear-gradient(135deg, rgba(14, 26, 34, .94), rgba(6, 19, 31, .9));
    color: #e7d4ac;
    cursor: pointer;
    text-align: left;
}

.focus-quest-choice {
    display: grid;
    gap: 7px;
    min-height: 62px;
    padding: 9px 12px;
    border-radius: 8px;
}

.focus-quest-choice.is-active {
    border-color: #f0bd55;
    box-shadow: 0 0 0 2px rgba(237, 177, 68, .2), inset 0 0 24px rgba(195, 132, 38, .16);
}

.focus-quest-choice > span {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.focus-quest-choice i {
    position: relative;
    height: 6px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(0, 0, 0, .5);
}

.focus-quest-choice i::after {
    display: block;
    width: var(--quest-progress);
    height: 100%;
    content: "";
    background: linear-gradient(90deg, #d49232, #f3cf68);
}

.focus-quest-choice small { color: #d4b980; }
.focus-free-choice { width: 100%; margin-top: 10px; padding: 9px 12px; border-radius: 8px; text-align: center; }

.focus-task-scroll {
    display: flex;
    flex-direction: column;
    background: rgba(233, 221, 190, .92);
    color: #241b16;
}

.focus-task-scroll h2 { color: #493721; text-shadow: none; }
.focus-task-scroll h2 > span { border-color: #8a622b; color: #f4d28b; }

.focus-target-list {
    display: grid;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid rgba(92, 64, 31, .28);
    border-radius: 10px;
    background: rgba(247, 238, 213, .62);
}

.focus-target-choice {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 54px;
    padding: 7px 10px;
    border: 0;
    border-bottom: 1px solid rgba(95, 69, 39, .25);
    border-radius: 0;
    background: transparent;
    color: #2c2118;
}

.focus-target-choice:hover,
.focus-target-choice.is-selected { background: rgba(218, 180, 102, .34); }
.focus-target-choice b { font-size: 15px; }
.focus-target-choice strong,
.focus-target-choice small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-target-choice strong { font: 600 13px/1.25 Georgia, serif; }
.focus-target-choice small { margin-top: 2px; color: #736351; font-size: 9px; }
.focus-target-choice > i { color: #9e6a2b; font-style: normal; }

.focus-preparation-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 10px;
}

.focus-preparation-fields label { display: grid; gap: 3px; color: #5d4a35; font-size: 9px; }
.focus-preparation-fields select { min-height: 34px; background: rgba(255, 249, 231, .9); color: #302318; }
.focus-preparation-fields .button { align-self: end; }

.focus-time-console {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: flex-start;
    text-align: center;
}

.focus-time-console .focus-clock {
    margin: 6px 0 0;
    color: #ffe5a4;
    font: 500 clamp(58px, 6vw, 90px)/.95 Georgia, serif;
    letter-spacing: -4px;
    text-shadow: 0 0 22px rgba(239, 173, 58, .46);
}

.focus-time-console .focus-task {
    max-width: 100%;
    margin: 8px 0 0;
    overflow: hidden;
    color: #f7e9cb;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.focus-time-console .focus-next {
    display: -webkit-box;
    max-width: 100%;
    margin: 5px 0 8px;
    overflow: hidden;
    color: #b6c5cd;
    font-size: 10px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.focus-mode-row {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 7px;
    margin-top: 8px;
}

.focus-mode-row label { display: grid; grid-template-columns: 1fr; color: #9fb0ba; font-size: 8px; }
.focus-mode-row input,
.focus-mode-row select { min-height: 34px; }
.focus-time-console .focus-controls { width: 100%; gap: 6px; margin-top: 10px; }
.focus-time-console .focus-controls .button { min-height: 38px; flex: 1 1 92px; padding: 7px 9px; }

.focus-companion-strip {
    display: grid;
    min-height: 92px;
    grid-template-columns: 82px minmax(180px, .9fr) minmax(260px, 1.1fr);
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-top: 1px solid rgba(211, 160, 73, .42);
    background: linear-gradient(90deg, rgba(3, 13, 23, .95), rgba(8, 25, 37, .88));
}

.focus-companion-strip img { width: 78px; height: 78px; object-fit: contain; object-position: center top; }
.focus-companion-strip blockquote { margin: 0; color: #d8e6e8; font-size: 10px; line-height: 1.45; }
.focus-companion-strip blockquote strong,
.focus-companion-strip blockquote span { display: block; }
.focus-companion-strip blockquote strong { margin-bottom: 3px; color: #f3d391; font: 600 14px Georgia, serif; }
.focus-companion-strip form { display: flex; gap: 7px; }
.focus-companion-strip form input { min-width: 0; flex: 1; }

/* Auberge des compagnons */
.companion-tavern-screen {
    padding-bottom: 14px;
    background:
        linear-gradient(180deg, rgba(3, 10, 16, .15), rgba(3, 10, 16, .62)),
        url("../images/immersive/companion-inn-v1.png") center top / cover fixed;
}

.companion-tavern-screen .companion-guest-list {
    margin: 12px;
    border-color: rgba(220, 167, 74, .48);
    background: rgba(4, 15, 25, .82);
    box-shadow: inset 0 0 30px rgba(189, 124, 39, .08);
}

.companion-tavern-screen .companion-guest-list > div { grid-template-columns: repeat(5, minmax(130px, 1fr)); }
.companion-tavern-screen .companion-guest {
    position: relative;
    grid-template-columns: 74px minmax(0, 1fr);
    min-height: 92px;
    border-color: rgba(195, 143, 65, .52);
    border-radius: 6px;
    background: linear-gradient(145deg, rgba(12, 27, 36, .96), rgba(4, 17, 28, .92));
}

.companion-tavern-screen .companion-guest img {
    width: 72px;
    height: 82px;
    object-position: center top;
}

.companion-tavern-screen .companion-guest strong {
    color: #efd29a;
    font: 600 14px Georgia, serif;
}

.companion-tavern-screen .companion-guest small { color: #b8c7c9; font-size: 9px; white-space: normal; }
.companion-tavern-screen .companion-guest em { display: block; margin-top: 5px; color: #5fd0c9; font-size: 8px; font-style: normal; }
.companion-tavern-screen .companion-guest.is-selected { border-color: #62dbe0; box-shadow: 0 0 0 2px rgba(68, 199, 207, .25), 0 0 24px rgba(53, 185, 200, .18); }
.companion-tavern-screen .companion-inn { margin: 0 12px; min-height: 500px; background: rgba(4, 16, 27, .86); }
.companion-tavern-screen .companion-inn-art { min-height: 500px; background: radial-gradient(circle at 50% 28%, rgba(230, 171, 77, .2), rgba(3, 14, 24, .76) 58%); }

/* Galerie des boss */
.boss-gallery-screen {
    min-height: 680px;
    background:
        linear-gradient(180deg, rgba(2, 9, 16, .18), rgba(2, 9, 16, .55)),
        url("../images/immersive/boss-gallery-v1.png") center / cover no-repeat;
}

.boss-gallery-count {
    display: grid;
    min-width: 90px;
    color: #f1cf86;
    font: 500 28px Georgia, serif;
    text-align: center;
}

.boss-gallery-count small { color: #8ba6ad; font: 700 8px/1.2 Inter, sans-serif; text-transform: uppercase; }
.boss-gallery-layout { display: grid; min-height: 560px; grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); }
.boss-gallery-screen .boss-grid {
    display: grid;
    max-height: 590px;
    padding: 14px;
    overflow-y: auto;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    grid-auto-rows: minmax(225px, auto);
    gap: 10px;
}

.boss-gallery-screen .boss-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(195, 143, 64, .55);
    border-radius: 6px;
    background: rgba(3, 14, 24, .88);
    color: #e9d8b7;
    cursor: pointer;
    text-align: left;
}

.boss-gallery-screen .boss-card.is-selected { border-color: #5cd4cf; box-shadow: 0 0 0 2px rgba(64, 205, 201, .28), 0 0 24px rgba(42, 184, 190, .18); }
.boss-gallery-screen .boss-card img { width: 100%; height: 145px; padding: 4px; object-fit: contain; object-position: center; background: radial-gradient(circle, rgba(66, 101, 114, .15), transparent 63%); }
.boss-gallery-screen .boss-card-content { display: grid; gap: 4px; padding: 7px 9px 9px; }
.boss-gallery-screen .boss-card-content small { color: #5fc7c7; font-size: 8px; }
.boss-gallery-screen .boss-card-content strong { overflow: hidden; color: #efd29b; font: 600 14px/1.15 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.boss-gallery-screen .boss-card-content em,
.boss-gallery-screen .boss-card-content b { color: #aebdc1; font-size: 8px; font-style: normal; font-weight: 600; }
.boss-gallery-screen .boss-card-content b { color: #d7b571; }

.boss-inspection-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 15px;
    border-left: 1px solid rgba(206, 151, 67, .5);
    background: rgba(3, 14, 23, .84);
}

.boss-inspection-panel header { text-align: center; }
.boss-inspection-panel h2 { font-size: 25px; }
.boss-inspection-panel > img { width: 100%; height: 210px; object-fit: contain; object-position: center; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .7)); }
.boss-inspection-panel > p { margin: 6px 0 9px; color: #b6c6c8; font-size: 9px; line-height: 1.45; text-align: center; }
.boss-inspection-progress { display: grid; gap: 6px; }
.boss-inspection-progress > span { display: flex; align-items: end; justify-content: space-between; color: #c9d6d8; }
.boss-inspection-progress strong { color: #e6bf6d; font: 500 24px Georgia, serif; }
.boss-inspection-panel section { min-height: 0; margin: 10px 0; overflow-y: auto; }
.boss-inspection-panel section h3 { margin: 0 0 6px; color: #e6c582; font: 500 13px Georgia, serif; }
.boss-inspection-panel section button { display: grid; width: 100%; grid-template-columns: 24px minmax(0, 1fr); gap: 5px; padding: 6px; border: 0; border-bottom: 1px solid rgba(176, 133, 69, .2); background: transparent; color: #c7d3d5; cursor: pointer; text-align: left; }
.boss-inspection-panel section button:hover { background: rgba(61, 128, 139, .15); }
.boss-inspection-panel section button b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.boss-inspection-panel > .button { margin-top: auto; }

/* Salle des trophées */
.trophy-hall {
    min-height: 680px;
    padding: 0;
    background:
        linear-gradient(180deg, rgba(2, 9, 16, .1), rgba(2, 9, 16, .58)),
        url("../images/immersive/trophy-hall-v1.png") center / cover no-repeat;
}

.trophy-feature {
    display: grid;
    min-height: 122px;
    grid-template-columns: 110px minmax(0, 1fr) 170px;
    align-items: center;
    gap: 16px;
    margin: 12px;
    padding: 10px 18px;
    border: 1px solid rgba(213, 160, 70, .58);
    border-radius: 8px;
    background: rgba(4, 17, 27, .88);
}

.trophy-feature h2 { font-size: 30px; }
.trophy-feature p { margin: 4px 0 0; color: #b5c2c4; font-size: 10px; }
.trophy-feature-medal,
.reward-display { background-image: url("../generated/medals-atlas.png"); background-repeat: no-repeat; background-size: 500% auto; filter: drop-shadow(0 9px 12px rgba(0, 0, 0, .65)); }
.trophy-feature-medal { width: 100px; aspect-ratio: 1; background-position-y: 40%; }
.trophy-feature-medal.atlas-slot-0,
.reward-display.atlas-slot-0 { background-position-x: 0; }
.trophy-feature-medal.atlas-slot-1,
.reward-display.atlas-slot-1 { background-position-x: 25%; }
.trophy-feature-medal.atlas-slot-2,
.reward-display.atlas-slot-2 { background-position-x: 50%; }
.trophy-feature-medal.atlas-slot-3,
.reward-display.atlas-slot-3 { background-position-x: 75%; }
.trophy-feature-medal.atlas-slot-4,
.reward-display.atlas-slot-4 { background-position-x: 100%; }
.trophy-global-progress { display: grid; gap: 8px; padding: 12px; border-left: 1px solid rgba(211, 163, 80, .3); }
.trophy-global-progress strong { color: #f1cb79; font: 500 28px Georgia, serif; }
.trophy-global-progress span { color: #6cd0c7; font-size: 9px; }

.trophy-gallery-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; }
.trophy-hall .medal-gallery {
    display: grid;
    max-height: 505px;
    padding: 12px;
    overflow-y: auto;
    grid-template-columns: repeat(4, minmax(125px, 1fr));
    grid-auto-rows: 190px;
    gap: 10px;
}

.trophy-hall .medal-card {
    display: grid;
    min-width: 0;
    grid-template-rows: minmax(0, 1fr) auto auto;
    padding: 8px;
    border-color: rgba(198, 147, 65, .5);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(4, 15, 25, .72), rgba(4, 17, 27, .94));
    box-shadow: inset 0 0 20px rgba(219, 166, 76, .05);
}

.trophy-hall .medal-card::before { height: 125px; margin: 0 auto; aspect-ratio: 1; }
.trophy-hall .medal-card strong { min-height: auto; color: #ecd199; font: 600 12px/1.2 Georgia, serif; -webkit-line-clamp: 2; }
.trophy-hall .medal-card em { margin: 4px 0; color: #62cabc; font-size: 8px; font-style: normal; text-transform: uppercase; }
.trophy-hall .medal-card.locked { opacity: .56; }
.trophy-reward-rail { display: grid; max-height: 505px; padding: 12px; border-left: 1px solid rgba(208, 157, 69, .4); background: rgba(4, 15, 25, .84); }
.trophy-reward-rail section { display: grid; place-items: center; text-align: center; }
.trophy-reward-rail section + section { border-top: 1px solid rgba(205, 154, 73, .32); }
.reward-display { width: 112px; aspect-ratio: 1; background-position-y: 40%; }
.reward-display.is-locked { filter: grayscale(1) brightness(.55); }
.trophy-reward-rail h3 { margin: 4px 0; color: #e8ca8f; font: 500 15px Georgia, serif; }
.trophy-reward-rail p { margin: 0; color: #a7b8bc; font-size: 8px; }

/* Administration musicale : une piste = une ligne compacte */
.music-context-picker { margin: 0; padding: 10px; border: 1px solid rgba(95, 169, 204, .28); border-radius: 9px; }
.music-context-picker legend { padding: 0 6px; color: #b9d5e5; font-size: 10px; }
.music-context-picker > div,
.music-context-menu > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 12px; }
.music-context-picker label,
.music-context-menu label { display: flex; align-items: center; gap: 5px; font-size: 9px; }

.music-track-row {
    position: relative;
    grid-template-columns: 38px minmax(180px, 1.2fr) 112px 70px minmax(120px, .8fr) 108px auto auto;
    align-items: center;
    gap: 7px;
    min-height: 58px;
    padding: 7px;
}

.music-track-row > small {
    grid-column: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-preview-button {
    display: grid;
    width: 34px;
    height: 34px;
    border: 1px solid #bd893a;
    border-radius: 50%;
    background: rgba(9, 43, 56, .92);
    color: #f1cc79;
    cursor: pointer;
    place-items: center;
}

.music-track-row .music-track-title { min-width: 0; }
.music-track-row .music-track-title input { min-width: 0; width: 100%; }
.music-context-menu,
.music-credit-menu { position: relative; }
.music-context-menu summary,
.music-credit-menu summary { padding: 8px 9px; border: 1px solid rgba(95, 169, 204, .28); border-radius: 8px; background: #071a2b; color: #c6dce7; cursor: pointer; font-size: 9px; text-align: center; white-space: nowrap; }
.music-context-menu[open] > div,
.music-credit-menu[open] > div {
    position: absolute;
    z-index: 20;
    top: calc(100% + 5px);
    right: 0;
    width: min(480px, 70vw);
    padding: 10px;
    border: 1px solid rgba(209, 161, 76, .62);
    border-radius: 9px;
    background: #071a2b;
    box-shadow: 0 14px 35px rgba(0, 0, 0, .55);
}
.music-credit-fields { display: grid; grid-column: auto; grid-template-columns: 1fr; }

@media (min-width: 1101px) {
    .fa-body[data-current-page="timer"] .main-viewport,
    .fa-body[data-current-page="bosses"] .main-viewport,
    .fa-body[data-current-page="titles"] .main-viewport { overflow: hidden; }
    .fa-body[data-current-page="timer"] .page-root,
    .fa-body[data-current-page="bosses"] .page-root,
    .fa-body[data-current-page="titles"] .page-root { height: 100%; min-height: 0; }
    .focus-orchestration,
    .boss-gallery-screen,
    .trophy-hall { height: 100%; min-height: 0; }
}

/* Boutique 1.7.1.8 — composition plein écran calée sur la maquette de référence. */
@media (min-width: 1101px) {
    .fa-body[data-current-page="shop"] .app-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .fa-body[data-current-page="shop"] .community-rail,
    .fa-body[data-current-page="shop"] .topbar,
    .fa-body[data-current-page="shop"] .bottom-mantra {
        display: none !important;
    }

    .fa-body[data-current-page="shop"] .app-column {
        min-width: 0;
        height: 100dvh;
    }

    .fa-body[data-current-page="shop"] .main-viewport {
        height: 100dvh;
        min-height: 100dvh;
        padding: 0;
        overflow: hidden;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen {
        width: 100%;
        height: 100dvh;
        border-width: 0 0 0 1px;
        border-radius: 0;
    }

    .fa-body[data-current-page="shop"] .shop-hero-banner {
        min-height: clamp(305px, 36dvh, 340px);
        height: clamp(305px, 36dvh, 340px);
        flex-basis: clamp(305px, 36dvh, 340px);
        background:
            linear-gradient(90deg, rgba(2, 9, 15, .5) 0 25%, rgba(2, 9, 15, .04) 42% 72%, rgba(2, 9, 15, .38) 88% 100%),
            url("../images/immersive/shop-market-v1.png") center 50% / 100% auto no-repeat,
            #07121b;
        box-shadow: inset 0 -22px 42px rgba(0, 0, 0, .45);
    }

    .fa-body[data-current-page="shop"] .shop-hero-banner::after {
        right: 0;
        bottom: 0;
        left: 0;
        height: 46px;
        background: linear-gradient(180deg, #7c5125 0, #3e2411 34%, #1c1009 100%);
        border-top: 2px solid #a77738;
        border-bottom: 2px solid #120b06;
        box-shadow: 0 -5px 18px rgba(0, 0, 0, .4), inset 0 5px 7px rgba(255, 207, 112, .1);
        content: "";
    }

    .fa-body[data-current-page="shop"] .shop-sign {
        top: 52px;
        left: 54px;
        width: 284px;
        padding: 20px 24px 22px;
        border-color: rgba(181, 128, 52, .92);
        background: linear-gradient(155deg, rgba(7, 22, 28, .98), rgba(13, 27, 28, .98));
        box-shadow: 0 14px 26px rgba(0, 0, 0, .58), inset 0 0 30px rgba(221, 157, 52, .07);
    }

    .fa-body[data-current-page="shop"] .shop-sign h1 {
        margin-bottom: 10px;
        font-size: 39px;
        letter-spacing: .055em;
    }

    .fa-body[data-current-page="shop"] .shop-sign p {
        font-size: 15px;
        line-height: 1.42;
    }

    .fa-body[data-current-page="shop"] .shop-hero-banner > .shopkeeper-stage {
        z-index: 4;
        inset: 0 260px 0 315px;
        overflow: hidden;
    }

    .fa-body[data-current-page="shop"] .shop-hero-banner > .shopkeeper-stage > img {
        top: auto;
        right: auto;
        bottom: 0;
        left: 50%;
        width: min(400px, 36vw);
        height: auto;
        max-height: none;
        object-fit: initial;
        object-position: initial;
        filter: brightness(1.04) saturate(1.02) drop-shadow(0 14px 20px rgba(0, 0, 0, .62));
        opacity: 1;
        transform: translateX(-50%);
        -webkit-mask-image: none;
        mask-image: none;
    }

    .fa-body[data-current-page="shop"] .shop-hero-banner > .shop-wallet {
        top: 24px;
        right: 28px;
        width: 320px;
        padding: 10px 14px;
        border-color: rgba(182, 130, 52, .75);
        background: rgba(4, 16, 25, .94);
    }

    .fa-body[data-current-page="shop"] .shop-featured-case {
        right: 42px;
        bottom: 50px;
        width: 205px;
        height: 142px;
        border-radius: 50% 50% 5px 5px;
        background: radial-gradient(circle at 50% 34%, rgba(226, 175, 70, .2), transparent 45%), rgba(5, 17, 23, .91);
    }

    .fa-body[data-current-page="shop"] .shop-featured-case::before {
        width: 100px;
        height: 100px;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen > .shop-shelves {
        padding: 0 14px 10px;
        background:
            linear-gradient(180deg, rgba(4, 15, 22, .9), rgba(2, 9, 15, .97)),
            url("../images/immersive/shop-market-v1.png") center bottom / cover no-repeat;
    }

    .fa-body[data-current-page="shop"] .shop-category-tabs {
        flex: 0 0 50px;
        align-items: center;
        gap: 8px;
        margin: 0 0 10px;
        padding: 7px 0 8px;
        overflow-x: auto;
        border-bottom: 1px solid rgba(190, 135, 55, .5);
        background: transparent;
    }

    .fa-body[data-current-page="shop"] .shop-category-tabs button {
        min-height: 34px;
        padding: 7px 15px;
        border-color: rgba(180, 127, 51, .7);
        border-radius: 6px;
        background: rgba(4, 16, 24, .95);
        color: #d7c6a4;
        font: 600 10px Georgia, serif;
    }

    .fa-body[data-current-page="shop"] .shop-category-tabs button.is-active {
        border-color: #58c9c1;
        background: rgba(5, 45, 50, .92);
        color: #8ee5df;
        box-shadow: 0 0 13px rgba(62, 207, 198, .18), inset 0 0 14px rgba(62, 207, 198, .1);
    }

    .fa-body[data-current-page="shop"] .shop-stock-scroll {
        padding: 0 7px 2px 0;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-showcase-grid {
        grid-auto-rows: minmax(220px, auto);
        gap: 10px;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card {
        min-height: 220px;
        padding: 13px;
        grid-template-columns: 150px minmax(0, 1fr);
        column-gap: 12px;
        border-color: rgba(186, 132, 54, .72);
        background: linear-gradient(145deg, rgba(8, 25, 34, .98), rgba(3, 13, 20, .99));
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card::before {
        width: 158px;
        height: 158px;
        flex-basis: 158px;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card h3 {
        margin: 7px 0 9px;
        font-size: 19px;
        line-height: 1.12;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card p {
        font-size: 11px;
        line-height: 1.5;
        -webkit-line-clamp: 4;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card .rarity {
        padding: 4px 8px;
        font-size: 9px;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card .price {
        font-size: 16px;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card .price-row .button {
        min-width: 86px;
        min-height: 38px;
        font-size: 10px;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card.is-hero-portrait,
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card.is-hero-portrait .shop-card-inspect {
        grid-template-columns: 158px minmax(0, 1fr);
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card.is-hero-portrait .shop-hero-portrait {
        width: 158px;
        height: 158px;
    }

    .fa-body[data-current-page="shop"] .shop-shelf-footer {
        min-height: 28px;
        margin-top: 4px;
    }
}

@media (max-width: 1250px) {
    .focus-orchestration-grid { grid-template-columns: 27% 37% 36%; }
    .focus-companion-strip { grid-template-columns: 70px minmax(150px, .8fr) minmax(220px, 1fr); }
    .companion-tavern-screen .companion-guest-list > div { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .boss-gallery-layout { grid-template-columns: minmax(0, 2.4fr) minmax(245px, 1fr); }
    .boss-gallery-screen .boss-grid { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
    .trophy-hall .medal-gallery { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
}

@media (max-width: 900px) {
    .immersive-screen { overflow: visible; }
    .focus-orchestration-grid,
    .boss-gallery-layout,
    .trophy-gallery-layout { grid-template-columns: 1fr; }
    .focus-orchestration-grid > section + section,
    .boss-inspection-panel,
    .trophy-reward-rail { border-top: 1px solid rgba(205, 154, 73, .35); border-left: 0; }
    .focus-target-list,
    .boss-gallery-screen .boss-grid,
    .trophy-hall .medal-gallery { max-height: none; }
    .focus-companion-strip { grid-template-columns: 68px minmax(0, 1fr); }
    .focus-companion-strip form { grid-column: 1 / -1; }
    .companion-tavern-screen .companion-guest-list > div,
    .boss-gallery-screen .boss-grid,
    .trophy-hall .medal-gallery { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
    .trophy-reward-rail { grid-template-columns: repeat(2, 1fr); }
    .music-track-row { grid-template-columns: 38px minmax(0, 1fr) auto auto; }
    .music-track-row > small,
    .music-credit-menu { grid-column: 2 / -1; }
}

@media (max-width: 600px) {
    .immersive-heading { align-items: flex-start; flex-direction: column; }
    .companion-tavern-screen .companion-guest-list > div,
    .boss-gallery-screen .boss-grid,
    .trophy-hall .medal-gallery,
    .trophy-reward-rail { grid-template-columns: 1fr; }
    .trophy-feature { grid-template-columns: 78px minmax(0, 1fr); }
    .trophy-feature-medal { width: 72px; }
    .trophy-global-progress { grid-column: 1 / -1; border-top: 1px solid rgba(211, 163, 80, .3); border-left: 0; }
    .music-context-picker > div,
    .music-context-menu > div { grid-template-columns: 1fr; }
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-width: 320px;
    min-height: 100%;
    background: var(--bg);
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100dvh;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 78% 2%, rgba(30, 128, 180, .11), transparent 28%),
        radial-gradient(circle at 45% 110%, rgba(102, 45, 177, .16), transparent 36%),
        linear-gradient(145deg, #020813 0%, var(--bg) 46%, #06111d 100%);
}

body.module-view {
    overflow: hidden !important;
}

.fa-body {
    position: fixed;
    z-index: 2147480000;
    inset: 0;
    min-width: 320px;
    min-height: 100dvh;
    overflow: hidden;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    background:
        radial-gradient(circle at 78% 2%, rgba(30, 128, 180, .11), transparent 28%),
        radial-gradient(circle at 45% 110%, rgba(102, 45, 177, .16), transparent 36%),
        linear-gradient(145deg, #020813 0%, var(--bg) 46%, #06111d 100%);
}

.fa-body > .app-shell {
    width: 100%;
    height: 100dvh;
    min-height: 0;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

a {
    color: var(--cyan);
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 9999;
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fff;
    color: #071422;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: 100dvh;
}

.sidebar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    flex-direction: column;
    width: var(--sidebar);
    height: 100dvh;
    padding: 15px 13px 12px;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background:
        radial-gradient(circle at 75% 15%, rgba(43, 188, 225, .09), transparent 28%),
        linear-gradient(180deg, rgba(5, 23, 38, .99), rgba(4, 17, 29, .99));
    box-shadow: 14px 0 48px rgba(0, 0, 0, .24);
}

.community-rail {
    display: none;
}

.sidebar::after {
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: .7;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 4px 5px 11px;
}

.brand-home,
.mobile-brand-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.brand-home:focus-visible,
.mobile-brand-home:focus-visible {
    border-radius: 9px;
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.sidebar-brand img {
    width: 46px;
    height: 46px;
    filter: drop-shadow(0 0 10px rgba(244, 182, 62, .35));
}

.sidebar-brand strong {
    display: block;
    color: #c8dcff;
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    font-size: 21px;
    letter-spacing: .4px;
    line-height: 1;
    text-transform: uppercase;
}

.sidebar-brand strong span {
    color: var(--gold);
}

.sidebar-brand small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 10px;
}

.sidebar-close {
    display: none;
    flex: 0 0 auto;
    margin-left: auto;
}

.primary-create {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    margin: 3px 0 10px;
    border: 1px solid rgba(84, 223, 225, .3);
    border-radius: 10px;
    background: linear-gradient(180deg, #178d96, #0b6878);
    box-shadow: inset 0 1px rgba(255,255,255,.13), 0 8px 20px rgba(0, 109, 126, .22);
    color: #fff;
    cursor: pointer;
    font-weight: 750;
}

.primary-create:hover {
    filter: brightness(1.12);
}

.main-nav {
    flex: 1;
    min-height: 0;
    padding-right: 2px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-color: #1b526b transparent;
    scrollbar-width: thin;
}

.nav-group {
    margin: 0 0 9px;
}

.nav-group h2 {
    margin: 0;
    padding: 5px 7px 4px;
    color: #8daec8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .65px;
}

.nav-item {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr);
    align-items: center;
    width: 100%;
    min-height: 34px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #dcebf7;
    cursor: pointer;
    text-align: left;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.nav-item > span:first-child {
    color: #93c9e4;
    font-size: 16px;
    text-align: center;
}

.nav-item:hover {
    border-color: rgba(86, 196, 236, .14);
    background: rgba(30, 100, 138, .18);
    transform: translateX(2px);
}

.nav-item.is-active {
    border-color: rgba(63, 177, 224, .27);
    background: linear-gradient(90deg, rgba(36, 116, 166, .42), rgba(28, 81, 120, .28));
    box-shadow: inset 3px 0 var(--cyan);
    color: #fff;
}

.sidebar-companion {
    position: relative;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 7px 9px;
    align-items: center;
    min-height: 110px;
    margin: 8px 0;
    padding: 8px;
    border: 1px solid rgba(91, 203, 226, .19);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(16, 42, 58, .96), rgba(9, 30, 46, .94));
    overflow: hidden;
}

.sidebar-companion::before {
    position: absolute;
    inset: auto -25px -28px auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    content: "";
    background: rgba(84, 207, 214, .08);
    filter: blur(3px);
}

.sidebar-companion img {
    width: 62px;
    height: 72px;
    object-fit: contain;
    border-radius: 10px;
}

.sidebar-companion strong {
    color: var(--gold-soft);
    font-size: 12px;
}

.sidebar-companion p {
    display: -webkit-box;
    margin: 3px 0 0;
    overflow: hidden;
    color: #c8d7e2;
    font-size: 10px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.ghost-button {
    grid-column: 1 / -1;
    min-height: 31px;
    border: 1px solid rgba(76, 212, 199, .22);
    border-radius: 8px;
    background: rgba(25, 126, 117, .38);
    color: #c9fff7;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.return-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 39px;
    border: 1px solid rgba(139, 174, 199, .2);
    border-radius: 9px;
    background: rgba(8, 29, 46, .9);
    color: #bfd5e5;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.return-link:hover {
    border-color: var(--cyan);
    color: #fff;
}

.app-column {
    display: grid;
    grid-template-rows: var(--topbar) minmax(0, 1fr) var(--footer);
    min-width: 0;
    min-height: 100dvh;
}

.topbar {
    position: sticky;
    z-index: 25;
    top: 0;
    display: flex;
    align-items: stretch;
    min-width: 0;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(68, 164, 204, .27);
    background: rgba(3, 12, 22, .95);
    box-shadow: 0 10px 36px rgba(0, 0, 0, .24);
    backdrop-filter: blur(16px);
}

.mobile-brand,
.mobile-return {
    display: none;
}

.topbar-identity {
    display: flex;
    flex: 1 1 540px;
    min-width: 0;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(11, 31, 48, .96), rgba(7, 23, 37, .96));
    overflow: hidden;
}

.metric-with-help {
    position: relative;
}

.metric-help {
    position: absolute;
    z-index: 60;
    top: calc(100% + 9px);
    left: 50%;
    width: 220px;
    padding: 9px 11px;
    border: 1px solid rgba(103, 203, 235, .34);
    border-radius: 9px;
    background: rgba(5, 19, 32, .98);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .48);
    color: #e3f2fb;
    font-size: 10px;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -5px);
    transition: opacity .16s ease, transform .16s ease;
}

.metric-with-help:hover .metric-help,
.metric-with-help:focus-visible .metric-help {
    opacity: 1;
    transform: translate(-50%, 0);
}

.economy-counter {
    display: grid;
    grid-template-columns: 34px auto;
    grid-template-rows: 1fr 1fr;
    align-items: center;
    min-width: 138px;
    padding: 9px 14px;
    border-right: 1px solid var(--line-soft);
}

.economy-counter > span {
    grid-row: 1 / 3;
    margin-right: 9px;
}

.economy-counter strong {
    align-self: end;
    color: #fff;
    font-size: 17px;
    line-height: 1;
}

.economy-counter small {
    align-self: start;
    margin-top: 3px;
    color: #b6c8d6;
    font-size: 10px;
}

.potato-mark {
    position: relative;
    width: 29px;
    height: 37px;
    border: 2px solid #f1b048;
    border-radius: 48% 42% 46% 52%;
    background: linear-gradient(145deg, #e9a542, #9d5a25);
    box-shadow: inset 5px 2px 8px rgba(255,255,255,.18), 0 0 13px rgba(244, 182, 62, .18);
    transform: rotate(10deg);
}

.potato-mark::before,
.potato-mark::after {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    content: "";
    background: #7f421d;
    box-shadow: 11px 8px #7f421d;
}

.potato-mark::before { top: 8px; left: 8px; }
.potato-mark::after { bottom: 8px; left: 6px; }

.merit-mark {
    display: grid;
    width: 30px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff5b4, #e2a31d 54%, #8f5010);
    box-shadow: 0 0 15px rgba(255, 194, 44, .3);
    color: #fff8cf;
}

.momentum {
    display: grid;
    grid-template-columns: 32px minmax(90px, 1fr) 42px;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 190px;
    padding: 8px 13px;
}

.momentum-bolt {
    color: var(--green);
    font-size: 34px;
    font-weight: 900;
    filter: drop-shadow(0 0 8px rgba(73, 211, 112, .35));
}

.momentum small {
    display: block;
    margin-bottom: 5px;
    color: #dbe9f2;
    font-size: 10px;
}

.momentum > strong {
    font-size: 12px;
}

.progress-track {
    width: 100%;
    height: 9px;
    border-radius: 999px;
    background: #132a3c;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.55);
    overflow: hidden;
}

.progress-track > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2ea96a, #70d87f);
    box-shadow: 0 0 12px rgba(95, 218, 123, .38);
    transition: width .45s ease;
}

.p-0 { width: 0% !important; }
.p-5 { width: 5% !important; }
.p-10 { width: 10% !important; }
.p-15 { width: 15% !important; }
.p-20 { width: 20% !important; }
.p-25 { width: 25% !important; }
.p-30 { width: 30% !important; }
.p-35 { width: 35% !important; }
.p-40 { width: 40% !important; }
.p-45 { width: 45% !important; }
.p-50 { width: 50% !important; }
.p-55 { width: 55% !important; }
.p-60 { width: 60% !important; }
.p-65 { width: 65% !important; }
.p-70 { width: 70% !important; }
.p-75 { width: 75% !important; }
.p-80 { width: 80% !important; }
.p-85 { width: 85% !important; }
.p-90 { width: 90% !important; }
.p-95 { width: 95% !important; }
.p-100 { width: 100% !important; }

.topbar-companion {
    display: grid;
    grid-template-columns: 48px minmax(110px, 1fr);
    align-items: center;
    gap: 7px;
    flex: 0 1 245px;
    min-width: 178px;
    margin-left: 10px;
    padding: 5px 9px;
    border: 1px solid rgba(176, 106, 255, .24);
    border-radius: 14px;
    background: linear-gradient(155deg, rgba(33, 20, 57, .9), rgba(13, 25, 42, .96));
    cursor: pointer;
}

.topbar-quest {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    flex: 1 1 340px;
    min-width: 220px;
    margin-left: 10px;
    padding: 7px 12px;
    border: 1px solid rgba(75, 150, 188, .24);
    border-radius: 14px;
    background:
        radial-gradient(circle at 12% 25%, rgba(78, 177, 196, .12), transparent 34%),
        linear-gradient(155deg, rgba(10, 31, 48, .96), rgba(9, 22, 37, .96));
    cursor: pointer;
}

.quest-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(244, 190, 82, .34);
    border-radius: 50%;
    background: rgba(98, 66, 22, .28);
    color: #ffd36a;
    font-size: 18px;
    box-shadow: 0 0 15px rgba(232, 174, 62, .13);
}

.topbar-quest div {
    min-width: 0;
}

.topbar-quest small,
.topbar-quest strong,
.topbar-quest div > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-quest small {
    color: #8fd8ec;
    font-size: 9px;
    text-transform: uppercase;
}

.topbar-quest strong {
    margin-top: 2px;
    color: #f3f8fb;
    font-size: 11px;
}

.topbar-quest div > span {
    margin-top: 2px;
    color: #9eb5c5;
    font-size: 8px;
}

.affinity-avatar {
    position: relative;
    display: block;
    width: 46px;
    height: 55px;
    overflow: hidden;
    border: 2px solid rgba(142, 221, 164, .45);
    border-radius: 50%;
    background: #0a1826;
    box-shadow: 0 0 14px rgba(87, 210, 123, .18);
}

.affinity-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 23%;
    transform: scale(1.55);
    transform-origin: 50% 25%;
}

.affinity-avatar img[data-companion="merlin"] { object-position: 50% 23%; transform: scale(1.42); transform-origin: 50% 24%; }
.affinity-avatar img[data-companion="nain"] { object-position: 50% 7%; transform: scale(2.08); transform-origin: 50% 10%; }
.affinity-avatar img[data-companion="gobelin"] { object-position: 50% 27%; transform: scale(1.42); transform-origin: 50% 27%; }
.affinity-avatar img[data-companion="chat"] { object-position: 50% 24%; transform: scale(1.48); transform-origin: 50% 24%; }
.affinity-avatar img[data-companion="elfe"] { object-position: 50% 6%; transform: scale(2.12); transform-origin: 50% 9%; }

.affinity-avatar img[data-companion="nain"],
.affinity-avatar img[data-companion="elfe"] {
    animation: none;
}

.topbar-companion small,
.topbar-companion strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-companion small {
    color: #d7e6f0;
    font-size: 10px;
}

.topbar-companion strong {
    margin-top: 3px;
    color: #c7a8ff;
    font-size: 10px;
}

.heart {
    color: #dc59ff;
    font-size: 21px;
    text-shadow: 0 0 11px rgba(215, 72, 255, .55);
}

.topbar-companion > .affinity-avatar { grid-column: 1; grid-row: 1; }
.topbar-companion > .heart {
    z-index: 2;
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    justify-self: end;
}
.topbar-companion > div { grid-column: 2; min-width: 0; }

.topbar-hero {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    flex: 0 1 190px;
    min-width: 142px;
    margin-left: 8px;
    padding: 5px 9px;
    border: 1px solid rgba(226, 181, 82, .28);
    border-radius: 14px;
    background: linear-gradient(155deg, rgba(45, 31, 15, .92), rgba(13, 25, 42, .96));
    color: #f4f8fb;
    cursor: pointer;
    text-align: left;
}

.topbar-hero:hover,
.topbar-hero:focus-visible {
    border-color: rgba(255, 211, 106, .72);
    box-shadow: 0 0 20px rgba(225, 171, 61, .16);
}

.topbar-hero-avatar {
    width: 42px;
    height: 42px;
}

.topbar-hero > span:last-child {
    min-width: 0;
}

.topbar-hero small,
.topbar-hero strong {
    display: -webkit-box;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-hero small {
    color: #e6cf9d;
    font-size: 9px;
}

.topbar-hero strong {
    margin-top: 2px;
    color: #ffe19a;
    font-size: 10px;
    line-height: 1.08;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mini-timer {
    align-items: center;
    align-self: center;
    gap: 6px;
    min-width: 92px;
    min-height: 48px;
    margin-left: 10px;
    padding: 6px 10px;
    border: 1px solid rgba(245, 179, 55, .28);
    border-radius: 12px;
    background: #112136;
    cursor: pointer;
}

.mini-timer:not([hidden]) {
    display: grid;
    grid-template-columns: 8px auto;
}

.mini-timer strong {
    font-size: 16px;
    line-height: 1;
}

.mini-timer small {
    grid-column: 2;
    color: var(--muted);
    font-size: 9px;
}

.timer-dot {
    grid-row: 1 / 3;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
}

.topbar-actions {
    display: flex;
    align-items: stretch;
    flex: 0 0 auto;
    gap: 3px;
    margin-left: 9px;
}

.top-action,
.sync-state {
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #bdcfdd;
    cursor: pointer;
}

.top-action {
    display: grid;
    min-width: 56px;
    padding: 7px 5px 5px;
    place-items: center;
}

.top-action > span {
    color: #9eb7d1;
    font-size: 20px;
    line-height: 1;
}

.top-action small {
    margin-top: 6px;
    font-size: 9px;
}

.top-action:hover,
.sync-state:hover {
    border-color: rgba(90, 193, 229, .25);
    background: rgba(28, 75, 106, .25);
    color: #fff;
}

.admin-action > span {
    color: var(--gold);
}

.sync-state {
    display: grid;
    grid-template-columns: 10px minmax(90px, auto);
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    text-align: left;
}

.sync-state > span:first-child {
    color: var(--gold);
    text-shadow: 0 0 8px currentColor;
}

.sync-dot.sync-local { color: var(--gold); }
.sync-dot.sync-detected,
.sync-dot.sync-syncing { color: #62d6f6; }
.sync-dot.sync-synced { color: #55c978; }
.sync-dot.sync-offline { color: #f4b63e; }
.sync-dot.sync-conflict { color: #b06aff; }
.sync-dot.sync-error { color: #eb6673; }

.sync-state strong,
.sync-state small {
    display: block;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-state strong { color: #dbe9f2; font-size: 9px; }
.sync-state small { color: var(--muted); font-size: 8px; }

.main-viewport {
    min-width: 0;
    padding: 12px;
    overflow: auto;
    scrollbar-color: #236481 #07131f;
    scrollbar-width: thin;
}

.bottom-mantra {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 5px 18px;
    border-top: 1px solid rgba(102, 76, 204, .35);
    background: linear-gradient(90deg, #15143d, #24184f 55%, #20133f);
    color: #e4ddf7;
    font-size: 10px;
}

.bottom-mantra p {
    margin: 0;
}

.bottom-mantra p:last-child {
    text-align: right;
}

.bottom-mantra strong {
    color: #ffd057;
}

.tiny-potato {
    width: 26px;
    height: 20px;
    border-radius: 50% 46% 54% 45%;
    background: linear-gradient(140deg, #f2b64c, #a86227);
    box-shadow: 0 0 8px rgba(247, 185, 74, .3);
    transform: rotate(-12deg);
}

.loading-state {
    display: grid;
    min-height: calc(100dvh - var(--topbar) - var(--footer) - 24px);
    place-content: center;
    place-items: center;
    color: var(--muted);
    text-align: center;
}

.loading-state h1 {
    margin: 18px 0 4px;
    color: var(--text);
    font-size: 22px;
}

.loading-state p {
    margin: 0;
}

.loading-potato {
    width: 64px;
    height: 78px;
    border: 4px solid #f3bc57;
    border-radius: 48% 42% 46% 54%;
    background: linear-gradient(145deg, #e8a442, #8e4f22);
    box-shadow: inset 10px 5px 15px rgba(255,255,255,.16), 0 0 40px rgba(244, 182, 62, .25);
    animation: potato-breathe 1.8s ease-in-out infinite;
}

.page-root {
    min-height: 100%;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 2px 0 12px;
    padding: 12px 16px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(11, 31, 48, .93), rgba(7, 23, 37, .9));
}

.page-header h1 {
    margin: 2px 0 0;
    font-size: clamp(24px, 2vw, 34px);
    letter-spacing: -.7px;
}

.page-header p {
    max-width: 760px;
    margin: 5px 0 0;
    color: var(--muted);
}

.eyebrow,
.card-title {
    color: #8ecbf0;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .45px;
    text-transform: uppercase;
}

.page-actions,
.toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid rgba(112, 180, 217, .25);
    border-radius: 9px;
    background: #112b40;
    color: #eaf6ff;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
}

.button:hover {
    filter: brightness(1.14);
}

.button.primary {
    border-color: #d79529;
    background: linear-gradient(180deg, #efad32, #c77921);
    color: #fffaf0;
    box-shadow: inset 0 1px rgba(255,255,255,.2), 0 8px 24px rgba(212, 124, 31, .2);
}

.button.success {
    border-color: #4cb86c;
    background: linear-gradient(180deg, #44ae63, #287644);
}

.button.danger {
    border-color: #c6525e;
    background: linear-gradient(180deg, #b84d59, #7d303a);
}

.button.secondary {
    background: linear-gradient(180deg, #183b55, #102a40);
}

.button.ghost {
    background: transparent;
}

.button.small {
    min-height: 31px;
    padding: 5px 10px;
    font-size: 11px;
}

.icon-button,
.close-button {
    display: grid;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    background: #0e2639;
    cursor: pointer;
    place-items: center;
}

.card {
    position: relative;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(150deg, rgba(12, 36, 53, .97), rgba(6, 23, 37, .97)),
        var(--panel);
    box-shadow: var(--glow);
    overflow: hidden;
}

.card::before {
    position: absolute;
    inset: 0 auto auto 0;
    width: 65%;
    height: 1px;
    content: "";
    background: linear-gradient(90deg, var(--cyan), transparent);
    opacity: .48;
}

.card.violet {
    border-color: rgba(175, 89, 242, .49);
}

.card.violet::before {
    background: linear-gradient(90deg, var(--violet), transparent);
}

.card.gold {
    border-color: rgba(236, 171, 57, .42);
}

.card.gold::before {
    background: linear-gradient(90deg, var(--gold), transparent);
}

.card.green {
    border-color: rgba(65, 190, 115, .42);
}

.card.green::before {
    background: linear-gradient(90deg, var(--green), transparent);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 10px 13px 8px;
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 13px;
}

.card-header h2 {
    color: #9ed3f5;
    letter-spacing: .25px;
    text-transform: uppercase;
}

.card-body {
    padding: 10px 13px 13px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    grid-auto-rows: minmax(150px, auto);
    gap: 12px;
}

.dashboard-timer {
    grid-column: span 5;
    grid-row: span 2;
    min-height: 340px;
}

.dashboard-today {
    grid-column: span 3;
    grid-row: span 2;
}

.dashboard-distractions {
    grid-column: span 4;
    grid-row: span 2;
}

.dashboard-summary {
    grid-column: span 4;
    grid-row: span 2;
}

.dashboard-boss {
    grid-column: span 5;
    grid-row: span 2;
}

.dashboard-pause {
    grid-column: span 3;
    grid-row: span 2;
}

.dashboard-titles {
    grid-column: span 4;
    grid-row: span 2;
}

.dashboard-shop {
    grid-column: span 4;
    grid-row: span 2;
}

.dashboard-advice {
    grid-column: span 2;
    grid-row: span 2;
}

.dashboard-backup {
    grid-column: span 2;
    grid-row: span 2;
}

.dashboard-bottom {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 4fr 5fr 3fr;
    gap: 12px;
    min-width: 0;
    min-height: 0;
}

.dashboard-bottom > .card {
    grid-column: auto;
    grid-row: auto;
    min-width: 0;
    min-height: 230px;
}

.timer-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 205px;
    min-height: 286px;
}

.timer-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 10px 16px 17px;
    text-align: center;
}

.session-kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #c8d7e4;
    font-size: 11px;
}

.session-kicker strong {
    color: var(--gold);
}

.timer-display {
    margin: 5px 0 0;
    color: #f9fbff;
    font-size: clamp(58px, 5.3vw, 92px);
    font-weight: 850;
    letter-spacing: -3px;
    line-height: 1;
    text-shadow: 0 8px 22px rgba(0,0,0,.45);
}

.timer-task {
    max-width: 430px;
    margin: 9px 0 0;
    overflow: hidden;
    color: #d9ebf7;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-inline-badges {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-right: 5px;
    vertical-align: middle;
}

.task-inline-badges .complexity-icon,
.task-inline-badges .decisive-crown {
    font-size: .9em;
}

.timer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 17px;
}

.timer-actions .button {
    min-width: 105px;
}

.timer-next-break {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.timer-companion {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: end;
    min-width: 0;
    padding: 10px 10px 14px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 35%, rgba(103, 211, 142, .18), transparent 54%);
}

.timer-companion img {
    position: absolute;
    inset: 4px 0 35px;
    width: 100%;
    height: calc(100% - 32px);
    object-fit: contain;
    object-position: bottom;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .45));
}

.companion-bubble {
    position: relative;
    z-index: 2;
    max-width: 175px;
    margin: 0 auto 106px;
    padding: 9px 10px;
    border-radius: 12px 12px 4px 12px;
    background: rgba(244, 239, 222, .96);
    box-shadow: 0 7px 18px rgba(0,0,0,.32);
    color: #18222b;
    font-size: 9px;
}

.companion-nameplate {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 7px 9px;
    border: 1px solid rgba(92, 196, 231, .22);
    border-radius: 8px;
    background: rgba(10, 39, 60, .91);
    color: #e3f3ff;
    font-size: 10px;
}

.companion-switcher {
    position: relative;
    z-index: 4;
    display: grid;
    gap: 3px;
    width: 100%;
    margin-bottom: 7px;
}

.companion-current-name {
    color: #f6ead1;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0, 0, 0, .85);
}

.item-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.task-line,
.distraction-note {
    display: grid;
    align-items: center;
    min-height: 47px;
    border: 1px solid rgba(87, 165, 204, .13);
    border-radius: 9px;
    background: rgba(10, 31, 47, .8);
}

.task-line {
    grid-template-columns: 31px minmax(0, 1fr) auto;
    gap: 5px;
    padding: 6px 8px;
}

.task-line.is-active {
    border-color: #277caf;
    background: rgba(18, 61, 91, .68);
    box-shadow: inset 3px 0 var(--cyan);
}

.task-line strong,
.task-line small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-line strong {
    font-size: 11px;
}

.task-line small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
}

.task-check {
    display: grid;
    width: 25px;
    height: 25px;
    border: 2px solid #4c7187;
    border-radius: 50%;
    background: transparent;
    color: white;
    cursor: pointer;
    place-items: center;
}

.task-line.is-done .task-check {
    border-color: var(--green);
    background: var(--green);
}

.task-line.is-done strong {
    color: #91adbb;
    text-decoration: line-through;
}

.inline-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 37px;
    margin: 9px 12px 12px;
    border: 1px solid rgba(68, 150, 191, .24);
    border-radius: 8px;
    background: rgba(18, 61, 91, .55);
    color: #ccecff;
    cursor: pointer;
    font-size: 10px;
    font-weight: 750;
}

.distraction-note {
    grid-template-columns: 31px minmax(0, 1fr) 26px;
    gap: 5px;
    min-height: 52px;
    padding: 7px;
    border-color: rgba(218, 177, 99, .3);
    background: linear-gradient(100deg, rgba(223, 180, 97, .88), rgba(237, 213, 165, .94));
    color: #2d261b;
    transform: rotate(-.25deg);
}

.distraction-note:nth-child(even) {
    background: linear-gradient(100deg, rgba(190, 168, 176, .9), rgba(229, 220, 215, .94));
    transform: rotate(.3deg);
}

.note-pin {
    width: 22px;
    height: 24px;
    border-radius: 3px;
    background: #9e6b36;
    opacity: .45;
}

.distraction-note strong {
    font-size: 10px;
}

.distraction-note small {
    display: block;
    margin-top: 3px;
    font-size: 8px;
}

.plain-icon-button {
    background: transparent;
    color: currentColor;
    cursor: pointer;
    font-size: 18px;
}

.summary-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46%;
    gap: 10px;
}

.metric-list {
    display: grid;
    gap: 1px;
    border: 1px solid rgba(76, 152, 189, .2);
    border-radius: 9px;
    overflow: hidden;
}

.metric-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 39px;
    padding: 6px 9px;
    background: rgba(8, 27, 42, .7);
    font-size: 10px;
}

.metric-list strong {
    font-size: 11px;
}

.metric-list .earned {
    color: var(--gold);
}

.reward-callout {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    min-height: 165px;
    padding: 70px 10px 11px;
    border: 1px solid rgba(233, 165, 48, .28);
    border-radius: 10px;
    background:
        radial-gradient(circle at 50% 18%, rgba(244, 182, 62, .25), transparent 34%),
        linear-gradient(180deg, rgba(69, 48, 22, .42), rgba(37, 27, 18, .82));
    text-align: center;
}

.reward-callout::before {
    position: absolute;
    top: 18px;
    width: 70px;
    height: 58px;
    border-radius: 45% 52% 46% 50%;
    content: "";
    background: linear-gradient(145deg, #f2b64b, #9b5725);
    box-shadow: 0 0 20px rgba(244, 182, 62, .25);
    transform: rotate(-8deg);
}

.reward-callout h3 {
    margin: 0;
    color: #ffd46a;
    font-size: 17px;
}

.reward-callout p {
    margin: 5px 0;
    color: #f0e8d8;
    font-size: 10px;
}

.reward-pill {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(151, 93, 21, .62);
    color: #ffe29c;
    font-size: 10px;
    font-weight: 800;
}

.boss-feature {
    display: grid;
    grid-template-columns: minmax(0, 58%) minmax(160px, 42%);
    min-height: 220px;
    margin: 0 10px 10px;
    border: 1px solid rgba(163, 87, 230, .25);
    border-radius: 10px;
    overflow: hidden;
}

.boss-visual {
    position: relative;
    min-height: 215px;
    background: #0a1022;
}

.boss-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.boss-visual::after {
    position: absolute;
    inset: auto 0 0;
    height: 52%;
    content: "";
    background: linear-gradient(transparent, rgba(6, 10, 27, .95));
}

.boss-caption {
    position: absolute;
    z-index: 2;
    inset: auto 12px 10px;
}

.boss-caption h3 {
    margin: 0 0 5px;
    font-size: 14px;
}

.boss-caption p {
    margin: 0;
    color: #c7b7df;
    font-size: 9px;
}

.boss-steps {
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 9px;
    background: #071525;
}

.boss-step {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 29px;
    padding: 5px 7px;
    border-radius: 6px;
    background: rgba(21, 49, 68, .58);
    color: #a7b9c8;
    font-size: 9px;
}

.boss-step.done {
    color: #85cda1;
}

.boss-step.active {
    background: rgba(83, 47, 127, .82);
    color: #e3c8ff;
}

.boss-step button {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #25445c;
    color: #d8edfb;
    cursor: pointer;
}

.boss-progress,
.standard-progress {
    width: 100%;
    height: 13px;
    border: 0;
    border-radius: 99px;
    background: #181b36;
    overflow: hidden;
}

progress::-webkit-progress-bar {
    border-radius: 99px;
    background: #18263b;
}

progress::-webkit-progress-value {
    border-radius: 99px;
    background: linear-gradient(90deg, #8d3ed0, #d759e5);
}

progress::-moz-progress-bar {
    border-radius: 99px;
    background: linear-gradient(90deg, #8d3ed0, #d759e5);
}

.pause-card-content {
    display: flex;
    flex-direction: column;
    min-height: 237px;
    padding: 12px 13px 13px;
    background:
        radial-gradient(circle at 84% 38%, rgba(88, 204, 160, .17), transparent 29%),
        linear-gradient(160deg, rgba(9, 49, 54, .64), rgba(8, 29, 42, .74));
}

.pause-card-content h3 {
    margin: 2px 0 7px;
    font-size: 16px;
}

.pause-card-content > p {
    flex: 1;
    margin: 0;
    color: #d2eae6;
    font-size: 11px;
}

.pause-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.pause-tags span,
.tag {
    padding: 5px 9px;
    border: 1px solid rgba(104, 207, 187, .19);
    border-radius: 99px;
    background: rgba(11, 61, 64, .52);
    color: #bdece3;
    font-size: 9px;
    line-height: 1.1;
}

.medal-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    padding: 5px 10px 12px;
}

.mini-medal {
    min-width: 0;
    text-align: center;
}

.mini-medal img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 6px 8px rgba(0,0,0,.35));
}

.mini-medal strong {
    display: -webkit-box;
    min-height: 28px;
    overflow: hidden;
    color: #efd28a;
    font-size: 8px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.shop-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 5px 9px 12px;
}

.shop-mini {
    min-width: 0;
    padding: 7px 5px;
    border: 1px solid rgba(221, 171, 72, .25);
    border-radius: 8px;
    background: rgba(13, 29, 42, .78);
    text-align: center;
}

.shop-mini img {
    width: 58px;
    height: 58px;
    margin: auto;
    object-fit: contain;
}

.shop-mini strong {
    display: -webkit-box;
    min-height: 28px;
    overflow: hidden;
    font-size: 8px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.shop-mini span {
    color: var(--gold);
    font-size: 9px;
    font-weight: 800;
}

.advice-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.advice-card img {
    width: 100%;
    height: 136px;
    object-fit: contain;
    object-position: bottom;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,.42));
}

.advice-card blockquote {
    flex: 1;
    margin: 0;
    padding: 4px 12px 12px;
    color: #d8e7f2;
    font-size: 10px;
}

.backup-actions {
    display: grid;
    gap: 7px;
    padding: 8px 10px 12px;
}

.backup-actions p {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 9px;
}

.backup-actions .button {
    min-height: 33px;
    padding: 6px 8px;
    font-size: 9px;
}

.dashboard-empty {
    display: grid;
    min-height: 130px;
    padding: 20px;
    place-items: center;
    color: var(--muted);
    text-align: center;
}

.focus-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, 360px);
    gap: 14px;
}

.focus-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - var(--topbar) - var(--footer) - 145px);
    padding: 24px;
    text-align: center;
}

.focus-clock {
    margin: 12px 0;
    font-size: clamp(86px, 12vw, 170px);
    font-weight: 850;
    letter-spacing: -6px;
    line-height: .95;
    text-shadow: 0 15px 35px rgba(0,0,0,.42);
}

.focus-task {
    max-width: 780px;
    margin: 0;
    font-size: clamp(18px, 2vw, 28px);
}

.focus-next {
    max-width: 660px;
    margin: 9px 0 0;
    color: var(--muted);
}

.focus-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-top: 22px;
}

.focus-side {
    display: grid;
    align-content: start;
    gap: 12px;
}

.quiet-companion {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: center;
    min-height: 160px;
    padding: 12px;
}

.quiet-companion img {
    width: 105px;
    height: 135px;
    object-fit: contain;
}

.quiet-companion blockquote {
    margin: 0;
    color: #d8ebf7;
    font-size: 12px;
}

.quick-park {
    padding: 13px;
}

.quick-park form {
    display: flex;
    gap: 7px;
    margin-top: 10px;
}

.quick-park input {
    flex: 1;
    min-width: 0;
}

.form-control,
input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(100, 169, 204, .35);
    border-radius: 8px;
    background: #081a29;
    color: #eef7ff;
}

input,
select {
    min-height: 39px;
    padding: 8px 10px;
}

textarea {
    padding: 9px 10px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #668398;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 220px)) auto;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(8, 27, 43, .86);
}

.list-layout {
    display: grid;
    gap: 9px;
}

.data-card {
    display: grid;
    grid-template-columns: 8px minmax(0, 1.5fr) minmax(150px, .7fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    padding: 10px 12px 10px 0;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(11, 35, 52, .95), rgba(7, 24, 38, .95));
}

.data-card > i {
    align-self: stretch;
    border-radius: 11px 0 0 11px;
    background: var(--cyan);
}

.data-card.priority-high > i { background: var(--red); }
.data-card.priority-medium > i { background: var(--gold); }
.data-card.priority-low > i { background: var(--green); }

.data-card h3 {
    margin: 0;
    font-size: 14px;
}

.data-card p {
    margin: 4px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-card-meta {
    color: #bad0df;
    font-size: 10px;
}

.data-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: 6px;
}

.status-badge,
.rarity {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 3px 8px;
    border: 1px solid rgba(94, 171, 210, .23);
    border-radius: 99px;
    background: rgba(28, 81, 111, .44);
    color: #bde7ff;
    font-size: 9px;
    font-weight: 750;
}

.status-done { color: #9ee5b4; }
.status-blocked { color: #ff9aa4; }
.status-paused { color: #ffd684; }

.empty-panel {
    display: grid;
    min-height: 230px;
    padding: 35px;
    place-items: center;
    border: 1px dashed rgba(98, 182, 220, .28);
    border-radius: var(--radius);
    background: rgba(8, 27, 42, .55);
    color: var(--muted);
    text-align: center;
}

.project-grid,
.routine-grid,
.companion-grid,
.boss-grid,
.shop-grid,
.theme-grid,
.extension-grid,
.stats-grid,
.settings-grid,
.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.project-card,
.routine-card,
.note-card,
.link-card {
    padding: 15px;
}

.routine-card[role="button"],
.quest-task[role="button"],
.data-card[role="button"],
.task-line[role="button"],
.distraction-note[role="button"],
.dashboard-card-link {
    cursor: pointer;
}

.routine-card[role="button"]:focus-visible,
.quest-task[role="button"]:focus-visible,
.data-card[role="button"]:focus-visible,
.task-line[role="button"]:focus-visible,
.distraction-note[role="button"]:focus-visible,
.dashboard-card-link:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.routine-days {
    margin: 0;
    padding: 0;
    border: 0;
}

.routine-days legend {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.routine-days > div {
    display: grid;
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    gap: 7px;
}

.routine-days label {
    cursor: pointer;
}

.routine-days input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.routine-days span {
    display: grid;
    min-height: 42px;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: rgba(10, 31, 47, .82);
    color: var(--muted);
    font-weight: 800;
}

.routine-days input:checked + span {
    border-color: rgba(244, 182, 62, .7);
    background: linear-gradient(180deg, rgba(212, 150, 43, .34), rgba(107, 71, 24, .42));
    color: #ffe7a1;
    box-shadow: inset 0 0 0 1px rgba(255, 221, 126, .1);
}

.routine-reward-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(244, 182, 62, .32);
    border-radius: 12px;
    background: radial-gradient(circle at 8% 50%, rgba(244, 182, 62, .18), transparent 24%), rgba(12, 32, 47, .9);
}

.routine-reward-preview > span {
    font-size: 32px;
}

.routine-reward-preview small,
.routine-reward-preview strong,
.routine-reward-preview p {
    display: block;
}

.routine-reward-preview strong {
    margin-top: 2px;
    color: var(--gold);
    font-size: 17px;
}

.routine-reward-preview p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.project-card h3,
.routine-card h3,
.note-card h3,
.link-card h3 {
    margin: 3px 0 6px;
}

.project-card p,
.routine-card p,
.note-card p,
.link-card p {
    color: var(--muted);
    font-size: 11px;
}

.project-color {
    width: 42px;
    height: 5px;
    border-radius: 99px;
    background: var(--cyan);
}

.task-quest-groups {
    display: grid;
    gap: 14px;
}

.task-project-group {
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 85% 0%, rgba(114, 80, 177, .12), transparent 35%),
        rgba(6, 22, 35, .72);
}

.task-project-group > header,
.quest-steps > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.task-project-group h2,
.quest-steps h3 {
    margin: 2px 0 0;
    font-size: 18px;
}

.quest-task-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.quest-task-main {
    min-width: 0;
}

.task-symbols {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: none;
}

.complexity-icon,
.decisive-crown {
    display: inline-grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    font-size: 14px;
}

.complexity-difficult {
    background: rgba(160, 46, 55, .25);
    color: #ff8d91;
    filter: saturate(1.15);
}

.complexity-epic {
    border: 1px solid rgba(211, 83, 235, .55);
    background: radial-gradient(circle, rgba(192, 61, 220, .45), rgba(74, 26, 107, .28));
    color: #f4a6ff;
    box-shadow: 0 0 14px rgba(190, 66, 223, .3);
    transform: scale(1.08);
}

.decisive-crown {
    border: 1px solid rgba(235, 187, 78, .56);
    background: rgba(112, 72, 10, .42);
    color: #ffd96c;
    box-shadow: 0 0 12px rgba(235, 187, 78, .24);
}

.task-time-meter,
.quest-time-meter {
    position: relative;
    overflow: hidden;
    height: 6px;
    margin-top: 8px;
    border-radius: 99px;
    background: rgba(70, 105, 128, .25);
}

.task-time-meter > span,
.quest-time-meter > span {
    display: block;
    width: var(--time-progress);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #54c5d9, #71d39a);
}

.task-time-meter.time-near > span,
.quest-time-meter.time-near > span {
    background: linear-gradient(90deg, #eab147, #ffcc68);
}

.task-time-meter.time-over > span,
.quest-time-meter.time-over > span {
    background: linear-gradient(90deg, #d24d61, #ff7682);
}

.task-time-summary {
    display: grid;
    grid-template-columns: auto minmax(120px, 260px) auto;
    align-items: center;
    gap: 10px;
    width: min(100%, 610px);
    margin: 13px auto 2px;
    padding: 9px 11px;
    border: 1px solid rgba(98, 182, 220, .26);
    border-radius: 11px;
    background: rgba(7, 27, 42, .82);
    color: #c8e1ee;
    text-align: left;
}

.task-time-summary > span:first-child small,
.task-time-summary > span:first-child strong {
    display: block;
}

.task-time-summary > span:first-child small {
    color: #89a8ba;
    font-size: 8px;
    text-transform: uppercase;
}

.task-time-summary > span:first-child strong {
    margin-top: 2px;
    color: #f3f8fa;
    font-size: 12px;
}

.task-time-summary > span:first-child b {
    color: #74d9b0;
}

.task-time-summary.time-near > span:first-child b { color: #ffd16f; }
.task-time-summary.time-over > span:first-child b { color: #ff8490; }

.task-time-summary-bar {
    overflow: hidden;
    height: 8px;
    border-radius: 99px;
    background: rgba(70, 105, 128, .27);
}

.task-time-summary-bar i {
    display: block;
    width: var(--time-progress);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #55c7db, #72d29d);
}

.task-time-summary.time-near .task-time-summary-bar i {
    background: linear-gradient(90deg, #e6a83f, #ffd370);
}

.task-time-summary.time-over .task-time-summary-bar i {
    background: linear-gradient(90deg, #d44d62, #ff7d89);
}

.task-time-summary em {
    color: #8faabb;
    font-size: 8px;
    font-style: normal;
    white-space: nowrap;
}

.task-time-summary.is-empty {
    display: block;
    color: #89a8ba;
    font-size: 10px;
    text-align: center;
}

.dashboard-timer .task-time-summary.is-compact {
    grid-template-columns: minmax(0, 1fr) 58px;
    align-self: flex-start;
    width: 240px;
    margin: 4px 0 0 -84px;
    padding: 4px 8px;
}

.dashboard-timer .task-time-summary.is-compact > span:first-child strong {
    font-size: 10px;
}

.dashboard-timer .task-time-summary.is-compact > span:first-child small {
    font-size: 7px;
}

.dashboard-timer .task-time-summary.is-compact em {
    display: none;
}

.quest-task.time-near {
    border-color: rgba(234, 177, 71, .42);
}

.quest-task.time-over {
    border-color: rgba(223, 76, 94, .52);
}

.data-card-meta small {
    display: block;
    margin-top: 4px;
    color: #7897aa;
}

.quest-journal {
    display: grid;
    grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
    gap: 12px;
}

.quest-project-rail,
.quest-stage,
.quest-details {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.quest-project-rail {
    display: flex;
    grid-row: 1 / span 2;
    flex-direction: column;
    gap: 7px;
    min-height: 620px;
    padding: 12px;
    background:
        linear-gradient(180deg, rgba(15, 41, 58, .98), rgba(6, 22, 35, .98)),
        repeating-linear-gradient(0deg, transparent, transparent 18px, rgba(255,255,255,.015) 19px);
}

.quest-rail-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 5px 11px;
    border-bottom: 1px solid rgba(124, 180, 210, .16);
}

.quest-rail-heading > span {
    font-size: 26px;
}

.quest-rail-heading strong,
.quest-rail-heading small,
.quest-project-choice strong,
.quest-project-choice small {
    display: block;
}

.quest-rail-heading small,
.quest-project-choice small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
}

.quest-project-choice {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: rgba(10, 31, 47, .75);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.quest-project-choice:hover,
.quest-project-choice.is-active {
    border-color: color-mix(in srgb, var(--quest-accent) 65%, transparent);
    background: linear-gradient(120deg, color-mix(in srgb, var(--quest-accent) 19%, transparent), rgba(17, 47, 67, .9));
    transform: translateX(2px);
}

.quest-choice-sigil {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(235, 193, 92, .35);
    border-radius: 50%;
    background: rgba(59, 44, 21, .36);
}

.quest-new-project {
    margin-top: auto;
}

.quest-stage {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
    min-height: 330px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(7, 24, 38, .98) 0%, rgba(8, 25, 43, .92) 47%, rgba(10, 13, 31, .78) 100%),
        radial-gradient(circle at 72% 34%, color-mix(in srgb, var(--quest-accent) 23%, transparent), transparent 40%);
}

.quest-stage-backdrop {
    position: absolute;
    inset: 0;
    opacity: .28;
    background-image:
        linear-gradient(30deg, transparent 48%, rgba(255,255,255,.035) 49%, transparent 51%),
        linear-gradient(-30deg, transparent 48%, rgba(255,255,255,.025) 49%, transparent 51%);
    background-size: 42px 42px;
}

.quest-boss-art {
    position: absolute;
    z-index: 1;
    right: 190px;
    bottom: -8px;
    width: min(39%, 390px);
    height: 96%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,.5));
    opacity: .94;
    pointer-events: none;
}

.quest-map-art {
    position: absolute;
    right: 255px;
    bottom: -35px;
    color: color-mix(in srgb, var(--quest-accent) 30%, transparent);
    font: 280px/1 Georgia, serif;
    transform: rotate(-12deg);
}

.quest-stage-copy,
.quest-boss-panel {
    position: relative;
    z-index: 2;
}

.quest-stage-copy {
    align-self: center;
    max-width: 620px;
    padding: 24px;
}

.quest-stage-copy h2 {
    max-width: 560px;
    margin: 4px 0 8px;
    font: 800 clamp(27px, 3vw, 42px)/1.05 var(--display);
}

.quest-objective {
    max-width: 560px;
    margin: 0 0 14px;
    color: #d3e5ef;
    font-size: 13px;
    line-height: 1.5;
}

.quest-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    color: #a9c4d4;
    font-size: 10px;
}

.quest-meta-row > span,
.complexity-label {
    padding: 5px 8px;
    border: 1px solid rgba(104, 166, 198, .22);
    border-radius: 99px;
    background: rgba(8, 29, 44, .72);
}

.complexity-label.complexity-difficult { color: #ff9b9f; }
.complexity-label.complexity-epic { color: #efa2ff; }

.quest-time-meter {
    width: min(100%, 560px);
    height: 23px;
    margin: 12px 0;
}

.quest-time-meter strong {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #f2f8fb;
    font-size: 9px;
    text-shadow: 0 1px 2px #000;
}

.quest-stage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quest-boss-panel {
    align-self: stretch;
    padding: 18px;
    border-left: 1px solid rgba(156, 104, 202, .24);
    background: linear-gradient(180deg, rgba(21, 22, 49, .62), rgba(5, 20, 34, .93));
    backdrop-filter: blur(3px);
}

.quest-boss-panel h3 {
    margin: 8px 0 6px;
    color: #e9c2ff;
    font-size: 20px;
}

.quest-boss-panel p {
    color: #afc2d0;
    font-size: 10px;
    line-height: 1.45;
}

.quest-boss-placeholder {
    display: grid;
    height: 105px;
    place-items: center;
    font-size: 56px;
    filter: grayscale(.7);
    opacity: .55;
}

.boss-mini-progress {
    display: grid;
    gap: 5px;
    margin: 14px 0;
    color: #c4d5e0;
    font-size: 9px;
}

.boss-mini-progress progress {
    width: 100%;
}

.quest-details {
    display: grid;
    gap: 12px;
    padding: 12px;
    background: rgba(6, 22, 35, .78);
}

.quest-detail-columns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.quest-checklist {
    min-height: 116px;
    padding: 10px;
    border: 1px solid rgba(104, 166, 198, .16);
    border-radius: 10px;
    background: rgba(12, 37, 54, .55);
}

.quest-checklist h3 {
    margin: 0 0 7px;
    color: #cbe7f6;
    font-size: 11px;
}

.quest-object-list > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.quest-object-list > header h3 {
    margin: 0;
}

.quest-object-add {
    display: grid;
    width: 25px;
    height: 25px;
    padding: 0;
    border: 1px solid rgba(104, 202, 226, .32);
    border-radius: 8px;
    background: rgba(28, 73, 96, .72);
    color: #d7f5ff;
    font: inherit;
    place-items: center;
    cursor: pointer;
}

.quest-object-add:hover {
    border-color: var(--quest-accent, #62d6f6);
    background: rgba(42, 104, 132, .82);
}

.quest-object-cards {
    display: grid;
    gap: 5px;
}

.quest-object-card {
    display: grid;
    grid-template-columns: 23px minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 5px;
    border: 1px solid rgba(104, 166, 198, .14);
    border-radius: 8px;
    background: rgba(6, 24, 38, .58);
}

.quest-object-card.is-complete {
    border-color: rgba(91, 193, 135, .24);
    background: rgba(20, 63, 54, .44);
}

.quest-object-check,
.quest-object-copy {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.quest-object-check {
    display: grid;
    width: 23px;
    height: 23px;
    padding: 0;
    border: 1px solid rgba(111, 172, 204, .28);
    border-radius: 50%;
    color: #91bad0;
    place-items: center;
}

.quest-object-card.is-complete .quest-object-check {
    border-color: #4fa678;
    background: #2b7450;
    color: #effff5;
}

.quest-object-copy {
    min-width: 0;
    padding: 0;
    text-align: left;
}

.quest-object-copy strong,
.quest-object-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quest-object-copy strong {
    color: #d9edf6;
    font-size: 9px;
}

.quest-object-copy small {
    margin-top: 2px;
    color: #829eae;
    font-size: 8px;
}

.quest-object-flag {
    color: #e9bd53;
    font-size: 10px;
}

.quest-checklist ul {
    display: grid;
    gap: 5px;
    margin: 0;
    padding-left: 17px;
}

.quest-checklist li,
.quest-checklist p {
    margin: 0;
    color: #93adbd;
    font-size: 9px;
    line-height: 1.4;
}

.quest-step-list {
    display: grid;
    gap: 6px;
}

.quest-step {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 7px;
    border: 1px solid rgba(104, 166, 198, .16);
    border-radius: 9px;
    background: rgba(10, 31, 47, .72);
}

.quest-step.is-done {
    opacity: .66;
}

.quest-step-number {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--quest-accent) 55%, transparent);
    border-radius: 50%;
    color: #d7eff9;
    font-weight: 800;
}

.quest-step strong,
.quest-step small {
    display: block;
}

.quest-step small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
}

.quest-no-steps {
    padding: 16px;
    border: 1px dashed rgba(104, 166, 198, .24);
    border-radius: 10px;
    text-align: center;
}

.quest-empty-icon {
    display: block;
    font-size: 52px;
}

.calendar-shell {
    padding: 13px;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.calendar-weekdays {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    min-height: 112px;
    padding: 7px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: rgba(8, 26, 41, .72);
}

.calendar-day.is-outside {
    opacity: .38;
}

.calendar-day.is-today {
    border-color: var(--gold);
    box-shadow: inset 0 0 0 1px rgba(244,182,62,.18);
}

.calendar-day > strong {
    display: block;
    margin-bottom: 6px;
    color: #d8eaf7;
    font-size: 11px;
}

.calendar-event {
    display: block;
    margin: 3px 0;
    padding: 3px 5px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(39, 123, 164, .5);
    color: #d8f4ff;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button.calendar-event {
    width: 100%;
    border: 0;
    text-align: left;
    cursor: pointer;
}

button.calendar-event:hover,
button.calendar-event:focus-visible {
    background: rgba(67, 156, 199, .72);
    outline: 1px solid rgba(105, 214, 241, .55);
}

.distraction-project-dialog .modal-card {
    width: min(760px, calc(100vw - 32px));
}

.distraction-project-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.distraction-project-choice {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 112px;
    padding: 10px;
    border: 1px solid rgba(91, 176, 213, .27);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(16, 44, 65, .96), rgba(18, 28, 52, .96));
    color: #edf8ff;
    text-align: left;
    cursor: pointer;
}

.distraction-project-choice:hover,
.distraction-project-choice:focus-visible {
    border-color: var(--gold);
    transform: translateY(-1px);
    outline: none;
}

.distraction-project-art {
    display: grid;
    width: 92px;
    height: 88px;
    overflow: hidden;
    place-items: center;
    border-radius: 10px;
    background: #06111f;
    font-size: 38px;
}

.distraction-project-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.distraction-project-choice small,
.distraction-project-choice strong,
.distraction-project-choice em {
    display: block;
}

.distraction-project-choice small {
    color: var(--cyan);
    font-size: 9px;
    text-transform: uppercase;
}

.distraction-project-choice strong {
    margin: 4px 0;
    font-size: 14px;
}

.distraction-project-choice em {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.distraction-project-empty {
    grid-column: 1 / -1;
    display: grid;
    min-height: 210px;
    padding: 22px;
    place-items: center;
    border: 1px dashed var(--line-soft);
    border-radius: 14px;
    text-align: center;
}

.distraction-project-empty > span {
    font-size: 42px;
}

.companion-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.companion-card {
    display: grid;
    grid-template-columns: minmax(110px, 42%) minmax(0, 1fr);
    min-height: 330px;
}

.companion-card.is-active {
    border-color: var(--green);
    box-shadow: 0 0 38px rgba(76, 194, 113, .18);
}

.companion-card img {
    width: 100%;
    height: 100%;
    min-height: 250px;
    object-fit: contain;
    object-position: bottom;
    background: radial-gradient(circle at 50% 45%, rgba(103, 204, 137, .14), transparent 56%);
}

.companion-card-content {
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
}

.companion-card h3 {
    margin: 2px 0;
    font-size: 19px;
}

.companion-card .companion-bio {
    margin: 6px 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}

.companion-relationship {
    margin: 5px 0 2px;
    padding: 9px 10px;
    border: 1px solid rgba(139, 117, 212, .25);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(68, 44, 107, .25), rgba(21, 54, 69, .32));
}

.companion-relationship strong {
    display: block;
    margin-bottom: 3px;
    color: #d9b5ff;
    font-size: 10px;
    letter-spacing: .25px;
}

.companion-relationship p {
    margin: 0;
    color: #c8d9e7;
    font-size: 9.5px;
    line-height: 1.4;
}

.companion-card .button {
    margin-top: auto;
}

.affinity-row {
    margin: 8px 0;
}

.affinity-row small {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: #cbdde9;
}

.companion-inn {
    display: grid;
    grid-template-columns: minmax(300px, 35%) minmax(0, 1fr);
    min-height: 540px;
    overflow: hidden;
    border-color: rgba(205, 159, 79, .35);
    background: radial-gradient(circle at 14% 34%, rgba(224, 157, 67, .15), transparent 32%), linear-gradient(135deg, rgba(31, 25, 25, .94), rgba(7, 27, 43, .97));
}

.companion-inn-art {
    position: relative;
    min-height: 540px;
    overflow: hidden;
    border-right: 1px solid rgba(218, 169, 83, .25);
    background: linear-gradient(180deg, rgba(5, 13, 25, .08), rgba(3, 13, 22, .72)), radial-gradient(circle at 50% 20%, rgba(243, 190, 99, .18), transparent 36%), #061422;
}

.companion-inn-art::after {
    position: absolute;
    right: 7%;
    bottom: 0;
    left: 7%;
    height: 18%;
    content: "";
    border-radius: 50% 50% 0 0;
    background: radial-gradient(ellipse at center, rgba(230, 159, 62, .2), transparent 68%);
    filter: blur(10px);
}

.companion-inn-art img {
    position: absolute;
    z-index: 1;
    inset: 14px 4% 0;
    width: 92%;
    height: calc(100% - 14px);
    object-fit: contain;
    object-position: center bottom;
    animation: companion-float 5.8s ease-in-out infinite;
}

.companion-inn-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    padding: 16px;
}

.companion-inn-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 14px;
}

.companion-inn-tabs button {
    min-height: 42px;
    padding: 8px;
    border: 1px solid rgba(111, 169, 199, .24);
    border-radius: 10px;
    background: rgba(10, 36, 53, .78);
    color: #aac6d5;
    font: 700 11px/1.2 inherit;
    cursor: pointer;
}

.companion-inn-tabs button:hover,
.companion-inn-tabs button.is-active {
    border-color: rgba(229, 179, 87, .62);
    background: linear-gradient(180deg, rgba(129, 78, 34, .68), rgba(62, 40, 29, .72));
    color: #ffe1a3;
}

.companion-welcome-copy,
.companion-grimoire,
.companion-wardrobe,
.companion-moment-stage {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(169, 126, 66, .2);
    border-radius: 14px;
    background: rgba(6, 21, 33, .7);
}

.companion-welcome-copy h2,
.companion-grimoire h2,
.companion-wardrobe h2 {
    margin: 4px 0 10px;
    color: #fff0c8;
    font-size: 25px;
}

.companion-welcome-copy > p,
.companion-wardrobe > p,
.companion-moment-stage > small {
    color: #a9c0cc;
    line-height: 1.6;
}

.companion-welcome-copy .companion-relationship {
    margin: 18px 0;
}

.companion-welcome-copy .affinity-row {
    display: grid;
    gap: 8px;
}

.companion-welcome-copy .affinity-row em {
    color: #8ca8b7;
    font-size: 10px;
    font-style: normal;
}

.companion-inn-main > footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
}

.companion-grimoire > header,
.companion-wardrobe > header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.companion-grimoire > header > span,
.companion-wardrobe > header > span {
    font-size: 34px;
}

.companion-grimoire header small,
.companion-wardrobe header small {
    color: #d8a95e;
    text-transform: uppercase;
}

.companion-chapters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.companion-chapter {
    min-height: 112px;
    padding: 10px;
    border: 1px solid rgba(190, 147, 75, .25);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(67, 45, 29, .5), rgba(11, 30, 42, .76));
}

.companion-chapter > span {
    color: #d8a95e;
    font-size: 9px;
    text-transform: uppercase;
}

.companion-chapter h3 {
    margin: 4px 0 6px;
    color: #f7e6bf;
    font-size: 13px;
}

.companion-chapter p {
    margin: 0;
    color: #acc0c9;
    font-size: 10px;
    line-height: 1.45;
}

.companion-chapter.is-locked {
    filter: grayscale(.65);
    opacity: .62;
}

.companion-moment-stage {
    display: grid;
    align-content: center;
    gap: 18px;
    min-height: 360px;
    background: radial-gradient(circle at 50% 120%, rgba(237, 161, 65, .19), transparent 46%), rgba(6, 21, 33, .72);
}

.companion-scene-copy {
    max-width: 720px;
    margin: 0 auto;
    padding: 18px;
    border: 1px solid rgba(228, 179, 93, .28);
    border-radius: 12px;
    background: rgba(23, 24, 27, .66);
    color: #dce8ed;
}

.companion-scene-copy p {
    margin: 7px 0;
    font-size: 13px;
    line-height: 1.55;
}

.companion-scene-copy strong {
    color: #f3c875;
}

.companion-dialogue-lines {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.companion-dialogue-line {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    max-width: 88%;
}

.companion-dialogue-line.is-reply {
    grid-template-columns: minmax(0, 1fr) 46px;
    justify-self: end;
}

.companion-dialogue-line.is-reply img {
    grid-column: 2;
}

.companion-dialogue-line.is-reply p {
    grid-column: 1;
    grid-row: 1;
    text-align: right;
}

.companion-dialogue-line img {
    width: 46px;
    height: 50px;
    object-fit: contain;
    object-position: center top;
}

.companion-dialogue-line p {
    margin: 0;
    padding: 8px 10px;
    border: 1px solid rgba(220, 177, 91, .2);
    border-radius: 10px;
    background: rgba(8, 29, 43, .86);
}

.companion-dialogue-line p strong,
.companion-dialogue-line p span {
    display: block;
}

.companion-dialogue-line p span {
    margin-top: 2px;
    color: #d4e3e9;
}

.companion-scene-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.companion-choice-prompt {
    max-width: 62ch;
    font-size: 15px !important;
}

.companion-choice-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.companion-choice-options .button {
    min-height: 52px;
    white-space: normal;
    line-height: 1.25;
}

.companion-choice-outcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(228, 179, 93, .18);
}

.companion-choice-outcome strong {
    font-size: 12px;
}

.reset-lab-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-color: rgba(203, 81, 91, .42);
    background: linear-gradient(120deg, rgba(84, 28, 36, .34), rgba(10, 31, 45, .86));
}

.reset-lab-card p {
    max-width: 80ch;
}

.reset-profile-dialog .modal-card {
    max-width: 720px;
}

.reset-profile-warning {
    padding: 16px;
    border: 1px solid rgba(203, 81, 91, .4);
    border-radius: 12px;
    background: rgba(90, 29, 38, .3);
}

.reset-profile-warning strong {
    color: #ffb5bb;
}

.reset-profile-warning p {
    margin: 7px 0 0;
}

.companion-outfits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.companion-outfit {
    overflow: hidden;
    border: 1px solid rgba(120, 166, 190, .22);
    border-radius: 12px;
    background: rgba(7, 25, 39, .76);
}

.companion-outfit.is-selected {
    border-color: #e1b35f;
    box-shadow: inset 0 0 0 1px rgba(225, 179, 95, .24);
}

.companion-outfit img {
    display: block;
    width: 100%;
    height: 210px;
    padding: 4px;
    object-fit: contain;
    object-position: center top;
    background: #061523;
}

.companion-outfit > div {
    padding: 9px;
}

.companion-outfit h3 {
    min-height: 30px;
    margin: 0;
    color: #eff7fa;
    font-size: 11px;
}

.companion-outfit p {
    min-height: 28px;
    margin: 4px 0 8px;
    color: #91aab7;
    font-size: 9px;
}

.companion-guest-list {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(107, 170, 200, .2);
    border-radius: 14px;
    background: rgba(7, 27, 42, .8);
}

.companion-guest-list > header {
    margin-bottom: 9px;
}

.companion-guest-list h2 {
    margin: 2px 0 0;
    color: #dceef7;
    font-size: 18px;
}

.companion-guest-list > div {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.companion-guest {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 5px;
    border: 1px solid rgba(107, 170, 200, .18);
    border-radius: 10px;
    background: rgba(9, 34, 51, .8);
    color: #cce2ec;
    text-align: left;
    cursor: pointer;
}

.companion-guest:hover,
.companion-guest.is-selected {
    border-color: rgba(225, 179, 95, .62);
    background: rgba(67, 49, 35, .78);
}

.companion-guest.is-active {
    box-shadow: inset 3px 0 #69c995;
}

.companion-guest img {
    width: 54px;
    height: 58px;
    object-fit: contain;
    object-position: center top;
}

.companion-guest strong,
.companion-guest small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.companion-guest strong {
    font-size: 11px;
}

.companion-guest small {
    margin-top: 3px;
    color: #8faab8;
    font-size: 8px;
}

@media (max-width: 1180px) {
    .companion-inn {
        grid-template-columns: minmax(230px, 31%) minmax(0, 1fr);
    }

    .companion-inn-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .companion-outfits,
    .companion-guest-list > div {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .companion-inn {
        grid-template-columns: 1fr;
    }

    .companion-inn-art {
        min-height: 360px;
        border-right: 0;
        border-bottom: 1px solid rgba(218, 169, 83, .25);
    }

    .companion-chapters,
    .companion-outfits,
    .companion-choice-options,
    .companion-guest-list > div {
        grid-template-columns: 1fr;
    }

    .companion-choice-outcome {
        align-items: stretch;
        flex-direction: column;
    }

    .reset-lab-card {
        align-items: stretch;
        flex-direction: column;
    }
}

.boss-grid {
    grid-template-columns: repeat(3, minmax(250px, 1fr));
}

.boss-card {
    display: flex;
    flex-direction: column;
}

.boss-card img {
    width: 100%;
    height: clamp(210px, 28vh, 310px);
    padding: 8px;
    object-fit: contain;
    object-position: center;
    background:
        radial-gradient(circle at 50% 42%, rgba(119, 71, 169, .22), transparent 46%),
        #06111f;
}

.boss-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 13px;
}

.boss-card h3 {
    margin: 0;
    font-size: 16px;
}

.boss-card p {
    min-height: 48px;
    color: var(--muted);
    font-size: 10px;
}

.boss-card .button {
    margin-top: 10px;
}

.trophy-hall {
    padding: 14px;
    border: 1px solid rgba(203, 154, 67, .32);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(28, 25, 37, .78), rgba(5, 22, 35, .92)),
        radial-gradient(circle at 50% 0, rgba(235, 183, 86, .16), transparent 44%);
    box-shadow: inset 0 18px 42px rgba(230, 167, 65, .04);
}

.trophy-hall > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
    padding: 12px 16px;
    border: 1px solid rgba(217, 171, 85, .24);
    border-radius: 12px;
    background: rgba(47, 35, 35, .58);
}

.trophy-hall > header h2 {
    margin: 3px 0;
    color: #ffe1a2;
}

.trophy-hall > header p {
    margin: 0;
    color: #a9bec9;
}

.trophy-hall-count {
    display: grid;
    min-width: 92px;
    color: #f1c76d;
    font-size: 28px;
    font-weight: 900;
    text-align: center;
}

.trophy-hall-count small {
    color: #bfae91;
    font-size: 9px;
    text-transform: uppercase;
}

.medal-gallery {
    display: grid;
    grid-template-columns: repeat(8, minmax(100px, 1fr));
    gap: 10px;
}

.medal-card {
    position: relative;
    padding: 10px 8px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 11px;
    background: rgba(9, 29, 44, .82);
    text-align: center;
}

.medal-card.locked {
    filter: grayscale(.86);
    opacity: .5;
}

.mini-medal.locked {
    filter: grayscale(.9);
    opacity: .46;
}

.mini-medal.locked::before {
    animation: none;
}

.medal-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

.medal-card::before {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1.08;
    margin: 0 auto 6px;
    content: "";
    background-image: url("../generated/medals-atlas.png");
    background-position: 0 40%;
    background-repeat: no-repeat;
    background-size: 500% auto;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45));
}

.medal-card.atlas-slot-0::before { background-position-x: 0; }
.medal-card.atlas-slot-1::before { background-position-x: 25%; }
.medal-card.atlas-slot-2::before { background-position-x: 50%; }
.medal-card.atlas-slot-3::before { background-position-x: 75%; }
.medal-card.atlas-slot-4::before { background-position-x: 100%; }

.medal-card img {
    display: none;
}

.medal-card strong {
    display: -webkit-box;
    min-height: 42px;
    overflow: hidden;
    color: #f1d38c;
    font-size: 9px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.medal-card small {
    display: none;
}

.shop-market {
    display: grid;
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.shopkeeper {
    position: sticky;
    top: 10px;
    overflow: hidden;
    border: 1px solid rgba(210, 156, 62, .36);
    border-radius: 15px;
    background:
        radial-gradient(circle at 50% 25%, rgba(225, 166, 65, .18), transparent 35%),
        linear-gradient(180deg, #071724, #102b35);
}

.shopkeeper > img {
    display: block;
    width: 100%;
    height: 310px;
    padding: 8px 8px 0;
    object-fit: contain;
    object-position: center bottom;
}

.shopkeeper > div {
    padding: 12px;
    border-top: 1px solid rgba(210, 156, 62, .22);
    background: rgba(20, 30, 31, .88);
}

.shopkeeper h2 {
    margin: 3px 0 7px;
    color: #f2bf5d;
}

.shopkeeper p {
    color: #bdc9ca;
    font-size: 10px;
    line-height: 1.5;
}

.shopkeeper > div > div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 7px;
    margin-top: 10px;
    padding: 8px;
    border-radius: 9px;
    background: rgba(5, 19, 29, .72);
}

.shopkeeper > div > div strong {
    color: #ffe08e;
}

.shopkeeper > div > div small {
    color: #9db1ba;
}

.shop-stock {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(97, 160, 192, .2);
    border-radius: 15px;
    background: rgba(6, 24, 38, .76);
}

.shop-stock .filter-bar {
    margin-top: 0;
}

.hero-bag {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid rgba(99, 204, 176, .24);
    border-radius: 12px;
    background:
        radial-gradient(circle at 8% 0, rgba(89, 206, 164, .12), transparent 35%),
        rgba(7, 31, 43, .76);
}

.hero-bag > header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 9px;
}

.hero-bag h2 {
    margin: 2px 0 0;
    font-size: 15px;
}

.hero-bag > header > small {
    max-width: 430px;
    color: #98bcb8;
    font-size: 9px;
    text-align: right;
}

.hero-bag > div {
    display: grid;
    gap: 6px;
}

.hero-bag article {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border: 1px solid rgba(103, 181, 172, .16);
    border-radius: 9px;
    background: rgba(5, 20, 33, .7);
}

.hero-bag article > span {
    font-size: 19px;
    text-align: center;
}

.hero-bag article strong,
.hero-bag article small {
    display: block;
}

.hero-bag article small {
    margin-top: 2px;
    color: #96b3bd;
    font-size: 9px;
}

.hero-bag article > b {
    color: #93e2bd;
}

.hero-bag.is-empty > div > p {
    margin: 0;
    color: #9db3bc;
    font-size: 10px;
}

.shop-grid {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.shop-stock .shop-grid {
    grid-template-columns: repeat(4, minmax(145px, 1fr));
}

@media (max-width: 1180px) {
    .shop-market {
        grid-template-columns: 1fr;
    }

    .shopkeeper {
        position: relative;
        display: grid;
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .shopkeeper > img {
        height: 220px;
    }

    .shopkeeper > div {
        border-top: 0;
        border-left: 1px solid rgba(210, 156, 62, .22);
    }

    .shop-stock .shop-grid {
        grid-template-columns: repeat(3, minmax(145px, 1fr));
    }
}

.shop-card {
    display: flex;
    flex-direction: column;
    padding: 11px;
}

.shop-card img {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    object-fit: contain;
}

.shop-card::before {
    position: relative;
    inset: auto;
    display: block;
    flex: 0 0 112px;
    width: 112px;
    height: 112px;
    margin: 0 auto 2px;
    content: "";
    background-image: url("../generated/shop-atlas.png");
    background-position: 0 0;
    background-repeat: no-repeat;
    background-size: 500% 200%;
    filter: drop-shadow(0 8px 11px rgba(0, 0, 0, .42));
    opacity: 1;
}

.shop-card.atlas-slot-0::before { background-position: 0 0; }
.shop-card.atlas-slot-1::before { background-position: 25% 0; }
.shop-card.atlas-slot-2::before { background-position: 50% 0; }
.shop-card.atlas-slot-3::before { background-position: 75% 0; }
.shop-card.atlas-slot-4::before { background-position: 100% 0; }
.shop-card.atlas-slot-5::before { background-position: 0 100%; }
.shop-card.atlas-slot-6::before { background-position: 25% 100%; }
.shop-card.atlas-slot-7::before { background-position: 50% 100%; }
.shop-card.atlas-slot-8::before { background-position: 75% 100%; }
.shop-card.atlas-slot-9::before { background-position: 100% 100%; }

.shop-card img {
    display: none;
}

.shop-card h3 {
    margin: 5px 0;
    font-size: 12px;
}

.shop-card p {
    flex: 1;
    color: var(--muted);
    font-size: 9px;
}

.shop-card .effect-ready {
    display: block;
    color: #83d9bb;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 8px;
}

.price {
    color: var(--gold);
    font-size: 11px;
    font-weight: 850;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    min-height: 140px;
    padding: 17px;
}

.stat-card strong {
    display: block;
    margin: 8px 0 4px;
    color: #fff;
    font-size: clamp(28px, 3vw, 45px);
}

.stat-card p {
    margin: 0;
    color: var(--muted);
}

.chart-card {
    grid-column: span 2;
    min-height: 260px;
    padding: 17px;
}

.bar-chart {
    display: flex;
    align-items: end;
    gap: 10px;
    height: 170px;
    margin-top: 20px;
    padding-top: 10px;
    border-bottom: 1px solid var(--line-soft);
}

.bar-chart > div {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    gap: 4px;
    height: 100%;
}

.bar-chart span {
    width: min(38px, 70%);
    min-height: 5px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--cyan), #236a91);
}

.bar-chart span[class*="p-"] { width: min(38px, 70%) !important; }
.bar-chart span.p-0 { height: 5%; }
.bar-chart span.p-5 { height: 5%; }
.bar-chart span.p-10 { height: 10%; }
.bar-chart span.p-15 { height: 15%; }
.bar-chart span.p-20 { height: 20%; }
.bar-chart span.p-25 { height: 25%; }
.bar-chart span.p-30 { height: 30%; }
.bar-chart span.p-35 { height: 35%; }
.bar-chart span.p-40 { height: 40%; }
.bar-chart span.p-45 { height: 45%; }
.bar-chart span.p-50 { height: 50%; }
.bar-chart span.p-55 { height: 55%; }
.bar-chart span.p-60 { height: 60%; }
.bar-chart span.p-65 { height: 65%; }
.bar-chart span.p-70 { height: 70%; }
.bar-chart span.p-75 { height: 75%; }
.bar-chart span.p-80 { height: 80%; }
.bar-chart span.p-85 { height: 85%; }
.bar-chart span.p-90 { height: 90%; }
.bar-chart span.p-95 { height: 95%; }
.bar-chart span.p-100 { height: 100%; }

.bar-chart small {
    color: var(--muted);
    font-size: 8px;
}

.note-grid,
.link-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
}

.note-card,
.link-card {
    min-height: 160px;
}

.note-card footer,
.link-card footer {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.file-vault {
    padding: 18px;
}

.drop-zone {
    display: grid;
    min-height: 210px;
    padding: 25px;
    place-items: center;
    border: 2px dashed rgba(93, 180, 217, .32);
    border-radius: 14px;
    background: rgba(8, 27, 42, .55);
    text-align: center;
}

.drop-zone input {
    max-width: 420px;
}

.file-list {
    display: grid;
    gap: 7px;
    margin-top: 15px;
}

.file-row {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: rgba(9, 31, 47, .72);
}

.theme-grid,
.extension-grid {
    grid-template-columns: repeat(3, minmax(230px, 1fr));
}

.theme-card,
.extension-card,
.settings-card,
.admin-card {
    padding: 15px;
}

.theme-preview {
    height: 130px;
    margin: -4px -4px 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    background: linear-gradient(135deg, #071724, #2a184b), #071724;
    box-shadow: inset 0 0 0 9px rgba(0,0,0,.15);
}

.theme-preview.preview-0 { background: linear-gradient(135deg, #06121f, #2b174c); }
.theme-preview.preview-1 { background: linear-gradient(135deg, #07170f, #3a4d24); }
.theme-preview.preview-2 { background: linear-gradient(135deg, #171a32, #3d7165); }
.theme-preview.preview-3 { background: linear-gradient(135deg, #211328, #8b684d); }
.theme-preview.preview-4 { background: linear-gradient(135deg, #020817, #5b165a); }

@keyframes companion-breathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.012); }
}

@keyframes timer-companion-float {
    0%, 100% { transform: translateX(-6px) translateY(0) scale(1.68); }
    50% { transform: translateX(-6px) translateY(-4px) scale(1.68); }
}

@keyframes timer-elf-float {
    0%, 100% { transform: translateX(-18px) translateY(0) scale(2.15); }
    50% { transform: translateX(-18px) translateY(-4px) scale(2.15); }
}

.sidebar-companion img,
.topbar-companion img,
.timer-companion img,
.companion-card img {
    animation: companion-breathe 3.8s ease-in-out infinite;
    transform-origin: 50% 100%;
}

.theme-card h3,
.extension-card h3,
.settings-card h3,
.admin-card h3 {
    margin: 0 0 7px;
}

.theme-card p,
.extension-card p,
.settings-card p,
.admin-card p {
    color: var(--muted);
    font-size: 10px;
}

.settings-grid,
.admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-card.span-2,
.admin-card.span-2 {
    grid-column: 1 / -1;
}

.settings-list {
    display: grid;
    gap: 10px;
}

.setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
}

.setting-row:last-child {
    border-bottom: 0;
}

.setting-row strong,
.setting-row small {
    display: block;
}

.setting-row small {
    margin-top: 3px;
    color: var(--muted);
}

.toggle {
    position: relative;
    width: 48px;
    height: 27px;
}

.toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.toggle span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 99px;
    background: #263b4b;
    cursor: pointer;
}

.toggle span::after {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    content: "";
    background: #d7e4ec;
    transition: transform .2s ease;
}

.toggle input:checked + span {
    background: #29895c;
}

.toggle input:checked + span::after {
    transform: translateX(21px);
}

.sync-banner {
    display: grid;
    grid-template-columns: 45px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(80, 184, 219, .25);
    border-radius: 12px;
    background: rgba(13, 47, 66, .58);
}

.sync-banner > span {
    display: grid;
    width: 43px;
    height: 43px;
    border-radius: 50%;
    background: rgba(63, 185, 130, .22);
    color: var(--green);
    font-size: 22px;
    place-items: center;
}

.sync-account-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.sync-account-actions .button {
    text-decoration: none;
}

.update-timeline {
    display: grid;
    gap: 9px;
}

.update-entry {
    padding: 13px;
    border-left: 3px solid var(--violet);
    border-radius: 0 10px 10px 0;
    background: rgba(20, 30, 51, .72);
}

.update-entry h3 {
    margin: 0;
}

.update-entry ul {
    margin-bottom: 0;
    color: var(--muted);
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    padding: 9px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(8, 27, 42, .82);
}

.admin-nav button {
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #bdd2e0;
    cursor: pointer;
    font-size: 10px;
}

.admin-nav button.is-active {
    border-color: rgba(244, 182, 62, .35);
    background: rgba(126, 82, 27, .44);
    color: #ffe0a0;
}

.admin-metric {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
}

.admin-metric strong {
    font-size: 34px;
}

.privacy-notice {
    padding: 12px;
    border: 1px solid rgba(71, 191, 130, .26);
    border-radius: 10px;
    background: rgba(15, 74, 52, .27);
    color: #bdebd0;
}

.modal {
    width: min(94vw, 760px);
    max-height: min(92dvh, 880px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #081827;
    color: var(--text);
    box-shadow: 0 30px 90px rgba(0,0,0,.62), 0 0 40px rgba(64, 175, 218, .12);
}

.modal::backdrop {
    background: rgba(0, 5, 11, .76);
    backdrop-filter: blur(5px);
}

.modal-card {
    padding: 18px;
}

.modal-card > header,
.form-modal > header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
}

.modal-card h2 {
    margin: 2px 0 0;
    font-size: 24px;
}

.login-dialog {
    width: min(94vw, 520px);
}

.login-error {
    margin: 0;
    padding: 9px 11px;
    border: 1px solid rgba(226, 88, 100, .45);
    border-radius: 9px;
    background: rgba(119, 31, 46, .28);
    color: #ffd2d6;
    font-size: 12px;
    font-weight: 700;
}

.form-modal {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-modal > header,
.form-modal > footer,
.form-modal .span-2,
.span-2 {
    grid-column: 1 / -1;
}

.form-modal label {
    display: grid;
    gap: 5px;
    color: #bdd1df;
    font-size: 10px;
    font-weight: 750;
}

.form-modal footer,
.modal-card > footer {
    display: flex;
    justify-content: end;
    gap: 8px;
    margin-top: 8px;
}

.dynamic-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dynamic-form label.span-2 {
    grid-column: 1 / -1;
}

.form-advanced {
    padding: 9px;
    border: 1px solid rgba(104, 166, 198, .22);
    border-radius: 11px;
    background: rgba(8, 28, 43, .62);
}

.form-advanced > summary {
    color: #bfe5f5;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.form-advanced[open] > summary {
    margin-bottom: 11px;
}

.task-decisive-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 11px;
    border: 1px solid rgba(233, 188, 78, .25);
    border-radius: 11px;
    background: rgba(78, 53, 15, .22);
}

.task-decisive-toggle span,
.task-decisive-toggle small {
    display: block;
}

.task-decisive-toggle small {
    margin-top: 3px;
    color: #a9b8c1;
    font-weight: 500;
}

.task-decisive-toggle input {
    width: 20px;
    height: 20px;
    accent-color: #dba83c;
}

.boss-choice-field {
    min-width: 0;
    margin: 0;
    padding: 10px;
    border: 1px solid rgba(164, 109, 211, .28);
    border-radius: 11px;
    background: rgba(15, 18, 42, .45);
}

.boss-choice-field legend {
    padding: 0 6px;
    color: #d7b8ed;
    font-size: 10px;
    font-weight: 800;
}

.boss-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 8px;
    max-height: 340px;
    overflow: auto;
    padding: 2px;
}

.boss-choice-card {
    position: relative;
    display: grid;
    grid-template-rows: 92px auto;
    overflow: hidden;
    min-width: 0;
    border: 1px solid rgba(119, 91, 166, .32);
    border-radius: 10px;
    background: linear-gradient(160deg, rgba(26, 25, 58, .9), rgba(7, 25, 39, .95));
    cursor: pointer;
}

.boss-choice-card:has(input:checked) {
    border-color: #ce79ec;
    box-shadow: 0 0 0 2px rgba(198, 91, 224, .22), 0 0 18px rgba(184, 67, 215, .2);
}

.boss-choice-card input {
    position: absolute;
    z-index: 2;
    top: 7px;
    left: 7px;
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    accent-color: #bd66dc;
}

.boss-choice-card img,
.boss-choice-empty {
    width: 100%;
    height: 92px;
    object-fit: contain;
    object-position: center;
    background: radial-gradient(circle, rgba(128, 69, 169, .23), rgba(3, 14, 26, .88) 68%);
}

.boss-choice-empty {
    display: grid;
    place-items: center;
    font-size: 42px;
    filter: grayscale(.65);
}

.boss-choice-card > span:last-child {
    display: block;
    min-width: 0;
    padding: 7px 8px 8px;
}

.boss-choice-card strong,
.boss-choice-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.boss-choice-card strong {
    color: #e5eef5;
    font-size: 10px;
}

.boss-choice-card small {
    margin-top: 3px;
    color: #a997bc;
    font-size: 8px;
}

.estimate-review-dialog {
    width: min(94vw, 620px);
}

.estimate-review-dialog p {
    color: #c8dce7;
    line-height: 1.55;
}

.estimate-review-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 16px;
}

.estimate-review-actions > label {
    grid-column: 1 / -1;
    color: #bdd1df;
    font-size: 10px;
    font-weight: 750;
}

.estimate-review-actions > label > span {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 5px;
}

.pause-dialog {
    width: min(92vw, 540px);
    text-align: center;
}

.pause-dialog header {
    text-align: left;
}

.timer-complete-dialog {
    width: min(92vw, 560px);
}

.timer-complete-message {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(93, 208, 145, .36);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(24, 100, 72, .34), rgba(18, 47, 72, .46));
}

.timer-complete-emblem {
    display: grid;
    width: 68px;
    height: 68px;
    border: 1px solid rgba(146, 233, 177, .6);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100, 208, 139, .5), rgba(24, 94, 68, .72));
    color: #effff3;
    font-size: 34px;
    font-weight: 900;
    place-items: center;
    box-shadow: 0 0 28px rgba(79, 211, 139, .22);
}

.timer-complete-message strong {
    display: block;
    color: #f3fff7;
    font-size: 18px;
}

.timer-complete-message p {
    margin: 7px 0 0;
    color: #c8dbe5;
    line-height: 1.5;
}

@media (max-width: 520px) {
    .timer-complete-message {
        grid-template-columns: 54px minmax(0, 1fr);
        padding: 14px;
    }

    .timer-complete-emblem {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }
}

.pause-visual {
    display: grid;
    width: 110px;
    height: 110px;
    margin: 0 auto 15px;
    border: 1px solid rgba(100, 218, 191, .3);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94, 215, 186, .26), rgba(16, 73, 70, .15) 50%, transparent 52%);
    place-items: center;
}

.pause-visual span {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(133, 237, 210, .72);
    box-shadow: 0 0 25px rgba(117, 232, 203, .35);
    animation: pause-breathe 6s ease-in-out infinite;
}

.pause-instruction {
    color: #d9eee9;
}

.pause-meta {
    color: var(--muted);
    font-size: 11px;
}

.pause-countdown {
    margin: 15px 0;
    font-size: 45px;
    font-weight: 850;
}

.onboarding-dialog {
    width: min(94vw, 820px);
}

.onboarding-progress {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 18px;
}

.onboarding-progress span {
    height: 5px;
    border-radius: 99px;
    background: #21394c;
}

.onboarding-progress span.done {
    background: linear-gradient(90deg, var(--cyan), var(--violet));
}

.onboarding-content {
    min-height: 310px;
}

.onboarding-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.choice-card {
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: rgba(10, 34, 51, .78);
    cursor: pointer;
}

.choice-card.is-selected {
    border-color: var(--gold);
    box-shadow: inset 0 0 0 1px rgba(244,182,62,.25);
}

.choice-card img {
    width: 90px;
    height: 100px;
    margin: auto;
    object-fit: contain;
}

.choice-card strong,
.choice-card small {
    display: block;
    text-align: center;
}

.choice-card small {
    margin-top: 4px;
    color: var(--muted);
}

.conflict-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
}

.toast-region {
    position: fixed;
    z-index: 9999;
    right: 18px;
    bottom: 54px;
    display: grid;
    gap: 8px;
    width: min(390px, calc(100vw - 36px));
    pointer-events: none;
}

.toast {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    padding: 11px 13px;
    border: 1px solid rgba(81, 185, 220, .35);
    border-radius: 10px;
    background: rgba(7, 27, 42, .97);
    box-shadow: var(--shadow);
    color: #eaf7ff;
    animation: toast-in .22s ease both;
}

.toast.success { border-color: rgba(76, 201, 118, .42); }
.toast.warning { border-color: rgba(244, 182, 62, .48); }
.toast.error { border-color: rgba(235, 102, 115, .5); }

.toast > span:first-child {
    font-size: 19px;
}

.toast strong,
.toast small {
    display: block;
}

.toast small {
    margin-top: 2px;
    color: var(--muted);
}

.noscript-message {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    padding: 30px;
    place-items: center;
    background: #06121f;
    color: #fff;
    text-align: center;
}

.theme-dark-forest {
    --bg: #06100d;
    --bg-soft: #0b1d16;
    --panel: #0c231a;
    --panel-strong: #123225;
    --panel-soft: #163b2a;
    --line: #31674b;
    --cyan: #8bd6b0;
    --cyan-strong: #56b886;
    --violet: #b9a568;
    --gold: #d8a84f;
    --green: #80ca75;
}

.theme-potato-zen {
    --bg: #101326;
    --bg-soft: #171a31;
    --panel: #1a1e38;
    --panel-strong: #232846;
    --panel-soft: #2b3152;
    --line: #515b88;
    --cyan: #78dfca;
    --cyan-strong: #4dbba9;
    --violet: #a99ae9;
    --gold: #e7b968;
    --green: #7dcf9b;
}

.theme-strange-academy {
    --bg: #120d18;
    --bg-soft: #1c1322;
    --panel: #27182c;
    --panel-strong: #35203c;
    --panel-soft: #452849;
    --line: #75527b;
    --cyan: #bd9ad3;
    --cyan-strong: #986fb3;
    --violet: #df76c0;
    --gold: #d7ac59;
    --green: #9bbc7c;
}

.theme-technomagic-night {
    --bg: #020611;
    --bg-soft: #071124;
    --panel: #071a2e;
    --panel-strong: #0a2742;
    --panel-soft: #0c3550;
    --line: #176d91;
    --cyan: #3ef0ff;
    --cyan-strong: #00bfd2;
    --violet: #ff4fe1;
    --gold: #ffd45a;
    --green: #52f28f;
}

@keyframes potato-breathe {
    0%, 100% { transform: rotate(6deg) scale(.96); }
    50% { transform: rotate(-4deg) scale(1.04); }
}

@keyframes pause-breathe {
    0%, 100% { transform: scale(.7); opacity: .6; }
    46% { transform: scale(1.45); opacity: 1; }
}

@keyframes toast-in {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 1660px) {
    :root {
        --sidebar: 224px;
    }

    .fa-body {
        font-size: 14px;
    }

    .top-action {
        min-width: 48px;
    }

    .sync-state {
        grid-template-columns: 9px minmax(65px, auto);
        padding-inline: 6px;
    }

    .dashboard-timer { grid-column: span 5; }
    .dashboard-today { grid-column: span 3; }
    .dashboard-distractions { grid-column: span 4; }
    .dashboard-summary { grid-column: span 4; }
    .dashboard-boss { grid-column: span 5; }
    .dashboard-pause { grid-column: span 3; }
    .dashboard-titles { grid-column: span 5; }
    .dashboard-shop { grid-column: span 4; }
    .dashboard-advice { grid-column: span 3; }
    .dashboard-backup { grid-column: span 3; }

    .timer-hero {
        grid-template-columns: minmax(0, 1fr) 175px;
    }

    .companion-bubble {
        margin-bottom: 96px;
    }
}

@media (max-width: 1420px) {
    :root {
        --sidebar: 210px;
        --topbar: 72px;
    }

    .sidebar-brand strong {
        font-size: 18px;
    }

    .sidebar {
        padding-inline: 10px;
    }

    .sidebar-companion {
        display: none;
    }

    .economy-counter {
        min-width: 104px;
        padding-inline: 9px;
    }

    .economy-counter small {
        font-size: 8px;
    }

    .momentum {
        min-width: 155px;
        padding-inline: 8px;
    }

    .topbar-companion {
        flex-basis: 180px;
    }

    .topbar-hero {
        grid-template-columns: 38px minmax(0, 1fr);
        flex-basis: 145px;
        min-width: 108px;
        padding-inline: 6px;
    }

    .topbar-hero-avatar {
        width: 36px;
        height: 36px;
    }

    .top-action small {
        display: none;
    }

    .top-action {
        min-width: 40px;
        padding: 6px 4px;
    }

    .sync-state small {
        display: none;
    }

    .dashboard-grid {
        grid-auto-rows: minmax(135px, auto);
        gap: 9px;
    }

    .dashboard-timer { grid-column: span 7; }
    .dashboard-today { grid-column: span 5; }
    .dashboard-distractions { grid-column: span 5; }
    .dashboard-summary { grid-column: span 7; }
    .dashboard-boss { grid-column: span 7; }
    .dashboard-pause { grid-column: span 5; }
    .dashboard-titles { grid-column: span 7; }
    .dashboard-shop { grid-column: span 5; }
    .dashboard-advice { grid-column: span 6; }
    .dashboard-backup { grid-column: span 6; }

    .project-grid,
    .routine-grid,
    .companion-grid,
    .boss-grid,
    .theme-grid,
    .extension-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-grid {
        grid-template-columns: repeat(4, minmax(140px, 1fr));
    }

    .medal-gallery {
        grid-template-columns: repeat(6, minmax(90px, 1fr));
    }
}

@media (max-width: 1100px) {
    :root {
        --sidebar: 260px;
    }

    .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-105%);
        transition: transform .24s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: grid;
    }

    .sidebar.is-open::before {
        position: fixed;
        z-index: -1;
        inset: 0 -100vw 0 0;
        content: "";
        background: rgba(0,0,0,.52);
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
        margin-right: 9px;
    }

    .mobile-brand strong {
        display: none;
    }

    .menu-toggle {
        width: 36px;
        height: 36px;
    }

    .topbar-companion {
        display: none;
    }

    .mobile-return {
        display: grid;
        width: 38px;
        border: 1px solid var(--line-soft);
        border-radius: 9px;
        color: #d7e9f5;
        font-size: 20px;
        text-decoration: none;
        place-items: center;
    }

    .focus-page {
        grid-template-columns: minmax(0, 1fr);
    }

    .focus-stage {
        min-height: 540px;
    }

    .focus-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-grid {
        grid-template-columns: repeat(3, minmax(135px, 1fr));
    }

    .quest-journal {
        grid-template-columns: minmax(0, 1fr);
    }

    .quest-project-rail {
        grid-row: auto;
        flex-direction: row;
        min-height: 0;
        overflow-x: auto;
    }

    .quest-rail-heading {
        min-width: 150px;
        border-right: 1px solid rgba(124, 180, 210, .16);
        border-bottom: 0;
    }

    .quest-project-choice {
        min-width: 210px;
    }

    .quest-new-project {
        min-width: 180px;
        margin-top: 0;
    }
}

@media (max-width: 780px) {
    .boss-choice-grid {
        grid-template-columns: repeat(2, minmax(110px, 1fr));
    }

    .quest-stage {
        grid-template-columns: minmax(0, 1fr);
    }

    .quest-stage-copy {
        padding: 18px;
    }

    .quest-boss-art {
        right: -20px;
        width: 55%;
        opacity: .34;
    }

    .quest-boss-panel {
        border-top: 1px solid rgba(156, 104, 202, .24);
        border-left: 0;
    }

    .quest-detail-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quest-step {
        grid-template-columns: 30px minmax(0, 1fr) auto;
    }

    .quest-step .button {
        grid-column: 2 / -1;
    }

    .topbar-hero {
        grid-template-columns: 34px;
        min-width: 44px;
        flex: 0 0 44px;
        padding: 4px;
        place-content: center;
    }

    .topbar-hero > span:last-child {
        display: none;
    }

    .topbar-hero-avatar {
        width: 34px;
        height: 34px;
    }
    :root {
        --topbar: 64px;
        --footer: 0px;
    }

    .app-column {
        grid-template-rows: var(--topbar) minmax(0, 1fr);
    }

    .topbar {
        padding: 7px 8px;
    }

    .topbar-identity {
        flex: 1;
    }

    .economy-counter {
        min-width: 68px;
        padding: 6px 7px;
        grid-template-columns: 24px auto;
    }

    .economy-counter > span {
        margin-right: 4px;
        transform: scale(.72);
    }

    .economy-counter strong {
        font-size: 13px;
    }

    .economy-counter small,
    .momentum small,
    .momentum-bolt,
    .sync-state span:last-child,
    .top-action,
    .mini-timer small {
        display: none;
    }

    .momentum {
        grid-template-columns: minmax(55px, 1fr) 35px;
        min-width: 88px;
        padding-inline: 7px;
    }

    .momentum > div {
        min-width: 55px;
    }

    .topbar-actions {
        gap: 5px;
        margin-left: 6px;
    }

    .sync-state {
        display: grid;
        min-width: 34px;
        padding: 5px;
        place-items: center;
    }

    .mobile-return {
        width: 34px;
    }

    .mini-timer {
        min-width: 70px;
        min-height: 44px;
        margin-left: 6px;
    }

    .mini-timer:not([hidden]) {
        grid-template-columns: 7px auto;
    }

    .main-viewport {
        padding: 8px;
    }

    .bottom-mantra {
        display: none;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
        padding: 12px;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: auto;
    }

    .dashboard-grid > .card {
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    .timer-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .timer-main {
        min-height: 270px;
    }

    .timer-companion {
        min-height: 250px;
    }

    .timer-companion img {
        inset: 5px 25% 35px;
        width: 50%;
    }

    .companion-bubble {
        margin: 0 15px 120px auto;
    }

    .boss-feature,
    .summary-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .boss-steps {
        padding: 10px;
    }

    .project-grid,
    .routine-grid,
    .companion-grid,
    .boss-grid,
    .shop-grid,
    .theme-grid,
    .extension-grid,
    .stats-grid,
    .settings-grid,
    .admin-grid,
    .note-grid,
    .link-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .chart-card,
    .settings-card.span-2,
    .admin-card.span-2 {
        grid-column: 1;
    }

    .companion-card {
        grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
    }

    .medal-gallery {
        grid-template-columns: repeat(3, minmax(80px, 1fr));
    }

    .filter-bar {
        grid-template-columns: minmax(0, 1fr);
    }

    .data-card {
        grid-template-columns: 7px minmax(0, 1fr);
        padding-right: 8px;
    }

    .data-card-meta,
    .data-card-actions {
        grid-column: 2;
        justify-content: start;
    }

    .calendar-day {
        min-height: 72px;
        padding: 4px;
    }

    .calendar-event {
        max-width: 100%;
        padding: 2px;
        font-size: 7px;
    }

    .focus-side {
        grid-template-columns: minmax(0, 1fr);
    }

    .focus-stage {
        min-height: calc(100dvh - var(--topbar) - 90px);
        padding: 15px;
    }

    .focus-clock {
        font-size: clamp(74px, 23vw, 120px);
        letter-spacing: -4px;
    }

    .form-modal,
    .dynamic-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-modal > label,
    .dynamic-form label {
        grid-column: 1 !important;
    }

    .onboarding-choices {
        grid-template-columns: minmax(0, 1fr);
    }

    .choice-card {
        min-height: 80px;
    }

    .conflict-options {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 480px) {
    .mobile-brand img,
    .economy-counter.merit,
    .momentum {
        display: none;
    }

    .topbar-identity {
        flex: 0 0 78px;
    }

    .economy-counter {
        min-width: 78px;
        border-right: 0;
    }

    .mini-timer {
        flex: 1;
        min-width: 72px;
    }

    .timer-display {
        font-size: 64px;
    }

    .medal-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .medal-row .mini-medal:nth-child(n+4) {
        display: none;
    }

    .shop-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-row .shop-mini:nth-child(n+3) {
        display: none;
    }

    .modal {
        width: calc(100vw - 12px);
        max-height: calc(100dvh - 12px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

.fa-body.reduce-motion *,
.fa-body.reduce-motion *::before,
.fa-body.reduce-motion *::after {
    animation: none !important;
    transition: none !important;
}

/* Visual direction: cockpit ChronoQuest validated at 1536 × 1024. */
.topbar-welcome {
    display: none;
}

.session-ring {
    display: grid;
    place-items: center;
    text-align: center;
}

.reward-art,
.pause-card-content {
    position: relative;
}

.reward-art img,
.pause-companion,
.page-companion-cameo {
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, .42));
}

.page-heading-copy {
    min-width: 0;
}

.page-emblem {
    margin-right: 6px;
    font-size: 16px;
}

.page-companion-cameo {
    position: relative;
    display: block;
    align-self: end;
    width: 82px;
    height: 82px;
    margin: -7px 18px -7px auto;
    overflow: hidden;
    border: 2px solid rgba(122, 206, 226, .28);
    border-radius: 50%;
    background: #03101d;
    box-shadow: 0 0 22px rgba(99, 161, 211, .22);
}

.page-companion-cameo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 24%;
    transform: scale(1.5);
    transform-origin: 50% 24%;
}

.page-header[data-companion="merlin"] .page-companion-cameo img { object-position: 50% 25%; transform: scale(1.34); transform-origin: 50% 25%; }
.page-header[data-companion="nain"] .page-companion-cameo img { object-position: 50% 22%; transform: scale(1.65); transform-origin: 50% 22%; }
.page-header[data-companion="gobelin"] .page-companion-cameo img { object-position: 50% 28%; transform: scale(1.36); transform-origin: 50% 28%; }
.page-header[data-companion="chat"] .page-companion-cameo img { object-position: 50% 25%; transform: scale(1.42); transform-origin: 50% 25%; }
.page-header[data-companion="elfe"] .page-companion-cameo img { object-position: 50% 13%; transform: scale(1.75); transform-origin: 50% 16%; }

@media (min-width: 1101px) {
    :root {
        --sidebar: clamp(220px, 14.3vw, 250px);
        --topbar: clamp(84px, 10dvh, 102px);
        --footer: clamp(38px, 4.5dvh, 46px);
        --radius: 14px;
    }

    .fa-body {
        font-size: 14px;
    }

    .fa-body.page-dashboard {
        overflow: hidden;
    }

    .app-shell {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .app-column {
        height: 100dvh;
        min-height: 0;
    }

    .sidebar {
        padding: clamp(10px, 1.35dvh, 14px) 13px clamp(7px, 1dvh, 10px);
        border-right-color: #17455e;
        background:
            radial-gradient(circle at 72% 14%, rgba(32, 157, 198, .11), transparent 28%),
            linear-gradient(180deg, #061728 0%, #061b2b 50%, #071d2c 100%);
    }

    .sidebar-brand {
        position: relative;
        min-height: clamp(72px, 8.6dvh, 88px);
        padding: 5px 7px clamp(11px, 1.45dvh, 15px) 18px;
        align-items: flex-start;
    }

    .sidebar-brand::before,
    .sidebar-brand::after {
        position: absolute;
        color: #ffd45e;
        content: "✦";
        text-shadow: 0 0 12px rgba(255, 207, 68, .75);
    }

    .sidebar-brand::before {
        top: 4px;
        left: 0;
        font-size: 18px;
    }

    .sidebar-brand::after {
        top: 47px;
        right: 3px;
        font-size: 12px;
    }

    .sidebar-brand img.brand-logo {
        display: block;
        width: clamp(162px, 12.8vw, 197px);
        height: clamp(52px, 6.25dvh, 64px);
        margin: -2px auto 0;
        object-fit: contain;
        filter: drop-shadow(0 0 12px rgba(99, 145, 255, .2));
    }

    .sidebar-brand .brand-meta {
        position: absolute;
        bottom: 3px;
        left: 29px;
    }

    .sidebar-brand .brand-meta strong {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .sidebar-brand .brand-meta small {
        margin: 0;
        font-size: 10px;
    }

    .primary-create {
        min-height: clamp(33px, 3.8dvh, 39px);
        margin: -1px 0 clamp(6px, .95dvh, 10px);
        border-radius: 9px;
        font-size: 13px;
    }

    .main-nav {
        padding: 4px;
        overflow: hidden;
        border: 1px solid rgba(77, 164, 201, .24);
        border-radius: 12px;
        background: linear-gradient(180deg, rgba(7, 29, 46, .78), rgba(5, 23, 38, .58));
    }

    .nav-group {
        margin-bottom: 2px;
    }

    .nav-group h2 {
        padding: 3px 7px 1px;
        font-size: 9px;
    }

    .nav-item {
        grid-template-columns: 26px minmax(0, 1fr);
        min-height: clamp(27px, 3.15dvh, 32px);
        padding: 3px 7px;
        font-size: 12.5px;
    }

    .nav-item > span:first-child {
        font-size: 15px;
    }

    .sidebar-companion {
        grid-template-columns: clamp(62px, 4.8vw, 74px) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) clamp(28px, 3.3dvh, 34px);
        gap: 7px 8px;
        min-height: clamp(104px, 12.4dvh, 127px);
        margin: clamp(4px, .65dvh, 7px) 0 3px;
        padding: 5px;
        overflow: visible;
        border-color: transparent;
        background: transparent;
        box-shadow: none;
    }

    .sidebar-companion::before {
        display: none;
    }

    .sidebar-companion img {
        grid-row: 1 / 3;
        align-self: end;
        width: clamp(68px, 5.35vw, 82px);
        height: clamp(100px, 12dvh, 123px);
        margin: 0 0 -5px -8px;
        object-fit: cover;
        object-position: 50% 58%;
        animation: none;
        -webkit-mask-image: radial-gradient(ellipse 65% 62% at 50% 54%, #000 64%, transparent 100%);
        mask-image: radial-gradient(ellipse 65% 62% at 50% 54%, #000 64%, transparent 100%);
        transform: perspective(220px) rotateY(-7deg) translateX(-3px) scale(1.15);
        transform-origin: center bottom;
    }

    .sidebar-companion > div {
        align-self: center;
        padding: 4px 2px;
        border: 0;
        background: transparent;
    }

    .sidebar-companion strong {
        color: #eef7ff;
        font-size: 10px;
    }

    .sidebar-companion p {
        font-size: 9px;
    }

    .sidebar-companion .ghost-button {
        grid-column: 2;
        min-height: 32px;
    }

    .return-link {
        min-height: clamp(21px, 2.45dvh, 25px);
        border-color: transparent;
        background: transparent;
        font-size: 9px;
    }

    .topbar {
        position: relative;
        gap: 10px;
        padding: clamp(17px, 2.15dvh, 22px) 12px 0;
        background: #030c18;
        backdrop-filter: none;
    }

    .topbar-welcome {
        display: flex;
        flex: 0 0 300px;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        padding: 11px 16px;
        border: 1px solid rgba(47, 98, 133, .25);
        border-radius: 18px;
        background: linear-gradient(150deg, #091a2a, #0a1927);
    }

    .topbar-welcome strong {
        color: #ffc65b;
        font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
        font-size: 26px;
        letter-spacing: .7px;
        text-transform: uppercase;
    }

    .topbar-welcome small {
        margin-top: 4px;
        color: #d5cfc4;
        font-size: 11px;
    }

    .topbar-identity {
        display: grid;
        grid-template-columns: 132px 145px 180px;
        flex: 0 0 457px;
        overflow: visible;
        border-radius: 18px;
    }

    .economy-counter {
        grid-template-columns: 36px auto;
        min-width: 0;
        padding: 9px 12px;
    }

    .economy-counter strong {
        font-size: 17px;
    }

    .economy-counter small {
        font-size: 10.5px;
    }

    .momentum {
        grid-template-columns: 26px minmax(72px, 1fr) 31px;
        gap: 5px;
        min-width: 0;
        padding: 8px 7px;
    }

    .momentum > div {
        min-width: 0;
    }

    .momentum > strong {
        min-width: 0;
        justify-self: end;
        text-align: right;
    }

    .topbar-companion {
        flex: 0 0 226px;
        grid-template-columns: 43px minmax(0, 1fr);
        min-width: 0;
        margin-left: auto;
        border-radius: 18px;
    }

    .topbar-companion > .affinity-avatar {
        grid-column: 1;
        width: 37px;
        height: 47px;
    }

    .topbar-companion .heart {
        display: grid;
        z-index: 2;
        grid-column: 1;
        grid-row: 1;
        align-self: end;
        justify-self: end;
        width: 22px;
        height: 22px;
        border: 2px solid #cf4cff;
        border-radius: 50%;
        place-items: center;
        background: #16102c;
        font-size: 13px;
    }

    .topbar-companion > div {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .topbar-companion small,
    .topbar-companion strong {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        line-height: 1.25;
    }

    .topbar-quest strong {
        font-size: 12px;
    }

    .topbar-quest div > span,
    .top-action small {
        font-size: 9px;
    }

    .topbar-actions {
        flex: 0 0 105px;
        gap: 1px;
        margin-left: 0;
        border: 1px solid rgba(47, 98, 133, .25);
        border-radius: 18px;
        background: linear-gradient(150deg, #091a2a, #0a1927);
    }

    .top-action {
        min-width: 50px;
        padding: 7px 3px 5px;
    }

    .top-action > span {
        font-size: 20px;
        filter: grayscale(.2);
    }

    .top-action small {
        margin-top: 5px;
        font-size: 8px;
    }

    .sync-state,
    .admin-action,
    .mini-timer {
        display: none !important;
    }

    .main-viewport {
        padding: clamp(9px, 1.17dvh, 12px);
    }

    .fa-body.page-dashboard .main-viewport {
        overflow: hidden;
    }

    .fa-body.page-dashboard .page-root {
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    .bottom-mantra {
        padding: 6px 26px 6px 52px;
        font-size: 11px;
        background: linear-gradient(90deg, #171344, #2c1a62 54%, #241447);
    }

    .bottom-mantra .tiny-potato {
        width: 34px;
        height: 25px;
    }

    .page-header {
        position: relative;
        min-height: 92px;
        align-items: center;
        overflow: hidden;
        border-color: rgba(74, 159, 198, .3);
        background:
            radial-gradient(circle at 80% 20%, rgba(176, 106, 255, .15), transparent 24%),
            linear-gradient(145deg, rgba(11, 31, 48, .97), rgba(7, 23, 37, .94));
    }

    .page-header::after {
        position: absolute;
        inset: auto 0 0;
        height: 2px;
        content: "";
        background: linear-gradient(90deg, var(--cyan), var(--violet), transparent);
        opacity: .65;
    }

    .page-companion-cameo {
        width: 88px;
        height: 88px;
        margin: -3px 24px -3px auto;
    }

    .dashboard-grid {
        position: relative;
        display: block;
        width: 100%;
        height: 100%;
        margin: 0;
        transform: none;
    }

    .dashboard-grid > .card {
        position: absolute;
        min-height: 0;
    }

    .dashboard-timer { inset: 0 auto auto 0; width: 47.6%; height: 34.6%; }
    .dashboard-today { inset: 0 auto auto 48.4%; width: 25%; height: 37%; }
    .dashboard-distractions { inset: 0 0 auto auto; width: 25.8%; height: 36.1%; }
    .dashboard-summary { inset: 36.2% auto auto 0; width: 31.3%; height: 32.5%; }
    .dashboard-boss { inset: 38.9% auto auto 32%; width: 41.4%; height: 33.9%; }
    .dashboard-pause { inset: 37% 0 auto auto; width: 25.8%; height: 40.3%; }

    .dashboard-bottom {
        display: contents;
    }

    .dashboard-bottom > .card {
        position: absolute;
        min-height: 0;
    }

    .dashboard-titles { inset: 70% auto auto 0; width: 31.3%; height: 30%; }
    .dashboard-shop { inset: 73.7% auto auto 32%; width: 40.6%; height: 26.3%; }
    .dashboard-advice { inset: 78% 0 auto auto; width: 26.6%; height: 22%; }

    .card-header {
        min-height: 38px;
        padding: 8px 12px 6px;
    }

    .card-header h2,
    .card-header h3 {
        font-size: 12.5px;
    }

    .dashboard-timer .card-header {
        position: relative;
        z-index: 4;
    }

    .dashboard-timer .status-badge {
        position: absolute;
        top: 7px;
        right: auto;
        left: 210px;
        max-width: 220px;
        padding: 5px 9px;
        border-radius: 9px;
        background: linear-gradient(180deg, #263a52, #14273d);
        color: #ecf6ff;
        font-size: 9px;
        white-space: nowrap;
    }

    .timer-hero {
        grid-template-columns: 104px 253px minmax(190px, 1fr);
        justify-content: start;
        height: calc(100% - 38px);
        min-height: 0;
    }

    .session-ring {
        align-self: start;
        width: 84px;
        height: 84px;
        margin: 13px 0 0 14px;
        border-radius: 50%;
        background:
            radial-gradient(circle, #082036 61%, transparent 62%),
            conic-gradient(#f5bd3d 0 var(--session-progress, 0%), #153a52 var(--session-progress, 0%) 100%);
        box-shadow: inset 0 0 0 1px rgba(84, 166, 201, .22);
    }

    .session-ring strong {
        display: block;
        font-size: 15px;
        line-height: 1;
    }

    .session-ring span {
        display: block;
        margin-top: 5px;
        color: #c3d8e6;
        font-size: 8px;
        line-height: 1.25;
    }

    .timer-main {
        justify-content: flex-start;
        padding: 20px 0 9px;
        transform: none;
    }

    .timer-display {
        margin: 0;
        font-size: 52px;
        letter-spacing: -2.5px;
        transform: translate(-46px, -13px);
    }

    .timer-task {
        align-self: flex-start;
        width: 240px;
        max-width: 240px;
        margin-top: 22px;
        margin-left: -84px;
        font-size: 12.5px;
        transform: none;
    }

    .timer-actions {
        align-self: flex-start;
        flex-wrap: nowrap;
        gap: 6px;
        margin-top: 8px;
        margin-left: -84px;
        width: min(240px, calc(100% + 40px));
    }

    .timer-actions .button {
        min-width: 0;
        flex: 1 1 0;
        min-height: 33px;
        padding: 5px 4px;
        font-size: 10px;
    }

    .timer-next-break {
        align-self: flex-start;
        width: 160px;
        margin-top: 3px;
        margin-left: -44px;
        font-size: 10px;
        text-align: center;
        white-space: nowrap;
    }

    .timer-companion {
        overflow: visible;
        padding: 0 8px 10px;
        background: radial-gradient(circle at 60% 35%, rgba(103, 211, 142, .2), transparent 58%);
    }

    .timer-companion img {
        inset: -38px -24px 12px auto;
        width: 190px;
        max-width: none;
        height: calc(100% + 38px);
        animation: timer-companion-float 4.2s ease-in-out infinite;
        object-fit: cover;
        object-position: 50% 10%;
        transform: translateX(-6px) scale(1.68);
        transform-origin: 50% 12%;
    }

    .timer-companion img[src*="elfe-dashboard.png"] {
        inset: -30px -34px 12px auto;
        height: calc(100% + 44px);
        clip-path: inset(0 0 0 20%);
        object-position: 48% 7%;
        transform: translateX(-18px) scale(2.15);
        transform-origin: 50% 12%;
        animation-name: timer-elf-float;
    }

    .companion-bubble {
        position: absolute;
        z-index: 3;
        top: -2px;
        left: -84px;
        width: 154px;
        min-height: 116px;
        max-height: 176px;
        margin: 0;
        padding: 13px 12px;
        overflow: visible;
        font-size: 10.6px;
        line-height: 1.3;
    }

    .companion-bubble.is-long {
        font-size: 9.9px;
        line-height: 1.26;
    }

    .companion-bubble.is-very-long {
        font-size: 9.3px;
        line-height: 1.22;
    }

    .companion-switcher {
        position: absolute;
        right: 8px;
        bottom: 27px;
        left: 8px;
        gap: 5px;
        width: auto;
        margin-bottom: 0;
    }

    .companion-current-name {
        font-size: 12px;
        font-weight: 800;
    }

    .companion-nameplate {
        min-height: 32px;
        font-size: 11.5px;
    }

    .dashboard-today,
    .dashboard-distractions,
    .dashboard-boss,
    .dashboard-titles,
    .dashboard-shop {
        display: flex;
        flex-direction: column;
    }

    .dashboard-today .card-body,
    .dashboard-distractions .card-body {
        flex: 1;
        min-height: 0;
        padding: 6px 10px 0;
        overflow: hidden;
    }

    .dashboard-today .inline-footer,
    .dashboard-distractions .inline-footer,
    .dashboard-boss .inline-footer,
    .dashboard-titles .inline-footer,
    .dashboard-shop .inline-footer {
        flex: 0 0 32px;
        min-height: 32px;
        margin: 6px 10px 10px;
    }

    .task-line {
        min-height: 33px;
        padding: 2px 6px;
    }

    .dashboard-today .item-list {
        gap: 4px;
    }

    .task-line strong {
        font-size: 11px;
    }

    .distraction-note {
        min-height: 49px;
    }

    .dashboard-summary .card-body {
        height: calc(100% - 38px);
        padding: 5px 10px 10px;
    }

    .summary-layout {
        grid-template-columns: minmax(0, 1fr) 47%;
        height: 100%;
        gap: 10px;
    }

    .metric-list > div {
        min-height: 0;
        padding: 5px 9px;
        font-size: 10.5px;
        line-height: 1.2;
    }

    .dashboard-summary .metric-list > div + div {
        border-top: 1px solid rgba(94, 166, 202, .14);
    }

    .dashboard-summary .metric-list strong {
        font-size: 12px;
    }

    .dashboard-summary .metric-list {
        align-self: center;
        height: min(178px, 82%);
    }

    .reward-callout {
        min-height: 0;
        padding: 87px 8px 7px;
        justify-content: end;
    }

    .reward-callout::before {
        display: none;
    }

    .reward-art {
        position: absolute;
        inset: 0 0 auto;
        height: 100px;
        overflow: hidden;
        background: #03101d;
    }

    .reward-art::after {
        position: absolute;
        inset: auto 0 0;
        height: 22px;
        content: "";
        background: linear-gradient(180deg, transparent, rgba(40, 29, 20, .9));
        pointer-events: none;
    }

    .reward-art img {
        position: absolute;
        top: 0;
        right: auto;
        left: calc(50% - 79px);
        width: 158px;
        max-width: none;
        height: 100px;
        display: block;
        object-fit: cover;
        object-position: 50% 14%;
        transform: none;
    }

    .reward-art .reward-potato {
        display: none;
    }

    .reward-potato {
        position: absolute;
        z-index: 2;
        top: 15px;
        left: 8px;
        width: 55px;
        height: 70px;
        border-radius: 48% 43% 51% 46%;
        background: linear-gradient(145deg, #f2bd4d, #9b5725);
        box-shadow: inset 6px 3px 9px rgba(255,255,255,.18), 0 0 20px rgba(244, 182, 62, .32);
        transform: rotate(-12deg);
    }

    .reward-callout h3 {
        position: relative;
        z-index: 2;
        font-size: 15.5px;
        line-height: 1.05;
    }

    .reward-callout p {
        position: relative;
        z-index: 2;
        margin: 3px 0;
        font-size: 8.2px;
        line-height: 1.18;
    }

    .reward-callout .reward-pill {
        position: relative;
        z-index: 2;
    }

    .reward-callout.is-fresh .reward-art img {
        animation: reward-goblin-pop .75s cubic-bezier(.2, .85, .35, 1.2) both;
    }

    .boss-feature {
        flex: 1;
        grid-template-columns: minmax(250px, 274px) minmax(160px, 1fr);
        min-height: 0;
        margin: 0 9px;
    }

    .boss-visual {
        min-height: 0;
        background: #080f21;
    }

    .dashboard-boss > .card-header > span {
        display: none;
    }

    .dashboard-boss {
        position: absolute;
        overflow: visible;
        border-top-color: transparent;
        border-top-left-radius: 0;
    }

    .dashboard-boss::before {
        position: absolute;
        z-index: 2;
        top: 26px;
        right: -1px;
        left: 200px;
        height: 1px;
        content: "";
        background: linear-gradient(90deg, rgba(175, 89, 242, .49), rgba(72, 149, 185, .3));
    }

    .dashboard-boss > .card-header {
        position: relative;
        z-index: 3;
        align-self: flex-start;
        width: 164px;
        min-height: 38px;
        margin-top: -12px;
        margin-bottom: 12px;
        padding: 10px 13px 6px;
        border: 1px solid rgba(175, 89, 242, .49);
        border-right: 0;
        border-bottom: 0;
        border-radius: 14px 0 0;
        background:
            linear-gradient(135deg, rgba(127, 53, 177, .14), transparent 62%),
            #0a1b2b;
        box-shadow: 0 -6px 16px rgba(40, 11, 65, .1);
    }

    .dashboard-boss > .card-header::after {
        position: absolute;
        top: -1px;
        right: -36px;
        width: 36px;
        height: 39px;
        content: "";
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 39' preserveAspectRatio='none'%3E%3Cpath d='M0 0H4C16 0 20 8 23 17C27 28 30 35 36 38V39H0Z' fill='%230a1b2b'/%3E%3Cpath d='M0 .5H4C16 .5 20 8 23 17C27 28 30 35 36 38' fill='none' stroke='%23af59f2' stroke-opacity='.49'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
    }

    .dashboard-boss > .card-header h2 {
        color: #c681f4;
    }

    .dashboard-boss .boss-visual img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 50% 0;
        transform: translateY(-8px) scale(1.035);
        transform-origin: 50% 18%;
    }

    .dashboard-boss .boss-caption {
        display: block;
        inset: auto 10px 8px;
        text-shadow: 0 2px 5px rgba(0, 0, 0, .95);
    }

    .dashboard-boss .boss-caption h3 {
        font-size: 12px;
    }

    .boss-steps {
        align-content: start;
        gap: 3px;
        overflow: auto;
    }

    .boss-step {
        min-height: 22px;
        padding: 2px 5px;
        font-size: 10.5px;
        line-height: 1.15;
    }

    .dashboard-pause .pause-card-content {
        height: calc(100% - 38px);
        min-height: 0;
        padding: 10px 10px;
    }

    .pause-companion {
        position: absolute;
        z-index: 1;
        top: 8px;
        right: -12px;
        width: 148px;
        height: 132px;
        object-position: center bottom;
    }

    .pause-card-content h3,
    .pause-card-content > p {
        position: relative;
        z-index: 2;
        max-width: 60%;
    }

    .pause-card-content h3 {
        font-size: 15px;
    }

    .pause-card-content > p {
        min-height: 0;
        font-size: 11.5px;
        line-height: 1.28;
        overflow: hidden;
    }

    .pause-tags {
        position: relative;
        z-index: 2;
        flex: 0 0 auto;
        margin: 6px 0;
    }

    .pause-card-content .button {
        position: relative;
        z-index: 2;
        flex: 0 0 33px;
        min-height: 33px;
        margin-top: auto;
        font-size: 10px;
    }

    .medal-row,
    .shop-row {
        flex: 1;
        min-height: 0;
        align-items: center;
        padding: 2px 9px 0;
    }

    .shop-row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .mini-medal img {
        display: none;
    }

    .mini-medal::before {
        display: block;
        width: 100%;
        max-width: 58px;
        aspect-ratio: 1;
        margin: 0 auto 3px;
        content: "";
        background-image: url("../generated/medals-atlas.png");
        background-repeat: no-repeat;
        background-size: 500% auto;
        background-position-y: center;
        filter: drop-shadow(0 7px 9px rgba(0,0,0,.42));
        animation: character-breathe 3.8s ease-in-out infinite;
    }

    .mini-medal:nth-child(1)::before { background-position-x: 0; }
    .mini-medal:nth-child(2)::before { background-position-x: 25%; }
    .mini-medal:nth-child(3)::before { background-position-x: 50%; }
    .mini-medal:nth-child(4)::before { background-position-x: 75%; }
    .mini-medal:nth-child(5)::before { background-position-x: 100%; }

    .shop-mini img {
        display: none;
    }

    .shop-mini::before {
        display: block;
        width: 44px;
        aspect-ratio: 1;
        margin: 0 auto 3px;
        content: "";
        background-image: url("../generated/shop-atlas.png");
        background-repeat: no-repeat;
        background-size: 500% 200%;
        filter: drop-shadow(0 7px 9px rgba(0,0,0,.42));
    }

    .shop-mini:nth-child(1)::before { background-position: 0 0; }
    .shop-mini:nth-child(2)::before { background-position: 25% 0; }
    .shop-mini:nth-child(3)::before { background-position: 50% 0; }
    .shop-mini:nth-child(4)::before { background-position: 75% 0; }
    .shop-mini:nth-child(5)::before { background-position: 100% 0; }

    .shop-mini {
        padding: 5px 3px;
    }

    .mini-medal strong {
        min-height: 36px;
        font-size: 9.5px;
        line-height: 1.2;
        -webkit-line-clamp: 3;
    }

    .shop-mini strong {
        min-height: 22px;
        font-size: 9px;
        line-height: 1.2;
    }

    .shop-mini img {
        width: 52px;
        height: 52px;
    }

    .dashboard-advice .card-header {
        position: relative;
        z-index: 2;
    }

    .advice-card {
        position: relative;
        height: calc(100% - 38px);
        min-height: 0;
        overflow: hidden;
        background:
            radial-gradient(circle at 76% 38%, rgba(58, 91, 167, .22), transparent 44%),
            linear-gradient(90deg, rgba(5, 19, 34, .96), rgba(4, 12, 28, .7));
    }

    .advice-card img {
        position: absolute;
        top: -16px;
        right: -22px;
        display: block;
        width: 70%;
        height: calc(100% + 82px);
        object-fit: cover;
        object-position: 50% 23%;
        filter: drop-shadow(0 10px 15px rgba(0,0,0,.42));
        animation: none;
    }

    .advice-card::before {
        display: none;
    }

    .advice-card blockquote {
        position: absolute;
        z-index: 2;
        top: 4px;
        left: 10px;
        bottom: 39px;
        width: 54%;
        padding: 5px 6px;
        background: transparent;
        color: #d8e7f2;
        font-size: 10.5px;
        line-height: 1.24;
        overflow: hidden;
    }

    .advice-card blockquote.is-long {
        font-size: 9.6px;
        line-height: 1.2;
    }

    .advice-card blockquote span,
    .advice-card blockquote small {
        display: block;
    }

    .advice-card blockquote small {
        margin-top: 4px;
        padding-top: 4px;
        border-top: 1px solid rgba(148, 113, 231, .35);
        color: #d7bbff;
        font-size: 9px;
        font-style: normal;
        line-height: 1.22;
    }

    .advice-card .inline-footer {
        position: absolute;
        z-index: 3;
        right: 8px;
        bottom: 8px;
        left: 8px;
        min-height: 27px;
        margin: 0;
    }

    .backup-actions {
        grid-template-columns: minmax(0, 1fr) minmax(112px, 42%);
        gap: 5px 7px;
        height: calc(100% - 38px);
        padding: 5px 9px 9px;
    }

    .backup-actions p {
        grid-row: 1 / 5;
        align-self: start;
        margin: 0;
        padding: 4px;
        font-size: 8px;
    }

    .backup-actions .button {
        min-height: 28px;
        padding: 4px 6px;
        font-size: 8px;
    }
}

@media (min-width: 1650px) and (min-aspect-ratio: 17 / 9) {
    :root {
        --community-rail: clamp(265px, 17vw, 294px);
    }

    .app-shell:has(> .community-rail) {
        grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--community-rail);
    }

    .app-shell.community-is-collapsed {
        grid-template-columns: var(--sidebar) minmax(0, 1fr) 68px;
    }

    /*
     * Le volet Communauté retire près de 300 px à la scène centrale. Dans cet
     * état seulement, les commandes du chrono doivent rester au-dessus du
     * débordement volontaire de l'illustration du compagnon.
     */
    .app-shell:not(.community-is-collapsed) .timer-actions,
    .app-shell:not(.community-is-collapsed) .timer-next-break {
        position: relative;
        z-index: 4;
    }

    .app-shell:not(.community-is-collapsed) .dashboard-today .task-line {
        padding-inline: 5px;
    }

    .app-shell:not(.community-is-collapsed) .dashboard-today .task-line strong {
        font-size: 10.5px;
    }

    .community-rail {
        position: relative;
        z-index: 40;
        display: flex;
        flex-direction: column;
        min-width: 0;
        height: 100dvh;
        padding: 14px 12px 12px;
        overflow: hidden;
        border-left: 1px solid rgba(63, 151, 191, .3);
        background:
            radial-gradient(circle at 50% 12%, rgba(125, 75, 205, .16), transparent 27%),
            linear-gradient(180deg, #07182a, #061421 64%, #08192a);
        box-shadow: -16px 0 38px rgba(0, 0, 0, .24);
    }

    .community-header,
    .community-identity,
    .community-tabs,
    .community-privacy,
    .community-feed li,
    .community-compose {
        display: flex;
        align-items: center;
    }

    .community-header {
        justify-content: space-between;
        min-height: 60px;
        padding: 6px 5px 12px;
    }

    .community-header .eyebrow {
        display: block;
        margin-bottom: 4px;
        color: #a7cde4;
        font-size: 9px;
    }

    .community-header strong {
        color: #f1f7ff;
        font-size: 20px;
    }

    .community-collapse {
        display: grid;
        width: 34px;
        height: 34px;
        border: 1px solid rgba(112, 181, 215, .26);
        border-radius: 9px;
        background: rgba(15, 45, 68, .72);
        color: #dff3ff;
        cursor: pointer;
        font-size: 23px;
        place-items: center;
    }

    .community-header-actions {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .community-settings {
        display: grid;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 1px solid rgba(112, 181, 215, .26);
        border-radius: 9px;
        background: rgba(15, 45, 68, .72);
        color: #dff3ff;
        cursor: pointer;
        place-items: center;
    }

    .community-identity {
        gap: 9px;
        min-height: 66px;
        padding: 8px;
        border: 1px solid rgba(101, 173, 204, .22);
        border-radius: 12px;
        background: rgba(8, 33, 52, .78);
    }

    .community-avatar {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        overflow: hidden;
        border: 2px solid rgba(95, 202, 147, .55);
        border-radius: 50%;
        background: #06111f;
    }

    .community-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 50% 15%;
        transform: scale(2.25);
        transform-origin: 50% 16%;
    }

    .community-alias-editor {
        min-width: 0;
        flex: 1;
    }

    .community-alias-view {
        min-width: 0;
    }

    .community-alias-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 28px 28px;
        gap: 4px;
        min-width: 0;
    }

    .community-alias-form label {
        min-width: 0;
    }

    .community-alias-form input {
        width: 100%;
        min-width: 0;
        height: 28px;
        padding: 4px 6px;
        border: 1px solid rgba(98, 190, 219, .34);
        border-radius: 7px;
        background: rgba(4, 20, 33, .9);
        color: #f5fbff;
        font-size: 10px;
        outline: none;
    }

    .community-alias-form input:focus {
        border-color: #62d6f6;
        box-shadow: 0 0 0 2px rgba(98, 214, 246, .12);
    }

    .community-alias-form button {
        width: 28px;
        height: 28px;
        padding: 0;
        font-size: 12px;
    }

    .community-identity small,
    .community-identity strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .community-identity small {
        color: #94afc1;
        font-size: 9px;
    }

    .community-identity strong {
        margin-top: 2px;
        color: #fff0b9;
        font-size: 12px;
    }

    .community-identity button {
        padding: 5px 7px;
        border: 1px solid rgba(225, 182, 89, .26);
        border-radius: 7px;
        background: rgba(115, 76, 24, .36);
        color: #ffdc88;
        cursor: pointer;
        font-size: 9px;
    }

    .community-tabs {
        gap: 5px;
        padding: 12px 0 8px;
    }

    .community-tabs button {
        flex: 1;
        min-height: 34px;
        border: 1px solid rgba(92, 169, 204, .22);
        border-radius: 8px;
        background: rgba(9, 32, 50, .78);
        color: #9eb9ca;
        cursor: pointer;
        font-size: 10px;
        font-weight: 800;
    }

    .community-tabs button.is-active {
        border-color: rgba(177, 99, 244, .5);
        background: linear-gradient(180deg, rgba(112, 53, 159, .7), rgba(53, 34, 94, .76));
        color: #f4e7ff;
    }

    .community-panel {
        display: flex;
        flex: 1;
        min-height: 0;
        flex-direction: column;
        gap: 10px;
    }

    .community-privacy {
        gap: 8px;
        padding: 9px;
        border: 1px solid rgba(77, 172, 149, .24);
        border-radius: 10px;
        background: rgba(8, 54, 50, .48);
    }

    .community-privacy > span {
        color: #7de1c9;
        font-size: 18px;
    }

    .community-privacy p,
    .community-feed p {
        margin: 0;
    }

    .community-privacy strong,
    .community-privacy small {
        display: block;
    }

    .community-privacy strong {
        color: #d8fff5;
        font-size: 10px;
    }

    .community-privacy small {
        margin-top: 2px;
        color: #9fc8c0;
        font-size: 8px;
        line-height: 1.35;
    }

    .community-empty {
        display: grid;
        flex: 1;
        min-height: 0;
        grid-template-rows: auto auto auto;
        padding: 18px;
        border: 1px dashed rgba(103, 168, 201, .25);
        border-radius: 12px;
        align-content: center;
        text-align: center;
    }

    .community-empty-art {
        z-index: 0;
        width: min(150px, 76%);
        max-height: 225px;
        margin: 0 auto 8px;
        object-fit: cover;
        object-position: 50% 38%;
        filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .42));
    }

    .community-empty strong {
        position: relative;
        z-index: 1;
        margin-top: 8px;
        color: #e9f6ff;
        font-size: 13px;
    }

    .community-empty p {
        position: relative;
        z-index: 1;
        margin: 7px 0 0;
        color: #9eb5c5;
        font-size: 9px;
        line-height: 1.5;
    }

    .community-compose {
        gap: 6px;
    }

    .community-compose input {
        min-width: 0;
        flex: 1;
    }

    .community-compose input,
    .community-compose button {
        min-height: 36px;
        border: 1px solid rgba(92, 169, 204, .2);
        border-radius: 8px;
        background: rgba(5, 23, 38, .82);
        color: #9eb5c5;
        font-size: 9px;
    }

    .community-compose input {
        padding: 7px 9px;
    }

    .community-compose button {
        padding: 7px 9px;
    }

    .community-feed {
        display: grid;
        gap: 8px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .community-feed li {
        gap: 9px;
        min-height: 54px;
        padding: 8px 9px;
        border: 1px solid rgba(132, 101, 204, .24);
        border-radius: 10px;
        background: rgba(26, 24, 60, .6);
    }

    .community-feed li > span {
        font-size: 21px;
    }

    .community-feed strong,
    .community-feed small {
        display: block;
    }

    .community-feed strong {
        color: #f3eaff;
        font-size: 10px;
    }

    .community-feed small {
        margin-top: 2px;
        color: #bfaadb;
        font-size: 9px;
    }

    .community-collapsed-label {
        display: none;
    }

    .community-rail.is-collapsed {
        position: relative;
        align-items: center;
        padding: 14px 9px;
        overflow: hidden;
    }

    .community-rail.is-collapsed::before,
    .community-rail.is-collapsed::after {
        position: absolute;
        content: "";
    }

    .community-rail.is-collapsed::before {
        inset: 60px 2px 10px;
        opacity: .9;
        background: url("../icons/community-vine.svg") center top / 62px 248px repeat-y;
        filter: drop-shadow(0 0 7px rgba(102, 176, 104, .38));
    }

    .community-rail.is-collapsed::after {
        inset: 58px 5px 8px;
        border: 1px solid rgba(205, 184, 101, .18);
        border-radius: 24px;
        box-shadow:
            inset 0 0 18px rgba(61, 116, 74, .18),
            0 0 18px rgba(67, 125, 86, .12);
    }

    .community-rail.is-collapsed .community-header {
        width: 100%;
        justify-content: center;
        padding: 0;
    }

    .community-rail.is-collapsed .community-header > div,
    .community-rail.is-collapsed .community-identity,
    .community-rail.is-collapsed .community-tabs,
    .community-rail.is-collapsed .community-panel,
    .community-rail.is-collapsed .community-login-gate {
        display: none;
    }

    .community-rail.is-collapsed .community-collapse {
        transform: rotate(180deg);
    }

    .community-rail.is-collapsed .community-settings {
        display: none;
    }

    .community-rail.is-collapsed .community-collapsed-label {
        position: relative;
        z-index: 2;
        display: grid;
        flex: 1;
        width: 38px;
        margin-top: 12px;
        padding: 22px 7px;
        border: 1px solid rgba(210, 186, 98, .38);
        border-radius: 19px;
        background:
            linear-gradient(180deg, rgba(8, 30, 35, .9), rgba(28, 27, 58, .9)),
            radial-gradient(circle, rgba(105, 158, 92, .22), transparent 62%);
        box-shadow:
            inset 0 0 0 1px rgba(103, 166, 102, .12),
            0 8px 24px rgba(0, 0, 0, .3);
        color: #f0dfa2;
        font-size: 14px;
        font-weight: 800;
        letter-spacing: 1.9px;
        place-items: center;
        text-shadow: 0 0 10px rgba(156, 203, 119, .38);
        text-transform: uppercase;
        writing-mode: vertical-rl;
    }

    .community-rail.is-guest.is-collapsed .community-collapsed-label {
        display: none;
    }
}

/* ChronoQuest 1.2 — identité de héros, chat public et cosmétiques réels. */
.hero-avatar {
    position: relative;
    display: inline-block;
    overflow: hidden;
    flex: 0 0 auto;
    border: 2px solid rgba(102, 200, 162, .58);
    border-radius: 50%;
    background-color: #071427;
    background-repeat: no-repeat;
    background-position: 0 0;
    background-size: 500% 500%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .34);
    isolation: isolate;
}

.hero-avatar.hero-atlas-1 { background-image: url("../heroes/heroes-atlas-01.png") !important; }
.hero-avatar.hero-atlas-2 { background-image: url("../heroes/heroes-atlas-02.png") !important; }
.hero-avatar.hero-slot-0 { background-position: 0% 0%; }
.hero-avatar.hero-slot-1 { background-position: 25% 0%; }
.hero-avatar.hero-slot-2 { background-position: 50% 0%; }
.hero-avatar.hero-slot-3 { background-position: 75% 0%; }
.hero-avatar.hero-slot-4 { background-position: 100% 0%; }
.hero-avatar.hero-slot-5 { background-position: 0% 25%; }
.hero-avatar.hero-slot-6 { background-position: 25% 25%; }
.hero-avatar.hero-slot-7 { background-position: 50% 25%; }
.hero-avatar.hero-slot-8 { background-position: 75% 25%; }
.hero-avatar.hero-slot-9 { background-position: 100% 25%; }
.hero-avatar.hero-slot-10 { background-position: 0% 50%; }
.hero-avatar.hero-slot-11 { background-position: 25% 50%; }
.hero-avatar.hero-slot-12 { background-position: 50% 50%; }
.hero-avatar.hero-slot-13 { background-position: 75% 50%; }
.hero-avatar.hero-slot-14 { background-position: 100% 50%; }
.hero-avatar.hero-slot-15 { background-position: 0% 75%; }
.hero-avatar.hero-slot-16 { background-position: 25% 75%; }
.hero-avatar.hero-slot-17 { background-position: 50% 75%; }
.hero-avatar.hero-slot-18 { background-position: 75% 75%; }
.hero-avatar.hero-slot-19 { background-position: 100% 75%; }
.hero-avatar.hero-slot-20 { background-position: 0% 100%; }
.hero-avatar.hero-slot-21 { background-position: 25% 100%; }
.hero-avatar.hero-slot-22 { background-position: 50% 100%; }
.hero-avatar.hero-slot-23 { background-position: 75% 100%; }
.hero-avatar.hero-slot-24 { background-position: 100% 100%; }

.hero-avatar.cosmetic-shop-01,
.hero-avatar.cosmetic-shop-13,
.hero-avatar.cosmetic-shop-25 {
    background-color: #173725;
    box-shadow: 0 0 0 4px rgba(60, 139, 92, .18), 0 0 28px rgba(66, 175, 116, .30);
}

.hero-avatar[class*="cosmetic-shop-04"]::before,
.hero-avatar[class*="cosmetic-shop-12"]::before,
.hero-avatar[class*="cosmetic-shop-16"]::before,
.hero-avatar[class*="cosmetic-shop-24"]::before,
.hero-avatar[class*="cosmetic-shop-28"]::before {
    position: absolute;
    z-index: 2;
    inset: 0;
    border-radius: inherit;
    content: "";
    background:
        radial-gradient(circle at 20% 25%, #ffe483 0 2px, transparent 3px),
        radial-gradient(circle at 78% 32%, #bc78ff 0 2px, transparent 3px),
        radial-gradient(circle at 64% 78%, #6ce5cf 0 2px, transparent 3px);
    animation: hero-aura 3.8s ease-in-out infinite;
    pointer-events: none;
}

.hero-cosmetic {
    position: absolute;
    z-index: 4;
    display: block;
    border: 0;
    background: transparent;
    font-style: normal;
    pointer-events: none;
}

.hero-frame-overlay {
    position: absolute;
    z-index: 7;
    inset: 2.5%;
    border: clamp(2px, .024em, 5px) double #d49a45;
    border-radius: inherit;
    box-shadow:
        inset 0 0 0 1px rgba(255, 232, 165, .65),
        inset 0 0 16px rgba(203, 119, 42, .28),
        0 0 0 2px rgba(92, 48, 18, .78);
    pointer-events: none;
}

.hero-frame-overlay::before,
.hero-frame-overlay::after {
    position: absolute;
    left: 50%;
    width: 13%;
    aspect-ratio: 1;
    border: 1px solid #ffe19a;
    content: "";
    background: linear-gradient(135deg, #6d351c, #d28b3d 46%, #6ce0ac 48% 66%, #7a3f20 68%);
    box-shadow: 0 0 0 2px #5b2f1b, 0 0 9px rgba(239, 177, 80, .55);
    transform: translateX(-50%) rotate(45deg);
}

.hero-frame-overlay::before { top: -5%; }
.hero-frame-overlay::after { bottom: -5%; }

.hero-frame-overlay.frame-shop-14 {
    border-color: #9fd2dd;
    box-shadow: inset 0 0 0 2px rgba(132, 196, 211, .48), 0 0 0 2px rgba(40, 92, 105, .76);
}

.hero-frame-overlay.frame-shop-26 {
    border-color: #c7a2ff;
    box-shadow: inset 0 0 12px rgba(157, 104, 227, .46), 0 0 0 2px rgba(56, 38, 91, .86);
}

.hero-cosmetic-bell {
    top: 72%;
    left: 45%;
    width: 10%;
    aspect-ratio: .9;
    border-radius: 52% 52% 24% 24%;
    background: linear-gradient(90deg, #9c5b14, #ffe078 45%, #ba711b);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .48);
    clip-path: polygon(36% 0, 64% 0, 70% 15%, 78% 24%, 96% 82%, 82% 100%, 18% 100%, 4% 82%, 22% 24%, 30% 15%);
}

.hero-cosmetic-bell::after {
    position: absolute;
    right: 34%;
    bottom: -10%;
    left: 34%;
    aspect-ratio: 1;
    border-radius: 50%;
    content: "";
    background: #f2bb42;
}

.hero-cosmetic-hat {
    top: 1%;
    left: 15%;
    width: 70%;
    height: 29%;
    border-radius: 55% 45% 12% 16%;
    background: linear-gradient(160deg, transparent 0 13%, #3e1f55 14% 34%, #7350a0 35% 44%, #211731 46% 100%);
    clip-path: polygon(48% 0, 72% 58%, 96% 75%, 91% 93%, 52% 84%, 8% 98%, 2% 81%, 31% 61%);
    filter: drop-shadow(0 5px 3px rgba(0, 0, 0, .5));
}

.hero-cosmetic-hat::after {
    position: absolute;
    right: 8%;
    bottom: 14%;
    left: 8%;
    height: 12%;
    border-radius: 999px;
    content: "";
    background: #d7a541;
}

.hero-cosmetic-glasses {
    top: 31%;
    left: 19%;
    width: 62%;
    height: 19%;
    background: linear-gradient(90deg, transparent 44%, #bd7b32 45% 55%, transparent 56%);
}

.hero-cosmetic-glasses::before,
.hero-cosmetic-glasses::after {
    position: absolute;
    top: 0;
    width: 39%;
    aspect-ratio: 1.28;
    border: clamp(1px, .018em, 4px) solid #b8792e;
    border-radius: 48%;
    content: "";
    background: rgba(43, 128, 137, .19);
    box-shadow: inset 0 0 7px rgba(109, 219, 225, .32), 0 2px 3px rgba(0, 0, 0, .55);
}

.hero-cosmetic-glasses::before { left: 0; }
.hero-cosmetic-glasses::after { right: 0; }

.hero-cosmetic-cape {
    z-index: 3;
    right: 5%;
    bottom: 0;
    left: 5%;
    height: 42%;
    border-radius: 45% 45% 8% 8%;
    background: linear-gradient(90deg, rgba(43, 18, 72, .78), rgba(101, 54, 139, .58), rgba(38, 16, 65, .8));
    clip-path: polygon(4% 18%, 32% 0, 50% 16%, 68% 0, 96% 18%, 87% 100%, 13% 100%);
    mix-blend-mode: screen;
}

.hero-cosmetic-scarf {
    top: 58%;
    left: 14%;
    width: 72%;
    height: 14%;
    border: clamp(2px, .025em, 5px) solid #be4e3f;
    border-top-color: #f09b62;
    border-radius: 46%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .4);
}

.hero-cosmetic-feather {
    top: 8%;
    right: 10%;
    width: 10%;
    height: 36%;
    border-radius: 90% 0 90% 0;
    background: linear-gradient(90deg, #7044a6, #f1ce78 45%, #fff5bc);
    transform: rotate(28deg);
    transform-origin: bottom;
}

.hero-cosmetic-ribbon {
    top: 61%;
    left: 18%;
    width: 16%;
    height: 28%;
    background: linear-gradient(90deg, #7b2c8f, #d888e6, #542069);
    clip-path: polygon(0 0, 100% 0, 82% 100%, 50% 78%, 18% 100%);
}

.hero-cosmetic-compass,
.hero-cosmetic-brooch,
.hero-cosmetic-potato {
    top: 65%;
    left: 44%;
    width: 13%;
    aspect-ratio: 1;
    border: clamp(1px, .015em, 3px) solid #ffe28d;
    border-radius: 50%;
    background: radial-gradient(circle, #55c8a1 0 18%, #d99b34 20% 52%, #6f3f18 54%);
    box-shadow: 0 3px 7px rgba(0, 0, 0, .46);
}

.hero-cosmetic-brooch { left: 61%; background: radial-gradient(circle, #d6fff0, #45a985 34%, #c38d39 38%); }
.hero-cosmetic-potato { left: 61%; border-radius: 48% 42% 50% 45%; background: radial-gradient(circle at 35% 32%, #ffe58c, #c9842e 62%, #7a431a); transform: rotate(12deg); }

.hero-cosmetic-hammer,
.hero-cosmetic-umbrella,
.hero-cosmetic-satchel,
.hero-cosmetic-jar,
.hero-cosmetic-mug {
    right: 5%;
    bottom: 8%;
    width: 20%;
    height: 27%;
    border: clamp(1px, .014em, 3px) solid rgba(255, 226, 158, .76);
    border-radius: 18% 18% 30% 30%;
    background: linear-gradient(145deg, #8a5428, #dca34c 52%, #5e351e);
    box-shadow: 0 4px 7px rgba(0, 0, 0, .45);
}

.hero-cosmetic-hammer { width: 11%; height: 35%; border-radius: 3px; transform: rotate(34deg); }
.hero-cosmetic-umbrella { top: 12%; right: 2%; bottom: auto; width: 30%; height: 15%; border-radius: 100% 100% 8% 8%; background: #563980; }
.hero-cosmetic-satchel { right: 10%; width: 25%; height: 20%; }
.hero-cosmetic-jar { background: linear-gradient(145deg, rgba(126, 213, 205, .66), rgba(43, 109, 117, .76)); }
.hero-cosmetic-mug { width: 18%; height: 18%; border-radius: 4px 4px 28% 28%; }

.hero-cosmetic-antenna {
    top: 0;
    left: 48%;
    width: 4%;
    height: 23%;
    border-radius: 999px;
    background: #88d7e2;
}

.hero-cosmetic-antenna::before {
    position: absolute;
    top: -10%;
    left: -85%;
    width: 270%;
    aspect-ratio: 1;
    border-radius: 50%;
    content: "";
    background: #dfff72;
    box-shadow: 0 0 8px #8aff70;
}

.topbar-hero-avatar .hero-cosmetic {
    filter: saturate(1.1);
}

.medal-card[role="button"] {
    cursor: pointer;
}

.medal-card.is-selected {
    border-color: #ffd46c;
    box-shadow: 0 0 0 2px rgba(255, 205, 92, .32), 0 14px 34px rgba(0, 0, 0, .38);
}

.medal-card.is-selected::after {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    content: "✓";
    background: #d69b2d;
    color: #fff7d8;
    font-weight: 900;
    place-items: center;
}

.hero-avatar-label {
    position: absolute;
    z-index: 5;
    right: 5%;
    bottom: 5%;
    left: 5%;
    display: none;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(3, 15, 27, .86);
    text-align: center;
}

.hero-avatar-label strong,
.hero-avatar-label small { display: block; }

.hero-avatar-label small { color: #d8b4ff; font-size: 10px; }

.community-alias-view > span {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: #d9b5ff;
    font-size: 8px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.community-messages {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0 2px 2px;
    overflow: auto;
    list-style: none;
    scrollbar-color: rgba(99, 188, 222, .38) transparent;
    scrollbar-width: thin;
}

.community-message {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(82, 152, 188, .22);
    border-radius: 10px;
    background: rgba(7, 28, 45, .76);
}

.community-message.is-own {
    border-color: rgba(167, 97, 228, .34);
    background: rgba(38, 24, 66, .64);
}

.community-message-avatar,
.community-feed-avatar {
    width: 34px;
    height: 34px;
}

.community-message header {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 5px;
}

.community-message header strong {
    overflow: hidden;
    color: #fff2bd;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.community-message header span {
    overflow: hidden;
    color: #c7a5e8;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.community-message p {
    margin: 4px 0;
    color: #d8e8f2;
    font-size: 10px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.community-message footer {
    display: flex;
    justify-content: space-between;
    color: #7994a6;
    font-size: 8px;
}

.community-message footer button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #d49a9f;
    cursor: pointer;
    font-size: 8px;
}

.community-compose label {
    display: flex;
    min-width: 0;
    flex: 1;
}

.community-compose input { width: 100%; }

.community-login-gate {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(223, 176, 82, .24);
    border-radius: 10px;
    background: rgba(66, 46, 18, .28);
    text-align: center;
}

.community-login-gate > span {
    color: #f0c75b;
    font-size: 34px;
}

.community-login-gate > strong {
    color: #fff1c4;
}

.community-login-gate p {
    margin: 0;
    color: #d9c79e;
    font-size: 9px;
}

.community-empty[hidden] { display: none !important; }

.community-feed-avatar {
    flex: 0 0 34px;
    font-size: 0 !important;
}

.community-achievement-status {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 7px;
    padding: 9px;
    border: 1px solid rgba(220, 173, 84, .24);
    border-radius: 10px;
    background: rgba(71, 48, 18, .34);
}

.community-achievement-status p {
    min-width: 0;
    margin: 0;
}

.community-achievement-status strong,
.community-achievement-status small {
    display: block;
}

.community-achievement-status strong {
    color: #ffe49b;
    font-size: 10px;
}

.community-achievement-status small {
    margin-top: 3px;
    color: #cbbd9d;
    font-size: 8px;
    line-height: 1.35;
}

.community-achievement-status button {
    min-height: 30px;
    padding: 5px 7px;
    border: 1px solid rgba(230, 190, 101, .3);
    border-radius: 7px;
    background: rgba(109, 72, 25, .52);
    color: #ffe5a0;
    cursor: pointer;
    font-size: 9px;
    font-weight: 800;
}

.hero-profile-dialog {
    width: min(1050px, calc(100vw - 30px));
    max-height: min(850px, calc(100dvh - 30px));
}

.music-upload-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0 18px;
    padding: 14px;
    border: 1px solid rgba(104, 180, 215, .26);
    border-radius: 12px;
    background: rgba(6, 27, 43, .72);
}

.music-context-guide {
    margin: 14px 0;
    padding: 14px 16px;
    border: 1px solid rgba(180, 129, 224, .28);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(40, 25, 67, .7), rgba(7, 31, 44, .78));
    color: #d9e9f4;
}

.music-context-guide > strong {
    color: #e6c96f;
    font-size: 13px;
}

.music-context-guide ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 20px;
    margin: 11px 0;
    padding-left: 18px;
}

.music-context-guide li,
.music-context-guide p {
    color: #a8c2d3;
    font-size: 10px;
    line-height: 1.45;
}

.music-context-guide b { color: #ecf7ff; }
.music-context-guide p { margin: 0; }

.music-upload-form label,
.music-track-row label {
    display: grid;
    gap: 5px;
    color: #b9d5e5;
    font-size: 10px;
}

.music-upload-form input,
.music-upload-form select,
.music-track-row input,
.music-track-row select {
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid rgba(95, 169, 204, .28);
    border-radius: 8px;
    background: #071a2b;
    color: #ecf7ff;
}

.music-upload-form p {
    margin: 0;
    color: #90aabd;
    font-size: 10px;
}

.music-track-list {
    display: grid;
    gap: 9px;
}

.music-track-row {
    display: grid;
    grid-template-columns: 34px minmax(150px, 1fr) minmax(190px, 1.15fr) 74px auto auto;
    align-items: end;
    gap: 9px;
    padding: 10px;
    border: 1px solid rgba(107, 172, 203, .22);
    border-radius: 10px;
    background: rgba(9, 29, 46, .74);
}

.music-track-row > span {
    align-self: center;
    color: #e8bf5b;
    font-size: 25px;
    text-align: center;
}

.music-track-row > small {
    grid-column: 2 / 5;
    color: #8fa8b9;
    font-size: 9px;
}

.music-credit-fields {
    display: grid;
    grid-column: 2 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.music-enabled {
    display: flex !important;
    min-height: 38px;
    align-items: center;
    gap: 6px;
}

.music-enabled input {
    min-height: auto;
}

.music-credit-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 12px;
}

.music-credit-list article {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid rgba(96, 172, 205, .2);
    border-radius: 10px;
    background: rgba(7, 28, 45, .7);
}

.music-credit-list strong { color: #edf8ff; }
.music-credit-list span { color: #d7bd76; font-size: 11px; }
.music-credit-list a { color: #79d4f4; font-size: 10px; }
.music-credit-list small { color: #91aabc; font-size: 10px; }

.hero-profile-card {
    width: auto;
    max-height: inherit;
}

.hero-profile-card > [data-hero-profile-content] {
    min-height: 0;
    overflow: auto;
}

.hero-profile-layout {
    display: grid;
    grid-template-columns: minmax(240px, .75fr) minmax(330px, 1.25fr);
    gap: 18px;
    margin-bottom: 18px;
}

.hero-profile-preview,
.hero-profile-controls,
.hero-portrait-picker {
    padding: 16px;
    border: 1px solid rgba(93, 167, 202, .25);
    border-radius: 14px;
    background: rgba(6, 26, 42, .76);
}

.hero-profile-preview {
    display: grid;
    place-items: center;
    text-align: center;
}

.hero-avatar-large {
    width: min(240px, 70vw);
    height: min(240px, 70vw);
    border-radius: 22%;
}

.hero-avatar-large .hero-avatar-label { display: block; }

.hero-profile-preview p,
.hero-portrait-picker header p {
    margin: 12px 0 0;
    color: #9eb5c5;
    font-size: 12px;
}

.hero-profile-controls {
    display: grid;
    align-content: start;
    gap: 14px;
}

.hero-profile-controls > label:not(.hero-sharing-setting) {
    display: grid;
    gap: 6px;
    color: #d7e8f3;
    font-size: 12px;
    font-weight: 800;
}

.hero-profile-controls input,
.hero-profile-controls select {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(100, 183, 218, .3);
    border-radius: 9px;
    background: #071c2e;
    color: #f2f8ff;
}

.hero-selected-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(191, 135, 230, .28);
    border-radius: 10px;
    background: rgba(52, 33, 76, .55);
}

.hero-selected-title span,
.hero-selected-title small { display: block; }
.hero-selected-title small {
    margin-top: 4px;
    color: #dfbaf1;
    font-size: 11px;
}

.hero-progression {
    padding: 12px;
    border: 1px solid rgba(103, 216, 182, .25);
    border-radius: 10px;
    background: rgba(12, 56, 54, .58);
}

.hero-progression > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hero-progression > div span,
.hero-progression > div small,
.hero-progression > div strong {
    display: block;
}

.hero-progression > div small {
    color: #92c9bc;
    font-size: 9px;
    text-transform: uppercase;
}

.hero-progression > div strong {
    margin-top: 2px;
    color: #e9fff7;
    font-size: 17px;
}

.hero-progression > div b {
    color: #f3cd75;
    font-size: 13px;
}

.hero-progression-track {
    display: block;
    height: 8px;
    margin: 9px 0 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #0b2635;
}

.hero-progression-track i {
    display: block;
    width: var(--progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5dc99f, #8ed978, #efc45f);
}

.hero-progression p {
    margin: 0;
    color: #a6c4bd;
    font-size: 9px;
    line-height: 1.4;
}

.hero-sharing-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(19, 58, 57, .6);
}

.hero-sharing-setting span,
.hero-sharing-setting small { display: block; }
.hero-sharing-setting small { color: #9bcac1; font-size: 10px; }

.hero-sharing-setting input {
    position: relative;
    width: 46px;
    height: 25px;
    flex: 0 0 46px;
    appearance: none;
    border: 1px solid rgba(107, 184, 167, .38);
    border-radius: 999px;
    background: #10283a;
    cursor: pointer;
}

.hero-sharing-setting input::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    content: "";
    background: #91a8b7;
    transition: transform .18s ease, background .18s ease;
}

.hero-sharing-setting input:checked {
    border-color: rgba(111, 219, 179, .58);
    background: #216a59;
}

.hero-sharing-setting input:checked::after {
    background: #eafff7;
    transform: translateX(21px);
}

.hero-equipped {
    padding: 12px;
    border-radius: 10px;
    background: rgba(52, 33, 76, .55);
}

.hero-equipped strong,
.hero-equipped span { display: block; }
.hero-equipped span { margin-top: 5px; color: #cbb4df; font-size: 11px; }

.economy-ledger {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(225, 178, 83, .24);
    border-radius: 14px;
    background:
        radial-gradient(circle at 4% 0, rgba(234, 185, 80, .1), transparent 30%),
        rgba(6, 26, 42, .76);
}

.economy-ledger > header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.economy-ledger h3,
.economy-ledger p {
    margin: 0;
}

.economy-ledger header p {
    margin-top: 3px;
    color: #9eb5c5;
    font-size: 10px;
}

.economy-ledger header > span {
    color: #f0cd77;
    font-size: 10px;
    white-space: nowrap;
}

.economy-ledger > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.economy-ledger article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 9px;
    border: 1px solid rgba(96, 155, 185, .16);
    border-radius: 8px;
    background: rgba(6, 20, 32, .72);
}

.economy-ledger article span,
.economy-ledger article small {
    display: block;
}

.economy-ledger article strong {
    color: #e9f5ff;
    font-size: 10px;
}

.economy-ledger article small {
    margin-top: 2px;
    color: #829dad;
    font-size: 8px;
}

.economy-ledger article b {
    color: #f0cd77;
    font-size: 10px;
    white-space: nowrap;
}

.economy-ledger article.is-reversed {
    opacity: .48;
}

.economy-ledger article.is-reversed b {
    text-decoration: line-through;
}

.economy-ledger .empty-ledger {
    grid-column: 1 / -1;
    color: #9eb5c5;
    font-size: 10px;
}

.hero-portrait-picker header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.hero-portrait-picker h3 { margin: 0; }

.hero-portrait-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
}

.hero-portrait-option {
    display: grid;
    min-width: 0;
    gap: 5px;
    padding: 8px;
    border: 1px solid rgba(92, 169, 204, .22);
    border-radius: 10px;
    background: rgba(8, 31, 49, .78);
    color: #e8f4fb;
    cursor: pointer;
    text-align: left;
}

.hero-portrait-option.is-selected {
    border-color: #e6b14b;
    box-shadow: 0 0 0 2px rgba(230, 177, 75, .16);
}

.hero-portrait-option.is-locked {
    cursor: default;
    filter: grayscale(.8);
    opacity: .56;
}

.hero-portrait-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 9px;
}

.hero-portrait-option > span {
    overflow: hidden;
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-portrait-option > small { color: #98adbc; font-size: 8px; }

.shop-card.is-hero-portrait {
    padding-top: 12px;
}

.shop-card.is-hero-portrait::before {
    display: none;
}

.shop-hero-portrait {
    display: block;
    width: 92px;
    height: 92px;
    margin: 0 auto 8px;
    border-radius: 14px;
}

.hero-settings-preview {
    display: grid;
    margin: 8px 0 14px;
    place-items: center;
}

.hero-settings-avatar {
    width: 128px;
    height: 128px;
    border-radius: 20px;
}

.hero-settings-avatar .hero-avatar-label { display: block; }

.setting-range input[type="range"] {
    width: min(210px, 42%);
    accent-color: var(--gold);
}

.equipped-shop-07 .dashboard-timer,
.equipped-shop-07 .focus-stage {
    background:
        linear-gradient(rgba(9, 28, 42, .90), rgba(5, 18, 30, .94)),
        repeating-linear-gradient(90deg, transparent 0 24px, rgba(209, 173, 95, .08) 25px 26px);
    box-shadow: inset 0 0 0 2px rgba(211, 176, 94, .18);
}

.equipped-shop-19 .dashboard-timer,
.equipped-shop-19 .focus-stage {
    background:
        radial-gradient(circle at 18% 18%, rgba(100, 212, 188, .12), transparent 28%),
        linear-gradient(145deg, rgba(8, 34, 48, .98), rgba(13, 27, 49, .98));
    box-shadow: inset 0 0 22px rgba(90, 207, 180, .10);
}

.equipped-shop-01 .main-viewport {
    background-image: radial-gradient(circle at 48% 0, rgba(79, 161, 105, .08), transparent 34%);
}

.equipped-shop-13 .main-viewport {
    background-image:
        radial-gradient(circle at 15% 20%, rgba(56, 123, 74, .10), transparent 30%),
        radial-gradient(circle at 80% 40%, rgba(80, 58, 130, .08), transparent 36%);
}

.equipped-shop-25 .main-viewport {
    background-image: radial-gradient(circle at 50% 8%, rgba(217, 170, 78, .10), transparent 32%);
}

.medal-progress {
    position: absolute;
    right: 10px;
    bottom: 7px;
    left: 10px;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(117, 144, 165, .22);
}

.medal-progress::after {
    display: block;
    width: var(--progress);
    height: 100%;
    border-radius: inherit;
    content: "";
    background: linear-gradient(90deg, #5dbee8, #bd68ef);
}

@keyframes hero-aura {
    0%, 100% { opacity: .45; transform: rotate(0deg) scale(.96); }
    50% { opacity: .95; transform: rotate(4deg) scale(1.04); }
}

@media (max-width: 1649px), (max-aspect-ratio: 17 / 9) {
    .community-rail {
        position: fixed;
        z-index: 120;
        top: 0;
        right: 0;
        display: flex;
        width: min(360px, calc(100vw - 18px));
        height: 100dvh;
        flex-direction: column;
        gap: 9px;
        padding: 14px 12px 12px;
        overflow: hidden;
        border-left: 1px solid rgba(63, 151, 191, .38);
        background:
            radial-gradient(circle at 50% 12%, rgba(125, 75, 205, .18), transparent 27%),
            linear-gradient(180deg, #07182a, #061421 64%, #08192a);
        box-shadow: -18px 0 48px rgba(0, 0, 0, .48);
        transition: width .22s ease, transform .22s ease;
    }

    .community-header,
    .community-identity,
    .community-tabs,
    .community-privacy,
    .community-feed li,
    .community-compose {
        display: flex;
        align-items: center;
    }

    .community-header { justify-content: space-between; min-height: 54px; }
    .community-header .eyebrow { display: block; color: #a7cde4; font-size: 9px; }
    .community-header strong { color: #f1f7ff; font-size: 21px; }

    .community-collapse {
        display: grid;
        width: 36px;
        height: 36px;
        border: 1px solid rgba(112, 181, 215, .26);
        border-radius: 9px;
        background: rgba(15, 45, 68, .72);
        color: #dff3ff;
        cursor: pointer;
        font-size: 23px;
        place-items: center;
    }

    .community-header-actions {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .community-settings {
        display: grid;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 1px solid rgba(112, 181, 215, .26);
        border-radius: 9px;
        background: rgba(15, 45, 68, .72);
        color: #dff3ff;
        cursor: pointer;
        place-items: center;
    }

    .community-identity {
        gap: 9px;
        min-height: 70px;
        padding: 8px;
        border: 1px solid rgba(101, 173, 204, .22);
        border-radius: 12px;
        background: rgba(8, 33, 52, .78);
    }

    .community-avatar { width: 46px; height: 46px; flex-basis: 46px; }
    .community-alias-editor { min-width: 0; flex: 1; }
    .community-identity small,
    .community-identity strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .community-identity small { color: #94afc1; font-size: 9px; }
    .community-identity strong { color: #fff0b9; font-size: 12px; }
    .community-identity > button { padding: 6px 8px; border: 1px solid rgba(225, 182, 89, .26); border-radius: 7px; background: rgba(115, 76, 24, .36); color: #ffdc88; }

    .community-tabs { gap: 5px; }
    .community-tabs button { flex: 1; min-height: 36px; border: 1px solid rgba(92, 169, 204, .22); border-radius: 8px; background: rgba(9, 32, 50, .78); color: #9eb9ca; font-weight: 800; }
    .community-tabs button.is-active { border-color: rgba(177, 99, 244, .5); background: linear-gradient(180deg, rgba(112, 53, 159, .7), rgba(53, 34, 94, .76)); color: #f4e7ff; }

    .community-panel { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 9px; }
    .community-privacy { gap: 8px; padding: 9px; border: 1px solid rgba(77, 172, 149, .24); border-radius: 10px; background: rgba(8, 54, 50, .48); }
    .community-privacy p { margin: 0; }
    .community-privacy strong,
    .community-privacy small { display: block; }
    .community-privacy strong { color: #d8fff5; font-size: 10px; }
    .community-privacy small { color: #9fc8c0; font-size: 8px; }
    .community-empty { display: grid; min-height: 0; flex: 1; padding: 14px; border: 1px dashed rgba(103, 168, 201, .25); border-radius: 12px; align-content: center; text-align: center; }
    .community-empty-art { width: min(130px, 62%); max-height: 180px; margin: auto; object-fit: cover; object-position: 50% 38%; }
    .community-empty p { color: #9eb5c5; font-size: 10px; }
    .community-compose { gap: 6px; }
    .community-compose input,
    .community-compose button { min-height: 38px; border: 1px solid rgba(92, 169, 204, .2); border-radius: 8px; background: rgba(5, 23, 38, .82); color: #d6e6ef; font-size: 10px; }
    .community-compose input { padding: 8px; }
    .community-compose button { padding: 8px 10px; }
    .community-feed { display: grid; gap: 8px; margin: 0; padding: 0; overflow: auto; list-style: none; }
    .community-feed li { gap: 9px; padding: 8px; border: 1px solid rgba(132, 101, 204, .24); border-radius: 10px; background: rgba(26, 24, 60, .6); }
    .community-feed p { margin: 0; }
    .community-feed strong,
    .community-feed small { display: block; }
    .community-feed strong { color: #f3eaff; font-size: 10px; }
    .community-feed small { color: #bfaadb; font-size: 9px; }
    .community-collapsed-label { display: none; }

    .community-rail.is-collapsed {
        width: 58px;
        align-items: center;
        padding: 12px 8px;
        background:
            url("../icons/community-vine.svg") center 72px / 54px 220px repeat-y,
            linear-gradient(180deg, #07182a, #061421);
    }

    .community-rail.is-collapsed .community-header > div,
    .community-rail.is-collapsed .community-identity,
    .community-rail.is-collapsed .community-tabs,
    .community-rail.is-collapsed .community-panel,
    .community-rail.is-collapsed .community-login-gate { display: none; }

    .community-rail.is-collapsed .community-header { justify-content: center; }
    .community-rail.is-collapsed .community-collapse { transform: rotate(180deg); }
    .community-rail.is-collapsed .community-settings { display: none; }
    .community-rail.is-collapsed .community-collapsed-label {
        display: grid;
        flex: 1;
        width: 38px;
        margin-top: 8px;
        padding: 18px 7px;
        border: 1px solid rgba(210, 186, 98, .38);
        border-radius: 19px;
        background: rgba(8, 30, 35, .9);
        color: #f0dfa2;
        font-size: 13px;
        font-weight: 800;
        letter-spacing: 1.5px;
        place-items: center;
        text-transform: uppercase;
        writing-mode: vertical-rl;
    }

    .community-rail.is-guest.is-collapsed .community-collapsed-label {
        display: none;
    }
}

@media (min-width: 1101px) and (max-width: 1649px), (min-width: 1101px) and (max-aspect-ratio: 17 / 9) {
    .app-shell > .app-column {
        margin-right: 58px;
        transition: margin-right .22s ease;
    }

    .app-shell:not(.community-is-collapsed) > .app-column {
        margin-right: min(360px, calc(100vw - 18px));
    }

    .app-shell:not(.community-is-collapsed) .topbar-quest {
        display: none;
    }

    .app-shell:not(.community-is-collapsed) .topbar-hero {
        flex-basis: 176px;
        min-width: 154px;
    }

    .app-shell:not(.community-is-collapsed) .dashboard-timer .timer-hero {
        grid-template-columns: 90px 205px minmax(145px, 1fr);
    }

    .app-shell:not(.community-is-collapsed) .dashboard-timer .session-ring {
        width: 78px;
        height: 78px;
        margin-left: 9px;
    }

    .app-shell:not(.community-is-collapsed) .dashboard-timer .companion-switcher {
        right: 6px;
        left: 6px;
    }

    .app-shell:not(.community-is-collapsed) .dashboard-timer .companion-nameplate {
        gap: 4px;
        padding-inline: 5px;
        font-size: 10px;
    }
}

@media (max-width: 720px) {
    .hero-profile-layout { grid-template-columns: 1fr; }
    .hero-portrait-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .community-rail { width: min(340px, calc(100vw - 8px)); }
    .music-context-guide ul,
    .music-upload-form,
    .music-credit-fields,
    .music-credit-list { grid-template-columns: 1fr; }
    .music-upload-form .span-2,
    .music-credit-fields { grid-column: 1; }
    .hero-selected-title { align-items: stretch; flex-direction: column; }
    .economy-ledger > div { grid-template-columns: 1fr; }
    .hero-bag > header { align-items: start; flex-direction: column; }
    .hero-bag > header > small { text-align: left; }
    .hero-bag article { grid-template-columns: 28px minmax(0, 1fr) auto; }
    .hero-bag article .button { grid-column: 2 / -1; width: 100%; }
}

@keyframes reward-goblin-pop {
    0% { transform: translateY(8px) scale(.96); filter: brightness(.82); }
    55% { transform: translateY(-4px) scale(1.025); filter: brightness(1.12); }
    100% { transform: translateY(0) scale(1); filter: brightness(1); }
}

@media (min-width: 1101px) {
    .app-shell.sidebar-is-collapsed {
        grid-template-columns: 0 minmax(0, 1fr);
    }

    .app-shell.sidebar-is-collapsed > .sidebar {
        width: var(--sidebar);
        pointer-events: none;
        transform: translateX(-110%);
    }

    .app-shell.sidebar-is-collapsed .mobile-brand {
        display: flex;
        align-items: center;
        flex: 0 0 auto;
        margin-right: 8px;
    }

    .app-shell.sidebar-is-collapsed .mobile-brand-home {
        display: none;
    }

    .sidebar,
    .app-shell {
        transition: transform .22s ease, grid-template-columns .22s ease;
    }
}

@media (min-width: 1650px) and (min-aspect-ratio: 17 / 9) {
    .app-shell.sidebar-is-collapsed:has(> .community-rail) {
        grid-template-columns: 0 minmax(0, 1fr) var(--community-rail);
    }

    .app-shell.sidebar-is-collapsed.community-is-collapsed {
        grid-template-columns: 0 minmax(0, 1fr) 68px;
    }
}

@media (min-width: 1101px) and (min-height: 800px) {
    .fa-body[data-current-page="timer"] .main-viewport,
    .fa-body[data-current-page="calendar"] .main-viewport:has(.calendar-shell),
    .fa-body[data-current-page="projects"] .main-viewport:has(.quest-journal) {
        overflow: hidden;
    }

    .fa-body[data-current-page="timer"] .page-root,
    .fa-body[data-current-page="calendar"] .page-root:has(.calendar-shell),
    .fa-body[data-current-page="projects"] .page-root:has(.quest-journal) {
        display: flex;
        height: 100%;
        min-height: 0;
        flex-direction: column;
    }

    .fa-body[data-current-page="timer"] .focus-page {
        flex: 1;
        min-height: 0;
    }

    .fa-body[data-current-page="timer"] .focus-stage {
        min-height: 0;
    }

    .fa-body[data-current-page="calendar"] .page-root:has(.calendar-shell) .calendar-shell {
        display: flex;
        flex: 1;
        min-height: 0;
        flex-direction: column;
    }

    .fa-body[data-current-page="calendar"] .page-root:has(.calendar-shell) .calendar-grid {
        grid-template-rows: repeat(6, minmax(0, 1fr));
        flex: 1;
        min-height: 0;
    }

    .fa-body[data-current-page="calendar"] .page-root:has(.calendar-shell) .calendar-day {
        min-height: 0;
    }

    .fa-body[data-current-page="projects"] .quest-journal {
        grid-template-rows: minmax(260px, 1.2fr) minmax(190px, 1fr);
        flex: 1;
        min-height: 0;
    }

    .fa-body[data-current-page="projects"] .quest-project-rail {
        min-height: 0;
        overflow-y: auto;
    }

    .fa-body[data-current-page="projects"] .quest-stage {
        min-height: 0;
    }

    .fa-body[data-current-page="projects"] .quest-details {
        grid-template-rows: auto minmax(0, 1fr);
        min-height: 0;
        overflow: hidden;
    }

    .fa-body[data-current-page="projects"] .quest-steps {
        display: flex;
        min-height: 0;
        flex-direction: column;
    }

    .fa-body[data-current-page="projects"] .quest-step-list {
        min-height: 0;
        overflow-y: auto;
    }
}

@media (min-width: 1101px) and (min-height: 900px) {
    .fa-body[data-current-page="projects"] .quest-project-rail {
        min-height: 0;
    }
}

/*
 * Bureau compact (1280–1420 px).
 * La composition reste identique à la grande maquette, mais ses éléments
 * internes se resserrent pour qu'aucun contrôle ou texte utile ne soit coupé.
 */
@media (min-width: 1101px) and (max-width: 1420px) {
    .app-shell:not(.community-is-collapsed) > .app-column {
        margin-right: 0;
    }

    .topbar {
        gap: 7px;
        padding-inline: 9px;
    }

    .topbar-identity {
        grid-template-columns: 105px 112px 143px;
        flex-basis: 360px;
    }

    .economy-counter {
        padding-inline: 7px;
    }

    .topbar-quest {
        display: none;
    }

    .topbar-companion {
        flex-basis: 205px;
        margin-left: auto;
    }

    .topbar-hero {
        flex-basis: 132px;
        min-width: 122px;
    }

    .topbar-actions {
        flex-basis: 91px;
    }

    .dashboard-timer .timer-hero {
        grid-template-columns: 82px minmax(188px, 1fr) 156px;
    }

    .dashboard-timer .session-ring {
        width: 70px;
        height: 70px;
        margin: 13px 0 0 8px;
    }

    .dashboard-timer .timer-display {
        font-size: 46px;
        transform: translate(-24px, -12px);
    }

    .dashboard-timer .timer-task {
        width: 188px;
        max-width: 188px;
        margin-top: 18px;
        margin-left: -49px;
        font-size: 10.5px;
    }

    .dashboard-timer .timer-actions {
        width: 188px;
        margin-top: 6px;
        margin-left: -49px;
    }

    .dashboard-timer .timer-actions .button {
        min-height: 29px;
        padding-inline: 2px;
        font-size: 7.5px;
    }

    .dashboard-timer .timer-next-break {
        width: 135px;
        margin-left: -22px;
        font-size: 8.5px;
    }

    .dashboard-timer .timer-companion img {
        right: -18px;
        width: 166px;
        transform: translateX(-2px) scale(1.55);
    }

    .dashboard-timer .timer-companion img[src*="elfe-dashboard.png"] {
        right: -24px;
        clip-path: inset(0 0 0 10%);
        transform: translateX(-8px) scale(1.92);
    }

    .dashboard-timer .companion-bubble {
        top: -1px;
        left: -70px;
        width: 145px;
        min-height: 104px;
        padding: 10px;
        font-size: 9.2px;
    }

    .dashboard-timer .companion-bubble.is-long {
        font-size: 8.8px;
    }

    .dashboard-timer .companion-bubble.is-very-long {
        font-size: 8.3px;
    }

    .dashboard-timer .companion-switcher {
        bottom: 16px;
    }

    .dashboard-distractions .card-body {
        padding-inline: 7px;
    }

    .dashboard-distractions .distraction-note {
        min-height: 42px;
        padding: 5px 7px;
    }

    .dashboard-distractions .distraction-note strong {
        font-size: 9px;
    }

    .dashboard-distractions .distraction-note small {
        font-size: 7.5px;
    }

    .dashboard-pause .pause-card-content {
        padding: 7px 8px;
    }

    .dashboard-pause .pause-companion {
        width: 118px;
        height: 108px;
    }

    .dashboard-pause .pause-card-content h3 {
        font-size: 13px;
    }

    .dashboard-pause .pause-card-content > p {
        max-height: 70px;
        font-size: 9.3px;
        line-height: 1.2;
    }

    .dashboard-pause .pause-tags {
        gap: 4px;
        margin: 3px 0;
    }

    .dashboard-pause .pause-tag {
        padding: 3px 6px;
        font-size: 7.5px;
    }

    .dashboard-pause .pause-card-content .button {
        min-height: 28px;
        flex-basis: 28px;
    }
}

/* ChronoQuest 1.7.0 — passe immersive lisible, proche des écrans de jeu. */
@media (min-width: 1101px) {
    /* Boutique : le marchand se tient réellement derrière son guichet. */
    .shop-market-screen {
        background-image:
            linear-gradient(180deg, rgba(2, 8, 13, .03), rgba(2, 8, 13, .2)),
            url("../images/immersive/shop-market-v1.png");
    }

    .shop-game-layout {
        grid-template-columns: minmax(0, 1fr) minmax(270px, .28fr);
        grid-template-rows: minmax(175px, .42fr) minmax(0, 1fr);
    }

    .shopkeeper-stage {
        grid-column: 1;
        grid-row: 1;
        border-right: 0;
        border-bottom: 1px solid rgba(211, 157, 68, .5);
        background: radial-gradient(circle at 54% 42%, rgba(246, 186, 83, .22), transparent 28%);
    }

    .shopkeeper-stage > img {
        inset: -5px auto -8px 42%;
        width: 235px;
        height: calc(100% + 12px);
        object-position: center top;
    }

    .shopkeeper-stage > div {
        top: 22px;
        right: auto;
        bottom: auto;
        left: 24px;
        width: 245px;
        padding: 12px 16px;
        border: 2px solid rgba(214, 161, 72, .72);
        background: linear-gradient(145deg, rgba(4, 17, 25, .94), rgba(22, 24, 22, .88));
        box-shadow: 0 10px 25px rgba(0, 0, 0, .42), inset 0 0 22px rgba(198, 142, 56, .08);
    }

    .shopkeeper-stage h2 { font-size: 25px; }
    .shopkeeper-stage p { font-size: 11px; line-height: 1.35; }

    .shop-shelves {
        grid-column: 1;
        grid-row: 2;
        padding: 10px 14px 12px;
        background: linear-gradient(180deg, rgba(5, 18, 26, .68), rgba(3, 12, 19, .88));
        box-shadow: inset 0 12px 24px rgba(0, 0, 0, .34);
    }

    .shop-inspection-panel {
        grid-column: 2;
        grid-row: 1 / 3;
        border-left: 2px solid rgba(211, 157, 68, .58);
        background: linear-gradient(180deg, rgba(4, 17, 26, .86), rgba(2, 10, 17, .96));
        box-shadow: inset 14px 0 28px rgba(0, 0, 0, .26);
    }

    .shop-market-screen .shop-card {
        border-width: 2px;
        background: linear-gradient(180deg, rgba(7, 24, 34, .9), rgba(4, 14, 22, .96));
        box-shadow: inset 0 0 20px rgba(211, 157, 68, .05), 0 5px 12px rgba(0, 0, 0, .22);
    }

    .shop-market-screen .shop-card h3 { font-size: 14px; }
    .shop-market-screen .shop-card p { font-size: 10px; }
    .shop-market-screen .shop-card .rarity { font-size: 9px; }
    .shop-market-screen .price-row .button { font-size: 10px; }
    .shop-inspection-panel > p { font-size: 11px; }

}

@media (min-width: 1101px) and (max-height: 759px) {
    .shop-game-layout { grid-template-rows: 132px minmax(0, 1fr); }
    .shopkeeper-stage > img { width: 180px; left: 43%; }
    .shopkeeper-stage > div { top: 10px; width: 215px; padding: 7px 12px; }
    .shopkeeper-stage h2 { font-size: 20px; }
    .shopkeeper-stage p { font-size: 9px; }
    .shop-market-screen .shop-card h3 { font-size: 11px; }
    .shop-market-screen .shop-card p { display: none; }

}

/* === ChronoQuest 1.7 · compositions de jeu immersives ==================== */
.immersive-heading-tools,
.immersive-pagination,
.shop-wallet,
.shop-shelf-footer,
.hero-bag-compact {
    display: flex;
    align-items: center;
}

.immersive-heading-tools { gap: 12px; }
.immersive-pagination { gap: 6px; }
.immersive-pagination button {
    display: grid;
    width: 31px;
    height: 31px;
    padding: 0;
    border: 1px solid rgba(220, 166, 72, .58);
    border-radius: 7px;
    background: rgba(4, 19, 30, .9);
    color: #f2d08b;
    cursor: pointer;
    place-items: center;
}
.immersive-pagination button:disabled { cursor: default; opacity: .34; }
.immersive-pagination span { color: #bdc9c9; font-size: 9px; white-space: nowrap; }
.focus-more-count { display: block; margin-top: 5px; color: #76634b; font-size: 8px; text-align: center; }

/* Les écrans paginés n'ont plus de mini-ascenseur interne. */
.focus-project-rail > div,
.focus-target-list,
.boss-gallery-screen .boss-grid,
.boss-inspection-panel section,
.trophy-hall .medal-gallery,
.trophy-reward-rail {
    max-height: none;
    overflow: visible;
}

/* Sanctuaire du temps */
.focus-orchestration {
    height: 100%;
    min-height: 610px;
}
.focus-orchestration-grid { grid-template-columns: minmax(190px, 28%) minmax(300px, 40%) minmax(245px, 32%); }
.focus-project-rail > div { gap: 6px; }
.focus-quest-choice { min-height: 50px; padding-block: 7px; }
.focus-target-list { align-content: start; }
.focus-target-choice { min-height: 45px; }
.focus-time-console .focus-clock { margin-top: 14px; font-size: clamp(54px, 5.5vw, 82px); }
.focus-time-console .focus-controls { flex-wrap: wrap; }

/* Journal des quêtes */
.quest-command-screen {
    min-height: 680px;
    overflow: visible;
    background:
        linear-gradient(180deg, rgba(2, 8, 14, .2), rgba(2, 8, 14, .62)),
        url("../images/immersive/quest-command-v1.png") center / cover no-repeat;
}
.quest-command-screen .quest-journal {
    min-height: 0;
    margin: 12px;
    border-color: rgba(214, 160, 65, .56);
    background: rgba(3, 15, 25, .78);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .34), inset 0 0 34px rgba(205, 143, 45, .05);
}
.quest-command-screen .quest-project-rail,
.quest-command-screen .quest-details,
.quest-command-screen .quest-stage {
    min-height: 0;
    background-color: rgba(3, 15, 25, .82);
}
.quest-command-screen .quest-project-rail,
.quest-command-screen .quest-step-list {
    overflow: visible;
}
.quest-command-screen .quest-step-list { max-height: none; }
.quest-command-screen .quest-checklist { background: rgba(5, 22, 34, .78); }
.quest-command-screen .quest-checklist { min-height: 88px; padding: 7px; }
.quest-command-screen .quest-details { gap: 7px; padding: 8px; }
.quest-command-screen .quest-step-list { gap: 4px; }
.quest-command-screen .quest-step { padding-block: 4px; }
.quest-command-screen .quest-step-card { min-height: 48px; }

/* Échoppe */
.shop-market-screen {
    display: flex;
    min-height: 680px;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(2, 8, 13, .06), rgba(2, 8, 13, .5)),
        url("../images/immersive/shop-market-v1.png") center / cover no-repeat;
}
.shop-heading { background: linear-gradient(90deg, rgba(4, 15, 24, .97), rgba(7, 23, 30, .73), rgba(4, 15, 24, .94)); }
.shop-wallet {
    display: grid;
    grid-template-columns: 32px auto auto 20px auto auto;
    gap: 2px 8px;
    min-width: 330px;
    padding: 7px 12px;
    border: 1px solid rgba(209, 157, 68, .45);
    border-radius: 9px;
    background: rgba(4, 17, 27, .86);
}
.shop-wallet .reward-potato { grid-row: span 2; }
.shop-wallet .reward-potato {
    position: relative;
    z-index: auto;
    top: auto;
    left: auto;
    display: block;
    width: 27px;
    height: 34px;
    align-self: center;
    justify-self: center;
    box-shadow: inset 3px 2px 5px rgba(255,255,255,.18), 0 0 10px rgba(244, 182, 62, .2);
}
.shop-wallet strong { color: #f4d083; font: 600 19px Georgia, serif; }
.shop-wallet small { color: #9fb1b7; font-size: 8px; }
.shop-wallet i { grid-row: span 2; color: #f4c951; font-size: 22px; font-style: normal; }
.shop-game-layout {
    display: grid;
    min-height: 0;
    flex: 1;
    grid-template-columns: minmax(170px, .68fr) minmax(470px, 2.25fr) minmax(235px, .95fr);
}
.shopkeeper-stage {
    position: relative;
    min-height: 0;
    overflow: hidden;
    border-right: 1px solid rgba(211, 157, 68, .42);
    background: radial-gradient(circle at 50% 30%, rgba(227, 166, 67, .18), transparent 42%);
}
.shopkeeper-stage > img {
    position: absolute;
    inset: 5% 0 64px;
    width: 100%;
    height: calc(95% - 64px);
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .7));
}
.shopkeeper-stage > div {
    position: absolute;
    right: 10px;
    bottom: 12px;
    left: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(214, 161, 72, .5);
    border-radius: 8px;
    background: rgba(4, 17, 25, .9);
    text-align: center;
}
.shopkeeper-stage h2 { margin: 2px 0; color: #efd090; font: 600 20px Georgia, serif; }
.shopkeeper-stage p { margin: 2px 0; color: #bfc8c7; font-size: 9px; }
.shop-shelves {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    padding: 12px;
    background: rgba(3, 13, 22, .7);
}
.shop-category-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 9px;
    padding-bottom: 7px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(205, 151, 64, .35);
    scrollbar-width: none;
}
.shop-category-tabs::-webkit-scrollbar { display: none; }
.shop-category-tabs button {
    padding: 7px 11px;
    border: 1px solid rgba(191, 138, 60, .5);
    border-radius: 7px;
    background: rgba(5, 21, 31, .9);
    color: #c9bfaa;
    cursor: pointer;
    font-size: 9px;
    white-space: nowrap;
}
.shop-category-tabs button.is-active { border-color: #5dd5cf; color: #8ce8df; box-shadow: inset 0 0 15px rgba(59, 200, 191, .12); }
.shop-showcase-grid {
    display: grid;
    min-height: 0;
    flex: 1;
    grid-template-columns: repeat(3, minmax(135px, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.shop-market-screen .shop-card {
    min-width: 0;
    padding: 8px;
    border-color: rgba(198, 145, 61, .55);
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(5, 20, 31, .93), rgba(4, 15, 24, .96));
}
.shop-market-screen .shop-card.is-selected { border-color: #61d5cf; box-shadow: 0 0 0 2px rgba(61, 207, 201, .2), inset 0 0 22px rgba(51, 186, 184, .08); }
.shop-card-inspect {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}
.shop-market-screen .shop-card::before { flex-basis: 88px; width: 88px; height: 88px; }
.shop-market-screen .shop-card h3 { min-height: 29px; margin: 3px 0; color: #efd49a; font: 600 12px/1.15 Georgia, serif; }
.shop-market-screen .shop-card p { display: -webkit-box; margin: 2px 0; overflow: hidden; font-size: 8px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.shop-market-screen .shop-card .rarity { color: #55cfc9; font-size: 7px; text-transform: uppercase; }
.shop-market-screen .price-row { margin-top: 5px; }
.shop-market-screen .price-row .button { padding: 6px 8px; font-size: 8px; }
.shop-shelf-footer { justify-content: space-between; gap: 10px; margin-top: 8px; }
.hero-bag-compact { min-width: 0; gap: 5px; overflow: hidden; }
.hero-bag-compact > span { color: #d4b87e; font: 600 11px Georgia, serif; white-space: nowrap; }
.hero-bag-compact > button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px;
    max-width: 140px;
    padding: 5px 7px;
    border: 1px solid rgba(91, 182, 169, .3);
    border-radius: 6px;
    background: rgba(5, 24, 34, .88);
    color: #c9dddc;
    cursor: pointer;
}
.hero-bag-compact small { overflow: hidden; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.shop-inspection-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    padding: 14px;
    border-left: 1px solid rgba(211, 157, 68, .48);
    background: rgba(3, 14, 23, .86);
    text-align: center;
}
.shop-detail-art {
    position: relative;
    width: min(180px, 90%);
    aspect-ratio: 1;
    margin: 8px auto;
    background-image: url("../generated/shop-atlas.png");
    background-repeat: no-repeat;
    background-size: 500% 200%;
    filter: drop-shadow(0 13px 18px rgba(0, 0, 0, .55));
}
.shop-detail-art.atlas-slot-0 { background-position: 0 0; }
.shop-detail-art.atlas-slot-1 { background-position: 25% 0; }
.shop-detail-art.atlas-slot-2 { background-position: 50% 0; }
.shop-detail-art.atlas-slot-3 { background-position: 75% 0; }
.shop-detail-art.atlas-slot-4 { background-position: 100% 0; }
.shop-detail-art.atlas-slot-5 { background-position: 0 100%; }
.shop-detail-art.atlas-slot-6 { background-position: 25% 100%; }
.shop-detail-art.atlas-slot-7 { background-position: 50% 100%; }
.shop-detail-art.atlas-slot-8 { background-position: 75% 100%; }
.shop-detail-art.atlas-slot-9 { background-position: 100% 100%; }
.shop-detail-art .shop-detail-portrait { position: absolute; inset: 0; width: 100%; height: 100%; }
.shop-inspection-panel h2 { margin: 5px 0; color: #efd192; font: 600 21px Georgia, serif; }
.shop-inspection-panel > p { color: #b8c5c5; font-size: 9px; line-height: 1.5; }
.shop-detail-price { display: grid; width: 100%; gap: 9px; margin-top: auto; }
.shop-detail-price strong { color: #f2ca75; font: 600 16px Georgia, serif; }

/* Galerie des boss */
.boss-gallery-screen { display: flex; height: 100%; min-height: 650px; flex-direction: column; }
.boss-gallery-layout { min-height: 0; flex: 1; grid-template-columns: minmax(0, 3.15fr) minmax(245px, .95fr); }
.boss-gallery-screen .boss-grid {
    min-height: 0;
    padding: 10px;
    grid-template-columns: repeat(3, minmax(135px, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
}
.boss-gallery-screen .boss-card { min-height: 0; }
.boss-gallery-screen .boss-card img { height: clamp(100px, 17vh, 145px); }
.boss-inspection-panel { min-height: 0; padding: 11px; }
.boss-inspection-panel > img { height: clamp(135px, 22vh, 205px); }
.boss-inspection-panel > p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.boss-inspection-panel section { margin: 7px 0; }

/* Galerie des trophées */
.trophy-hall { display: flex; height: 100%; min-height: 650px; flex-direction: column; }
.trophy-feature { min-height: 105px; margin: 9px; }
.trophy-gallery-layout { min-height: 0; flex: 1; grid-template-columns: minmax(0, 1fr) 205px; }
.trophy-hall .medal-gallery {
    min-height: 0;
    padding: 9px;
    grid-template-columns: repeat(4, minmax(105px, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 8px;
}
.trophy-hall .medal-card { min-height: 0; }
.trophy-hall .medal-card::before { height: min(13vh, 120px); }
.trophy-reward-rail { min-height: 0; padding: 9px; grid-template-rows: repeat(2, minmax(0, 1fr)); }
.reward-display { width: min(11vh, 105px); }

/* Auberge et grimoire */
.companion-tavern-screen { display: flex; height: 100%; min-height: 680px; flex-direction: column; }
.companion-game-layout {
    display: grid;
    min-height: 0;
    flex: 1;
    grid-template-columns: minmax(480px, 1.32fr) minmax(420px, 1fr);
}
.companion-tavern-screen .companion-guest-list { min-height: 0; margin: 10px 5px 10px 10px; }
.companion-tavern-screen .companion-guest-list > div { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
.companion-tavern-screen .companion-guest {
    display: flex;
    min-height: 0;
    flex-direction: column;
    padding: 7px;
    text-align: center;
}
.companion-tavern-screen .companion-guest img { width: 100%; height: clamp(105px, 16vh, 160px); object-fit: contain; object-position: center top; }
.companion-tavern-screen .companion-guest strong { font-size: 15px; }
.companion-tavern-screen .companion-guest span { width: 100%; }
.companion-tavern-screen .companion-inn {
    min-height: 0;
    margin: 10px 10px 10px 5px;
    grid-template-columns: minmax(180px, 38%) minmax(0, 1fr);
}
.companion-tavern-screen .companion-inn-art { min-height: 0; }
.companion-tavern-screen .companion-inn-art img { object-position: center top; }
.companion-tavern-screen .companion-inn-main { min-height: 0; }
.companion-tavern-screen .companion-inn-tabs { gap: 4px; }
.companion-tavern-screen .companion-inn-tabs button { padding-inline: 6px; font-size: 8px; }
.companion-tavern-screen .companion-welcome-copy,
.companion-tavern-screen .companion-moment-stage,
.companion-tavern-screen .companion-grimoire,
.companion-tavern-screen .companion-wardrobe { min-height: 0; }
.companion-tavern-screen .companion-grimoire,
.companion-tavern-screen .companion-wardrobe {
    overflow-y: auto;
    scrollbar-color: rgba(224, 173, 82, .65) rgba(3, 14, 23, .5);
    scrollbar-width: thin;
}
.companion-tavern-screen .companion-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.companion-tavern-screen .companion-outfits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.companion-tavern-screen .companion-outfit img { height: 150px; }
.companion-story-dialog {
    width: min(920px, 92vw);
    max-width: none;
    max-height: 92vh;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: #302217;
}
.companion-story-dialog::backdrop { background: rgba(0, 5, 10, .82); backdrop-filter: blur(4px); }
.grimoire-book {
    position: relative;
    display: grid;
    min-height: 620px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 28px 36px 22px;
    overflow: hidden;
    border: 6px double #8d5b24;
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(91, 53, 24, .14) 49.7%, rgba(63, 34, 14, .28) 50%, rgba(91, 53, 24, .14) 50.3%),
        radial-gradient(circle at 50% 20%, #fff3cf, #dfc18d 78%, #b0834d);
    box-shadow: 0 28px 75px rgba(0, 0, 0, .7), inset 0 0 45px rgba(86, 48, 16, .24);
}
.grimoire-book::before,
.grimoire-book::after {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 24px;
    content: "";
    background: linear-gradient(90deg, rgba(103, 62, 25, .42), transparent);
}
.grimoire-book::before { left: 0; }
.grimoire-book::after { right: 0; transform: scaleX(-1); }
.grimoire-book > header { padding: 0 25px 15px; border-bottom: 1px solid rgba(104, 67, 28, .35); text-align: center; }
.grimoire-book > header span { color: #80551f; font: italic 14px Georgia, serif; }
.grimoire-book h2 { margin: 5px 0; color: #4e2f12; font: 600 31px Georgia, serif; }
.grimoire-book > header small { color: #7e6548; }
.grimoire-close {
    position: absolute;
    z-index: 3;
    top: 15px;
    right: 17px;
    width: 34px;
    height: 34px;
    border: 1px solid #8b5c25;
    border-radius: 50%;
    background: #513016;
    color: #f8dfae;
    cursor: pointer;
    font-size: 23px;
}
.grimoire-page { position: relative; display: grid; align-content: center; padding: 24px 46px; }
.grimoire-page p { margin: 0; color: #382517; font: 18px/1.78 Georgia, serif; text-align: justify; text-indent: 2em; }
.grimoire-illumination { position: absolute; top: 18px; left: 16px; color: #9f6b24; font-size: 40px; }
.grimoire-page-number { position: absolute; right: 8px; bottom: 8px; color: #8a6840; font: 14px Georgia, serif; }
.grimoire-book > footer { display: grid; grid-template-columns: 180px 1fr 180px; align-items: center; gap: 12px; padding-top: 15px; border-top: 1px solid rgba(104, 67, 28, .35); }
.grimoire-book > footer > span { display: flex; justify-content: center; gap: 7px; }
.grimoire-book > footer i { width: 8px; height: 8px; border: 1px solid #8c622d; border-radius: 50%; }
.grimoire-book > footer i.is-active { background: #8c622d; }

@media (min-width: 1101px) {
    .fa-body[data-current-page="timer"] .main-viewport,
    .fa-body[data-current-page="bosses"] .main-viewport,
    .fa-body[data-current-page="titles"] .main-viewport,
    .fa-body[data-current-page="shop"] .main-viewport,
    .fa-body[data-current-page="companions"] .main-viewport {
        overflow: hidden;
    }
    .fa-body[data-current-page="timer"] .page-root,
    .fa-body[data-current-page="bosses"] .page-root,
    .fa-body[data-current-page="titles"] .page-root,
    .fa-body[data-current-page="shop"] .page-root,
    .fa-body[data-current-page="companions"] .page-root {
        display: flex;
        height: 100%;
        min-height: 0;
        flex-direction: column;
    }
    .fa-body[data-current-page="timer"] .immersive-screen,
    .fa-body[data-current-page="bosses"] .immersive-screen,
    .fa-body[data-current-page="titles"] .immersive-screen,
    .fa-body[data-current-page="shop"] .immersive-screen,
    .fa-body[data-current-page="companions"] .immersive-screen {
        min-height: 0;
        flex: 1;
    }
    .fa-body[data-current-page="projects"] .quest-project-rail,
    .fa-body[data-current-page="projects"] .quest-step-list { overflow-y: visible; }
    .fa-body[data-current-page="projects"] .quest-command-screen {
        display: flex;
        height: 100%;
        min-height: 0;
        flex: 1;
        flex-direction: column;
        overflow: hidden;
    }
    .fa-body[data-current-page="projects"] .quest-command-screen > .quest-journal {
        min-height: 0;
        flex: 1;
        grid-template-rows: minmax(245px, 1.05fr) minmax(225px, 1fr);
    }
    .fa-body[data-current-page="projects"] .quest-command-screen .quest-stage {
        min-height: 245px;
    }
}

@media (max-width: 1320px) {
    .shop-game-layout { grid-template-columns: 150px minmax(430px, 2fr) 215px; }
    .shop-market-screen .shop-card::before { flex-basis: 72px; width: 72px; height: 72px; }
    .companion-game-layout { grid-template-columns: minmax(420px, 1.2fr) minmax(360px, 1fr); }
    .companion-tavern-screen .companion-guest img { height: 112px; }
    .boss-inspection-panel h2 { font-size: 21px; }
}

/* Quêtes — salle de commandement (composition de référence) */
.quest-overview-screen {
    display: grid;
    height: 100%;
    min-height: 690px;
    padding: 10px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 10px;
    overflow: hidden;
    color: #e8e0cc;
    background:
        linear-gradient(90deg, rgba(3, 12, 20, .96), rgba(4, 18, 28, .78) 50%, rgba(3, 12, 20, .96)),
        url("../images/immersive/quest-command-v1.png") center / cover no-repeat;
}

.quest-overview-screen h1,
.quest-overview-screen h2,
.quest-overview-screen h3,
.quest-overview-screen strong {
    color: inherit;
}

.quest-overview-header,
.quest-boss-showcase,
.quest-next-step,
.quest-task-table-card,
.quest-overview-status,
.quest-timeline,
.quest-rewards {
    border: 1px solid rgba(188, 132, 48, .65);
    background: linear-gradient(145deg, rgba(6, 24, 37, .96), rgba(5, 18, 29, .92));
    box-shadow: inset 0 0 24px rgba(82, 169, 184, .025), 0 10px 28px rgba(0, 0, 0, .22);
}

.quest-overview-header {
    position: relative;
    display: grid;
    min-height: 106px;
    padding: 10px 12px;
    grid-template-columns: 86px minmax(260px, 1fr) 118px 150px 78px;
    align-items: center;
    gap: 14px;
    border-radius: 11px;
}

.quest-header-portrait {
    width: 76px;
    height: 76px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #ad7c35;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(44, 104, 111, .55), #06131e 70%);
    cursor: pointer;
}

.quest-header-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    transform: scale(1.18);
}

.quest-header-portrait span {
    display: grid;
    height: 100%;
    place-items: center;
    font-size: 36px;
}

.quest-header-copy { min-width: 0; }

.quest-header-title-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.quest-header-title-row h1 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font: 700 clamp(24px, 2.2vw, 38px)/1.05 Georgia, var(--display);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quest-project-switcher { position: relative; flex: 0 0 auto; }
.quest-project-switcher summary {
    padding: 5px 8px;
    border: 1px solid rgba(190, 141, 64, .46);
    border-radius: 6px;
    color: #d9ba78;
    font-size: 9px;
    list-style: none;
    cursor: pointer;
}
.quest-project-switcher summary::-webkit-details-marker { display: none; }
.quest-project-switcher > div {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    width: min(280px, 70vw);
    padding: 6px;
    gap: 4px;
    border: 1px solid #9d7133;
    border-radius: 8px;
    background: #071825;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .55);
}
.quest-project-switcher button {
    padding: 7px 9px;
    border: 0;
    border-radius: 5px;
    background: rgba(18, 47, 65, .85);
    color: #d9e8ec;
    font: inherit;
    font-size: 10px;
    text-align: left;
    cursor: pointer;
}
.quest-project-switcher button:hover,
.quest-project-switcher button.is-active { background: rgba(40, 104, 116, .76); color: #fff0bb; }

.quest-header-phase,
.quest-header-hours {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: #d9c18b;
    font-size: 11px;
}
.quest-header-phase > span {
    padding: 4px 8px;
    border: 1px solid rgba(55, 203, 187, .42);
    border-radius: 5px;
    color: #65ddcc;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.quest-header-phase > b {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #58d8c8;
    box-shadow: 0 0 8px #58d8c8;
}

.quest-header-progress {
    display: grid;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #081b29 58%, transparent 59%),
        conic-gradient(#6ed7af var(--quest-progress), rgba(45, 76, 91, .68) 0);
    place-content: center;
    text-align: center;
}
.quest-header-progress strong { font: 700 28px/1 Georgia, serif; }
.quest-header-progress span { margin-top: 4px; color: #cbd5d4; font-size: 9px; }

.quest-header-facts {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-left: 13px;
    border-left: 1px solid rgba(135, 171, 180, .18);
}
.quest-header-facts div { display: grid; gap: 1px; }
.quest-header-facts dt { color: #7e9aab; font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.quest-header-facts dd { margin: 0; color: #e6decb; font-size: 10px; }

.quest-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.quest-icon-action {
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(185, 135, 60, .42);
    border-radius: 7px;
    background: rgba(10, 31, 45, .88);
    color: #d8bd82;
    place-items: center;
    cursor: pointer;
}
.quest-icon-action.is-active { border-color: #4ec4aa; color: #75e5c6; }

.quest-overview-main {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(310px, 42%) minmax(0, 58%);
    gap: 10px;
}

.quest-boss-showcase {
    display: grid;
    min-height: 0;
    padding: 9px;
    grid-template-rows: minmax(0, 1fr) 90px;
    gap: 8px;
    border-radius: 10px;
}

.quest-boss-scene {
    position: relative;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(176, 125, 49, .5);
    border-radius: 8px 8px 3px 3px;
    background:
        radial-gradient(circle at 52% 36%, rgba(83, 152, 164, .2), transparent 42%),
        linear-gradient(180deg, rgba(6, 20, 29, .15), rgba(2, 9, 15, .88));
}
.quest-boss-scene > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center 45%;
    filter: drop-shadow(0 18px 18px rgba(0,0,0,.6));
    transform: scale(1.03);
}
.quest-boss-empty { display: grid; height: 100%; place-items: center; font-size: 110px; opacity: .55; }
.quest-boss-caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 7px 10px;
    border-top: 1px solid rgba(183, 132, 54, .55);
    background: rgba(4, 15, 23, .9);
    color: #edd49d;
    font: 600 12px/1.2 Georgia, serif;
    text-align: center;
}
.quest-boss-edit {
    position: absolute;
    top: 7px;
    right: 7px;
    padding: 5px 7px;
    border: 1px solid rgba(202, 155, 82, .54);
    border-radius: 5px;
    background: rgba(4, 16, 25, .82);
    color: #e4ca92;
    font-size: 9px;
    cursor: pointer;
}

.quest-boss-moods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.quest-boss-moods article {
    display: grid;
    min-width: 0;
    padding: 4px;
    border: 1px solid rgba(177, 127, 55, .42);
    border-radius: 5px;
    background: rgba(6, 22, 32, .9);
    grid-template-rows: minmax(0, 1fr) auto auto;
    text-align: center;
}
.quest-boss-moods article.is-current { border-color: #5dd4c2; box-shadow: inset 0 0 12px rgba(64, 211, 190, .18); }
.quest-boss-moods article > div { min-height: 0; overflow: hidden; }
.quest-boss-moods img { width: 100%; height: 48px; object-fit: cover; object-position: center 28%; filter: saturate(.72) brightness(.85); }
.quest-boss-moods article:nth-child(2) img { filter: saturate(.85) brightness(.78); }
.quest-boss-moods article:nth-child(3) img { filter: saturate(.65) brightness(.68); }
.quest-boss-moods article:nth-child(4) img { filter: grayscale(.45) brightness(.58); }
.quest-boss-moods strong { overflow: hidden; color: #d9bd83; font: 600 9px/1.1 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.quest-boss-moods small { color: #829ba8; font-size: 7px; }

.quest-overview-workspace {
    display: grid;
    min-height: 0;
    grid-template-rows: 98px minmax(150px, 1fr) 118px;
    gap: 8px;
}

.quest-next-step {
    position: relative;
    display: grid;
    padding: 10px 12px 9px;
    grid-template-columns: minmax(0, 1fr) 210px;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 5px 12px;
    border-radius: 8px;
}
.quest-next-step > header { display: flex; grid-column: 1 / -1; justify-content: space-between; }
.quest-next-step > header > span,
.quest-task-table-card > header h2,
.quest-overview-status > header h3,
.quest-timeline > header h2,
.quest-rewards > header h2 {
    margin: 0;
    color: #64d1c3;
    font: 700 10px/1.15 var(--display);
    text-transform: uppercase;
    letter-spacing: .1em;
}
.quest-next-step > header small { position: absolute; top: 9px; right: 10px; color: #8199a7; font-size: 7px; text-align: center; text-transform: uppercase; }
.quest-next-step > header small strong { color: #e9d8af; font-size: 10px; }
.quest-next-step h2 { margin: 1px 0 2px; overflow: hidden; font: 600 15px/1.1 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.quest-next-step p { margin: 0; overflow: hidden; color: #b4c3c9; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.quest-launch-step {
    align-self: end;
    height: 36px;
    border: 1px solid #3cae9c;
    border-radius: 5px;
    background: linear-gradient(180deg, rgba(19, 105, 104, .92), rgba(8, 66, 72, .94));
    color: #f0e8d8;
    font: 600 13px Georgia, serif;
    cursor: pointer;
}
.quest-launch-step span { float: right; }

.quest-task-table-card {
    min-height: 0;
    padding: 8px 10px;
    overflow: hidden;
    border-radius: 8px;
}
.quest-task-table-card > header,
.quest-timeline > header,
.quest-rewards > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}
.quest-task-table-card > header button,
.quest-timeline > header button,
.quest-rewards > header button {
    padding: 3px 6px;
    border: 1px solid rgba(177, 127, 55, .38);
    border-radius: 4px;
    background: rgba(16, 43, 57, .8);
    color: #d8c18d;
    font: inherit;
    font-size: 8px;
    cursor: pointer;
}
.quest-task-table { display: grid; min-height: 0; }
.quest-task-row {
    display: grid;
    min-width: 0;
    min-height: 25px;
    padding: 3px 5px;
    border: 0;
    border-bottom: 1px solid rgba(111, 146, 158, .15);
    background: transparent;
    grid-template-columns: 20px minmax(145px, 1fr) 55px 58px 62px;
    align-items: center;
    gap: 5px;
    color: #c6d1d3;
    font: inherit;
    font-size: 8.5px;
    text-align: left;
}
button.quest-task-row { cursor: pointer; }
.quest-task-row > strong { overflow: hidden; color: #dfe5e1; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.quest-task-row.is-current { outline: 1px solid #37b6aa; outline-offset: -1px; background: rgba(26, 92, 94, .22); }
.quest-task-row.is-done { opacity: .6; }
.quest-task-head { min-height: 20px; color: #849ba7; font-size: 7px; text-transform: uppercase; letter-spacing: .08em; }
.quest-task-total { border: 0; color: #ddc99b; text-transform: uppercase; }
.quest-task-row .task-symbols { overflow: hidden; white-space: nowrap; }
.quest-task-row .task-mention-icons { gap: 2px; }
.quest-task-row .task-mention-icons > span { width: 16px; height: 16px; font-size: 9px; }
.quest-no-tasks { display: grid; height: calc(100% - 20px); place-content: center; text-align: center; }
.quest-no-tasks p { color: #8fa7b2; font-size: 10px; }

.quest-overview-status-grid { display: grid; min-height: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.quest-overview-status {
    min-height: 0;
    padding: 7px;
    overflow: hidden;
    border-radius: 7px;
}
.quest-overview-status > header { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 4px; }
.quest-overview-status.quest-status-blocker { border-color: rgba(211, 76, 72, .7); }
.quest-overview-status.quest-status-blocker > header h3 { color: #ff817c; }
.quest-overview-status p { margin: 7px 2px; color: #91a6af; font-size: 8px; }
.quest-overview-status .quest-object-cards { gap: 3px; }
.quest-overview-status .quest-object-card { min-height: 25px; padding: 3px; grid-template-columns: 19px minmax(0, 1fr) auto; }
.quest-overview-status .quest-object-check { width: 19px; height: 19px; font-size: 8px; }
.quest-overview-status .quest-object-copy strong { color: #c8d8da; font-size: 7.5px; }
.quest-overview-status .quest-object-copy small { font-size: 7px; }
.quest-overview-status .quest-object-add { width: 20px; height: 20px; }

.quest-overview-footer { display: grid; min-height: 116px; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); gap: 10px; }
.quest-timeline,
.quest-rewards { min-height: 0; padding: 9px 12px; border-radius: 8px; }
.quest-timeline-track { position: relative; display: grid; height: 70px; grid-auto-flow: column; grid-auto-columns: minmax(80px, 1fr); align-items: start; gap: 5px; }
.quest-timeline-track::before { content: ""; position: absolute; top: 16px; right: 20px; left: 20px; height: 3px; background: linear-gradient(90deg, #47bfa9 var(--quest-progress), #80673c 0); }
.quest-timeline-track article,
.quest-timeline-track button {
    position: relative;
    z-index: 1;
    display: grid;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #aab6b8;
    place-items: center;
    font: inherit;
    text-align: center;
}
.quest-timeline-track button { cursor: pointer; }
.quest-timeline-track span { display: grid; width: 30px; height: 30px; border: 2px solid #92713c; border-radius: 50%; background: #071925; color: #d8c38f; place-items: center; }
.quest-timeline-track .is-done span { border-color: #5bd1b6; color: #72e0c7; }
.quest-timeline-track strong { width: 100%; margin-top: 3px; overflow: hidden; color: #d7c69e; font: 600 8px/1.1 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.quest-timeline-track small { color: #8397a0; font-size: 7px; }

.quest-rewards > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.quest-rewards > div > button {
    display: grid;
    min-width: 0;
    min-height: 70px;
    padding: 5px;
    border: 1px solid rgba(177, 127, 55, .38);
    border-radius: 6px;
    background: rgba(13, 35, 46, .78);
    color: #d7c69c;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: 1fr 1fr;
    align-items: center;
    gap: 0 6px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.quest-rewards > div > button > span { display: grid; width: 32px; height: 32px; grid-row: 1 / span 2; border: 1px solid #94713a; border-radius: 50%; background: rgba(86, 60, 24, .42); color: #edc76e; place-items: center; font-size: 17px; }
.quest-rewards > div > button strong { overflow: hidden; color: #e2c884; font: 600 9px/1.1 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.quest-rewards > div > button small { overflow: hidden; color: #879ca4; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 1101px) and (min-height: 760px) {
    .fa-body[data-current-page="projects"] .main-viewport:has(.quest-overview-screen) { overflow: hidden; }
    .fa-body[data-current-page="projects"] .page-root:has(.quest-overview-screen) { height: 100%; min-height: 0; }
    .fa-body[data-current-page="projects"] .quest-overview-screen { min-height: 0; }
}

@media (max-width: 1250px) {
    .quest-overview-header { grid-template-columns: 72px minmax(220px, 1fr) 96px 125px 68px; gap: 9px; }
    .quest-header-portrait { width: 64px; height: 64px; }
    .quest-header-progress { width: 76px; height: 76px; }
    .quest-header-progress strong { font-size: 23px; }
    .quest-overview-main { grid-template-columns: minmax(280px, 40%) minmax(0, 60%); }
    .quest-next-step { grid-template-columns: minmax(0, 1fr) 170px; }
    .quest-task-row { grid-template-columns: 18px minmax(120px, 1fr) 48px 52px 52px; font-size: 8px; }
}

@media (max-width: 900px) {
    .quest-overview-screen { height: auto; min-height: 0; overflow: visible; }
    .quest-overview-header { grid-template-columns: 62px minmax(0, 1fr) 72px; }
    .quest-header-facts,
    .quest-header-actions { display: none; }
    .quest-overview-main { grid-template-columns: minmax(0, 1fr); }
    .quest-boss-showcase { min-height: 430px; }
    .quest-overview-workspace { min-height: 470px; }
    .quest-overview-footer { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
    .quest-overview-screen { padding: 6px; }
    .quest-overview-header { grid-template-columns: 52px minmax(0, 1fr); padding: 8px; }
    .quest-header-portrait { width: 46px; height: 46px; }
    .quest-header-progress { display: none; }
    .quest-header-title-row h1 { font-size: 22px; }
    .quest-project-switcher summary { font-size: 0; }
    .quest-project-switcher summary::after { content: "⇄"; font-size: 13px; }
    .quest-overview-status-grid { grid-template-columns: minmax(0, 1fr); }
    .quest-overview-workspace { grid-template-rows: 116px auto auto; }
    .quest-next-step { grid-template-columns: minmax(0, 1fr); }
    .quest-next-step > div { padding-right: 45px; }
    .quest-launch-step { width: 100%; }
    .quest-task-row { grid-template-columns: 18px minmax(120px, 1fr) 44px 44px; }
    .quest-task-row > :nth-child(5) { display: none; }
    .quest-overview-footer { min-height: 0; }
    .quest-timeline-track { overflow-x: auto; }
    .quest-rewards > div { grid-template-columns: minmax(0, 1fr); }
}

/* Boutique — comptoir continu, sans pagination */
.shop-market-screen {
    height: 100%;
    min-height: 680px;
    overflow: hidden;
}

.shop-hero-banner {
    min-height: 235px;
    flex: 0 0 235px;
    background:
        linear-gradient(90deg, rgba(2, 10, 17, .94) 0 25%, rgba(2, 10, 17, .12) 43% 72%, rgba(2, 10, 17, .84) 86% 100%),
        linear-gradient(180deg, transparent 68%, rgba(3, 10, 14, .92) 100%),
        url("../images/immersive/shop-market-v1.png") center 32% / cover no-repeat;
}

.shop-hero-banner::after {
    content: "";
    position: absolute;
    z-index: 3;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 31px;
    border-top: 2px solid rgba(199, 142, 55, .7);
    border-bottom: 1px solid rgba(103, 66, 27, .9);
    background:
        linear-gradient(180deg, rgba(104, 61, 25, .92), rgba(36, 22, 14, .98)),
        repeating-linear-gradient(90deg, transparent 0 100px, rgba(239, 183, 87, .08) 101px 103px);
    box-shadow: 0 -8px 20px rgba(0, 0, 0, .42), inset 0 2px rgba(244, 193, 104, .12);
}

.shop-sign {
    width: min(350px, 31%);
    margin-left: 22px;
    padding: 16px 20px;
    border-color: rgba(218, 166, 76, .76);
    background: linear-gradient(150deg, rgba(6, 20, 29, .98), rgba(9, 27, 31, .96));
}

.shop-sign h1 { font-size: clamp(31px, 3.3vw, 49px); }

.shop-hero-banner > .shopkeeper-stage {
    inset: -8px 22% 22px 24%;
}

.shop-hero-banner > .shopkeeper-stage > img {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    filter: brightness(1.14) saturate(1.08) drop-shadow(0 18px 25px rgba(0, 0, 0, .78));
    -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
}

.shop-hero-banner > .shop-wallet {
    top: 20px;
    right: 20px;
    width: min(350px, 31%);
    padding: 10px 14px;
}

.shop-market-screen > .shop-shelves {
    min-height: 0;
    padding: 8px 12px 9px;
    overflow: hidden;
}

.shop-stock-scroll {
    min-height: 0;
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1px 7px 3px 1px;
    scrollbar-color: #9f7339 rgba(4, 17, 26, .84);
    scrollbar-width: thin;
}

.shop-stock-scroll::-webkit-scrollbar { width: 9px; }
.shop-stock-scroll::-webkit-scrollbar-track { border-radius: 8px; background: rgba(4, 17, 26, .84); }
.shop-stock-scroll::-webkit-scrollbar-thumb { border: 2px solid rgba(4, 17, 26, .84); border-radius: 8px; background: linear-gradient(#d2a253, #805427); }

.shop-market-screen .shop-showcase-grid {
    display: grid;
    min-height: auto;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    grid-template-rows: none;
    grid-auto-rows: minmax(178px, auto);
    gap: 9px;
}

.shop-market-screen .shop-card {
    min-height: 178px;
    padding: 9px;
    border-color: rgba(203, 151, 70, .62);
    background:
        linear-gradient(180deg, rgba(5, 22, 33, .96), rgba(3, 14, 22, .98)),
        radial-gradient(circle at 30% 15%, rgba(67, 186, 178, .08), transparent 35%);
}

.shop-market-screen .shop-card::before {
    width: 94px;
    height: 94px;
    flex-basis: 94px;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .42));
}

.shop-market-screen .shop-card h3 {
    min-height: 31px;
    font-size: 13px;
}

.shop-market-screen .shop-card p {
    font-size: 8.5px;
    line-height: 1.35;
}

.shop-market-screen .shop-card .price-row {
    padding-top: 5px;
    border-top: 1px solid rgba(151, 110, 53, .2);
}

.shop-shelf-footer {
    min-height: 38px;
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid rgba(205, 151, 64, .28);
}

.shop-scroll-hint {
    flex: 0 0 auto;
    color: #bda56f;
    font-size: 8px;
    letter-spacing: .04em;
}

@media (min-width: 1101px) and (min-height: 760px) {
    .fa-body[data-current-page="shop"] .main-viewport:has(.shop-market-screen) { overflow: hidden; }
    .fa-body[data-current-page="shop"] .page-root:has(.shop-market-screen) { height: 100%; min-height: 0; }
    .fa-body[data-current-page="shop"] .shop-market-screen { min-height: 0; }
}

@media (min-width: 1101px) and (max-height: 759px) {
    .shop-hero-banner { min-height: 190px; flex-basis: 190px; }
    .shop-market-screen .shop-showcase-grid { grid-auto-rows: minmax(148px, auto); }
    .shop-market-screen .shop-card { min-height: 148px; }
    .shop-market-screen .shop-card::before { width: 68px; height: 68px; flex-basis: 68px; }
}

@media (max-width: 900px) {
    .shop-market-screen { height: auto; min-height: 0; overflow: visible; }
    .shop-stock-scroll { overflow: visible; padding-right: 1px; }
    .shop-market-screen .shop-showcase-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
    .shop-scroll-hint { display: none; }
}

/* Ajustement fidèle au guichet de référence : enseigne, vitrine et objets dominants. */
.shop-hero-banner {
    min-height: 255px;
    flex-basis: 255px;
}

.shop-sign {
    position: absolute;
    z-index: 5;
    top: 28px;
    left: 22px;
    width: 245px;
    margin: 0;
    padding: 17px 22px 19px;
    border-width: 2px;
    text-align: center;
}

.shop-sign h1 {
    margin: 0 0 7px;
    font: 600 36px/1 Georgia, serif;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.shop-sign p {
    color: #d3c5a8;
    font: 500 13px/1.35 Georgia, serif;
}

.shop-sign em { color: #59d0c7; font-style: normal; }

.shop-hero-banner > .shopkeeper-stage {
    z-index: 2;
    inset: 0 265px 28px 250px;
}

.shop-hero-banner > .shopkeeper-stage > img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center bottom;
    transform: scale(1.08);
    transform-origin: center bottom;
}

.shop-featured-case {
    position: absolute;
    z-index: 4;
    right: 26px;
    bottom: 35px;
    display: grid;
    width: 185px;
    height: 118px;
    padding: 8px 10px 6px;
    border: 2px solid rgba(190, 137, 58, .72);
    border-radius: 48% 48% 5px 5px;
    background:
        radial-gradient(circle at 50% 35%, rgba(233, 181, 82, .18), transparent 42%),
        linear-gradient(180deg, rgba(11, 29, 36, .72), rgba(4, 13, 20, .94));
    box-shadow: inset 0 0 18px rgba(229, 171, 72, .1), 0 10px 22px rgba(0, 0, 0, .48);
    place-items: center;
}

.shop-featured-case::before {
    display: block;
    width: 76px;
    height: 76px;
    content: "";
    background-image: url("../generated/shop-atlas.png");
    background-repeat: no-repeat;
    background-size: 500% 200%;
    filter: drop-shadow(0 7px 8px rgba(0, 0, 0, .5));
}
.shop-featured-case.atlas-slot-0::before { background-position: 0 0; }
.shop-featured-case.atlas-slot-1::before { background-position: 25% 0; }
.shop-featured-case.atlas-slot-2::before { background-position: 50% 0; }
.shop-featured-case.atlas-slot-3::before { background-position: 75% 0; }
.shop-featured-case.atlas-slot-4::before { background-position: 100% 0; }
.shop-featured-case.atlas-slot-5::before { background-position: 0 100%; }
.shop-featured-case.atlas-slot-6::before { background-position: 25% 100%; }
.shop-featured-case.atlas-slot-7::before { background-position: 50% 100%; }
.shop-featured-case.atlas-slot-8::before { background-position: 75% 100%; }
.shop-featured-case.atlas-slot-9::before { background-position: 100% 100%; }

.shop-featured-case span {
    align-self: end;
    width: 100%;
    padding-top: 3px;
    border-top: 1px solid rgba(192, 142, 65, .45);
    color: #e6c888;
    font: 600 10px Georgia, serif;
    text-align: center;
}

.shop-hero-banner > .shop-wallet {
    top: 16px;
    right: 18px;
    width: 285px;
    min-width: 0;
    padding: 8px 11px;
}

.shop-market-screen .shop-showcase-grid {
    grid-auto-rows: minmax(190px, auto);
}

.shop-market-screen .shop-card {
    display: grid;
    min-height: 190px;
    padding: 10px;
    grid-template-columns: 128px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    column-gap: 10px;
}

.shop-market-screen .shop-card::before {
    width: 128px;
    height: 128px;
    margin: auto 0;
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    flex-basis: 128px;
}

.shop-market-screen .shop-card-inspect {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-content: center;
}

.shop-market-screen .shop-card h3 {
    min-height: 0;
    margin: 5px 0 7px;
    font-size: 16px;
    line-height: 1.15;
}

.shop-market-screen .shop-card p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.shop-market-screen .shop-card .rarity {
    width: fit-content;
    padding: 3px 7px;
    border: 1px solid rgba(78, 183, 181, .35);
    border-radius: 99px;
    background: rgba(16, 66, 77, .58);
    font-size: 8px;
}

.shop-market-screen .shop-card .price-row {
    grid-column: 2;
    grid-row: 2;
    margin-top: 7px;
}

.shop-market-screen .shop-card .price {
    padding: 5px 9px;
    border-radius: 99px;
    background: rgba(2, 12, 19, .72);
    font: 700 13px Georgia, serif;
}

.shop-market-screen .shop-card .price-row .button {
    min-width: 78px;
    padding: 8px 10px;
    font-size: 10px;
}

.shop-market-screen .shop-card.is-hero-portrait::before { display: none; }
.shop-market-screen .shop-card.is-hero-portrait { grid-template-columns: 128px minmax(0, 1fr); }
.shop-market-screen .shop-card.is-hero-portrait .shop-card-inspect { display: grid; grid-template-columns: 128px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 10px; grid-column: 1 / -1; }
.shop-market-screen .shop-card.is-hero-portrait .shop-hero-portrait { width: 128px; height: 128px; grid-row: 1 / span 3; }
.shop-market-screen .shop-card.is-hero-portrait .price-row { grid-column: 2; }

@media (min-width: 1101px) and (max-width: 1250px) {
    .shop-sign { width: 205px; left: 16px; }
    .shop-sign h1 { font-size: 30px; }
    .shop-hero-banner > .shopkeeper-stage { right: 225px; left: 205px; }
    .shop-featured-case { right: 16px; width: 155px; }
    .shop-hero-banner > .shop-wallet { right: 12px; width: 235px; }
    .shop-market-screen .shop-card { grid-template-columns: 110px minmax(0, 1fr); }
    .shop-market-screen .shop-card::before { width: 110px; height: 110px; flex-basis: 110px; }
    .shop-market-screen .shop-card h3 { font-size: 14px; }
}

@media (min-width: 1101px) and (max-height: 759px) {
    .shop-hero-banner { min-height: 205px; flex-basis: 205px; }
    .shop-sign { top: 18px; padding-block: 13px; }
    .shop-featured-case { height: 100px; }
    .shop-featured-case::before { width: 62px; height: 62px; }
    .shop-market-screen .shop-showcase-grid { grid-auto-rows: minmax(165px, auto); }
    .shop-market-screen .shop-card { min-height: 165px; grid-template-columns: 108px minmax(0, 1fr); }
    .shop-market-screen .shop-card::before { width: 108px; height: 108px; flex-basis: 108px; }
}

@media (max-width: 1100px) {
    .immersive-screen { height: auto; min-height: 0; overflow: visible; }
    .shop-game-layout,
    .companion-game-layout { grid-template-columns: 1fr; }
    .shopkeeper-stage { min-height: 330px; border-right: 0; border-bottom: 1px solid rgba(211, 157, 68, .42); }
    .shop-showcase-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); grid-template-rows: none; }
    .shop-inspection-panel { border-top: 1px solid rgba(211, 157, 68, .48); border-left: 0; }
    .boss-gallery-layout,
    .trophy-gallery-layout { grid-template-columns: 1fr; }
    .boss-inspection-panel,
    .trophy-reward-rail { border-top: 1px solid rgba(211, 157, 68, .48); border-left: 0; }
    .focus-orchestration-grid { grid-template-columns: 1fr; }
    .focus-orchestration-grid > section + section { border-top: 1px solid rgba(200, 149, 70, .42); border-left: 0; }
    .focus-companion-strip { grid-template-columns: 70px 1fr; }
    .focus-companion-strip form { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
    .immersive-heading { align-items: flex-start; flex-direction: column; }
    .immersive-heading-tools,
    .shop-wallet { width: 100%; min-width: 0; }
    .boss-gallery-screen .boss-grid,
    .trophy-hall .medal-gallery,
    .companion-tavern-screen .companion-guest-list > div,
    .shop-showcase-grid { grid-template-columns: 1fr; grid-template-rows: none; }
    .companion-tavern-screen .companion-inn { grid-template-columns: 1fr; }
    .companion-tavern-screen .companion-inn-art { min-height: 360px; }
    .grimoire-book { min-height: 520px; padding: 24px 20px 18px; }
    .grimoire-page { padding: 18px 12px; }
    .grimoire-page p { font-size: 15px; }
    .grimoire-book > footer { grid-template-columns: 1fr 1fr; }
    .grimoire-book > footer > span { grid-column: 1 / -1; grid-row: 1; }
}

@media (min-width: 1101px) and (max-height: 759px) {
    .immersive-heading { min-height: 92px; padding-block: 9px; }
    .immersive-heading h1 { font-size: clamp(27px, 3vw, 38px); }
    .shop-market-screen .shop-card::before { flex-basis: 58px; width: 58px; height: 58px; }
    .shop-market-screen .shop-card h3 { min-height: 25px; font-size: 10px; }
    .shop-market-screen .shop-card p { display: none; }
    .shop-market-screen .shop-card .price-row { margin-top: 2px; }
    .shop-market-screen .shop-card .price-row .button { padding-block: 4px; }
    .shop-shelf-footer { margin-top: 4px; }
    .boss-gallery-screen .boss-card img { height: clamp(86px, 15vh, 112px); }
    .boss-gallery-screen .boss-card-content { padding-block: 5px; }
    .boss-inspection-panel > img { height: clamp(110px, 19vh, 150px); }
    .trophy-feature { min-height: 86px; }
    .trophy-feature-medal { width: 78px; }
    .trophy-feature h2 { font-size: 24px; }
    .trophy-hall .medal-card::before { height: min(11vh, 90px); }
    .companion-tavern-screen .companion-guest img { height: 94px; }
    .companion-tavern-screen .companion-guest-list h2 { font-size: 15px; }
    .focus-orchestration-grid > section { padding-block: 9px; }
    .focus-target-choice { min-height: 38px; }
    .focus-time-console .focus-clock { font-size: clamp(48px, 5vw, 67px); }
    .focus-companion-strip { min-height: 70px; grid-template-columns: 58px minmax(160px, .9fr) minmax(220px, 1.1fr); }
    .focus-companion-strip img { width: 56px; height: 56px; }
    .fa-body[data-current-page="projects"] .main-viewport { overflow-y: auto; }
    .fa-body[data-current-page="projects"] .page-root { height: auto; min-height: 100%; }
    .fa-body[data-current-page="projects"] .quest-command-screen {
        height: auto;
        min-height: 670px;
        overflow: visible;
    }
}

/* ChronoQuest 1.7.3 — contrat de contraste global.
   Chaque surface porte désormais ses propres couleurs : aucun titre fonctionnel
   ne dépend plus de la couleur héritée d'un thème ou du navigateur. */
:root {
    --cq-dark-text-strong: #f6fbff;
    --cq-dark-text: #dfedf6;
    --cq-dark-muted: #b9cedb;
    --cq-dark-subtle: #9eb8c8;
    --cq-dark-field: #0b2537;
    --cq-dark-field-border: #4f91b1;
    --cq-parchment-text-strong: #241a12;
    --cq-parchment-text: #35271b;
    --cq-parchment-muted: #66513d;
}

.fa-body {
    color: var(--cq-dark-text);
    color-scheme: dark;
}

.page-header,
.card,
.data-card,
.task-project-group,
.routine-card,
.project-card,
.note-card,
.link-card,
.settings-card,
.admin-card,
.stats-card,
.empty-panel,
.calendar-shell,
.sync-banner,
.companion-guest-list,
.hero-bag,
.shop-stock {
    color: var(--cq-dark-text);
}

.page-header h1,
.page-header h2,
.page-header h3,
.task-project-group h2,
.data-card h3,
.routine-card h3,
.project-card h3,
.note-card h3,
.link-card h3,
.settings-card h3,
.admin-card h3,
.stats-card h3,
.empty-panel h2,
.calendar-shell h2,
.hero-bag h2,
.companion-card h3 {
    color: var(--cq-dark-text-strong) !important;
    opacity: 1;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .45);
}

.page-header p,
.task-project-group p,
.data-card p,
.routine-card p,
.project-card p,
.note-card p,
.link-card p,
.settings-card p,
.admin-card p,
.stats-card p,
.empty-panel p,
.calendar-shell p,
.sync-banner p,
.hero-bag p {
    color: var(--cq-dark-muted) !important;
    opacity: 1;
}

.data-card :is(small, .data-card-meta),
.routine-card small,
.project-card small,
.note-card small,
.link-card small,
.settings-card small,
.admin-card small,
.stats-card small,
.sync-banner small,
.hero-bag small {
    color: var(--cq-dark-subtle) !important;
    opacity: 1;
}

.data-card-meta strong,
.routine-card strong,
.status-badge,
.filter-bar,
.filter-bar label,
.calendar-event,
.calendar-day > strong {
    color: var(--cq-dark-text) !important;
    opacity: 1;
}

.eyebrow,
.card-title,
.task-project-group .eyebrow {
    color: #9bd9ff;
    opacity: 1;
}

/* Champs : fond sombre lisible, sans rectangle blanc agressif. */
.page-root :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea),
.modal :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea) {
    border-color: var(--cq-dark-field-border);
    background-color: var(--cq-dark-field);
    color: var(--cq-dark-text-strong);
    caret-color: #ffd477;
    opacity: 1;
}

.page-root :is(input, textarea)::placeholder,
.modal :is(input, textarea)::placeholder {
    color: #9fb9c9;
    opacity: 1;
}

.page-root select option,
.modal select option {
    background: #0b2537;
    color: #f6fbff;
}

.page-root label,
.modal label,
.form-modal label,
.dynamic-form label {
    color: #d9e8f1;
    opacity: 1;
}

.icon-button,
.close-button,
.button,
.top-action,
.nav-item {
    color: var(--cq-dark-text-strong);
}

/* Les contenus verrouillés grisent l'illustration, jamais le libellé. */
.trophy-hall .medal-card.locked,
.medal-card.locked {
    filter: none !important;
    opacity: 1 !important;
}

.trophy-hall .medal-card.locked::before,
.medal-card.locked::before {
    filter: grayscale(1) brightness(.58) !important;
    opacity: .58;
}

.trophy-hall .medal-card.locked strong,
.medal-card.locked strong {
    color: #c8d6de !important;
    opacity: 1;
}

.trophy-hall .medal-card.locked em,
.medal-card.locked em {
    color: #9fb5c2 !important;
    opacity: 1;
}

/* Les rares surfaces parchemin conservent volontairement du texte sombre. */
.fa-body[data-current-page="timer"] .focus-task-scroll,
.fa-body[data-current-page="timer"] .focus-task-scroll :is(h1, h2, h3, strong),
.fa-body[data-current-page="timer"] .focus-target-choice,
.fa-body[data-current-page="timer"] .focus-target-choice strong {
    color: var(--cq-parchment-text-strong) !important;
    text-shadow: none;
}

.fa-body[data-current-page="timer"] .focus-task-scroll :is(p, small),
.fa-body[data-current-page="timer"] .focus-target-choice small,
.fa-body[data-current-page="timer"] .focus-preparation-fields label {
    color: var(--cq-parchment-muted) !important;
    opacity: 1;
}

.fa-body[data-current-page="timer"] .focus-target-choice.is-selected {
    background: rgba(255, 228, 164, .76);
    box-shadow: inset 4px 0 #a96e19;
}

/* Ordinateurs 14 pouces : on compacte les cadres, pas les informations. */
@media (min-width: 901px) and (max-width: 1500px),
       (min-width: 901px) and (max-height: 850px) {
    .fa-body { font-size: 14px; }
    .page-header h1 { font-size: clamp(25px, 2vw, 31px); }
    .data-card h3,
    .routine-card h3,
    .project-card h3,
    .note-card h3,
    .link-card h3 { font-size: 14px; line-height: 1.25; }
    .data-card p,
    .routine-card p,
    .project-card p,
    .note-card p,
    .link-card p { font-size: 11px; line-height: 1.4; }
    .data-card :is(small, .data-card-meta),
    .routine-card small { font-size: 10px; line-height: 1.35; }
    .button.small { min-height: 32px; font-size: 11px; }
}

@media (max-width: 900px) {
    .page-header h1 { font-size: clamp(24px, 7vw, 31px); }
    .data-card h3,
    .routine-card h3 { font-size: 15px; }
    .data-card p,
    .routine-card p { font-size: 12px; white-space: normal; }
    .data-card :is(small, .data-card-meta),
    .routine-card small { font-size: 11px; }
}

@media (forced-colors: active) {
    .fa-body,
    .page-header,
    .card,
    .data-card,
    .routine-card,
    .task-project-group {
        background: Canvas;
        color: CanvasText;
        forced-color-adjust: auto;
    }

    .page-header :is(h1, h2, h3, p),
    .card :is(h1, h2, h3, p, small),
    .data-card :is(h1, h2, h3, p, small),
    .routine-card :is(h1, h2, h3, p, small) {
        color: CanvasText !important;
        text-shadow: none;
    }
}

/* ChronoQuest 1.7.5 — stabilisation finale et lot Compagnons enrichi. */
@media (min-width: 1101px) {
    /* La galerie accueille désormais six compagnons : trois cartes par rangée. */
    .fa-body[data-current-page="companions"] .companion-portrait-card:nth-child(4),
    .fa-body[data-current-page="companions"] .companion-portrait-card:nth-child(5),
    .fa-body[data-current-page="companions"] .companion-portrait-card:nth-child(6) {
        grid-column: span 2;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-card {
        grid-template-rows: minmax(0, 1fr) 134px;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-copy small {
        font-size: 13px;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-copy em,
    .fa-body[data-current-page="companions"] .companion-portrait-copy span,
    .fa-body[data-current-page="companions"] .companion-portrait-copy b {
        font-size: 11.5px;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-card[data-id="archibald"] .companion-portrait-art img {
        padding: 5px 8px 0 !important;
        object-position: center bottom !important;
    }

    /* Le sanctuaire ne peut plus déborder à gauche lorsque sa largeur change. */
    .fa-body[data-current-page="timer"] .focus-expanded-stage,
    .fa-body[data-current-page="timer"] .focus-expanded-grid {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-grid {
        grid-template-columns: minmax(150px, 13vw) minmax(0, 1fr) minmax(165px, 14vw);
    }

    .fa-body[data-current-page="timer"] .focus-expanded-rail {
        min-width: 0;
        padding-inline: clamp(7px, .8vw, 13px);
    }
}

/* Portable 14 pouces : davantage d'espace utile, sans réduire les textes. */
@media (min-width: 901px) and (max-width: 1500px),
       (min-width: 901px) and (max-height: 850px) {
    :root {
        --sidebar: clamp(178px, 12.8vw, 194px);
        --topbar: clamp(64px, 7.8dvh, 70px);
        --footer: clamp(28px, 3.4dvh, 33px);
    }

    .fa-body { font-size: 14px; }
    .sidebar { padding-inline: 8px; }
    .nav-item { min-height: 30px; font-size: 11.5px; }
    .topbar { gap: 7px; padding-inline: 9px; }
    .main-viewport { padding: 6px 8px; }

    .fa-body[data-current-page="timer"] .focus-expanded-grid {
        grid-template-columns: minmax(142px, 12.5vw) minmax(0, 1fr) minmax(156px, 13.5vw);
    }

    .fa-body[data-current-page="timer"] .focus-expanded-center {
        padding: 14px clamp(155px, 16vw, 194px) 13px 11px;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-center > aside {
        width: clamp(150px, 16vw, 194px);
    }

    .fa-body[data-current-page="timer"] .focus-expanded-center > aside blockquote {
        right: 66%;
        width: clamp(155px, 15vw, 185px);
        font-size: 12px;
    }
}

/* Verrou de contraste étendu aux intitulés interactifs et à l'identité. */
.fa-body :is(
    .task-card-title,
    .routine-card-title,
    .task-title,
    .routine-title,
    .project-title,
    .auth-panel h1,
    .auth-panel h2,
    .auth-panel h3,
    .login-dialog h2,
    .account-dialog h2,
    .form-modal legend,
    .dynamic-form legend
) {
    color: #f6fbff !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #f6fbff;
}

.fa-body :is(.auth-panel, .login-dialog, .account-dialog, .form-modal, .dynamic-form)
    :is(p, label, small, .field-help, .form-help) {
    color: #c6d9e5 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #c6d9e5;
}

@media (max-width: 700px) {
    /* Les écrans de gestion suivent leur contenu ; seuls les vrais tableaux immersifs
       conservent une section plein écran. */
    .fa-body:is(
        [data-current-page="tasks"],
        [data-current-page="routines"],
        [data-current-page="projects"],
        [data-current-page="calendar"],
        [data-current-page="distractions"],
        [data-current-page="notes"],
        [data-current-page="files"],
        [data-current-page="links"],
        [data-current-page="statistics"],
        [data-current-page="settings"]
    ) :is(.page-root, .immersive-screen) {
        min-height: 0;
        height: auto;
        scroll-snap-align: none;
    }

    .fa-body:is(
        [data-current-page="tasks"],
        [data-current-page="routines"],
        [data-current-page="projects"],
        [data-current-page="calendar"],
        [data-current-page="distractions"]
    ) :is(.data-grid, .card-grid, .content-grid, .project-grid) {
        align-content: start;
        gap: 10px;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-copy small {
        font-size: 13px;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-copy :is(em, span, b) {
        font-size: 12px;
    }
}

/* ChronoQuest 1.7.4 — densité native, sanctuaire contenu et mobile sans vide. */
@media (min-width: 1101px) and (max-width: 1700px),
       (min-width: 1101px) and (max-height: 950px) {
    :root {
        --sidebar: clamp(182px, 12.5vw, 205px);
        --topbar: clamp(64px, 7.8dvh, 72px);
        --footer: clamp(28px, 3.3dvh, 34px);
    }

    .main-viewport { padding: 6px 8px; }
    .page-header { min-height: 78px; margin-bottom: 8px; padding-block: 9px; }
    .page-header h1 { font-size: clamp(23px, 2vw, 31px); }
    .page-header p { font-size: 12px; }

    .fa-body[data-current-page="timer"] .app-shell {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .fa-body[data-current-page="timer"] .focus-orchestration,
    .fa-body[data-current-page="timer"] .focus-expanded-stage {
        width: 100%;
        max-width: 100%;
        height: 100%;
        margin: 0;
    }

    .fa-body[data-current-page="timer"] .focus-orchestration-grid {
        grid-template-columns: minmax(185px, 29%) minmax(300px, 39%) minmax(210px, 32%);
    }

    .fa-body[data-current-page="timer"] .focus-orchestration-grid > section {
        padding: 18px 14px 14px;
    }

    .fa-body[data-current-page="timer"] .focus-project-rail {
        padding-inline: 12px 16px;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-grid {
        width: 100%;
        grid-template-columns: minmax(145px, 13vw) minmax(340px, 1fr) minmax(160px, 14vw);
        overflow: hidden;
    }
}

@media (max-width: 700px) {
    .main-viewport {
        scroll-snap-type: none;
    }

    .page-root,
    .immersive-screen {
        height: auto;
        min-height: 0;
    }

    .fa-body.page-dashboard .dashboard-grid,
    .fa-body.page-dashboard .dashboard-bottom {
        gap: 10px;
        padding: 8px;
    }

    .fa-body.page-dashboard .dashboard-grid > .card,
    .fa-body.page-dashboard .dashboard-bottom > .card {
        min-height: 0;
        scroll-snap-align: none;
    }

    .fa-body.page-dashboard .dashboard-timer {
        min-height: 520px;
    }

    .shop-hero-banner,
    .shop-market-screen > .shop-shelves,
    .shop-market-screen .shop-card,
    .companion-portrait-card,
    .companion-detail-shell .companion-inn-art,
    .companion-detail-shell .companion-inn-main,
    .companion-detail-shell :is(.companion-welcome-copy, .companion-moment-stage, .companion-grimoire, .companion-wardrobe) {
        min-height: 0;
        scroll-snap-align: none;
    }

    .shop-hero-banner { min-height: 510px; }
    .companion-portrait-card { min-height: 560px; }
    .companion-detail-shell .companion-inn-art { min-height: 440px; }
}

@media (max-width: 900px) {
    .community-rail.is-collapsed {
        top: auto;
        right: 10px;
        bottom: 12px;
        width: 44px;
        height: 44px;
        padding: 0;
        overflow: visible;
        border: 0;
        border-radius: 50%;
        background: transparent;
        box-shadow: none;
    }

    .community-rail.is-collapsed::before,
    .community-rail.is-collapsed::after,
    .community-rail.is-collapsed .community-collapsed-label {
        display: none;
    }

    .community-rail.is-collapsed .community-header {
        width: 44px;
        min-height: 44px;
        padding: 0;
    }

    .community-rail.is-collapsed .community-header-actions {
        width: 44px;
        height: 44px;
    }

    .community-rail.is-collapsed .community-collapse {
        width: 44px;
        height: 44px;
        border-color: rgba(210, 186, 98, .52);
        border-radius: 50%;
        background: linear-gradient(145deg, rgba(19, 59, 65, .97), rgba(38, 28, 75, .97));
        box-shadow: 0 8px 22px rgba(0, 0, 0, .42);
    }
}

/* Priorité de cascade des écrans immersifs et de l’éditeur musical compact. */
.fa-body .trophy-hall {
    min-height: 680px;
    padding: 0;
    background:
        linear-gradient(180deg, rgba(2, 9, 16, .1), rgba(2, 9, 16, .58)),
        url("../images/immersive/trophy-hall-v1.png") center / cover no-repeat;
}

.music-admin-card .music-track-row {
    position: relative;
    grid-template-columns: 38px minmax(180px, 1.2fr) 112px 70px minmax(120px, .8fr) 108px auto auto;
    align-items: center;
    gap: 7px;
    min-height: 58px;
    padding: 7px;
}

.music-admin-card .music-track-row > small {
    grid-column: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-admin-card .music-credit-fields {
    display: grid;
    grid-column: auto;
    grid-template-columns: 1fr;
}

@media (max-width: 900px) {
    .music-admin-card .music-track-row { grid-template-columns: 38px minmax(0, 1fr) auto auto; }
    .music-admin-card .music-track-row > small,
    .music-admin-card .music-credit-menu { grid-column: 2 / -1; }
}

/* Correctifs compacts : le tableau de bord doit rester lisible avant le seuil mobile. */
@media (max-width: 900px) {
    .fa-body.page-dashboard .main-viewport {
        overflow-y: auto;
    }

    .fa-body.page-dashboard .dashboard-grid {
        display: grid;
        height: auto;
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: auto;
    }

    .fa-body.page-dashboard .dashboard-grid > .card,
    .fa-body.page-dashboard .dashboard-bottom > .card {
        position: relative;
        inset: auto;
        width: auto;
        height: auto;
        min-height: 0;
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    .fa-body.page-dashboard .dashboard-bottom {
        display: grid;
        grid-column: 1;
        grid-template-columns: minmax(0, 1fr);
    }

    .fa-body.page-dashboard .dashboard-timer {
        min-height: 340px;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-hero {
        height: 300px;
        min-height: 0;
        grid-template-columns: 84px minmax(0, 1fr) 220px;
    }

    .fa-body.page-dashboard .dashboard-timer .session-ring {
        align-self: start;
        width: 76px;
        height: 76px;
        margin: 30px 0 0 8px;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-main,
    .fa-body.page-dashboard .dashboard-timer .timer-companion {
        min-height: 0;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-main {
        padding: 12px 10px 14px 16px;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-display {
        margin: 4px 0 0;
        font-size: clamp(52px, 9vw, 72px);
        transform: none;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-task,
    .fa-body.page-dashboard .dashboard-timer .timer-actions,
    .fa-body.page-dashboard .dashboard-timer .timer-next-break {
        align-self: center;
        width: auto;
        max-width: min(100%, 390px);
        margin-left: 0;
        transform: none;
    }

    .fa-body.page-dashboard .dashboard-timer .task-time-summary.is-compact {
        align-self: center;
        width: min(240px, 100%);
        margin: 4px auto 0;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-actions {
        flex-wrap: nowrap;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-companion {
        padding: 10px 10px 14px;
        overflow: hidden;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-companion img,
    .fa-body.page-dashboard .dashboard-timer .timer-companion img[src*="elfe-dashboard.png"] {
        inset: 4px 0 35px;
        width: 100%;
        max-width: 100%;
        height: calc(100% - 32px);
        clip-path: none;
        object-fit: contain;
        object-position: bottom;
        transform: none;
    }

    .fa-body.page-dashboard .dashboard-timer .companion-bubble,
    .fa-body.page-dashboard .dashboard-timer .companion-bubble.is-long,
    .fa-body.page-dashboard .dashboard-timer .companion-bubble.is-very-long {
        position: relative;
        inset: auto;
        width: auto;
        max-width: 175px;
        min-height: 0;
        margin: 0 auto 106px;
        padding: 9px 10px;
        font-size: 9px;
    }

    .fa-body.page-dashboard .dashboard-timer .companion-switcher {
        right: 8px;
        bottom: 8px;
        left: 8px;
    }
}

/* L'atlas doit garder une vignette carrée ; une carte large ne doit pas zoomer la médaille. */
.trophy-hall .medal-card::before {
    width: 125px;
    max-width: 100%;
}

@media (max-width: 520px) {
    .fa-body.page-dashboard .dashboard-timer {
        min-height: 540px;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-hero {
        height: auto;
        grid-template-columns: minmax(0, 1fr);
    }

    .fa-body.page-dashboard .dashboard-timer .timer-main {
        min-height: 250px;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-companion {
        min-height: 250px;
    }
}

/* Bureau 1280 px : contenir tous les contrôles du chrono dans sa carte. */
@media (min-width: 1101px) and (max-width: 1420px) {
    .fa-body.page-dashboard .dashboard-timer .timer-hero {
        align-items: stretch;
        overflow: hidden;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-main,
    .fa-body.page-dashboard .dashboard-timer .timer-companion {
        height: 100%;
        min-height: 0;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-main {
        padding-block: 8px 4px;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-display {
        line-height: .92;
        transform: translate(-24px, -3px);
    }

    .fa-body.page-dashboard .dashboard-timer .timer-task {
        margin-top: 4px;
    }

    .fa-body.page-dashboard .dashboard-timer .task-time-summary.is-compact {
        min-height: 27px;
        margin-top: 2px;
        padding-block: 3px;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-actions {
        margin-top: 3px;
    }

    .fa-body.page-dashboard .dashboard-timer .timer-next-break {
        margin-top: 1px;
    }

    .fa-body.page-dashboard .dashboard-timer .companion-switcher {
        bottom: 7px;
        gap: 2px;
    }

    .fa-body.page-dashboard .dashboard-timer .companion-current-name {
        font-size: 10px;
        line-height: 1;
    }

    .fa-body.page-dashboard .dashboard-timer .companion-nameplate {
        min-height: 28px;
        padding: 3px 4px;
        font-size: 8.5px;
        line-height: 1;
        white-space: nowrap;
    }
}

/* 1.7.0 — overrides finaux placés après les règles historiques. */
@media (min-width: 1101px) {
    .shop-game-layout {
        grid-template-columns: minmax(0, 1fr) minmax(270px, .28fr);
        grid-template-rows: minmax(175px, .42fr) minmax(0, 1fr);
    }
    .shopkeeper-stage { grid-column: 1; grid-row: 1; }
    .shop-shelves { grid-column: 1; grid-row: 2; }
    .shop-inspection-panel { grid-column: 2; grid-row: 1 / 3; }

}

@media (min-width: 1101px) and (max-height: 759px) {
    .shop-game-layout { grid-template-rows: 132px minmax(0, 1fr); }
}

@media (min-width: 1101px) and (min-height: 760px) {
    .shop-game-layout { grid-template-rows: 220px minmax(0, 1fr); }
    .shopkeeper-stage > img {
        top: -16px;
        bottom: -20px;
        left: 39%;
        width: 340px;
        height: 264px;
        object-fit: cover;
        object-position: center 34%;
        border-radius: 48% 48% 0 0;
        -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
        mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
    }
    .shopkeeper-stage > div { top: 35px; }

    .shop-market-screen .shop-card { padding: 6px 8px; }
    .shop-market-screen .shop-card::before { width: 72px; height: 72px; flex-basis: 72px; }
    .shop-market-screen .shop-card h3 { min-height: 24px; font-size: 12px; }
    .shop-market-screen .shop-card p { font-size: 8px; -webkit-line-clamp: 1; }
    .shop-market-screen .price-row .button { padding-block: 5px; }

}

.trophy-hall .medal-card::before {
    width: 105px;
    height: 118px;
}

/* ChronoQuest 1.7.1 — boutique sans panneau latéral et galerie de compagnons. */
.shop-hero-banner {
    position: relative;
    display: grid;
    min-height: 220px;
    overflow: hidden;
    border-bottom: 1px solid rgba(211, 157, 68, .58);
    background:
        linear-gradient(90deg, rgba(2, 10, 17, .94) 0 27%, rgba(2, 10, 17, .18) 45% 70%, rgba(2, 10, 17, .86) 84% 100%),
        url("../images/immersive/shop-market-v1.png") center 34% / cover no-repeat;
    box-shadow: inset 0 -26px 45px rgba(0, 0, 0, .56);
}

.shop-sign {
    position: relative;
    z-index: 3;
    align-self: center;
    width: min(360px, 31%);
    margin-left: 24px;
    padding: 18px 22px;
    border: 2px solid rgba(211, 157, 68, .72);
    border-radius: 4px;
    background: linear-gradient(150deg, rgba(6, 20, 29, .98), rgba(11, 28, 33, .94));
    box-shadow: 0 12px 30px rgba(0, 0, 0, .52), inset 0 0 25px rgba(208, 147, 50, .08);
}

.shop-sign h1 {
    margin: 3px 0 7px;
    color: #f2d597;
    font: 600 clamp(29px, 3.1vw, 48px)/.98 Georgia, serif;
}

.shop-sign p { margin: 0; color: #b8d4d5; font-size: 11px; line-height: 1.45; }

.shop-hero-banner > .shopkeeper-stage {
    position: absolute;
    z-index: 2;
    inset: 0 25% 0 27%;
    min-height: 0;
    overflow: visible;
    border: 0;
    background: none;
}

.shop-hero-banner > .shopkeeper-stage > img {
    position: absolute;
    inset: -20px 0 -26px;
    width: 100%;
    height: calc(100% + 46px);
    max-width: none;
    object-fit: cover;
    object-position: center 24%;
    filter: brightness(1.16) saturate(1.08) drop-shadow(0 18px 25px rgba(0, 0, 0, .78));
    -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}

.shop-hero-banner > .shopkeeper-stage > div {
    position: absolute;
    z-index: 4;
    display: none;
    right: auto;
    bottom: 13px;
    left: 50%;
    width: 230px;
    padding: 5px 12px;
    border: 1px solid rgba(214, 161, 72, .58);
    border-radius: 6px;
    background: rgba(4, 17, 25, .88);
    text-align: center;
    transform: translateX(-50%);
}

.shop-hero-banner > .shopkeeper-stage h2 { margin: 1px 0; font-size: 17px; }
.shop-hero-banner > .shopkeeper-stage p { margin: 1px 0; font-size: 8px; }

.shop-hero-banner > .shop-wallet {
    position: absolute;
    z-index: 5;
    top: 22px;
    right: 22px;
    width: min(330px, 30%);
}

.shop-market-screen > .shop-shelves {
    min-height: 0;
    flex: 1;
    padding: 10px 14px 12px;
    background: linear-gradient(180deg, rgba(4, 16, 24, .82), rgba(2, 10, 16, .94));
}

.shop-market-screen .shop-showcase-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.shop-market-screen .shop-card-inspect { cursor: default; }

.shop-pagination {
    margin-left: auto;
    padding: 5px 7px;
    border: 1px solid rgba(213, 161, 73, .42);
    border-radius: 9px;
    background: rgba(3, 15, 24, .94);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .34);
}

.shop-pagination button {
    width: 42px;
    height: 42px;
    font-size: 20px;
}

.shop-pagination span { padding-inline: 7px; color: #edd095; font-size: 11px; font-weight: 800; }

.companion-heading { border-bottom: 1px solid rgba(211, 157, 68, .45); }

.companion-gallery-view {
    background:
        linear-gradient(180deg, rgba(2, 9, 15, .14), rgba(2, 9, 15, .62)),
        url("../images/immersive/companion-inn-v1.png") center / cover no-repeat;
}

.companion-portrait-grid {
    display: grid;
    min-height: 0;
    flex: 1;
    grid-template-columns: repeat(3, minmax(190px, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}

.companion-portrait-card {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-rows: minmax(115px, 1fr) auto;
    padding: 0;
    overflow: hidden;
    border: 2px solid rgba(196, 143, 59, .62);
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(8, 24, 31, .78), rgba(3, 13, 21, .97));
    box-shadow: 0 14px 28px rgba(0, 0, 0, .34), inset 0 0 20px rgba(210, 153, 58, .05);
    color: #dce8e7;
    cursor: pointer;
    text-align: center;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.companion-portrait-card:hover,
.companion-portrait-card:focus-visible {
    border-color: #69d6d2;
    box-shadow: 0 0 0 2px rgba(70, 201, 200, .22), 0 18px 34px rgba(0, 0, 0, .46);
    outline: 0;
    transform: translateY(-2px);
}

.companion-portrait-card.is-active::after {
    position: absolute;
    z-index: 4;
    top: 9px;
    right: 9px;
    padding: 4px 7px;
    border: 1px solid rgba(83, 224, 169, .58);
    border-radius: 999px;
    content: "Compagnon actif";
    background: rgba(15, 91, 63, .9);
    color: #dffff0;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.companion-portrait-art {
    position: relative;
    display: block;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 25%, rgba(101, 202, 207, .16), transparent 42%),
        linear-gradient(180deg, rgba(4, 20, 31, .35), rgba(2, 10, 17, .92));
}

.companion-portrait-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 13px 17px rgba(0, 0, 0, .68));
}

.companion-portrait-copy {
    display: grid;
    gap: 3px;
    min-height: 116px;
    padding: 9px 13px 11px;
    border-top: 1px solid rgba(205, 153, 67, .42);
    background: linear-gradient(180deg, rgba(4, 17, 25, .94), rgba(3, 12, 20, .99));
}

.companion-portrait-copy strong { color: #efd196; font: 600 22px Georgia, serif; }
.companion-portrait-copy small { color: #c5b58f; font-size: 12px; }
.companion-portrait-copy em { color: #d8b866; font: normal 11.5px Georgia, serif; }
.companion-portrait-copy span { color: #aebfc1; font-size: 11px; line-height: 1.4; }
.companion-portrait-copy b { color: #59d1ca; font-size: 10.5px; }

.companion-detail-view { background-position: center; }
.companion-gallery-return { min-height: 40px; }
.companion-detail-shell {
    min-height: 0;
    flex: 1;
    margin: 12px;
    grid-template-columns: minmax(280px, 38%) minmax(0, 1fr);
    overflow: hidden;
    border-color: rgba(210, 156, 68, .62);
    background: rgba(3, 15, 24, .91);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .45), inset 0 0 30px rgba(201, 143, 53, .05);
}

@media (min-width: 1101px) {
    .fa-body[data-current-page="shop"] .shop-market-screen,
    .fa-body[data-current-page="companions"] .companion-tavern-screen { height: 100%; }

    .fa-body[data-current-page="shop"] .shop-hero-banner { flex: 0 0 clamp(185px, 30vh, 245px); }
    .fa-body[data-current-page="companions"] .companion-heading { flex: 0 0 auto; }
}

@media (min-width: 1101px) and (max-height: 759px) {
    .fa-body[data-current-page="shop"] .shop-hero-banner { flex-basis: 158px; min-height: 158px; }
    .shop-sign { padding: 10px 15px; }
    .shop-sign h1 { font-size: 30px; }
    .shop-sign p { font-size: 9px; }
    .shop-hero-banner > .shopkeeper-stage > div { display: none; }
    .companion-portrait-copy { min-height: 82px; padding-block: 5px 7px; }
    .companion-portrait-copy strong { font-size: 17px; }
    .companion-portrait-copy small { font-size: 10px; }
    .companion-portrait-copy em { font-size: 9.5px; }
    .companion-portrait-copy b { font-size: 9px; }
    .companion-portrait-copy span { display: none; }
}

/* Smartphone : navigation réellement utilisable et sections cadrées écran par écran. */
@media (max-width: 700px) {
    :root { --topbar: 58px; --footer: 0px; }

    html,
    body,
    .fa-body { width: 100%; max-width: 100%; overflow-x: hidden; }

    .app-shell { min-height: 100dvh; }
    .app-column { grid-template-rows: var(--topbar) minmax(0, 1fr); min-height: 100dvh; }

    .topbar {
        z-index: 140;
        gap: 5px;
        min-height: var(--topbar);
        padding: 5px 7px;
    }

    .mobile-brand { flex: 0 0 auto; margin: 0; }
    .mobile-brand .menu-toggle {
        position: relative;
        z-index: 230;
        display: grid;
        width: 46px;
        height: 46px;
        border-color: rgba(103, 205, 231, .48);
        background: linear-gradient(145deg, rgba(15, 54, 74, .98), rgba(7, 29, 46, .98));
        color: #e7f8ff;
        font-size: 23px;
        place-items: center;
    }

    .mobile-brand img,
    .mobile-brand-home { display: block; width: 66px; height: auto; }

    .topbar-quest,
    .topbar-companion,
    .topbar-hero,
    .economy-counter.merit,
    .momentum,
    .sync-state,
    .theme-action,
    .mobile-return { display: none !important; }

    .topbar-identity { flex: 1 1 auto; border-radius: 10px; }
    .economy-counter { min-width: 0; flex: 1; border: 0; }
    .economy-counter small { display: block; font-size: 7px; }
    .topbar-actions { flex: 0 0 auto; margin: 0; }
    .topbar-actions .top-action:last-of-type {
        display: grid;
        width: 42px;
        min-width: 42px;
        height: 42px;
        padding: 0;
        place-items: center;
    }
    .topbar-actions .top-action:last-of-type small { display: none; }

    .mini-timer { min-width: 68px; min-height: 42px; margin: 0; }

    .sidebar {
        z-index: 240;
        width: min(86vw, 320px);
        padding: 10px 12px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        box-shadow: 24px 0 60px rgba(0, 0, 0, .7);
    }
    .sidebar.is-open::before { z-index: -1; background: rgba(0, 5, 10, .76); }
    .sidebar-close { width: 44px; height: 44px; font-size: 25px; }
    .sidebar-brand { min-height: 56px; }
    .sidebar-brand .brand-meta { display: block; }
    .main-nav { overflow: visible; flex: 0 0 auto; }
    .nav-item { min-height: 44px; font-size: 13px; }
    .primary-create { min-height: 48px; }

    .community-rail {
        z-index: 210;
        width: 100vw;
        max-width: none;
        border-left: 0;
    }
    .community-rail.is-collapsed { z-index: 150; right: 12px; bottom: 12px; }
    .fa-body[data-current-page="shop"] .community-rail.is-collapsed { bottom: 76px; }

    .main-viewport {
        height: calc(100dvh - var(--topbar));
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-behavior: smooth;
        scroll-snap-type: y proximity;
    }

    .page-root { min-height: 100%; }
    .immersive-screen {
        width: 100%;
        min-height: calc(100dvh - var(--topbar));
        border-radius: 0;
        background-attachment: scroll !important;
        background-position: center top !important;
        background-size: auto 100dvh !important;
    }

    .immersive-heading {
        min-height: 150px;
        padding: 18px 15px;
        scroll-snap-align: start;
        background: linear-gradient(180deg, rgba(3, 13, 22, .98), rgba(4, 18, 28, .9));
    }
    .immersive-heading h1 { font-size: clamp(29px, 10vw, 43px); }
    .immersive-heading p { max-width: none; font-size: 12px; }

    .fa-body.page-dashboard .dashboard-grid,
    .fa-body.page-dashboard .dashboard-bottom { gap: 0; }
    .fa-body.page-dashboard .dashboard-grid > .card,
    .fa-body.page-dashboard .dashboard-bottom > .card {
        min-height: calc(100dvh - var(--topbar));
        border-radius: 0;
        scroll-snap-align: start;
        scroll-snap-stop: normal;
    }
    .fa-body.page-dashboard .dashboard-timer { min-height: calc(100dvh - var(--topbar)); }
    .fa-body.page-dashboard .dashboard-timer .timer-main { min-height: 285px; }
    .fa-body.page-dashboard .dashboard-timer .timer-companion { min-height: 310px; }
    .fa-body.page-dashboard .dashboard-timer .timer-companion img,
    .fa-body.page-dashboard .dashboard-timer .timer-companion img[src*="elfe-dashboard.png"] {
        inset: 8px 4% 42px;
        width: 92%;
        height: calc(100% - 48px);
        object-fit: contain;
        object-position: center bottom;
    }
    .fa-body.page-dashboard .dashboard-timer .companion-bubble,
    .fa-body.page-dashboard .dashboard-timer .companion-bubble.is-long,
    .fa-body.page-dashboard .dashboard-timer .companion-bubble.is-very-long {
        z-index: 3;
        max-width: min(190px, 56%);
        margin: 15px 10px auto auto;
        font-size: 10px;
    }

    .shop-market-screen { display: block; background-image: none; }
    .shop-hero-banner {
        min-height: calc(100dvh - var(--topbar));
        scroll-snap-align: start;
        background:
            linear-gradient(180deg, rgba(2, 9, 15, .72), rgba(2, 9, 15, .08) 30%, rgba(2, 9, 15, .84) 100%),
            url("../images/immersive/shop-market-v1.png") center / cover no-repeat;
    }
    .shop-sign {
        position: absolute;
        top: 14px;
        right: 12px;
        left: 12px;
        width: auto;
        margin: 0;
        padding: 12px 14px;
        text-align: center;
    }
    .shop-sign h1 { font-size: 34px; }
    .shop-sign p { font-size: 10px; }
    .shop-hero-banner > .shopkeeper-stage {
        inset: 120px 4px 78px;
    }
    .shop-hero-banner > .shopkeeper-stage > img {
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center bottom;
    }
    .shop-hero-banner > .shopkeeper-stage > div {
        display: block;
        bottom: 0;
        width: min(250px, 80%);
    }
    .shop-hero-banner > .shop-wallet {
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        min-width: 0;
        background: rgba(3, 14, 22, .95);
    }
    .shop-market-screen > .shop-shelves {
        min-height: calc(100dvh - var(--topbar));
        padding: 10px;
        scroll-snap-align: start;
    }
    .shop-category-tabs {
        position: sticky;
        z-index: 8;
        top: 0;
        margin: -10px -10px 10px;
        padding: 10px;
        background: rgba(3, 14, 22, .97);
    }
    .shop-category-tabs button { min-height: 43px; padding-inline: 14px; font-size: 11px; }
    .shop-market-screen .shop-showcase-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .shop-market-screen .shop-card {
        min-height: calc(100dvh - 175px);
        padding: 14px;
        scroll-snap-align: start;
    }
    .shop-market-screen .shop-card::before { width: min(48vw, 180px); height: min(48vw, 180px); flex-basis: min(48vw, 180px); }
    .shop-market-screen .shop-card h3 { min-height: 0; font-size: 22px; text-align: center; }
    .shop-market-screen .shop-card p { display: block; font-size: 12px; line-height: 1.5; text-align: center; -webkit-line-clamp: unset; }
    .shop-market-screen .shop-card .rarity { font-size: 10px; }
    .shop-market-screen .price-row { margin-top: auto; }
    .shop-market-screen .price-row .button { min-height: 46px; padding: 10px 16px; font-size: 12px; }
    .shop-shelf-footer {
        position: sticky;
        z-index: 9;
        right: 0;
        bottom: 0;
        left: 0;
        align-items: flex-end;
        padding: 7px;
        background: rgba(3, 13, 21, .96);
    }
    .hero-bag-compact { display: none; }
    .shop-pagination { margin-left: auto; }
    .shop-pagination button { width: 50px; height: 50px; font-size: 25px; }
    .shop-pagination span { font-size: 12px; }

    .companion-tavern-screen { display: block; background-size: cover !important; }
    .companion-portrait-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: none;
        gap: 0;
        padding: 0;
    }
    .companion-portrait-card {
        min-height: calc(100dvh - var(--topbar));
        grid-template-rows: minmax(0, 68%) minmax(0, 32%);
        border-width: 0 0 2px;
        border-radius: 0;
        scroll-snap-align: start;
    }
    .companion-portrait-art img { padding: 16px 12px 0; }
    .companion-portrait-copy { align-content: center; min-height: 0; padding: 14px 18px 20px; }
    .companion-portrait-copy strong { font-size: 28px; }
    .companion-portrait-copy small { font-size: 12px; }
    .companion-portrait-copy em { font-size: 11px; }
    .companion-portrait-copy span { font-size: 11px; }
    .companion-portrait-copy b { font-size: 10px; }

    .companion-gallery-return { width: 100%; min-height: 46px; }
    .companion-detail-shell {
        display: grid;
        margin: 0;
        grid-template-columns: 1fr;
        border-width: 1px 0 0;
        border-radius: 0;
        overflow: visible;
    }
    .companion-detail-shell .companion-inn-art {
        min-height: calc(100dvh - var(--topbar));
        scroll-snap-align: start;
    }
    .companion-detail-shell .companion-inn-art img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
    .companion-detail-shell .companion-inn-main { min-height: calc(100dvh - var(--topbar)); scroll-snap-align: start; }
    .companion-detail-shell .companion-inn-tabs {
        position: sticky;
        z-index: 8;
        top: 0;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        padding: 8px;
        background: rgba(3, 14, 23, .98);
    }
    .companion-detail-shell .companion-inn-tabs button { min-height: 44px; font-size: 10px; }
    .companion-detail-shell .companion-welcome-copy,
    .companion-detail-shell .companion-moment-stage,
    .companion-detail-shell .companion-grimoire,
    .companion-detail-shell .companion-wardrobe { min-height: calc(100dvh - 190px); overflow: visible; }

    .boss-gallery-screen .boss-card,
    .trophy-hall .medal-card,
    .quest-command-screen .quest-stage,
    .focus-orchestration-grid > section { scroll-snap-align: start; }
    .boss-gallery-screen .boss-card img,
    .boss-inspection-panel > img { object-fit: contain; object-position: center; }
}

@media (max-width: 390px) {
    .mobile-brand-home { display: none; }
    .economy-counter small { display: none; }
    .shop-wallet { grid-template-columns: 27px auto auto 18px auto auto; gap: 2px 5px; padding-inline: 8px; }
    .shop-wallet strong { font-size: 16px; }
    .shop-wallet small { font-size: 7px; }
}

/* Navigation tactile : le volet reste prioritaire dans les intégrations mobiles étroites. */
@media (max-width: 1100px) {
    .mobile-brand .menu-toggle {
        position: relative;
        z-index: 260;
        pointer-events: auto;
        touch-action: manipulation;
    }

    .sidebar {
        z-index: 300;
        pointer-events: none;
        will-change: transform;
    }

    .sidebar.is-open {
        pointer-events: auto;
        transform: translate3d(0, 0, 0) !important;
    }
}

/* Boutique 1.7.1.7 — calage final après les anciens correctifs compacts. */
@media (min-width: 1101px) {
    .fa-body[data-current-page="shop"] .shop-market-screen {
        display: flex;
        min-height: 0;
        height: 100%;
        flex-direction: column;
        overflow: hidden;
        border: 1px solid rgba(202, 148, 61, .7);
        border-radius: 12px;
        background: #06131d;
    }

    .fa-body[data-current-page="shop"] .shop-hero-banner {
        position: relative;
        display: block;
        min-height: 255px;
        height: 255px;
        flex: 0 0 255px;
        overflow: hidden;
        border-bottom: 2px solid rgba(211, 157, 68, .68);
        background:
            linear-gradient(90deg, rgba(2, 10, 17, .94) 0 25%, rgba(2, 10, 17, .12) 41% 70%, rgba(2, 10, 17, .8) 86% 100%),
            url("../images/immersive/shop-market-v1.png") center 35% / cover no-repeat;
        box-shadow: inset 0 -35px 55px rgba(0, 0, 0, .68);
    }

    .fa-body[data-current-page="shop"] .shop-sign {
        position: absolute;
        z-index: 6;
        top: 28px;
        left: 22px;
        width: 245px;
        margin: 0;
        padding: 17px 22px 19px;
        border: 2px solid rgba(211, 157, 68, .78);
        border-radius: 4px;
        background: linear-gradient(150deg, rgba(6, 20, 29, .98), rgba(11, 28, 33, .96));
        box-shadow: 0 12px 30px rgba(0, 0, 0, .62), inset 0 0 25px rgba(208, 147, 50, .1);
        text-align: center;
    }

    .fa-body[data-current-page="shop"] .shop-sign h1 {
        margin: 0 0 7px;
        color: #f2d597;
        font: 600 36px/1 Georgia, serif;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .fa-body[data-current-page="shop"] .shop-sign p {
        margin: 0;
        color: #d3c5a8;
        font: 500 13px/1.35 Georgia, serif;
    }

    .fa-body[data-current-page="shop"] .shop-sign em { color: #59d0c7; font-style: normal; }

    .fa-body[data-current-page="shop"] .shop-hero-banner > .shopkeeper-stage {
        position: absolute;
        z-index: 3;
        inset: 0 250px 0 245px;
        display: block;
        min-height: 0;
        overflow: visible;
        border: 0;
        background: none;
    }

    .fa-body[data-current-page="shop"] .shop-hero-banner > .shopkeeper-stage > img {
        position: absolute;
        top: -32px;
        right: 0;
        bottom: -20px;
        left: 0;
        display: block;
        width: 100%;
        height: calc(100% + 52px);
        max-width: none;
        margin: 0;
        object-fit: contain;
        object-position: center bottom;
        filter: brightness(1.14) saturate(1.08) drop-shadow(0 18px 24px rgba(0, 0, 0, .78));
        opacity: 1;
        transform: none;
        -webkit-mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
        mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
    }

    .fa-body[data-current-page="shop"] .shop-hero-banner > .shopkeeper-stage > div { display: none; }

    .fa-body[data-current-page="shop"] .shop-hero-banner > .shop-wallet {
        position: absolute;
        z-index: 7;
        top: 16px;
        right: 18px;
        bottom: auto;
        left: auto;
        display: grid;
        width: 285px;
        min-width: 0;
        padding: 8px 11px;
    }

    .fa-body[data-current-page="shop"] .shop-featured-case {
        position: absolute;
        z-index: 6;
        right: 26px;
        bottom: 25px;
        display: grid;
        width: 185px;
        height: 128px;
        padding: 7px 10px 6px;
        border: 2px solid rgba(190, 137, 58, .78);
        border-radius: 48% 48% 5px 5px;
        background: radial-gradient(circle at 50% 35%, rgba(233, 181, 82, .22), transparent 45%), linear-gradient(180deg, rgba(11, 29, 36, .78), rgba(4, 13, 20, .96));
        box-shadow: inset 0 0 20px rgba(229, 171, 72, .14), 0 10px 22px rgba(0, 0, 0, .52);
        place-items: center;
    }

    .fa-body[data-current-page="shop"] .shop-featured-case::before {
        display: block;
        width: 88px;
        height: 88px;
        content: "";
        background-image: url("../generated/shop-atlas.png");
        background-repeat: no-repeat;
        background-size: 500% 200%;
        filter: drop-shadow(0 8px 9px rgba(0, 0, 0, .58));
        opacity: 1;
    }

    .fa-body[data-current-page="shop"] .shop-featured-case span {
        align-self: end;
        width: 100%;
        padding-top: 3px;
        border-top: 1px solid rgba(192, 142, 65, .48);
        color: #e6c888;
        font: 600 10px Georgia, serif;
        text-align: center;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen > .shop-shelves {
        display: flex;
        min-height: 0;
        flex: 1 1 auto;
        flex-direction: column;
        padding: 10px 14px 12px;
        overflow: hidden;
        background: linear-gradient(180deg, rgba(4, 16, 24, .88), rgba(2, 10, 16, .97));
    }

    .fa-body[data-current-page="shop"] .shop-stock-scroll {
        min-height: 0;
        flex: 1 1 auto;
        padding: 2px 5px 4px 1px;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-color: #b48139 rgba(3, 15, 23, .82);
        scrollbar-width: thin;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-showcase-grid {
        display: grid;
        min-height: 0;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-rows: minmax(196px, auto);
        gap: 10px;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card {
        display: grid;
        min-width: 0;
        min-height: 196px;
        padding: 12px 11px;
        grid-template-columns: 134px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        column-gap: 11px;
        overflow: hidden;
        border: 1px solid rgba(198, 145, 61, .64);
        border-radius: 8px;
        background: linear-gradient(145deg, rgba(8, 25, 35, .98), rgba(3, 14, 22, .98));
        box-shadow: inset 0 0 24px rgba(210, 150, 53, .04), 0 8px 18px rgba(0, 0, 0, .28);
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card::before {
        position: relative;
        inset: auto;
        display: block;
        width: 134px;
        height: 134px;
        margin: auto 0;
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: center;
        flex: 0 0 134px;
        content: "";
        background-image: url("../generated/shop-atlas.png");
        background-repeat: no-repeat;
        background-size: 500% 200%;
        filter: drop-shadow(0 9px 12px rgba(0, 0, 0, .5));
        opacity: 1;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card-inspect {
        display: flex;
        min-width: 0;
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        justify-content: center;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card h3 {
        min-height: 0;
        margin: 5px 0 7px;
        color: #efd49a;
        font: 600 16px/1.15 Georgia, serif;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card p {
        display: -webkit-box;
        margin: 0;
        overflow: hidden;
        color: #aebec2;
        font-size: 10px;
        line-height: 1.45;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card .rarity {
        width: fit-content;
        padding: 3px 7px;
        border: 1px solid rgba(78, 183, 181, .4);
        border-radius: 99px;
        background: rgba(16, 66, 77, .62);
        color: #6dd8d2;
        font-size: 8px;
        text-transform: uppercase;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card .price-row {
        display: flex;
        margin-top: 8px;
        grid-column: 2;
        grid-row: 2;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card .price {
        padding: 5px 9px;
        border-radius: 99px;
        background: rgba(2, 12, 19, .78);
        color: #e7c676;
        font: 700 13px Georgia, serif;
        white-space: nowrap;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card .price-row .button {
        min-width: 74px;
        min-height: 34px;
        padding: 7px 9px;
        font-size: 9px;
    }

    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card.is-hero-portrait::before { display: none; }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card.is-hero-portrait { grid-template-columns: 134px minmax(0, 1fr); }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card.is-hero-portrait .shop-card-inspect {
        display: grid;
        grid-template-columns: 134px minmax(0, 1fr);
        grid-template-rows: auto auto 1fr;
        column-gap: 11px;
        grid-column: 1 / -1;
    }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card.is-hero-portrait .shop-hero-portrait {
        width: 134px;
        height: 134px;
        grid-row: 1 / span 3;
    }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card.is-hero-portrait .price-row { grid-column: 2; }

    .fa-body[data-current-page="shop"] .shop-shelf-footer {
        display: flex;
        margin-top: 8px;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
}

/* La maquette stricte doit rester le dernier mot de la cascade desktop. */
@media (min-width: 1101px) {
    .fa-body[data-current-page="shop"] .shop-hero-banner {
        min-height: clamp(305px, 36dvh, 340px);
        height: clamp(305px, 36dvh, 340px);
        flex-basis: clamp(305px, 36dvh, 340px);
        background: linear-gradient(90deg, rgba(2, 9, 15, .5) 0 25%, rgba(2, 9, 15, .04) 42% 72%, rgba(2, 9, 15, .38) 88% 100%), url("../images/immersive/shop-market-v1.png") center 50% / 100% auto no-repeat, #07121b;
        box-shadow: inset 0 -22px 42px rgba(0, 0, 0, .45);
    }

    .fa-body[data-current-page="shop"] .shop-hero-banner::after {
        position: absolute;
        z-index: 5;
        right: 0;
        bottom: 0;
        left: 0;
        height: 46px;
        background: linear-gradient(180deg, #7c5125 0, #3e2411 34%, #1c1009 100%);
        border-top: 2px solid #a77738;
        border-bottom: 2px solid #120b06;
        box-shadow: 0 -5px 18px rgba(0, 0, 0, .4), inset 0 5px 7px rgba(255, 207, 112, .1);
        content: "";
        pointer-events: none;
    }

    .fa-body[data-current-page="shop"] .shop-sign {
        top: 52px;
        left: 54px;
        width: 284px;
        margin: 0;
        padding: 20px 24px 22px;
        border-color: rgba(181, 128, 52, .92);
        background: linear-gradient(155deg, rgba(7, 22, 28, .98), rgba(13, 27, 28, .98));
        text-align: center;
    }
    .fa-body[data-current-page="shop"] .shop-sign h1 { margin-bottom: 10px; font-size: 39px; }
    .fa-body[data-current-page="shop"] .shop-sign p { font-size: 15px; line-height: 1.42; }

    .fa-body[data-current-page="shop"] .shop-hero-banner > .shopkeeper-stage {
        z-index: 4;
        inset: 0 260px 0 315px;
        overflow: hidden;
    }
    .fa-body[data-current-page="shop"] .shop-hero-banner > .shopkeeper-stage > img {
        top: auto;
        right: auto;
        bottom: 20px;
        left: 50%;
        width: min(590px, 50vw);
        height: auto;
        max-height: none;
        object-fit: initial;
        object-position: initial;
        filter: brightness(1.04) saturate(1.02) drop-shadow(0 14px 20px rgba(0, 0, 0, .62));
        transform: translateX(-50%);
        -webkit-mask-image: none;
        mask-image: none;
    }

    .fa-body[data-current-page="shop"] .shop-hero-banner > .shop-wallet {
        top: 24px;
        right: 28px;
        bottom: auto;
        left: auto;
        width: 320px;
        padding: 10px 14px;
    }
    .fa-body[data-current-page="shop"] .shop-featured-case {
        right: 42px;
        bottom: 50px;
        width: 205px;
        height: 142px;
        border-radius: 50% 50% 5px 5px;
    }
    .fa-body[data-current-page="shop"] .shop-featured-case::before { width: 100px; height: 100px; }

    .fa-body[data-current-page="shop"] .shop-market-screen > .shop-shelves {
        padding: 0 14px 10px;
        background: linear-gradient(180deg, rgba(4, 15, 22, .9), rgba(2, 9, 15, .97)), url("../images/immersive/shop-market-v1.png") center bottom / cover no-repeat;
    }
    .fa-body[data-current-page="shop"] .shop-category-tabs {
        flex: 0 0 50px;
        align-items: center;
        gap: 8px;
        margin: 0 0 10px;
        padding: 7px 0 8px;
        overflow-x: auto;
        border-bottom: 1px solid rgba(190, 135, 55, .5);
    }
    .fa-body[data-current-page="shop"] .shop-category-tabs button {
        min-height: 34px;
        padding: 7px 15px;
        border-color: rgba(180, 127, 51, .7);
        background: rgba(4, 16, 24, .95);
        color: #d7c6a4;
        font: 600 10px Georgia, serif;
    }

    .fa-body[data-current-page="shop"] .shop-stock-scroll { padding: 0 7px 2px 0; }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-showcase-grid { grid-auto-rows: minmax(220px, auto); gap: 10px; }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card {
        min-height: 220px;
        padding: 13px;
        grid-template-columns: 158px minmax(0, 1fr);
        column-gap: 12px;
    }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card::before { width: 150px; height: 150px; flex-basis: 150px; }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card h3 { margin: 7px 0 9px; font-size: 19px; }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card p { font-size: 11px; line-height: 1.5; -webkit-line-clamp: 4; }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card .rarity { padding: 4px 8px; font-size: 9px; }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card .price { padding-inline: 7px; font-size: 14px; }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card .price-row .button { min-width: 68px; min-height: 36px; padding-inline: 7px; font-size: 9px; }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card.is-hero-portrait,
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card.is-hero-portrait .shop-card-inspect { grid-template-columns: 150px minmax(0, 1fr); }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card.is-hero-portrait .shop-hero-portrait { width: 150px; height: 150px; }
}

@media (min-width: 1101px) {
    .fa-body[data-current-page="shop"] .shop-hero-banner > .shopkeeper-stage > img {
        bottom: 0;
        width: min(400px, 36vw);
    }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-showcase-grid {
        grid-auto-rows: 220px;
    }
    .fa-body[data-current-page="shop"] .shop-market-screen .shop-card {
        height: 220px;
        min-height: 0;
        grid-template-columns: 150px minmax(0, 1fr);
    }
}

/* Compagnons 1.7.1.10 — taverne plein écran et fiches lisibles. */
@media (min-width: 1101px) {
    .fa-body[data-current-page="companions"] .app-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .fa-body[data-current-page="companions"] .community-rail,
    .fa-body[data-current-page="companions"] .topbar,
    .fa-body[data-current-page="companions"] .bottom-mantra {
        display: none !important;
    }

    .fa-body[data-current-page="companions"] .app-column,
    .fa-body[data-current-page="companions"] .main-viewport {
        height: 100dvh;
        min-height: 100dvh;
    }

    .fa-body[data-current-page="companions"] .main-viewport {
        padding: 0;
        overflow: hidden;
    }

    .fa-body[data-current-page="companions"] .companion-tavern-screen {
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        overflow: hidden;
        border: 0;
        border-radius: 0;
        background:
            linear-gradient(180deg, rgba(2, 9, 14, .18), rgba(2, 9, 14, .66)),
            url("../images/immersive/companion-inn-v1.png") center / cover no-repeat;
    }

    .fa-body[data-current-page="companions"] .companion-heading {
        display: flex;
        min-height: 118px;
        flex: 0 0 118px;
        align-items: center;
        justify-content: space-between;
        padding: 17px 34px 15px;
        border-bottom: 1px solid rgba(200, 143, 53, .62);
        background: linear-gradient(90deg, rgba(2, 10, 16, .94), rgba(2, 10, 16, .56) 70%, rgba(2, 10, 16, .88));
        box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
    }

    .fa-body[data-current-page="companions"] .companion-heading .eyebrow {
        color: #62d3d1;
        font-size: 11px;
        letter-spacing: .12em;
    }

    .fa-body[data-current-page="companions"] .companion-heading h1 {
        margin: 3px 0 5px;
        color: #f2d69c;
        font: 600 46px/.95 Georgia, serif;
    }

    .fa-body[data-current-page="companions"] .companion-heading p {
        margin: 0;
        color: #c5d6d7;
        font-size: 13px;
        line-height: 1.35;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-grid {
        display: grid;
        min-height: 0;
        flex: 1 1 auto;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 14px 16px 16px;
        overflow: hidden;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-card {
        grid-column: auto;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-card:nth-child(4),
    .fa-body[data-current-page="companions"] .companion-portrait-card:nth-child(5),
    .fa-body[data-current-page="companions"] .companion-portrait-card:nth-child(6) {
        grid-column: auto;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-card {
        display: grid;
        min-width: 0;
        min-height: 0;
        grid-template-rows: minmax(0, 1fr) 126px;
        overflow: hidden;
        border: 2px solid rgba(202, 148, 61, .72);
        border-radius: 8px;
        background: rgba(3, 14, 21, .92);
        box-shadow: 0 15px 30px rgba(0, 0, 0, .46), inset 0 0 22px rgba(219, 157, 58, .05);
    }

    .fa-body[data-current-page="companions"] .companion-portrait-card:hover,
    .fa-body[data-current-page="companions"] .companion-portrait-card:focus-visible {
        border-color: #61d7d2;
        box-shadow: 0 0 0 2px rgba(72, 217, 212, .2), 0 18px 36px rgba(0, 0, 0, .56);
        transform: translateY(-2px);
    }

    .fa-body[data-current-page="companions"] .companion-portrait-art {
        min-height: 0;
        background:
            linear-gradient(180deg, rgba(3, 17, 25, .04), rgba(3, 13, 20, .44)),
            url("../images/immersive/companion-inn-v1.png") center 45% / cover no-repeat;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-art img {
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        object-fit: cover;
        object-position: center 22%;
        filter: brightness(1.05) saturate(1.04) drop-shadow(0 14px 20px rgba(0, 0, 0, .7));
        transform: scale(1.03);
    }

    .fa-body[data-current-page="companions"] .companion-portrait-card[data-id="nain"] .companion-portrait-art img { object-position: center 18%; }
    .fa-body[data-current-page="companions"] .companion-portrait-card[data-id="gobelin"] .companion-portrait-art img { object-position: center 17%; }
    .fa-body[data-current-page="companions"] .companion-portrait-card[data-id="chat"] .companion-portrait-art img { object-position: center 15%; }
    .fa-body[data-current-page="companions"] .companion-portrait-card[data-id="elfe"] .companion-portrait-art img { object-position: center 13%; }

    .fa-body[data-current-page="companions"] .companion-portrait-copy {
        display: grid;
        min-height: 0;
        align-content: center;
        gap: 3px;
        padding: 8px 14px 10px;
        border-top: 1px solid rgba(205, 153, 67, .62);
        background: linear-gradient(180deg, rgba(4, 17, 25, .94), rgba(2, 10, 17, .99));
    }

    .fa-body[data-current-page="companions"] .companion-portrait-copy strong { font-size: 25px; line-height: 1; }
    .fa-body[data-current-page="companions"] .companion-portrait-copy small { font-size: 12px; line-height: 1.25; }
    .fa-body[data-current-page="companions"] .companion-portrait-copy em { font-size: 11px; line-height: 1.25; }
    .fa-body[data-current-page="companions"] .companion-portrait-copy span { overflow: hidden; font-size: 10.5px; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
    .fa-body[data-current-page="companions"] .companion-portrait-copy b { font-size: 10.5px; }

    .fa-body[data-current-page="companions"] .companion-detail-shell {
        min-height: 0;
        flex: 1 1 auto;
        margin: 12px 16px 16px;
        grid-template-columns: minmax(320px, 42%) minmax(0, 1fr);
        border: 2px solid rgba(202, 148, 61, .68);
        border-radius: 10px;
        background: rgba(3, 14, 22, .94);
    }

    .fa-body[data-current-page="companions"] .companion-detail-shell .companion-inn-art {
        min-height: 0;
        overflow: hidden;
        border-right: 1px solid rgba(202, 148, 61, .5);
        background: radial-gradient(circle at 50% 28%, rgba(104, 194, 193, .13), transparent 44%), rgba(2, 10, 17, .78);
    }

    .fa-body[data-current-page="companions"] .companion-detail-shell .companion-inn-art img {
        width: 100%;
        height: 100%;
        padding: 12px 12px 0;
        object-fit: contain;
        object-position: center bottom;
        filter: drop-shadow(0 20px 26px rgba(0, 0, 0, .68));
    }

    .fa-body[data-current-page="companions"] .companion-detail-shell .companion-inn-main {
        min-height: 0;
        overflow: hidden;
    }

    .fa-body[data-current-page="companions"] .companion-detail-shell .companion-inn-tabs {
        min-height: 58px;
        gap: 7px;
        padding: 10px;
        background: rgba(3, 13, 20, .92);
    }

    .fa-body[data-current-page="companions"] .companion-detail-shell .companion-inn-tabs button {
        min-height: 38px;
        padding: 8px 10px;
        border-color: rgba(201, 148, 62, .46);
        font-size: 11px;
    }

    .fa-body[data-current-page="companions"] .companion-welcome-copy,
    .fa-body[data-current-page="companions"] .companion-moment-stage,
    .fa-body[data-current-page="companions"] .companion-wardrobe {
        padding: 18px 20px;
    }

    .fa-body[data-current-page="companions"] .companion-welcome-copy h2 { font-size: 31px; }
    .fa-body[data-current-page="companions"] .companion-welcome-copy > p,
    .fa-body[data-current-page="companions"] .companion-relationship p,
    .fa-body[data-current-page="companions"] .companion-moment-stage p,
    .fa-body[data-current-page="companions"] .companion-wardrobe > p { font-size: 13px; line-height: 1.55; }

    .fa-body[data-current-page="companions"] .companion-grimoire {
        position: relative;
        margin: 13px 16px;
        padding: 18px 24px 22px;
        overflow-y: auto;
        border: 5px double #8d5b24;
        border-radius: 15px;
        background:
            linear-gradient(90deg, rgba(91, 53, 24, .12) 49.5%, rgba(63, 34, 14, .3) 50%, rgba(91, 53, 24, .12) 50.5%),
            radial-gradient(circle at 50% 16%, #fff0c7, #dec08b 76%, #ad7b42);
        box-shadow: inset 0 0 40px rgba(86, 48, 16, .22), 0 16px 34px rgba(0, 0, 0, .5);
        color: #3d2817;
    }

    .fa-body[data-current-page="companions"] .companion-grimoire::before {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 12px;
        content: "";
        background: linear-gradient(90deg, rgba(86, 47, 19, .2), rgba(255, 241, 202, .22), rgba(86, 47, 19, .2));
        transform: translateX(-50%);
        pointer-events: none;
    }

    .fa-body[data-current-page="companions"] .companion-grimoire > header {
        position: relative;
        z-index: 1;
        color: #4b2d12;
    }

    .fa-body[data-current-page="companions"] .companion-grimoire > header small,
    .fa-body[data-current-page="companions"] .companion-grimoire > header h2 { color: #4b2d12; }

    .fa-body[data-current-page="companions"] .companion-grimoire .companion-chapters {
        position: relative;
        z-index: 1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 28px;
    }

    .fa-body[data-current-page="companions"] .companion-grimoire .companion-chapter {
        border-color: rgba(109, 68, 28, .38);
        background: rgba(255, 244, 211, .38);
        color: #3d2817;
        box-shadow: none;
    }

    .fa-body[data-current-page="companions"] .companion-grimoire .companion-chapter h3,
    .fa-body[data-current-page="companions"] .companion-grimoire .companion-chapter p,
    .fa-body[data-current-page="companions"] .companion-grimoire .companion-chapter > span { color: #4b2d12; }
}

/* ChronoQuest 1.7.1.12 — garde-fous de cadrage après contrôle navigateur. */
@media (min-width: 1101px) {
    .fa-body[data-current-page="timer"] .focus-time-console .focus-controls {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 8px;
    }

    .fa-body[data-current-page="timer"] .focus-time-console .focus-controls .button {
        min-width: 0;
        min-height: 43px;
        padding: 6px 7px;
        font-size: 11px;
        line-height: 1.15;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-center > .focus-clock {
        max-width: 100%;
        font-size: clamp(76px, 8vw, 116px);
        white-space: nowrap;
    }

    .fa-body[data-current-page="timer"] .focus-selected-project strong {
        display: -webkit-box;
        overflow: hidden;
        font-size: 18px;
        line-height: 1.12;
        text-overflow: initial;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }
}

/* Tableau de bord 1.7.1.13 — contraste autonome et lecture sur portable. */
.fa-body.page-dashboard .dashboard-grid > .card,
.fa-body.page-dashboard .dashboard-bottom > .card {
    color: #edf7ff !important;
    filter: none !important;
    opacity: 1 !important;
}

.fa-body.page-dashboard .card-header h2,
.fa-body.page-dashboard .card-header h3 { color: #a9dcfb !important; }
.fa-body.page-dashboard .dashboard-today .task-line strong,
.fa-body.page-dashboard .dashboard-summary .metric-list span,
.fa-body.page-dashboard .dashboard-summary .metric-list strong,
.fa-body.page-dashboard .dashboard-boss .boss-caption h3,
.fa-body.page-dashboard .dashboard-shop .shop-mini strong { color: #f3f8fc !important; }
.fa-body.page-dashboard .dashboard-today .task-line small,
.fa-body.page-dashboard .dashboard-summary .metric-list small,
.fa-body.page-dashboard .dashboard-boss .boss-caption p,
.fa-body.page-dashboard .dashboard-shop .shop-mini span { color: #b9cede !important; }
.fa-body.page-dashboard .dashboard-titles .mini-medal strong { color: #f3d995 !important; }
.fa-body.page-dashboard .dashboard-pause :is(h3, p),
.fa-body.page-dashboard .dashboard-advice :is(blockquote, blockquote span, blockquote small) { color: #e5f0f7 !important; }

@media (min-width: 1101px) and (max-width: 1700px),
       (min-width: 1101px) and (max-height: 900px) {
    .fa-body.page-dashboard .card-header h2,
    .fa-body.page-dashboard .card-header h3 { font-size: 13.5px; }
    .fa-body.page-dashboard .dashboard-today .task-line strong { font-size: 12px; }
    .fa-body.page-dashboard .dashboard-today .task-line small { font-size: 10px; }
    .fa-body.page-dashboard .dashboard-summary .metric-list span { font-size: 11.5px; }
    .fa-body.page-dashboard .dashboard-summary .metric-list strong { font-size: 13px; }
    .fa-body.page-dashboard .dashboard-boss .boss-caption h3 { font-size: 13px; }
    .fa-body.page-dashboard .dashboard-boss .boss-caption p { font-size: 10px; }
    .fa-body.page-dashboard .dashboard-titles .mini-medal strong { font-size: 10.25px; line-height: 1.18; }
    .fa-body.page-dashboard .dashboard-shop .shop-mini strong { font-size: 10px; line-height: 1.18; }
    .fa-body.page-dashboard .dashboard-advice .advice-card blockquote { font-size: 11px; line-height: 1.32; }
    .fa-body.page-dashboard .dashboard-advice .advice-card blockquote > span {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }
    .fa-body.page-dashboard .dashboard-advice .advice-card blockquote > small {
        overflow: hidden;
        font-size: 9.5px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .fa-body.page-dashboard .dashboard-pause .pause-copy p { font-size: 10.5px; line-height: 1.42; }
}

/* Boss 1.7.1.15 — garde-fous finaux après les anciens paliers responsifs. */
@media (min-width: 1101px) {
    .fa-body[data-current-page="bosses"] .boss-gallery-screen {
        display: flex;
        height: 100%;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
    }

    .fa-body[data-current-page="bosses"] .boss-gallery-screen .immersive-heading {
        min-height: 94px;
        flex: 0 0 94px;
        padding: 11px 18px;
    }

    .fa-body[data-current-page="bosses"] .boss-gallery-layout {
        display: block !important;
        min-height: 0;
        flex: 1;
        overflow: hidden;
    }

    .fa-body[data-current-page="bosses"] .boss-grid {
        display: grid;
        height: 100%;
        max-height: none;
        grid-template-rows: none;
        grid-auto-rows: minmax(254px, auto);
        grid-auto-flow: row;
        grid-template-columns: repeat(3, minmax(220px, 1fr));
        gap: 12px;
        padding: 11px 14px 15px;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-gutter: stable;
    }

    .fa-body[data-current-page="bosses"] .boss-card {
        display: flex;
        min-height: 254px;
        flex-direction: column;
        overflow: hidden;
    }

    .fa-body[data-current-page="bosses"] .boss-card-art {
        display: grid;
        height: 168px;
        flex: 0 0 168px;
        overflow: hidden;
        place-items: center;
    }

    .fa-body[data-current-page="bosses"] .boss-card-art img {
        width: 100% !important;
        height: 100% !important;
        padding: 4px 8px 0 !important;
        object-fit: contain !important;
        object-position: center !important;
        background: transparent !important;
    }

    .fa-body[data-current-page="bosses"] .boss-card-content {
        display: grid;
        flex: 1;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 8px;
        align-content: center;
        padding: 7px 12px 10px;
    }

    .fa-body[data-current-page="bosses"] .boss-card-content strong {
        overflow: visible;
        color: #efd29b;
        font: 600 18px/1.08 Georgia, serif;
        text-align: left;
        text-overflow: initial;
        white-space: normal;
    }

    .fa-body[data-current-page="bosses"] .boss-rarity { align-self: center; }
    .fa-body[data-current-page="bosses"] .standard-progress,
    .fa-body[data-current-page="bosses"] .boss-card-stats,
    .fa-body[data-current-page="bosses"] .boss-project-name { grid-column: 1 / -1; }
    .fa-body[data-current-page="bosses"] .boss-card-stats :is(em, b) { font-size: 9px; }
    .fa-body[data-current-page="bosses"] .boss-project-name { font-size: 8.5px; text-align: left; }
    .fa-body[data-current-page="bosses"] .boss-inspection-panel { display: none !important; }
}

/* 1.7.1.18 — cadrage complet des personnages dans les galeries. */
.fa-body[data-current-page="companions"] .companion-portrait-art img,
.fa-body[data-current-page="companions"] .companion-detail-shell .companion-inn-art img {
    object-fit: contain !important;
    object-position: center bottom !important;
    transform: none !important;
}

.fa-body[data-current-page="bosses"] .boss-card-art img,
.fa-body[data-current-page="bosses"] .boss-inspection-panel > img {
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
}

@media (min-width: 1101px) {
    .fa-body[data-current-page="companions"] .companion-portrait-art img {
        padding: 10px 12px 0 !important;
    }

    .fa-body[data-current-page="companions"] .companion-portrait-card[data-id] .companion-portrait-art img {
        object-position: center bottom !important;
    }

    .fa-body[data-current-page="bosses"] .boss-grid {
        grid-auto-rows: minmax(300px, auto);
    }

    .fa-body[data-current-page="bosses"] .boss-card {
        min-height: 300px;
    }

    .fa-body[data-current-page="bosses"] .boss-card-art {
        height: 214px;
        flex-basis: 214px;
    }

    .fa-body[data-current-page="bosses"] .boss-card-art img {
        padding: 8px 10px 2px !important;
    }
}

@media (max-width: 1100px) {
    .fa-body[data-current-page="companions"] .companion-detail-shell .companion-inn-art img {
        padding: 16px 14px 0 !important;
    }

    .fa-body[data-current-page="bosses"] .boss-card-art {
        height: clamp(180px, 26vw, 220px);
        min-height: clamp(180px, 26vw, 220px);
    }

    .fa-body[data-current-page="bosses"] .boss-card-art img {
        width: 100% !important;
        height: 100% !important;
        padding: 8px 8px 2px !important;
    }

    .fa-body[data-current-page="bosses"] .boss-inspection-panel > img {
        height: min(52vh, 420px);
    }
}

@media (max-width: 600px) {
    .fa-body[data-current-page="bosses"] .boss-card-art {
        height: min(58vw, 240px);
        min-height: min(58vw, 240px);
    }
}

/* 1.7.1.19 — contraste des actions, boss entièrement contenus et trophées plus présents. */
.fa-body[data-current-page="timer"] .focus-target-choice {
    border-bottom-color: rgba(73, 48, 24, .38);
    background: rgba(246, 235, 205, .28);
}

.fa-body[data-current-page="timer"] .focus-target-choice strong {
    color: #1c120b;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(255, 248, 224, .45);
}

.fa-body[data-current-page="timer"] .focus-target-choice small {
    color: #5a4128;
    font-weight: 650;
    opacity: 1;
}

.fa-body[data-current-page="timer"] .focus-target-choice:hover,
.fa-body[data-current-page="timer"] .focus-target-choice.is-selected {
    background: rgba(218, 172, 77, .7);
    box-shadow: inset 5px 0 0 #9a5f1d, inset 0 0 0 1px rgba(112, 72, 27, .26);
}

.fa-body[data-current-page="timer"] .focus-target-choice.is-selected strong { color: #130c07; }
.fa-body[data-current-page="timer"] .focus-target-choice.is-selected small { color: #493018; }

.fa-body[data-current-page="bosses"] .boss-card-art img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}

.fa-body[data-current-page="bosses"] .boss-card-art { position: relative; }

@media (min-width: 1101px) {
    .fa-body[data-current-page="bosses"] .boss-grid { grid-auto-rows: minmax(310px, auto); }
    .fa-body[data-current-page="bosses"] .boss-card { min-height: 310px; }
    .fa-body[data-current-page="bosses"] .boss-card-art {
        height: 224px;
        flex-basis: 224px;
    }
}

.fa-body[data-current-page="titles"] .trophy-hall .medal-card {
    position: relative;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: flex-end;
    isolation: isolate;
    overflow: hidden;
}

.fa-body[data-current-page="titles"] .trophy-hall .medal-card::before {
    position: absolute;
    z-index: 0;
    top: -2px;
    left: 50%;
    width: 135px !important;
    height: 135px !important;
    max-width: none;
    margin: 0;
    transform: translateX(-50%);
}

.fa-body[data-current-page="titles"] .trophy-hall .medal-card strong,
.fa-body[data-current-page="titles"] .trophy-hall .medal-card em {
    position: relative;
    z-index: 1;
    width: 100%;
    background: rgba(3, 13, 21, .9);
}

.fa-body[data-current-page="titles"] .trophy-hall .medal-card strong {
    padding: 4px 5px 2px;
    border-top: 1px solid rgba(209, 159, 74, .38);
}

.fa-body[data-current-page="titles"] .trophy-hall .medal-card em { padding: 2px 4px 3px; }
.fa-body[data-current-page="titles"] .trophy-feature-medal { width: 100px; }
.fa-body[data-current-page="titles"] .reward-display { width: 112px; }

/* ChronoQuest 1.7.2 — stabilité, lisibilité et cadrages de validation. */
.modal,
.modal-card,
.form-modal,
.dynamic-form {
    color: #edf7ff;
}

.modal-card :is(h1, h2, h3, legend),
.form-modal :is(h1, h2, h3, legend),
.dynamic-form :is(h1, h2, h3, legend) {
    color: #f4f8fc;
}

.modal-card :is(p, small),
.form-modal :is(p, small),
.dynamic-form :is(p, small) {
    color: #b9ccda;
    opacity: 1;
}

.modal-card label,
.form-modal label,
.dynamic-form label {
    color: #d5e5ef;
    font-size: 12px;
}

.modal-card :is(input, select, textarea),
.form-modal :is(input, select, textarea),
.dynamic-form :is(input, select, textarea) {
    border-color: rgba(116, 192, 224, .55);
    background: #0a2031;
    color: #f7fbfe;
    caret-color: #f4b63e;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}

.modal-card :is(input, textarea)::placeholder,
.form-modal :is(input, textarea)::placeholder,
.dynamic-form :is(input, textarea)::placeholder {
    color: #8fa9ba;
    opacity: 1;
}

.modal-card :is(input, select, textarea):focus,
.form-modal :is(input, select, textarea):focus,
.dynamic-form :is(input, select, textarea):focus {
    border-color: #72d0ec;
    outline: 2px solid rgba(78, 190, 224, .2);
}

.login-dialog .span-2,
.login-dialog .form-modal > p,
.sync-banner :is(strong, p, small),
.sync-account-actions {
    color: #e5f1f8;
    opacity: 1;
}

/* Un état inactif n'assombrit jamais une carte complète. */
.card,
.data-card,
.dashboard-grid > *,
.dashboard-bottom > *,
.immersive-screen {
    filter: none;
}

.card[aria-disabled="true"],
.data-card[aria-disabled="true"] { opacity: 1; }
.card[aria-disabled="true"] :is(button, input, select),
.data-card[aria-disabled="true"] :is(button, input, select) { opacity: .5; }

/* Galerie des boss : l'illustration entière reste visible dans un cadre plus généreux. */
.fa-body[data-current-page="bosses"] .boss-card-art {
    position: relative;
    background: radial-gradient(circle at 50% 50%, rgba(67, 105, 124, .22), transparent 70%);
}

.fa-body[data-current-page="bosses"] .boss-card-art img {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 3px 6px 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
}

/* Galerie des trophées : emblèmes plus grands, centrés et jamais coupés. */
.fa-body[data-current-page="titles"] .trophy-hall .medal-card {
    min-height: 210px;
    padding-top: 156px;
}

.fa-body[data-current-page="titles"] .trophy-hall .medal-card::before {
    top: 5px;
    width: 154px !important;
    height: 154px !important;
    background-size: 500% auto;
    background-repeat: no-repeat;
}

.fa-body[data-current-page="titles"] .trophy-hall .medal-card strong,
.fa-body[data-current-page="titles"] .trophy-hall .medal-card em {
    flex: 0 0 auto;
}

/* Portraits et tenues : aucun agrandissement automatique ne peut recouper le sujet. */
.fa-body[data-current-page="companions"] :is(.companion-portrait-art, .companion-inn-art, .outfit-card) img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center bottom !important;
    transform: none !important;
}

/* Le sanctuaire agrandi se répartit réellement dans la largeur disponible. */
.fa-body[data-current-page="timer"] .focus-expanded-grid,
.fa-body[data-current-page="timer"] .focus-expanded-grid > *,
.fa-body[data-current-page="timer"] .focus-expanded-center {
    min-width: 0;
}

.fa-body[data-current-page="timer"] .focus-expanded-center {
    padding: 24px clamp(190px, 18vw, 250px) 24px 20px;
}

.fa-body[data-current-page="timer"] .focus-expanded-center > aside {
    right: 2px;
    width: clamp(180px, 18vw, 240px);
    height: 84%;
}

.fa-body[data-current-page="timer"] .focus-expanded-center > aside blockquote {
    top: 12%;
    right: 72%;
    width: clamp(175px, 16vw, 220px);
    max-height: 42%;
    overflow: auto;
    font-size: 13px;
}

.fa-body[data-current-page="timer"] .focus-expanded-center > h2,
.fa-body[data-current-page="timer"] .focus-expanded-center > p {
    width: 100%;
    overflow-wrap: anywhere;
}

@media (min-width: 1101px) {
    .fa-body[data-current-page="timer"] .focus-expanded-grid {
        grid-template-columns: clamp(190px, 14vw, 245px) minmax(440px, 1fr) clamp(200px, 15vw, 255px);
    }

    .fa-body[data-current-page="bosses"] .boss-grid {
        grid-auto-rows: minmax(330px, auto);
    }

    .fa-body[data-current-page="bosses"] .boss-card { min-height: 330px; }
    .fa-body[data-current-page="bosses"] .boss-card-art {
        height: 242px;
        flex-basis: 242px;
    }
}

/* Portable 14 pouces à 100 % : densité contrôlée sans zoom navigateur. */
@media (min-width: 1101px) and (max-width: 1500px),
       (min-width: 1101px) and (max-height: 850px) {
    :root {
        --sidebar: clamp(190px, 13.6vw, 205px);
        --topbar: clamp(68px, 8.5dvh, 76px);
        --footer: clamp(30px, 3.8dvh, 36px);
    }

    .fa-body { font-size: 13.5px; }
    .main-viewport { padding: 7px 9px; }
    .sidebar { padding: 8px 9px 7px; }
    .sidebar-brand { min-height: 60px; padding-block: 3px 8px; }
    .nav-item { min-height: 31px; font-size: 11px; }
    .primary-create { min-height: 42px; }

    .fa-body[data-current-page="timer"] .focus-expanded-stage > header {
        min-height: 60px;
        padding: 7px 14px;
    }

    .fa-body[data-current-page="timer"] .focus-expanded-stage > header h1 { font-size: 25px; }
    .fa-body[data-current-page="timer"] .focus-expanded-grid {
        grid-template-columns: minmax(160px, 14vw) minmax(390px, 1fr) minmax(175px, 15vw);
    }
    .fa-body[data-current-page="timer"] .focus-expanded-rail { gap: 8px; padding: 11px 8px; }
    .fa-body[data-current-page="timer"] .focus-expanded-rail h2 { font-size: 17px; }
    .fa-body[data-current-page="timer"] .focus-expanded-center {
        padding: 15px clamp(165px, 17vw, 205px) 14px 13px;
    }
    .fa-body[data-current-page="timer"] .focus-expanded-center > .focus-clock {
        margin-top: 7px;
        font-size: clamp(68px, 7.3vw, 96px);
    }
    .fa-body[data-current-page="timer"] .focus-expanded-center > h2 { font-size: 20px; }
    .fa-body[data-current-page="timer"] .focus-expanded-center > aside { width: clamp(158px, 17vw, 205px); }
    .fa-body[data-current-page="timer"] .focus-expanded-center > aside blockquote {
        right: 68%;
        width: clamp(160px, 15vw, 190px);
        padding: 11px;
        font-size: 11.5px;
    }

    .fa-body[data-current-page="titles"] .trophy-hall .medal-card {
        min-height: 184px;
        padding-top: 134px;
    }
    .fa-body[data-current-page="titles"] .trophy-hall .medal-card::before {
        width: 132px !important;
        height: 132px !important;
    }

    .fa-body[data-current-page="bosses"] .boss-grid { grid-auto-rows: minmax(286px, auto); }
    .fa-body[data-current-page="bosses"] .boss-card { min-height: 286px; }
    .fa-body[data-current-page="bosses"] .boss-card-art { height: 198px; flex-basis: 198px; }
}

@media (max-width: 700px) {
    .modal-card label,
    .form-modal label,
    .dynamic-form label { font-size: 13px; }

    .fa-body[data-current-page="titles"] .trophy-hall .medal-card {
        min-height: 220px;
        padding-top: 164px;
    }
    .fa-body[data-current-page="titles"] .trophy-hall .medal-card::before {
        width: 160px !important;
        height: 160px !important;
    }
}

/* ChronoQuest 1.7.3.2 — verrou de cascade final.
   Cette section reste volontairement en dernière position afin que les écrans
   historiques ne puissent plus réintroduire un texte sombre ou transparent. */
.fa-body :is(
    .data-card,
    .routine-card,
    .task-project-group,
    .project-card,
    .note-card,
    .link-card,
    .settings-card,
    .admin-card,
    .stats-card,
    .empty-panel,
    .sync-banner
) {
    color: #dfedf6;
    opacity: 1 !important;
    filter: none !important;
}

.fa-body :is(.data-card, .routine-card, .task-project-group) {
    background-color: #091e2e;
}

.fa-body :is(
    .data-card h3,
    .routine-card h3,
    .task-project-group h2,
    .project-card h3,
    .note-card h3,
    .link-card h3,
    .settings-card h3,
    .admin-card h3,
    .stats-card h3,
    .empty-panel h2
) {
    color: #f6fbff !important;
    opacity: 1 !important;
    filter: none !important;
    -webkit-text-fill-color: #f6fbff;
}

.fa-body :is(
    .data-card p,
    .routine-card p,
    .task-project-group p,
    .project-card p,
    .note-card p,
    .link-card p,
    .settings-card p,
    .admin-card p,
    .stats-card p,
    .empty-panel p
) {
    color: #b9cedb !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #b9cedb;
}

.fa-body :is(.data-card-meta, .data-card small, .routine-card small) {
    color: #a9c2d1 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #a9c2d1;
}

.fa-body :is(.page-root, .modal, .modal-card, .form-modal, .dynamic-form)
    :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea) {
    border-color: #4f91b1 !important;
    background: #0b2537 !important;
    color: #f6fbff !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #f6fbff;
}

.fa-body :is(.page-root, .modal, .modal-card, .form-modal, .dynamic-form)
    :is(input, textarea)::placeholder {
    color: #a9c2d1 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #a9c2d1;
}

/* Les surfaces parchemin sont la seule exception au texte clair. */
.fa-body[data-current-page="timer"] .focus-task-scroll :is(h1, h2, h3, strong),
.fa-body[data-current-page="timer"] .focus-target-choice strong {
    color: #241a12 !important;
    -webkit-text-fill-color: #241a12;
}

.fa-body[data-current-page="timer"] .focus-task-scroll :is(p, small),
.fa-body[data-current-page="timer"] .focus-target-choice small {
    color: #5a4128 !important;
    -webkit-text-fill-color: #5a4128;
}

@media (min-width: 901px) and (max-width: 1500px),
       (min-width: 901px) and (max-height: 850px) {
    .fa-body :is(.data-card h3, .routine-card h3, .project-card h3, .note-card h3, .link-card h3) {
        font-size: 14px !important;
        line-height: 1.3;
    }

    .fa-body :is(.data-card p, .routine-card p, .project-card p, .note-card p, .link-card p) {
        font-size: 11.5px !important;
        line-height: 1.42;
    }

    .fa-body :is(.data-card small, .data-card-meta, .routine-card small) {
        font-size: 10.5px !important;
        line-height: 1.4;
    }
}
