:root {
    --se-ink: #13283a;
    --se-ink-soft: #425667;
    --se-paper: #f3efe6;
    --se-paper-deep: #e9e2d5;
    --se-white: #fffdf8;
    --se-teal: #087e78;
    --se-teal-deep: #075f5c;
    --se-mint: #cce5dc;
    --se-blue: #315f82;
    --se-coral: #bd6c53;
    --se-line: rgba(19, 40, 58, 0.14);
    --se-shadow: 0 20px 60px rgba(31, 49, 62, 0.09);
    --se-radius: 26px;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 9% 8%, rgba(8, 126, 120, 0.11), transparent 28rem),
        radial-gradient(circle at 88% 16%, rgba(189, 108, 83, 0.10), transparent 30rem),
        linear-gradient(180deg, #f7f3eb 0%, var(--se-paper) 52%, #eee8dd 100%);
    color: var(--se-ink);
}

.se-page {
    --se-font-sans: "Noto Sans SC", sans-serif;
    --se-font-serif: "Noto Serif SC", serif;
    min-height: 76vh;
    overflow: clip;
    font-family: var(--se-font-sans);
}

body[data-language="tc"] .se-page {
    --se-font-sans: "Noto Sans TC", "Noto Sans SC", sans-serif;
    --se-font-serif: "Noto Serif TC", "Noto Serif SC", serif;
}

body[data-language="en"] .se-page {
    --se-font-sans: "Noto Sans", Arial, sans-serif;
    --se-font-serif: "Noto Serif", Georgia, serif;
}

.se-page *,
.se-page *::before,
.se-page *::after {
    box-sizing: border-box;
}

.se-container {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.se-loading,
.se-error {
    width: min(680px, calc(100% - 48px));
    min-height: 48vh;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: var(--se-ink-soft);
}

.se-loading__mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(8, 126, 120, 0.25);
    border-radius: 18px;
    background: rgba(255, 253, 248, 0.8);
    color: var(--se-teal);
    font-weight: 700;
    letter-spacing: -0.04em;
    animation: se-pulse 1.5s ease-in-out infinite;
}

.se-loading strong,
.se-error strong {
    display: block;
    margin-bottom: 4px;
    color: var(--se-ink);
    font-size: 18px;
}

.se-loading p,
.se-error p {
    margin: 0;
}

@keyframes se-pulse {
    50% { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(8, 126, 120, 0.15); }
}

.se-masthead {
    position: relative;
    min-height: 680px;
    padding: 156px 0 76px;
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--se-line);
    background:
        linear-gradient(180deg, rgba(7, 26, 45, 0.5) 0, rgba(7, 26, 45, 0.12) 102px, transparent 190px),
        linear-gradient(90deg, rgba(248, 244, 236, 0.98) 0%, rgba(248, 244, 236, 0.93) 44%, rgba(248, 244, 236, 0.55) 70%, rgba(248, 244, 236, 0.14) 100%),
        url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") center / cover no-repeat;
}

