:root {
    color-scheme: light;
    font-family: var(--dream-font-sans, system-ui, sans-serif);
    --ink: #392741;
    --muted: #503A57;
    --violet: #573767;
    --purple: var(--violet);
    --pink: #713C2B;
    --cta-purple: #80518D;
    --cta-pink: #A64278;
    --sky: #DDC8E5;
    --mist: #D2BEDB;
    --surface: #EADDED;
    --surface-soft: #DDC8E5;
    --input: #F4E7EE;
    --warm: #713C2B;
    --card-border: #AA88B7;
    --radius-card: 20px;
    --radius-control: 14px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --shadow-card: 0 4px 20px rgb(83 48 91 / 12%);
    --shadow-raised: 0 16px 44px rgb(66 38 75 / 24%);
    --focus-ring: #713C2B;
    --danger: #982F50;
    --success: #27664F;
}

* { box-sizing: border-box; }
body { min-width: 0; min-height: 100vh; margin: 0; padding-bottom: calc(var(--dream-mobile-navigation-height, 72px) + 16px); background: var(--mist); color: var(--ink); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
h1, h2, p { overflow-wrap: anywhere; }
.dream-background { position: fixed; z-index: -1; inset: 0; pointer-events: none; background: linear-gradient(155deg, rgb(210 190 219 / 90%), rgb(232 202 219 / 94%) 52%, rgb(208 219 220 / 94%)), url('../app/assets/dream-dusk-aurora-v1.webp') center top / cover no-repeat; background-color: var(--mist); }

.app-frame { width: min(1120px, 100%); margin: 0 auto; }
main { min-width: 0; padding: 0 20px 28px; }
.desktop-rail { display: none; }
.page-header { padding: 18px 0 12px; }
.page-header h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.page-header > p { max-width: 45rem; margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.explore-tabs { display: flex; min-height: 52px; margin: 0 -8px 6px; overflow-x: auto; scrollbar-width: none; }
.explore-tabs::-webkit-scrollbar, .filter-row::-webkit-scrollbar { display: none; }
.explore-tab { position: relative; display: inline-grid; flex: 0 0 auto; min-height: 48px; place-items: center; padding: 10px 12px 6px; color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap; }
.explore-tab.is-active { color: var(--violet); font-weight: 700; }
.explore-tab.is-active::after { position: absolute; inset-block-end: 0; width: 24px; height: 3px; border-radius: 999px; background: linear-gradient(135deg, var(--cta-purple), var(--cta-pink)); content: ""; }
.explore-tab.is-disabled { cursor: not-allowed; opacity: .5; }

.explore-home { padding-bottom: 12px; }
.explore-shelf { padding: 12px 0 16px; }
.explore-shelf__header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 0 0 6px; }
.explore-shelf__header h2 { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; margin: 0; font-size: 20px; font-weight: 700; line-height: 1.3; }
.explore-shelf__header a { max-width: 100%; min-height: 44px; margin-inline-start: auto; padding: 10px 0; color: var(--violet); font-size: 14px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.explore-shelf__rail { display: flex; gap: 12px; margin: 0 -20px; padding: 0 20px 4px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.explore-shelf__rail .explore-card { --home-card-width: clamp(128px, calc(36vw - 14px), 196px); flex: 0 0 var(--home-card-width); min-height: calc(var(--home-card-width) + 144px); scroll-snap-align: start; }

.explore-card { min-width: 0; overflow: hidden; border: 1px solid var(--card-border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-card); }
.explore-card > .explore-art { margin: 8px; }
.explore-card__link { display: block; padding: 0 8px 8px; }
.explore-art { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: var(--surface-soft); }
.explore-art img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.explore-card__body { padding: 0; }
.explore-card h2 { margin: 0; overflow: hidden; font-size: 14px; font-weight: 700; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.explore-card__body > p { display: -webkit-box; min-height: 36px; margin: 3px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.explore-card__tags { display: flex; gap: 4px; margin: 7px 0 0; padding: 0; list-style: none; }
.explore-card__tags li { min-width: 0; overflow: hidden; border-radius: 999px; padding: 3px 7px; background: rgb(112 73 131 / 9%); color: var(--violet); font-size: 10px; font-weight: 600; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.explore-card__tags li:not(:only-child) { flex: 1 1 0; }

.catalog { padding: 2px 0 28px; }
.catalog__sort, .filter-row { display: flex; gap: 8px; min-height: 48px; margin: 0 -4px 4px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
.catalog__sort { justify-content: flex-start; justify-content: safe flex-end; }
.filter-chip { display: inline-grid; flex: 0 0 auto; min-height: 44px; place-items: center; border: 1px solid rgb(112 73 131 / 18%); border-radius: 999px; padding: 7px 12px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.filter-chip.is-active { border-color: transparent; background: rgb(112 73 131 / 14%); color: var(--violet); font-weight: 700; }
.companion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-bottom: 28px; }
.catalog-grid .explore-card { align-self: start; }
.explore-card > .filter-chip { display: flex; min-block-size: 48px; margin: 0 8px 8px; white-space: normal; overflow-wrap: anywhere; text-align: center; }

.portrait-frame { position: relative; aspect-ratio: .57; overflow: hidden; background: var(--surface-soft); }
.portrait-frame::after, .detail-portrait::after { position: absolute; inset: 40% 0 0; content: ""; background: linear-gradient(transparent, rgb(40 34 56 / 67%)); pointer-events: none; }
.portrait-frame img, .detail-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.dream-cover-link { display: block; width: 100%; height: 100%; }
.dream-cover-skeleton { position: absolute; z-index: 1; inset: 0; opacity: 0; background: linear-gradient(110deg, rgb(255 255 255 / 0%) 34%, rgb(255 255 255 / 62%) 47%, rgb(255 255 255 / 0%) 60%), var(--surface-soft); background-size: 220% 100%, 100% 100%; pointer-events: none; }
.dream-general-cover.is-cover-loading .dream-cover-skeleton { opacity: 1; animation: dream-cover-sheen 1.4s ease-in-out infinite; }
.dream-general-cover.is-cover-ready .dream-cover-skeleton, .dream-general-cover.is-cover-session-only .dream-cover-skeleton { opacity: 0; animation: none; transition: opacity .2s ease-out; }
.dream-cover-retry { position: absolute; z-index: 2; inset-inline-end: 10px; inset-block-end: 10px; width: 44px; height: 44px; border: 0; border-radius: 999px; background: rgb(40 34 56 / 76%); color: white; cursor: pointer; font-size: 1.05rem; line-height: 1; }
.dream-cover-retry:focus-visible { outline: 3px solid rgb(112 73 131 / 58%); outline-offset: 3px; }
@keyframes dream-cover-sheen { 0% { background-position: 130% 0, 0 0; } 100% { background-position: -40% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .dream-cover-skeleton { animation: none; } }
.portrait-placeholder { display: grid; place-items: center; width: 100%; height: 100%; background: var(--surface-soft); color: var(--violet); }
.portrait-placeholder > span { display: grid; place-items: center; inline-size: 48px; block-size: 48px; max-inline-size: 50%; }
.portrait-placeholder svg { width: 100%; height: 100%; }

.empty-state { border: 1px solid var(--card-border); border-radius: var(--radius-card, 20px); background: var(--surface); }
.empty-state { display: grid; min-height: 220px; place-content: center; gap: 12px; padding: 24px; text-align: center; }
.empty-state__moon { display: inline-grid; width: 48px; height: 48px; place-items: center; margin: auto; border-radius: var(--radius-control); background: var(--surface-soft); color: var(--violet); font-size: 28px; }
.empty-state p { max-width: 32rem; margin: 0; color: var(--muted); font-weight: 600; }
.public-disabled-state { opacity: .8; }

.detail-page { margin: 0 -20px; padding-bottom: 88px; }
.detail-back { position: absolute; z-index: 2; inset-block-start: 16px; inset-inline-start: 20px; display: grid; width: 44px; height: 44px; place-items: center; margin: 0; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: 0 4px 16px rgb(44 32 70 / 16%); }
.detail-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.detail-back__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
html[dir="rtl"] .detail-back svg { transform: rotate(180deg); }
.detail-hero { position: relative; min-height: 390px; overflow: hidden; background: var(--surface-soft); }
.detail-portrait { position: absolute; inset: 0; overflow: hidden; background: var(--surface-soft); }
.detail-portrait::after { inset: 35% 0 0; background: linear-gradient(transparent, rgb(40 34 56 / 76%)); }
.detail-hero__content { position: absolute; z-index: 1; inset-inline: 20px; inset-block-end: 24px; color: white; }
.detail-hero__content h1 { margin: 0; color: white; font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.16; text-shadow: 0 2px 16px rgb(30 20 50 / 40%); }
.detail-meta, .detail-tagline { margin: 6px 0 0; color: rgb(255 255 255 / 88%); font-size: 14px; font-weight: 700; }
.detail-content { position: relative; margin: 0 12px; overflow: visible; border: 1px solid var(--card-border); border-radius: 0 0 20px 20px; background: var(--surface); box-shadow: 0 12px 28px rgb(71 47 114 / 8%); }
.detail-tags { padding: 18px 20px 0; }
.detail-tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.detail-tag-list li { border: 1px solid rgb(112 73 131 / 16%); border-radius: 999px; padding: 6px 11px; background: rgb(112 73 131 / 8%); color: var(--violet); font-size: 13px; font-weight: 600; }
.detail-section { margin: 0; padding: 18px 20px 22px; border: 0; border-radius: 0; color: var(--muted); background: transparent; }
.detail-section p { margin: 0; white-space: pre-line; }
.detail-action { position: fixed; z-index: 3; inset-inline: 0; inset-block-end: 0; width: min(100%, 780px); margin-inline: auto; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); border-block-start: 1px solid rgb(230 221 242 / 80%); background: var(--surface); box-shadow: 0 -8px 24px rgb(40 34 56 / 10%); backdrop-filter: blur(14px); }
.detail-action__button { display: flex; min-height: 56px; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-control); padding: 12px 20px; background: linear-gradient(135deg, var(--cta-purple), var(--cta-pink)); box-shadow: 0 3px 10px rgb(112 73 131 / 12%); color: #fff; font-size: 16px; font-weight: 700; text-align: center; }
.detail-action__button:focus-visible { outline: 3px solid rgb(112 73 131 / 52%); outline-offset: 3px; }

.mobile-navigation { position: fixed; z-index: 2; inset-inline: 0; inset-block-end: 0; display: grid; grid-template-columns: repeat(4, 1fr); min-height: 72px; border-top: 1px solid var(--card-border); background: rgb(234 221 237 / 97%); backdrop-filter: blur(14px); }
.app-destination { position: relative; display: grid; min-width: 0; min-height: 72px; place-items: center; align-content: center; gap: 2px; padding: 7px 4px 9px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }
.app-destination__icon-wrap { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 999px; }
.app-destination__icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.app-destination__label { min-width: 0; max-width: 100%; overflow-wrap: anywhere; font-size: 11px; font-weight: 700; }
.app-destination.is-active { color: var(--violet); }
.mobile-navigation .app-destination.is-active .app-destination__icon-wrap { width: 64px; background: linear-gradient(135deg, var(--cta-purple), var(--cta-pink)); color: #FFF4F8; }
.app-destination.is-disabled { cursor: not-allowed; opacity: .5; }
.app-destination:focus-visible, .explore-tab:focus-visible, .filter-chip:focus-visible, .explore-shelf__header a:focus-visible, .explore-card__link:focus-visible, .desktop-rail__brand:focus-visible { outline: 3px solid rgb(112 73 131 / 52%); outline-offset: 3px; }

.not-found-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.not-found-card { display: grid; min-width: min(100%, 360px); place-items: center; gap: 16px; padding: 36px; border: 1px solid var(--card-border); border-radius: var(--radius-card, 20px); background: var(--surface); text-align: center; }
.not-found-card h1 { font-size: 1.4rem; }

@media (min-width: 640px) {
    .companion-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
    body { padding-bottom: 0; }
    .app-frame { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 28px; padding: 18px 20px 28px; }
    main { padding: 0; }
    .desktop-rail { position: sticky; inset-block-start: 18px; display: grid; gap: 12px; align-self: start; padding: 12px 10px; border: 1px solid var(--card-border); border-radius: var(--radius-card, 20px); background: var(--surface); }
    .desktop-rail__brand { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 8px; font-weight: 700; }
    .desktop-rail__brand-mark { display: block; width: 32px; height: 32px; flex: 0 0 32px; object-fit: cover; border-radius: 20%; box-shadow: none; }
    .desktop-rail__destinations { display: grid; gap: 4px; }
    .desktop-rail .app-destination { min-height: 52px; grid-template-columns: 24px 1fr; justify-items: start; gap: 8px; padding: 10px 12px; font-size: 14px; text-align: start; }
    .desktop-rail .app-destination__icon-wrap { width: 24px; height: 24px; }
    .mobile-navigation { display: none; }
    .page-header { padding: 18px 0 12px; }
    .explore-shelf__rail { margin-inline: 0; padding-inline: 0; }
    .companion-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
    .detail-page { width: min(100%, 780px); margin: 0 auto; padding-bottom: 0; }
    .detail-hero { min-height: clamp(460px, 58vh, 620px); border: 1px solid var(--card-border); border-radius: 20px 20px 0 0; }
    .detail-hero__content { inset-inline: 32px; inset-block-end: 32px; }
    .detail-content { margin: 0; border-radius: 0 0 20px 20px; }
    .detail-section { margin-inline: 0; }
    .detail-action { position: static; width: auto; margin: 0; padding: 18px 20px 22px; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
}

/* Stable sequence accents distinguish introductions without encoding gender. */
.explore-card { --role-card-start: #F2D6CC; --role-card-end: #E8CEDF; background: linear-gradient(145deg, var(--role-card-start), var(--role-card-end)); }
.explore-card:nth-child(4n + 2) { --role-card-start: #EAD1E0; --role-card-end: #DAB7CB; }
.explore-card:nth-child(4n + 3) { --role-card-start: #D5E2DD; --role-card-end: #C4D8D2; }
.explore-card:nth-child(4n + 4) { --role-card-start: #DDD1EB; --role-card-end: #CDBDDC; }
.explore-card h2, .explore-card__body { color: #392741; }
.explore-card__body > p { color: #503A57; }
.explore-card__tags li { border: 1px solid rgb(87 55 103 / 22%); background: rgb(244 231 238 / 78%); color: #573767; }
.detail-content { background: linear-gradient(155deg, #F2D6CC, #EADDED 45%, #DDCEE9); }

/* Parity: one primary chat action, independent header actions, full detail sections. */
.detail-page { position:relative; }
.detail-favorite-button { position:absolute; z-index:3; inset-block-start:16px; inset-inline-end:72px; display:grid; place-items:center; width:44px; height:44px; border-radius:50%; background:rgb(30 20 40 / .28); color:#fff; text-decoration:none; font-size:30px; }
.detail-section h2 { margin:0 0 8px; font-size:20px; color:var(--ink); }
.detail-section h2:empty { display:none; }
.detail-section h3 { font-size:15px; margin:16px 0 5px; color:var(--ink); }
.detail-content { margin:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.detail-hero { min-height:390px; }
.detail-tags { padding:20px 20px 0; }
.detail-section { padding:16px 20px 4px; color:var(--ink); line-height:1.6; }
.detail-tag-list li { border-radius:8px; border-color:var(--card-border); background:var(--surface); color:var(--ink); font-weight:400; }
.detail-action { border:0; }
.dream-ui-balance { display:inline-flex; align-items:center; gap:6px; padding:9px 12px; border:1px solid var(--card-border); border-radius:999px; color:var(--ink); background:var(--surface); text-decoration:none; font-size:14px; white-space:nowrap; }
.page-header:has(> .dream-ui-balance) { position:relative; padding-inline-end:100px; }
.page-header > .dream-ui-balance { position:absolute; inset-inline-end:0; inset-block-start:18px; }
.explore-shelf__rail > [hidden] { display:none !important; }
.dream-shelf-more { flex:none; align-self:center; width:108px; min-height:48px; margin-inline:8px; border:1px solid var(--card-border); border-radius:30px; background:var(--surface); color:var(--ink); font:inherit; cursor:pointer; }

/* D-632: same compact sort entry and anchored menu as the native catalog. */
.catalog__sort { position:relative; display:block; overflow:visible; margin:0 0 6px; padding:0; min-height:48px; z-index:5; text-align:end; }
.catalog__sort summary { display:inline-flex; align-items:center; gap:8px; min-height:44px; max-inline-size:100%; padding:6px 12px; border:1px solid var(--card-border); border-radius:10px; background:var(--surface); color:var(--muted); font-size:13px; cursor:pointer; list-style:none; }
.catalog__sort summary::-webkit-details-marker { display:none; }
.catalog__sort nav { position:absolute; inset-inline-end:0; inset-block-start:44px; display:grid; min-inline-size:112px; max-inline-size:min(280px,85vw); padding:6px; border:1px solid var(--card-border); border-radius:12px; background:var(--surface); box-shadow:0 8px 28px #0004; text-align:start; }
.catalog__sort nav .filter-chip { display:block; border:0; border-radius:6px; white-space:normal; overflow-wrap:anywhere; }
.catalog__sort:not([open]) nav { display:none; }
.filter-row .filter-chip { display:inline-flex; align-items:center; justify-content:center; border-radius:10px; }
.filter-row .filter-chip.is-active::before { content:'✓'; margin-inline-end:6px; }

/* Audited native parity, 2026-11-02. */

.explore-shelf__rail { scroll-padding-inline:20px;scrollbar-width:none; }
.explore-shelf__rail::-webkit-scrollbar { display:none; }
.explore-shelf__header a { font-size:0;width:48px;display:grid;place-items:center;padding:0; }
.explore-shelf__header a::after { content:'';display:block;width:24px;height:24px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20512%20512%22%3E%3Cpath%20transform%3D%22translate%280%20512%29%20scale%281%20-1%29%22%20d%3D%22M256%20427%20226%20397%20345%20277H85V235H345L226%20115L256%2085L427%20256L256%20427Z%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat; }
[dir=rtl] .explore-shelf__header a::after { transform:rotate(180deg); }
.catalog>.filter-row>.filter-chip { border:1px solid var(--card-border);border-radius:8px;background:transparent;font-weight:400;min-height:36px; }
.catalog>.filter-row>.filter-chip.is-active { background:var(--surface-soft);border-color:transparent; }
.catalog { margin-inline:-4px; }
.catalog-grid .explore-card { aspect-ratio:.57; }
.detail-section { font-size:14px;line-height:1.5; }
.detail-section h2 { font-size:20px;font-weight:700; }
.detail-hero__content h1 { font-size:24px;line-height:1.3; }
.detail-meta { font-size:12px;font-weight:400; }
.detail-back,.detail-report-button { background:transparent;border:0;box-shadow:none;backdrop-filter:none; }
.detail-action__button { gap:8px;min-height:48px;font-size:14px;font-weight:500; }
.detail-action__button::before { content:'';display:block;width:18px;height:18px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20512%20512%22%3E%3Cpath%20transform%3D%22translate%280%20512%29%20scale%281%20-1%29%22%20d%3D%22M405%20320%20432%20379%20491%20405%20432%20432%20405%20491%20379%20432%20320%20405%20379%20379%20405%20320ZM245%20309%20192%20427%20139%20309%2021%20256%20139%20203%20192%2085%20245%20203%20363%20256%20245%20309ZM405%20192%20379%20133%20320%20107%20379%2080%20405%2021%20432%2080%20491%20107%20432%20133%20405%20192Z%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat; }
