html, body.fermi-page {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #f4f1ea;
    color: #1d1d1b;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

body.fermi-page,
body.fermi-page * {
    box-sizing: border-box;
}

body.fermi-page {
    min-height: 100dvh;
}

body.fermi-page h1,
body.fermi-page h2,
body.fermi-page .fe-question {
    text-transform: none !important;
    color: #1d1d1b !important;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif !important;
}

.fe-app {
    height: 100dvh;
    height: 100vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.fe-top {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.65rem;
    padding: 0.55rem 1.15rem;
    background: #1d1d1b;
    color: #fff;
    min-height: 3.5rem;
    overflow: visible;
}

.fe-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    min-height: 4rem;
    padding: 0.45rem 0.85rem;
    background: #fff;
    color: #1d1d1b;
    border-top: 3px solid #c90c0f;
}

.fe-back {
    color: #1d1d1b !important;
    background: #fab719 !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.fe-back i {
    color: #1d1d1b !important;
}

.fe-back:hover,
.fe-back:focus {
    background: #fff !important;
    color: #1d1d1b !important;
}

.fe-brand {
    margin: 0 0.4rem 0 0;
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 1rem;
    line-height: 1.2;
}

.fe-brand strong {
    color: #fff !important;
    text-transform: none !important;
    font-size: 1.05rem;
}

.fe-brand span {
    color: #fab719 !important;
    font-size: 0.85rem;
}

.fe-count {
    margin: 0;
    font-weight: 700;
    color: #1d1d1b !important;
    background: #fab719;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.fe-btn-gold {
    background: #fab719 !important;
    color: #1d1d1b !important;
    border: 2px solid #fab719 !important;
    flex-shrink: 0;
}

.fe-btn-gold,
.fe-btn-gold i,
.fe-btn-gold .fas {
    color: #1d1d1b !important;
}

.fe-btn-gold:hover,
.fe-btn-gold:focus {
    background: #fff !important;
    border-color: #fff !important;
    color: #1d1d1b !important;
}

.fe-btn-gold:hover i,
.fe-btn-gold:focus i,
.fe-btn-gold:hover .fas,
.fe-btn-gold:focus .fas {
    color: #1d1d1b !important;
}

.fe-main {
    position: relative;
    display: grid;
    grid-template-columns: minmax(16rem, 1.05fr) minmax(14rem, 0.95fr);
    gap: 1rem;
    padding: 1rem 1.25rem 0.75rem;
    min-height: 0;
    overflow: hidden;
}

.fe-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 0;
}

.fe-kicker {
    margin: 0 0 0.45rem;
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase !important;
    color: #c90c0f !important;
}

.fe-kicker.is-discuss {
    color: #8a5a00 !important;
}

.fe-question {
    margin: 0;
    font-size: clamp(1.55rem, 4.2vw, 3.35rem);
    line-height: 1.15;
    overflow: hidden;
}

.fe-hint {
    margin: 0.75rem 0 0;
    color: #555;
    font-size: clamp(0.85rem, 1.4vw, 1.05rem);
}

.fe-diagram {
    margin: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 0.5rem;
}

.fe-svg,
.fe-diagram svg {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fe-panel {
    position: absolute;
    left: 1.25rem;
    right: 1.25rem;
    bottom: 0.6rem;
    max-height: 46%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.97);
    border: 3px solid #c90c0f;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.fe-panel h2 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    color: #c90c0f !important;
    text-transform: none !important;
}

.fe-panel ol,
.fe-panel p {
    margin: 0.25rem 0 0;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    line-height: 1.35;
}

.fe-range {
    font-size: clamp(1.05rem, 2vw, 1.4rem);
    font-weight: 800;
    color: #1d1d1b;
    margin: 0.2rem 0 0.45rem;
}

.fe-btn {
    font-family: inherit;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    padding: 0.55rem 0.9rem;
    font-size: 0.95rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.fe-btn i,
.fe-btn .fas,
.fe-btn svg {
    color: inherit !important;
}

.fe-btn-primary {
    background: #c90c0f !important;
    color: #fff !important;
    border: 2px solid #c90c0f !important;
}

.fe-btn-primary,
.fe-btn-primary i,
.fe-btn-primary .fas {
    color: #fff !important;
}

.fe-btn-primary:hover,
.fe-btn-primary:focus {
    background: #8b0000 !important;
    border-color: #8b0000 !important;
    color: #fff !important;
}

.fe-btn-outline {
    background: #fff !important;
    color: #c90c0f !important;
    border: 2px solid #c90c0f !important;
}

.fe-btn-outline,
.fe-btn-outline i,
.fe-btn-outline .fas {
    color: #c90c0f !important;
}

.fe-btn-outline:hover,
.fe-btn-outline:focus,
.fe-btn-outline.is-on {
    background: #c90c0f !important;
    color: #fff !important;
}

.fe-btn-outline:hover i,
.fe-btn-outline:focus i,
.fe-btn-outline.is-on i,
.fe-btn-outline:hover .fas,
.fe-btn-outline:focus .fas,
.fe-btn-outline.is-on .fas {
    color: #fff !important;
}

.fe-btn-ghost {
    background: #fff !important;
    color: #1d1d1b !important;
    border: 2px solid #1d1d1b !important;
}

.fe-btn-ghost,
.fe-btn-ghost i,
.fe-btn-ghost .fas {
    color: #1d1d1b !important;
}

.fe-btn-ghost:hover,
.fe-btn-ghost:focus {
    border-color: #c90c0f !important;
    color: #c90c0f !important;
    background: #fff !important;
}

.fe-btn-ghost:hover i,
.fe-btn-ghost:focus i,
.fe-btn-ghost:hover .fas,
.fe-btn-ghost:focus .fas {
    color: #c90c0f !important;
}

.fe-modal {
    position: fixed;
    inset: 0;
    background: rgba(29, 29, 27, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 20;
}

.fe-modal[hidden] {
    display: none;
}

.fe-modal-card {
    background: #fff;
    color: #1d1d1b;
    max-width: 34rem;
    width: min(92vw, 34rem);
    border-radius: 16px;
    padding: 1.25rem 1.4rem;
    border-top: 6px solid #c90c0f;
}

.fe-modal-card h2 {
    margin: 0 0 0.5rem;
}

.fe-modal-card ul {
    margin: 0.4rem 0 0.8rem;
    padding-left: 1.1rem;
}

.fe-keys {
    font-size: 0.88rem;
    color: #555;
}

.fe-new {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.4rem;
    background: #fab719;
    color: #1d1d1b !important;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    vertical-align: middle;
    text-transform: none !important;
}

@media (max-width: 800px) {
    .fe-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }
    .fe-brand span {
        display: none;
    }
    .fe-question {
        font-size: clamp(1.35rem, 7vw, 2.1rem);
    }
    .fe-btn {
        padding: 0.5rem 0.55rem;
        font-size: 0.82rem;
    }
}

@media (max-height: 560px) {
    .fe-hint {
        display: none;
    }
    .fe-brand span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