.se-masthead::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.38;
    background-image:
        linear-gradient(rgba(19, 40, 58, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(19, 40, 58, 0.045) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(90deg, #000 0%, transparent 75%);
}

.se-masthead__grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
    align-items: stretch;
    gap: 64px;
}

.se-eyebrow {
    margin: 0 0 18px;
    color: var(--se-teal-deep);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.se-masthead h1,
.se-category-hero h1,
.se-entry-hero h1 {
    margin: 0;
    max-width: 860px;
    font-family: var(--se-font-serif);
    font-size: clamp(44px, 5vw, 74px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.se-masthead h1 em {
    color: var(--se-teal);
    font-style: normal;
}

.se-masthead__intro {
    max-width: 770px;
    margin: 24px 0 0;
    color: var(--se-ink-soft);
    font-size: 18px;
    line-height: 1.9;
}

.se-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid var(--se-teal);
    border-radius: 13px;
    background: var(--se-teal);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.se-button:hover {
    transform: translateY(-2px);
    background: var(--se-teal-deep);
}

.se-masthead__seal {
    position: relative;
    min-height: 290px;
    padding: 30px;
    overflow: hidden;
    border: 1px solid rgba(19, 40, 58, 0.13);
    border-radius: var(--se-radius);
    background: rgba(255, 253, 248, 0.68);
    box-shadow: var(--se-shadow);
}

.se-masthead__seal::after {
    content: "WSIC";
    position: absolute;
    right: -14px;
    bottom: -25px;
    color: rgba(8, 126, 120, 0.09);
    font-family: var(--se-font-serif);
    font-size: 112px;
    font-weight: 700;
    letter-spacing: -0.08em;
}

.se-seal__label {
    color: var(--se-coral);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.se-seal__value {
    display: block;
    margin-top: 18px;
    color: var(--se-ink);
    font-family: var(--se-font-serif);
    font-size: 56px;
    line-height: 1;
}

.se-seal__caption {
    display: block;
    margin-top: 8px;
    color: var(--se-ink-soft);
}

.se-seal__line {
    width: 46px;
    height: 3px;
    margin: 28px 0 18px;
    background: var(--se-teal);
}

.se-seal__note {
    position: relative;
    z-index: 1;
    max-width: 240px;
    margin: 0;
    color: var(--se-ink-soft);
    line-height: 1.75;
}

.se-masthead__summary {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 308px;
    padding: 30px;
    border: 1px solid rgba(19, 40, 58, 0.13);
    border-radius: var(--se-radius);
    background: rgba(255, 253, 248, 0.88);
    backdrop-filter: blur(12px);
    box-shadow: var(--se-shadow);
}

.se-summary__primary > span {
    display: block;
    color: var(--se-coral);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.se-summary__primary strong {
    display: block;
    margin-top: 13px;
    font-family: var(--se-font-serif);
    font-size: 58px;
    line-height: 1;
}

.se-summary__primary small {
    display: block;
    margin-top: 7px;
    color: var(--se-ink-soft);
    font-size: 14px;
}

.se-summary__taxonomy {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 26px 0 20px;
    overflow: hidden;
    border: 1px solid var(--se-line);
    border-radius: 15px;
    background: var(--se-line);
}

.se-summary__taxonomy div {
    padding: 13px 15px;
    background: rgba(255, 253, 248, 0.94);
}

.se-summary__taxonomy dt {
    color: var(--se-teal-deep);
    font-family: var(--se-font-serif);
    font-size: 22px;
    font-weight: 700;
}

.se-summary__taxonomy dd {
    margin: 2px 0 0;
    color: var(--se-ink-soft);
    font-size: 12px;
}

.se-masthead__summary > p {
    margin: 0;
    color: var(--se-ink-soft);
    font-size: 13px;
    line-height: 1.65;
}

.se-summary__mobile-intro {
    display: none;
}

.se-stats {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: -1px;
    border-right: 1px solid var(--se-line);
    border-bottom: 1px solid var(--se-line);
    background: rgba(255, 253, 248, 0.48);
}

.se-stat {
    padding: 28px;
    border-left: 1px solid var(--se-line);
}

.se-stat strong {
    display: block;
    color: var(--se-ink);
    font-family: var(--se-font-serif);
    font-size: 32px;
}

.se-stat span {
    display: block;
    margin-top: 4px;
    color: var(--se-ink-soft);
    font-size: 14px;
}

.se-section {
    padding: 78px 0;
}

.se-section--paper {
    background: rgba(255, 253, 248, 0.45);
    border-top: 1px solid var(--se-line);
    border-bottom: 1px solid var(--se-line);
}

.se-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 34px;
}

.se-section-heading h2 {
    margin: 6px 0 0;
    font-family: var(--se-font-serif);
    font-size: clamp(32px, 3.2vw, 48px);
    letter-spacing: -0.035em;
}

.se-section-heading p {
    max-width: 580px;
    margin: 0;
    color: var(--se-ink-soft);
    line-height: 1.75;
}

.se-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.se-category-card {
    position: relative;
    min-height: 220px;
    padding: 27px;
    overflow: hidden;
    border: 1px solid var(--se-line);
    border-radius: 22px;
    background: rgba(255, 253, 248, 0.74);
    color: inherit;
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.se-category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(8, 126, 120, 0.45);
    box-shadow: var(--se-shadow);
}

.se-category-card__number {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: var(--se-ink);
    color: #fff;
    font-weight: 700;
}

.se-category-card h3 {
    margin: 30px 0 5px;
    font-family: var(--se-font-serif);
    font-size: 24px;
}

.se-category-card p {
    margin: 0;
    color: var(--se-ink-soft);
}

.se-category-card__count {
    position: absolute;
    right: 24px;
    bottom: 23px;
    color: var(--se-teal-deep);
    font-size: 13px;
    font-weight: 700;
}

.se-explorer {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    align-items: start;
    overflow: clip;
    border: 1px solid var(--se-line);
    border-radius: var(--se-radius);
    background: rgba(255, 253, 248, 0.74);
    box-shadow: var(--se-shadow);
}

.se-explorer-shell {
    position: relative;
}

.se-mobile-filter-fab,
.se-mobile-filter-backdrop,
.se-mobile-filter-panel {
    display: none;
}

.se-explorer__tabs {
    position: sticky;
    top: 96px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 120px);
    padding: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 1px solid var(--se-line);
    background: rgba(233, 226, 213, 0.34);
    scrollbar-color: rgba(8, 126, 120, 0.35) transparent;
    scrollbar-width: thin;
}

.se-explorer__tab {
    min-width: 0;
    min-height: 96px;
    padding: 16px 18px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--se-ink-soft);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.se-explorer__tab.active {
    background: var(--se-ink);
    color: #fff;
}

.se-explorer__tab:hover {
    transform: translateY(-2px);
    background: rgba(8, 126, 120, 0.08);
}

.se-explorer__tab.active:hover {
    background: var(--se-ink);
}

.se-explorer__tab-number,
.se-explorer__tab small,
.se-explorer__tab strong {
    display: block;
}

.se-explorer__tab-number {
    color: var(--se-teal);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.se-explorer__tab.active .se-explorer__tab-number {
    color: var(--se-mint);
}

.se-explorer__tab strong {
    margin-top: 8px;
    color: inherit;
    font-size: 15px;
}

.se-explorer__tab small {
    margin-top: 5px;
    color: inherit;
    font-size: 11px;
    opacity: 0.72;
}

.se-explorer__content {
    padding: 34px;
}

.se-explorer__title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 30px;
}

.se-explorer__title .se-eyebrow {
    margin-bottom: 8px;
}

.se-explorer__title h3 {
    margin: 0;
    font-family: var(--se-font-serif);
    font-size: 34px;
}

.se-explorer__title p:not(.se-eyebrow) {
    max-width: 640px;
    margin: 8px 0 0;
    color: var(--se-ink-soft);
    line-height: 1.65;
}

.se-midgroup + .se-midgroup {
    margin-top: 34px;
}

.se-midgroup__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--se-line);
}

.se-midgroup__heading h4 {
    margin: 0;
    color: var(--se-teal-deep);
    font-size: 21px;
}

.se-midgroup__heading span {
    color: var(--se-ink-soft);
    font-size: 13px;
}

.se-subcategory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 44px;
    padding-top: 13px;
}

.se-subcategory-link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    color: var(--se-ink);
    border-bottom: 1px solid rgba(19, 40, 58, 0.06);
    text-decoration: none;
    cursor: pointer;
    transition:
        color 180ms ease,
        background-color 180ms ease,
        padding 180ms ease;
}

.se-subcategory-link:hover,
.se-subcategory-link:focus-visible {
    padding-inline: 10px;
    background: rgba(8, 126, 120, 0.06);
    color: var(--se-teal-deep);
}

.se-subcategory-link:focus-visible {
    outline: 2px solid var(--se-teal);
    outline-offset: 2px;
}

.se-subcategory-link small {
    flex: none;
    color: var(--se-ink-soft);
}

.se-flagship-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.se-entry-card {
    display: flex;
    min-height: 190px;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--se-line);
    border-radius: 20px;
    background: rgba(255, 253, 248, 0.72);
    color: inherit;
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease;
}

.se-entry-card:hover {
    transform: translateY(-4px);
    border-color: rgba(8, 126, 120, 0.45);
}

.se-entry-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--se-teal-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.se-entry-card h3 {
    margin: 24px 0 7px;
    font-family: var(--se-font-serif);
    font-size: 23px;
}

.se-entry-card p {
    margin: 0;
    color: var(--se-ink-soft);
    line-height: 1.55;
}

.se-entry-card__path {
    margin-top: auto;
    padding-top: 20px;
    color: var(--se-ink-soft);
    font-size: 12px;
}

.se-category-hero,
.se-entry-hero {
    position: relative;
    min-height: 440px;
    padding: 148px 0 58px;
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--se-line);
    background:
        linear-gradient(180deg, rgba(7, 26, 45, 0.5) 0, rgba(7, 26, 45, 0.12) 102px, transparent 190px),
        linear-gradient(90deg, rgba(248, 244, 236, 0.98) 0%, rgba(248, 244, 236, 0.93) 44%, rgba(248, 244, 236, 0.55) 70%, rgba(248, 244, 236, 0.14) 100%),
        url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") center / cover no-repeat;
}

.se-category-hero::before,
.se-entry-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.3;
    background-image:
        linear-gradient(rgba(19, 40, 58, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(19, 40, 58, 0.045) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(90deg, #000 0%, transparent 75%);
}

.se-category-hero .se-container,
.se-entry-hero .se-container {
    position: relative;
    z-index: 1;
}

.se-category-hero h1 {
    font-size: clamp(38px, 4vw, 58px);
}

.se-category-hero__meta,
.se-entry-hero__subtitle {
    margin: 18px 0 0;
    color: var(--se-ink-soft);
    font-size: 17px;
}

.se-results {
    padding: 54px 0 82px;
}

.se-results-panel {
    overflow: hidden;
    border: 1px solid var(--se-line);
    border-radius: var(--se-radius);
    background: rgba(255, 253, 248, 0.72);
    box-shadow: var(--se-shadow);
}

.se-results-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 28px;
    border-bottom: 1px solid var(--se-line);
}

.se-results-panel__head h2 {
    margin: 0;
    font-family: var(--se-font-serif);
    font-size: 24px;
}

.se-results-panel__head span {
    color: var(--se-ink-soft);
    font-size: 13px;
}

.se-entry-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 48px;
    padding: 18px 28px 28px;
}

.se-entry-row {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid rgba(19, 40, 58, 0.09);
    text-decoration: none;
}

.se-entry-row strong {
    color: var(--se-blue);
    font-size: 16px;
}

.se-entry-row:hover strong {
    color: var(--se-teal-deep);
}

.se-empty {
    padding: 70px 28px;
    color: var(--se-ink-soft);
    text-align: center;
}

.se-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 22px;
    border-top: 1px solid var(--se-line);
}

.se-pagination a,
.se-pagination span {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--se-line);
    border-radius: 10px;
    color: var(--se-ink);
    text-decoration: none;
}

.se-pagination span {
    border-color: transparent;
    color: var(--se-ink-soft);
}

.se-entry-hero h1 {
    font-size: clamp(42px, 5vw, 68px);
}

.se-entry-hero__subtitle {
    font-size: 20px;
}

.se-entry-back-nav {
    position: sticky;
    top: 112px;
    z-index: 100;
    margin-top: 32px;
    pointer-events: none;
}

.se-entry-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: 1px solid var(--se-line);
    border-radius: 50px;
    background: var(--se-white);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    color: var(--se-ink-soft);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    pointer-events: auto;
    transition:
        color 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

.se-entry-back-btn:hover,
.se-entry-back-btn:focus-visible {
    border-color: var(--accent-gold, #c0934e);
    background: var(--accent-gold, #c0934e);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    color: #fff;
    transform: translateX(-5px);
}

.se-entry-back-btn:focus-visible {
    outline: 2px solid var(--se-teal);
    outline-offset: 3px;
}

.se-entry-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 25px;
}

.se-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border-radius: 10px;
    background: rgba(49, 95, 130, 0.10);
    color: var(--se-blue);
    font-size: 13px;
    font-weight: 600;
}

.se-entry-content {
    padding: 46px 0 82px;
}

.se-article {
    padding: clamp(28px, 5vw, 62px);
    border: 1px solid var(--se-line);
    border-radius: var(--se-radius);
    background: rgba(255, 253, 248, 0.78);
    box-shadow: var(--se-shadow);
}

.se-article__lead {
    margin: 0 0 36px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--se-line);
    color: var(--se-ink);
    font-family: var(--se-font-serif);
    font-size: 21px;
    line-height: 1.85;
}

.se-article h2 {
    margin: 40px 0 17px;
    color: var(--se-teal-deep);
    font-family: var(--se-font-serif);
    font-size: 27px;
}

.se-article h2:first-child {
    margin-top: 0;
}

.se-article h3 {
    margin: 30px 0 12px;
    font-size: 20px;
}

.se-article p,
.se-article li {
    color: #263d4e;
    font-size: 16px;
    line-height: 1.95;
}

.se-article ul {
    margin: 10px 0 22px;
    padding-left: 1.4em;
}

.se-article a {
    color: var(--se-blue);
    text-underline-offset: 3px;
}

.se-article__detail {
    margin-top: 46px;
    padding-top: 4px;
    border-top: 1px solid var(--se-line);
}

.se-position-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin: 28px 0 34px;
    overflow: hidden;
    border: 1px solid var(--se-line);
    border-radius: 16px;
    background: var(--se-line);
}

.se-position-card div {
    padding: 20px;
    background: var(--se-white);
}

.se-position-card span {
    display: block;
    margin-bottom: 7px;
    color: var(--se-ink-soft);
    font-size: 12px;
}

.se-position-card strong {
    color: var(--se-ink);
}

.se-related {
    margin-top: 24px;
    padding: 28px;
    border: 1px solid var(--se-line);
    border-radius: 20px;
    background: rgba(255, 253, 248, 0.58);
}

.se-related h2 {
    margin: 0 0 18px;
    font-family: var(--se-font-serif);
    font-size: 23px;
}

.se-related__links {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.se-related__links a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid rgba(49, 95, 130, 0.18);
    border-radius: 999px;
    background: rgba(49, 95, 130, 0.07);
    color: var(--se-blue);
    font-size: 13px;
    text-decoration: none;
}

.se-related__links a:hover {
    border-color: var(--se-teal);
    color: var(--se-teal-deep);
}

.se-source-note {
    margin-top: 24px;
    padding: 22px 26px;
    border-left: 3px solid var(--se-coral);
    background: rgba(255, 253, 248, 0.52);
    color: var(--se-ink-soft);
    font-size: 13px;
    line-height: 1.8;
}

@media (min-width: 768px) and (max-width: 1199px) {
    .se-entry-back-nav {
        top: 140px;
    }
}

@media (max-width: 920px) {
    .se-masthead {
        min-height: auto;
        padding: 136px 0 62px;
        background:
            linear-gradient(180deg, rgba(7, 26, 45, 0.5) 0, rgba(7, 26, 45, 0.08) 92px, transparent 170px),
            linear-gradient(90deg, rgba(248, 244, 236, 0.97) 0%, rgba(248, 244, 236, 0.88) 58%, rgba(248, 244, 236, 0.54) 100%),
            url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") 68% center / cover no-repeat;
    }

    .se-category-hero,
    .se-entry-hero {
        min-height: auto;
        padding: 132px 0 54px;
        background:
            linear-gradient(180deg, rgba(7, 26, 45, 0.5) 0, rgba(7, 26, 45, 0.08) 92px, transparent 170px),
            linear-gradient(90deg, rgba(248, 244, 236, 0.97) 0%, rgba(248, 244, 236, 0.88) 58%, rgba(248, 244, 236, 0.62) 100%),
            url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") 68% center / cover no-repeat;
    }

    .se-masthead__grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .se-masthead__seal {
        min-height: 240px;
    }

    .se-masthead__summary {
        min-height: auto;
    }

    .se-explorer {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .se-explorer__content {
        padding-inline: 26px;
    }

    .se-category-grid,
    .se-flagship-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .se-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .se-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

}

@media (max-width: 767px) {
    .se-entry-back-nav {
        top: calc(var(--mobile-nav-height, 56px) + 16px);
        margin-top: 20px;
    }

    .se-entry-back-btn {
        max-width: 100%;
        padding: 6px 16px;
        font-size: 13px;
        white-space: normal;
    }

    .se-entry-back-btn:hover,
    .se-entry-back-btn:focus-visible {
        transform: translateX(-3px);
    }

    .se-container {
        width: min(100% - 28px, 1180px);
    }

    .se-masthead {
        padding: 112px 0 46px;
        background:
            linear-gradient(180deg, rgba(7, 26, 45, 0.54) 0, rgba(7, 26, 45, 0.08) 76px, transparent 142px),
            linear-gradient(90deg, rgba(248, 244, 236, 0.97) 0%, rgba(248, 244, 236, 0.88) 70%, rgba(248, 244, 236, 0.64) 100%),
            url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") 70% center / cover no-repeat;
    }

    .se-masthead__grid {
        display: flex;
        flex-direction: column;
        gap: 18px;
    }

    .se-masthead__grid > div:first-child {
        display: contents;
    }

    .se-masthead__grid > div:first-child > .se-eyebrow {
        order: 1;
        margin-bottom: -5px;
    }

    .se-masthead__grid > div:first-child > h1 {
        order: 2;
    }

    .se-masthead h1,
    .se-category-hero h1,
    .se-entry-hero h1 {
        font-size: 38px;
    }

    .se-masthead__intro {
        display: none;
    }

    .se-masthead__seal {
        min-height: 220px;
    }

    .se-masthead__summary {
        order: 3;
    }

    .se-masthead__summary > .se-summary__mobile-intro {
        display: block;
        padding: 0 0 14px;
        border-top: 0;
        border-bottom: 1px solid var(--se-line);
        font-size: 14px;
        line-height: 1.72;
    }

    .se-summary__primary {
        margin-top: 18px;
    }

    .se-summary__primary > span {
        font-size: 11px;
    }

    .se-summary__primary strong {
        margin-top: 10px;
        font-size: 46px;
    }

    .se-summary__primary small {
        margin-top: 5px;
        font-size: 13px;
    }

    .se-summary__taxonomy dt {
        font-size: 19px;
    }

    .se-summary__taxonomy dd {
        font-size: 11px;
    }

    .se-seal__value {
        font-size: 46px;
    }

    .se-stats,
    .se-category-grid,
    .se-flagship-grid,
    .se-subcategory-grid,
    .se-entry-list,
    .se-position-card {
        grid-template-columns: 1fr;
    }

    .se-section {
        padding: 58px 0;
    }

    .se-explorer__content {
        padding: 24px 20px;
    }

    .se-explorer {
        grid-template-columns: 1fr;
    }

    .se-explorer__tabs {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        max-height: none;
        padding: 10px;
        overflow: visible;
        overscroll-behavior: auto;
        border-right: 0;
        border-bottom: 1px solid var(--se-line);
    }

    .se-mobile-filter-fab {
        position: fixed;
        right: max(18px, env(safe-area-inset-right));
        bottom: max(24px, calc(env(safe-area-inset-bottom) + 18px));
        z-index: 92;
        display: grid;
        place-items: center;
        width: 60px !important;
        min-width: 60px !important;
        height: 60px;
        min-height: 60px;
        padding: 0 !important;
        border: 1px solid rgba(255, 255, 255, 0.28);
        border-radius: 50%;
        background: var(--se-ink);
        box-shadow: 0 12px 32px rgba(7, 26, 45, 0.28);
        color: #fff;
        font: inherit;
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        transform: translateY(14px) scale(0.88);
        transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
    }

    .se-mobile-filter-ready .se-mobile-filter-fab {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .se-mobile-filter-fab:active {
        transform: scale(0.94);
    }

    .se-mobile-filter-fab__glyph {
        margin-top: -3px;
        font-size: 20px;
        font-weight: 700;
        line-height: 1;
    }

    .se-mobile-filter-fab__number {
        position: absolute;
        right: -2px;
        top: -4px;
        display: grid;
        place-items: center;
        min-width: 23px;
        height: 23px;
        padding: 0 5px;
        border: 2px solid #f7f3eb;
        border-radius: 999px;
        background: var(--se-teal);
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.03em;
    }

    .se-mobile-filter-backdrop {
        position: fixed;
        inset: 0;
        z-index: 93;
        display: block;
        background: rgba(7, 26, 45, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 200ms ease;
    }

    .se-mobile-filter-panel {
        position: fixed;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        left: 10px;
        z-index: 94;
        display: block;
        max-height: min(78vh, 620px);
        padding: 18px 10px 12px;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 1px solid rgba(7, 26, 45, 0.12);
        border-radius: 26px;
        background: rgba(249, 246, 239, 0.98);
        box-shadow: 0 24px 70px rgba(7, 26, 45, 0.3);
        opacity: 0;
        pointer-events: none;
        transform: translateY(calc(100% + 24px));
        transition: opacity 200ms ease, transform 240ms ease;
    }

    .se-mobile-filter-open .se-mobile-filter-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .se-mobile-filter-open .se-mobile-filter-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .se-mobile-filter-open .se-mobile-filter-fab {
        opacity: 0;
        pointer-events: none;
    }

    .se-mobile-filter-panel__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 0 8px 14px;
    }

    .se-mobile-filter-panel__head span,
    .se-mobile-filter-panel__head strong {
        display: block;
    }

    .se-mobile-filter-panel__head span {
        margin-bottom: 3px;
        color: var(--se-coral);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.12em;
    }

    .se-mobile-filter-panel__head strong {
        color: var(--se-ink);
        font-size: 20px;
    }

    .se-mobile-filter-panel__head button {
        display: grid;
        place-items: center;
        flex: 0 0 38px;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px;
        min-height: 38px;
        padding: 0 !important;
        border: 1px solid var(--se-line);
        border-radius: 50%;
        background: #fffdf8;
        color: var(--se-ink);
        font: 400 25px/1 Arial, sans-serif;
    }

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

    .se-mobile-filter-grid .se-explorer__tab {
        min-height: 88px;
        border: 1px solid transparent;
        background: rgba(255, 253, 248, 0.76);
    }

    .se-mobile-filter-grid .se-explorer__tab:not(.active) {
        border-color: rgba(7, 26, 45, 0.08);
    }

    .se-mobile-filter-grid .se-explorer__tab.active {
        border-color: var(--se-ink);
        background: var(--se-ink);
        color: #fff;
    }

    .se-explorer__tab {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "number count"
            "name name";
        align-content: center;
        align-items: center;
        column-gap: 8px;
        width: auto !important;
        max-width: none !important;
        min-height: 84px;
        margin: 0 !important;
        padding: 13px 14px;
    }

    .se-explorer__tab-number {
        grid-area: number;
        font-size: 11px;
    }

    .se-explorer__tab strong {
        grid-area: name;
        margin-top: 8px;
        overflow: hidden;
        font-size: 14px;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .se-explorer__tab small {
        grid-area: count;
        justify-self: end;
        margin-top: 0;
        font-size: 10px;
        white-space: nowrap;
    }

    .se-explorer__title {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .se-entry-list {
        padding-inline: 20px;
    }

    .se-category-hero,
    .se-entry-hero {
        padding: 108px 0 42px;
        background:
            linear-gradient(180deg, rgba(7, 26, 45, 0.54) 0, rgba(7, 26, 45, 0.08) 76px, transparent 142px),
            linear-gradient(90deg, rgba(248, 244, 236, 0.97) 0%, rgba(248, 244, 236, 0.92) 72%, rgba(248, 244, 236, 0.76) 100%),
            url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") 70% center / cover no-repeat;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .se-loading__mark { animation: none; }
    .se-category-card,
    .se-entry-card,
    .se-button,
    .se-explorer__tab,
    .se-entry-back-btn,
    .se-mobile-filter-fab,
    .se-mobile-filter-backdrop,
    .se-mobile-filter-panel { transition: none; }
}

/* Category page hero: compact editorial hierarchy with a clearer image reveal. */
.se-category-hero {
    min-height: 410px;
    padding: 132px 0 54px;
    background:
        linear-gradient(180deg, rgba(7, 26, 45, 0.48) 0, rgba(7, 26, 45, 0.11) 94px, transparent 168px),
        linear-gradient(90deg, rgba(248, 244, 236, 0.98) 0%, rgba(248, 244, 236, 0.94) 34%, rgba(248, 244, 236, 0.72) 51%, rgba(248, 244, 236, 0.22) 68%, rgba(7, 26, 45, 0.06) 100%),
        url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") center / cover no-repeat;
}

.se-category-hero::before {
    opacity: 0.2;
    background-size: 58px 58px;
    mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.45) 48%, transparent 76%);
}

.se-category-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: 0;
    height: 96px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(19, 40, 58, 0.045));
}

.se-category-hero .se-container {
    display: grid;
    min-height: 224px;
    align-content: center;
    padding-left: 34px;
}

.se-category-hero .se-container::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--se-teal), rgba(8, 126, 120, 0.14));
    box-shadow: 0 0 0 7px rgba(8, 126, 120, 0.055);
}

.se-category-hero .se-eyebrow {
    width: max-content;
    margin-bottom: 20px;
    padding: 7px 11px 7px 12px;
    border: 1px solid rgba(8, 126, 120, 0.18);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.58);
    box-shadow: 0 8px 24px rgba(19, 40, 58, 0.045);
    font-size: 12px;
    letter-spacing: 0.18em;
    backdrop-filter: blur(10px);
}

.se-category-hero h1 {
    max-width: 720px;
    font-size: clamp(46px, 4.25vw, 66px);
    line-height: 1.04;
    letter-spacing: -0.05em;
    text-wrap: balance;
    text-shadow: 0 2px 18px rgba(255, 253, 248, 0.5);
}

.se-category-hero__meta {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    margin-top: 23px;
    padding: 8px 16px;
    border: 1px solid rgba(19, 40, 58, 0.1);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.7);
    box-shadow: 0 10px 28px rgba(19, 40, 58, 0.06);
    color: #385164;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    backdrop-filter: blur(12px);
}

.se-category-hero__meta::before {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--se-teal);
    box-shadow: 0 0 0 5px rgba(8, 126, 120, 0.1);
}

@media (min-width: 768px) and (max-width: 1199px) {
    .se-category-hero {
        min-height: 380px;
        padding: 122px 0 48px;
        background:
            linear-gradient(180deg, rgba(7, 26, 45, 0.48) 0, rgba(7, 26, 45, 0.09) 88px, transparent 154px),
            linear-gradient(90deg, rgba(248, 244, 236, 0.98) 0%, rgba(248, 244, 236, 0.92) 46%, rgba(248, 244, 236, 0.58) 67%, rgba(7, 26, 45, 0.04) 100%),
            url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") 64% center / cover no-repeat;
    }

    .se-category-hero .se-container {
        min-height: 210px;
    }
}

@media (max-width: 767px) {
    .se-category-hero {
        min-height: 332px;
        padding: 100px 0 38px;
        background:
            linear-gradient(180deg, rgba(7, 26, 45, 0.5) 0, rgba(7, 26, 45, 0.08) 72px, transparent 132px),
            linear-gradient(90deg, rgba(248, 244, 236, 0.98) 0%, rgba(248, 244, 236, 0.93) 68%, rgba(248, 244, 236, 0.68) 100%),
            url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") 69% center / cover no-repeat;
    }

    .se-category-hero .se-container {
        min-height: 194px;
        padding-left: 22px;
    }

    .se-category-hero .se-container::before {
        width: 2px;
        box-shadow: 0 0 0 5px rgba(8, 126, 120, 0.05);
    }

    .se-category-hero .se-eyebrow {
        margin-bottom: 16px;
        padding: 6px 9px 6px 10px;
        font-size: 10px;
        letter-spacing: 0.13em;
    }

    .se-category-hero h1 {
        font-size: clamp(34px, 10.5vw, 44px);
        line-height: 1.08;
    }

    .se-category-hero__meta {
        width: auto;
        margin-top: 19px;
        padding: 8px 13px;
        border-radius: 15px;
        font-size: 13px;
    }
}

/* Entry page hero: a richer title composition that matches the category header. */
.se-entry-hero {
    min-height: 450px;
    padding: 130px 0 56px;
    background:
        linear-gradient(180deg, rgba(7, 26, 45, 0.48) 0, rgba(7, 26, 45, 0.11) 94px, transparent 168px),
        linear-gradient(90deg, rgba(248, 244, 236, 0.98) 0%, rgba(248, 244, 236, 0.94) 35%, rgba(248, 244, 236, 0.7) 52%, rgba(248, 244, 236, 0.2) 69%, rgba(7, 26, 45, 0.07) 100%),
        url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") center / cover no-repeat;
}

.se-entry-hero::before {
    opacity: 0.2;
    background-size: 58px 58px;
    mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.42) 48%, transparent 76%);
}

.se-entry-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: 0;
    height: 100px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(19, 40, 58, 0.05));
}

.se-entry-hero .se-container {
    display: grid;
    min-height: 264px;
    align-content: center;
    padding-left: 36px;
}

.se-entry-hero .se-container::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--se-teal), rgba(8, 126, 120, 0.12));
    box-shadow: 0 0 0 7px rgba(8, 126, 120, 0.055);
}

.se-entry-hero .se-eyebrow {
    width: max-content;
    max-width: 100%;
    margin-bottom: 20px;
    padding: 7px 11px 7px 12px;
    border: 1px solid rgba(8, 126, 120, 0.18);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.6);
    box-shadow: 0 8px 24px rgba(19, 40, 58, 0.045);
    font-size: 12px;
    letter-spacing: 0.18em;
    backdrop-filter: blur(10px);
}

.se-entry-hero h1 {
    max-width: 790px;
    font-size: clamp(50px, 5.15vw, 74px);
    line-height: 1.03;
    letter-spacing: -0.055em;
    text-wrap: balance;
    text-shadow: 0 2px 18px rgba(255, 253, 248, 0.5);
}

.se-entry-hero__subtitle {
    max-width: 720px;
    margin-top: 18px;
    color: #3b5366;
    font-size: 19px;
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: -0.01em;
}

.se-entry-badges {
    gap: 10px;
    margin-top: 25px;
}

.se-entry-hero .se-badge {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(19, 40, 58, 0.1);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.7);
    box-shadow: 0 9px 24px rgba(19, 40, 58, 0.055);
    color: #315f82;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.015em;
    backdrop-filter: blur(12px);
}

.se-entry-hero .se-badge:first-child {
    border-color: rgba(8, 126, 120, 0.24);
    background: var(--se-teal-deep);
    box-shadow: 0 10px 26px rgba(7, 95, 92, 0.18);
    color: #fff;
}

.se-entry-hero .se-badge:nth-child(2)::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 9px;
    border-radius: 50%;
    background: var(--se-teal);
    box-shadow: 0 0 0 4px rgba(8, 126, 120, 0.1);
}

@media (min-width: 768px) and (max-width: 1199px) {
    .se-entry-hero {
        min-height: 420px;
        padding: 120px 0 50px;
        background:
            linear-gradient(180deg, rgba(7, 26, 45, 0.48) 0, rgba(7, 26, 45, 0.09) 88px, transparent 154px),
            linear-gradient(90deg, rgba(248, 244, 236, 0.98) 0%, rgba(248, 244, 236, 0.92) 47%, rgba(248, 244, 236, 0.57) 68%, rgba(7, 26, 45, 0.04) 100%),
            url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") 64% center / cover no-repeat;
    }

    .se-entry-hero .se-container {
        min-height: 250px;
    }
}

@media (max-width: 767px) {
    .se-entry-hero {
        min-height: 350px;
        padding: 98px 0 38px;
        background:
            linear-gradient(180deg, rgba(7, 26, 45, 0.5) 0, rgba(7, 26, 45, 0.08) 72px, transparent 132px),
            linear-gradient(90deg, rgba(248, 244, 236, 0.98) 0%, rgba(248, 244, 236, 0.93) 68%, rgba(248, 244, 236, 0.68) 100%),
            url("../assets/images/sleep-encyclopedia-hero-ai-20260724-v1.png") 69% center / cover no-repeat;
    }

    .se-entry-hero .se-container {
        min-height: 214px;
        padding-left: 22px;
    }

    .se-entry-hero .se-container::before {
        width: 2px;
        box-shadow: 0 0 0 5px rgba(8, 126, 120, 0.05);
    }

    .se-entry-hero .se-eyebrow {
        width: fit-content;
        margin-bottom: 16px;
        padding: 6px 9px 6px 10px;
        font-size: 10px;
        line-height: 1.4;
        letter-spacing: 0.12em;
    }

    .se-entry-hero h1 {
        font-size: clamp(36px, 11vw, 48px);
        line-height: 1.08;
    }

    .se-entry-hero__subtitle {
        margin-top: 14px;
        font-size: 15px;
    }

    .se-entry-badges {
        gap: 8px;
        margin-top: 20px;
    }

    .se-entry-hero .se-badge {
        min-height: 36px;
        padding: 0 12px;
        font-size: 12px;
    }
}

/* English entry titles vary widely in length. Keep short titles expressive
   while progressively reducing long titles so the hero remains scannable. */
body[data-language="en"] .se-entry-hero h1 {
    max-width: 900px;
    font-size: clamp(46px, 4.7vw, 68px);
    line-height: 1.05;
    letter-spacing: -0.045em;
    overflow-wrap: break-word;
    text-wrap: pretty;
}

body[data-language="en"] .se-entry-hero--title-medium h1 {
    max-width: 920px;
    font-size: clamp(40px, 4.2vw, 60px);
    line-height: 1.06;
}

body[data-language="en"] .se-entry-hero--title-long h1 {
    max-width: 940px;
    font-size: clamp(36px, 3.55vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

body[data-language="en"] .se-entry-hero--title-extra-long h1 {
    max-width: 960px;
    font-size: clamp(32px, 3vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.025em;
}

@media (max-width: 767px) {
    body[data-language="en"] .se-entry-hero h1 {
        font-size: clamp(32px, 9.8vw, 42px);
        line-height: 1.08;
    }

    body[data-language="en"] .se-entry-hero--title-medium h1 {
        font-size: clamp(30px, 9vw, 38px);
    }

    body[data-language="en"] .se-entry-hero--title-long h1 {
        font-size: clamp(26px, 8.2vw, 34px);
        line-height: 1.1;
    }

    body[data-language="en"] .se-entry-hero--title-extra-long h1 {
        font-size: clamp(24px, 7.4vw, 31px);
        line-height: 1.12;
        letter-spacing: -0.02em;
    }
}
