/* Habitat Entry — habitat-first resident entry experience */

/* Design tokens from atlas.css for consistency */
:root {
    --font-ui: "Figtree", system-ui, sans-serif;
    --font-label: "Syne", system-ui, sans-serif;
    --font-display: "Fraunces", serif;
    --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;

    --bg-deep: #050910;
    --bg-panel: rgba(10, 16, 28, 0.96);
    --bg-elevated: rgba(16, 24, 40, 0.94);
    --bg-glass: rgba(12, 18, 32, 0.82);
    --bg-card: rgba(20, 28, 44, 0.9);
    --bg-card-hover: rgba(28, 38, 56, 0.95);

    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --line-accent: rgba(88, 215, 196, 0.4);

    --text: #eef3ff;
    --text-secondary: #c0cbe0;
    --muted: #8a9aba;

    --accent: #8b9cff;
    --accent-2: #58d7c4;
    --accent-3: #f5b87a;
    --accent-warm: #ff7eb3;
    --danger: #ff7a7a;
    --success: #6ef0a8;

    --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 40px rgba(88, 215, 196, 0.15);
    --shadow-glow-warm: 0 0 30px rgba(255, 126, 179, 0.2);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: all 0.2s var(--ease-out-expo);
}

/* === Base === */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-ui);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-deep);
    background-image:
        radial-gradient(ellipse 120% 60% at 50% -10%, rgba(88, 215, 196, 0.06), transparent 50%),
        radial-gradient(ellipse 60% 50% at 100% 30%, rgba(139, 156, 255, 0.05), transparent 45%),
        radial-gradient(ellipse 50% 60% at 0% 80%, rgba(245, 184, 122, 0.04), transparent 45%),
        linear-gradient(180deg, #050910 0%, #080d18 100%);
    overflow-y: auto;
    overflow-x: hidden;
}

/* === App shell === */
.habitat-app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
}

.habitat-app::before,
.habitat-app::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.habitat-app::before {
    z-index: 0;
    background-image:
        radial-gradient(circle at 8% 12%, rgba(255,255,255,0.9) 0 1px, transparent 1.6px),
        radial-gradient(circle at 31% 81%, rgba(201,223,255,0.9) 0 1px, transparent 1.5px),
        radial-gradient(circle at 54% 16%, rgba(255,255,255,0.95) 0 1.1px, transparent 1.8px),
        radial-gradient(circle at 79% 62%, rgba(200,220,255,0.9) 0 1px, transparent 1.6px),
        radial-gradient(circle at 91% 24%, rgba(255,255,255,0.92) 0 1.1px, transparent 1.7px);
    background-size: 320px 320px, 420px 420px, 360px 360px, 500px 500px, 440px 440px;
    opacity: 0.45;
    animation: starDrift 150s linear infinite;
}

.habitat-app::after {
    z-index: 0;
    background:
        radial-gradient(ellipse 40% 28% at 22% 72%, rgba(146, 86, 255, 0.16) 0%, transparent 72%),
        radial-gradient(ellipse 35% 24% at 78% 24%, rgba(82, 167, 255, 0.16) 0%, transparent 72%);
    opacity: 0.64;
    animation: nebulaPulse 12s ease-in-out infinite alternate;
}

/* === Header === */
.habitat-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-glass);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    backdrop-filter: blur(24px) saturate(1.3);
}

.habitat-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Full brand (logo + wordmark) returns to entry / landing without full reload */
.habitat-header__brand--home {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-radius: 8px;
}

.habitat-header__brand--home:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.habitat-header__logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.habitat-header__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.habitat-header__wordmark {
    font-family: var(--font-label);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.habitat-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.habitat-header__mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.15);
}

.habitat-header__mode .btn {
    white-space: nowrap;
}

.habitat-header__mode-current[aria-current="page"] {
    pointer-events: none;
}

.neighborhood-claim-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0 18px 0;
}

.claim-move-hint {
    margin: 0;
    max-width: 42rem;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
}

.world-context-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.world-context-switcher__badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.world-context-switcher__badge--shared {
    color: var(--accent-2);
    border-color: rgba(120, 194, 255, 0.25);
}

.world-context-switcher__badge--private {
    color: var(--accent-warm);
    border-color: rgba(255, 176, 122, 0.25);
}

/* WebSocket connection status */
.ws-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    transition: var(--transition);
}

.ws-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    transition: var(--transition);
}

.ws-status[data-state="connected"] {
    color: var(--success);
    border-color: rgba(110, 240, 168, 0.3);
}

.ws-status[data-state="connected"]::before {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.ws-status[data-state="connecting"] {
    color: var(--accent-3);
}

.ws-status[data-state="connecting"]::before {
    background: var(--accent-3);
    animation: pulse 1.5s ease-in-out infinite;
}

.ws-status[data-state="disconnected"],
.ws-status[data-state="error"] {
    color: var(--danger);
    border-color: rgba(255, 122, 122, 0.3);
}

.ws-status[data-state="disconnected"]::before,
.ws-status[data-state="error"]::before {
    background: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* === Main content area === */
.habitat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
    overflow: hidden;
}

.landing-hero {
    width: min(860px, 92vw);
    margin: 0 auto;
    padding: 36px 32px;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: linear-gradient(140deg, rgba(10, 16, 30, 0.88), rgba(10, 23, 36, 0.8));
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 1;
}

.landing-hero__kicker {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-2);
    font-weight: 700;
}

.landing-hero__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(28px, 4.6vw, 54px);
    line-height: 1.06;
    color: var(--text);
}

.landing-hero__subtitle {
    margin: 16px 0 0;
    max-width: 64ch;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.landing-hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.landing-hero--booting {
    border-color: var(--line-accent);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(88, 215, 196, 0.22), 0 0 36px rgba(88, 215, 196, 0.2);
}

/* Ambient background decoration */
.habitat-main::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(88, 215, 196, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

/* === Hero / Entry Card === */
.entry-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    z-index: 1;
}

.entry-card--has-resident {
    /* Slightly wider when showing resident context */
    max-width: 520px;
}

/* === Resident Identity Banner === */
.resident-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(88, 215, 196, 0.08) 0%, rgba(139, 156, 255, 0.06) 100%);
    border: 1px solid var(--line-accent);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
}

.resident-banner__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--bg-deep);
    flex-shrink: 0;
}

.resident-banner__info {
    flex: 1;
    min-width: 0;
}

.resident-banner__greeting {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2px;
}

.resident-banner__name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resident-banner__context {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

/* === Entry Headline === */
.entry-headline {
    text-align: center;
    margin-bottom: 32px;
}

.entry-headline__title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    margin: 0 0 8px;
}

.entry-headline__subtitle {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.5;
}

/* === Entry Actions === */
.entry-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Primary action button (Continue, Enter Home, etc.) */
.entry-action {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
    font-family: inherit;
    color: var(--text);
    text-decoration: none;
}

.entry-action:hover {
    background: var(--bg-card-hover);
    border-color: var(--line-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.entry-action:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 156, 255, 0.25);
}

.entry-action:active {
    transform: translateY(0);
}

.entry-action__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.entry-action__icon--home {
    background: linear-gradient(135deg, rgba(88, 215, 196, 0.2) 0%, rgba(88, 215, 196, 0.1) 100%);
    color: var(--accent-2);
}

.entry-action__icon--neighborhood {
    background: linear-gradient(135deg, rgba(139, 156, 255, 0.2) 0%, rgba(139, 156, 255, 0.1) 100%);
    color: var(--accent);
}

.entry-action__icon--explore {
    background: linear-gradient(135deg, rgba(245, 184, 122, 0.2) 0%, rgba(245, 184, 122, 0.1) 100%);
    color: var(--accent-3);
}

.entry-action__icon--create {
    background: linear-gradient(135deg, rgba(255, 126, 179, 0.2) 0%, rgba(255, 126, 179, 0.1) 100%);
    color: var(--accent-warm);
}

.entry-action__icon--guest {
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.entry-action__content {
    flex: 1;
    min-width: 0;
}

.entry-action__label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.entry-action__desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}

.entry-action__arrow {
    font-size: 18px;
    color: var(--muted);
    flex-shrink: 0;
    transition: var(--transition);
}

.entry-action:hover .entry-action__arrow {
    color: var(--accent-2);
    transform: translateX(3px);
}

/* Primary CTA ( Continue as Resident ) */
.entry-action--primary {
    background: linear-gradient(135deg, rgba(88, 215, 196, 0.12) 0%, rgba(139, 156, 255, 0.08) 100%);
    border-color: var(--line-accent);
}

.entry-action--primary:hover {
    background: linear-gradient(135deg, rgba(88, 215, 196, 0.18) 0%, rgba(139, 156, 255, 0.12) 100%);
    box-shadow: var(--shadow-glow);
}

.entry-action--danger {
    border-color: rgba(255, 122, 122, 0.45);
    background: linear-gradient(135deg, rgba(255, 122, 122, 0.12) 0%, rgba(255, 122, 122, 0.08) 100%);
}

.entry-action--danger:hover {
    background: linear-gradient(135deg, rgba(255, 122, 122, 0.18) 0%, rgba(255, 122, 122, 0.12) 100%);
    box-shadow: 0 10px 24px rgba(255, 122, 122, 0.2);
}

.entry-action__icon--danger {
    background: rgba(255, 122, 122, 0.16);
    color: var(--danger);
}

/* === Resident Name Input (for new residents) === */
.resident-name-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.resident-name-form__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resident-name-form__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.resident-name-form__input {
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    transition: var(--transition);
}

.resident-name-form__input::placeholder {
    color: var(--muted);
}

.resident-name-form__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 156, 255, 0.2);
}

/* === Divider === */
.entry-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0;
}

.entry-divider__line {
    flex: 1;
    height: 1px;
    background: var(--line);
}

.entry-divider__text {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* === Loading state === */
.entry-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 48px 24px;
    text-align: center;
}

.entry-loading__spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--line);
    border-top-color: var(--accent-2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.entry-loading__text {
    font-size: 15px;
    color: var(--muted);
}

/* === Error state === */
.entry-error {
    padding: 24px;
    background: rgba(255, 122, 122, 0.08);
    border: 1px solid rgba(255, 122, 122, 0.3);
    border-radius: var(--radius-lg);
    text-align: center;
}

.entry-error__icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.entry-error__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--danger);
    margin-bottom: 6px;
}

.entry-error__message {
    font-size: 14px;
    color: var(--text-secondary);
}

.entry-error__action {
    margin-top: 16px;
}

/* === Degraded 3D fallback === */
.degraded-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(245, 184, 122, 0.12);
    border: 1px solid rgba(245, 184, 122, 0.3);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-3);
    margin-bottom: 20px;
}

.degraded-badge::before {
    content: '⚠';
}

/* === Neighborhood arrival === */
.neighborhood-arrival {
    width: 100%;
    max-width: 560px;
    background: var(--bg-card);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.neighborhood-arrival__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.neighborhood-arrival__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(139, 156, 255, 0.2) 0%, rgba(139, 156, 255, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.neighborhood-arrival__info {
    flex: 1;
}

.neighborhood-arrival__kicker {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 4px;
}

.neighborhood-arrival__name {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.neighborhood-arrival__meta {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

/* === Destination cards === */
.destinations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.destination-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
    color: var(--text);
    width: 100%;
}

.destination-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--line-accent);
    transform: translateY(-2px);
}

.destination-card:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 156, 255, 0.25);
}

.destination-card__icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.destination-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.destination-card__desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.destination-card__badge {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(88, 215, 196, 0.15);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    color: var(--accent-2);
    margin-top: 8px;
}

/* === Neighborhood Card (VAL-WEB-007) === */
.neighborhood-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
    color: var(--text);
    width: 100%;
}
.neighborhood-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--line-accent);
    transform: translateY(-2px);
}
.neighborhood-card:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 156, 255, 0.25);
}
.neighborhood-card__icon {
    font-size: 28px;
    flex-shrink: 0;
}
.neighborhood-card__content {
    flex: 1;
    min-width: 0;
}
.neighborhood-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.neighborhood-card__meta {
    font-size: 12px;
    color: var(--muted);
}
.neighborhood-card__arrow {
    font-size: 18px;
    color: var(--muted);
    flex-shrink: 0;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 156, 255, 0.25);
}

.btn--primary {
    background: linear-gradient(135deg, #7a84ff 0%, #4ecfb8 100%);
    color: #050810;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(78, 207, 184, 0.2);
}

.btn--primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 20px rgba(78, 207, 184, 0.3);
    transform: translateY(-1px);
}

.btn--primary:active {
    transform: translateY(0);
    filter: brightness(0.96);
}

.btn--ghost {
    background: rgba(8, 14, 26, 0.6);
    border-color: var(--line-accent);
    color: var(--accent-2);
}

.btn--ghost:hover {
    background: rgba(88, 215, 196, 0.1);
}

.btn--danger {
    background: rgba(255, 122, 122, 0.1);
    border-color: rgba(255, 122, 122, 0.3);
    color: var(--danger);
}

.btn--sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn--lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* === Accessibility === */
/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 9999;
    padding: 12px 20px;
    background: var(--accent);
    color: var(--bg-deep);
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 16px;
}

/* Focus visible - improved for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* VAL-WEB-025: Enhanced focus indicators for keyboard navigation */
.entry-action:focus-visible,
.destination-card:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(139, 156, 255, 0.2);
}

/* Ensure keyboard users can see focused elements clearly */
@media (keyboard: navigation) {
    .entry-action:focus,
    .destination-card:focus,
    .btn:focus {
        outline: 3px solid var(--accent);
        outline-offset: 3px;
    }
}

/* === Home Owner Info (VAL-WEB-016) === */
.home-owner-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.home-owner-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(88, 215, 196, 0.15);
    border: 1px solid rgba(88, 215, 196, 0.3);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.home-access-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(139, 156, 255, 0.15);
    border: 1px solid rgba(139, 156, 255, 0.3);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
}

/* === Home Personalization Cues (VAL-WEB-017) === */
/* Badge shown on home cards in neighborhood view */
.home-personalization-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(245, 184, 122, 0.12);
    border: 1px solid rgba(245, 184, 122, 0.25);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 500;
    color: var(--accent-3);
    letter-spacing: 0.03em;
    font-style: italic;
}

/* Personalization cue text shown in home view header */
.home-personalization-cue {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-3);
    font-style: italic;
    opacity: 0.85;
}

/* Personalization div inside destination list items (neighborhood view) */
.destination-list-item__personalization {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

/* === Degraded Mode Place Context (VAL-WEB-006) === */
.degraded-place-context {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(245, 184, 122, 0.08) 0%, rgba(245, 184, 122, 0.04) 100%);
    border: 1px solid rgba(245, 184, 122, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.degraded-place-context__kicker {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-3);
    margin-bottom: 4px;
}

.degraded-place-context__value {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.degraded-place-context__detail {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

/* === Shared Space Presence Roster (VAL-WEB-014, VAL-WEB-019) === */
.presence-roster {
    margin-top: 24px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.presence-roster__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.presence-roster__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.presence-roster__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}

.presence-roster__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--bg-deep);
}

.presence-roster__name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.presence-roster__status {
    font-size: 12px;
    color: var(--accent-2);
}

.presence-roster__empty {
    font-size: 14px;
    color: var(--muted);
    font-style: italic;
}

/* === Entry action icon for shared space === */
.entry-action__icon--shared {
    background: linear-gradient(135deg, rgba(255, 126, 179, 0.2) 0%, rgba(255, 126, 179, 0.1) 100%);
    color: var(--accent-warm);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === Responsive === */
@media (max-width: 600px) {
    .entry-card {
        padding: 28px 24px;
    }

    .entry-headline__title {
        font-size: 24px;
    }

    .neighborhood-arrival {
        padding: 24px 20px;
    }

    .destinations {
        grid-template-columns: 1fr;
    }
}

/* === Voxel Globe Background === */
#voxel-globe-host {
    z-index: 0;
    background:
        radial-gradient(ellipse 120% 90% at 50% 40%, rgba(38, 72, 140, 0.45) 0%, rgba(6, 10, 24, 0.82) 52%, #010206 100%),
        radial-gradient(ellipse 70% 55% at 18% 75%, rgba(124, 64, 201, 0.26) 0%, transparent 62%),
        radial-gradient(ellipse 65% 50% at 84% 20%, rgba(49, 131, 210, 0.24) 0%, transparent 60%),
        radial-gradient(circle at 58% 56%, rgba(255, 255, 255, 0.08) 0%, transparent 28%),
        #010206;
}

#voxel-globe-host::before,
#voxel-globe-host::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#voxel-globe-host::before {
    background-image:
        radial-gradient(circle at 12% 22%, rgba(255,255,255,0.95) 0 1px, transparent 1.6px),
        radial-gradient(circle at 30% 78%, rgba(195,220,255,0.88) 0 1px, transparent 1.5px),
        radial-gradient(circle at 52% 17%, rgba(255,255,255,0.96) 0 1.2px, transparent 1.8px),
        radial-gradient(circle at 74% 66%, rgba(187,212,255,0.92) 0 1.1px, transparent 1.7px),
        radial-gradient(circle at 88% 34%, rgba(255,255,255,0.94) 0 1.1px, transparent 1.6px);
    background-size: 340px 340px, 410px 410px, 300px 300px, 460px 460px, 380px 380px;
    opacity: 0.72;
    animation: starDrift 140s linear infinite;
}

#voxel-globe-host::after {
    background:
        radial-gradient(ellipse 36% 24% at 24% 62%, rgba(140, 79, 255, 0.2) 0%, transparent 72%),
        radial-gradient(ellipse 34% 22% at 76% 28%, rgba(78, 167, 255, 0.18) 0%, transparent 70%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.04) 0%, transparent 58%);
    mix-blend-mode: screen;
    opacity: 0.68;
    animation: nebulaPulse 11s ease-in-out infinite alternate;
}

@keyframes starDrift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-140px, -70px, 0); }
}

@keyframes nebulaPulse {
    from { opacity: 0.48; }
    to { opacity: 0.78; }
}

#voxel-globe-interact {
    z-index: 0;
}

.habitat-main {
    position: relative;
    z-index: 1;
}

.habitat-header {
    position: relative;
    z-index: 1;
}

/* === Breadcrumbs (VAL-WEB-009) === */
.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    padding: 2px 0;
    color: var(--muted);
    font-size: 13px;
    background: none;
    border: none;
    cursor: default;
}

.breadcrumb-item--clickable {
    color: var(--accent-2);
    cursor: pointer;
    transition: color 0.15s;
}

.breadcrumb-item--clickable:hover {
    color: var(--accent);
    text-decoration: underline;
}

.breadcrumb-item--current {
    color: var(--text);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--muted);
    margin: 0 6px;
    opacity: 0.5;
}

/* === Search (VAL-WEB-010) === */
.habitat-search {
    position: relative;
}

.habitat-search__input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.habitat-search__icon {
    position: absolute;
    left: 12px;
    color: var(--muted);
    pointer-events: none;
}

.habitat-search__input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.habitat-search__input::placeholder {
    color: var(--muted);
}

.habitat-search__input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
}

.habitat-search__clear {
    position: absolute;
    right: 8px;
    padding: 4px 8px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
}

.habitat-search__clear:hover {
    color: var(--text);
}

/* Search Results */
.search-results-group {
    border-bottom: 1px solid var(--line);
}

.search-results-group:last-child {
    border-bottom: none;
}

.search-results-group__label {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.1s;
}

.search-result-item:hover,
.search-result-item:focus {
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}

.search-result-item--active {
    background: rgba(88, 215, 196, 0.12);
    outline: 1px solid rgba(88, 215, 196, 0.28);
}

.search-result-item__icon {
    font-size: 18px;
    flex-shrink: 0;
}

.search-result-item__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-result-item__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item__scope {
    font-size: 12px;
    color: var(--muted);
}

.search-result-item__arrow {
    color: var(--muted);
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.search-result-item:hover .search-result-item__arrow,
.search-result-item:focus .search-result-item__arrow {
    opacity: 1;
}

/* === Resident Identity in Header (VAL-WEB-012) === */
.header-resident-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(88, 215, 196, 0.08);
    border: 1px solid rgba(88, 215, 196, 0.2);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--accent-2);
}

.header-resident-badge__avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 600;
    color: var(--bg-deep);
}

/* === Neighborhood with Homes and Shared Spaces (VAL-WEB-008) === */
.neighborhood-destinations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.neighborhood-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.homes-section {
    margin-bottom: 24px;
}

.shared-spaces-section {
    margin-top: 16px;
}

.destination-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    font-family: inherit;
    color: var(--text);
    text-align: left;
}

.destination-list-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line-accent);
    transform: translateY(-1px);
}

.destination-list-item:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 156, 255, 0.2);
}

.destination-list-item__icon {
    font-size: 24px;
    flex-shrink: 0;
}

.destination-list-item__content {
    flex: 1;
    min-width: 0;
}

.destination-list-item__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}

.destination-list-item__meta {
    font-size: 12px;
    color: var(--muted);
}

.destination-list-item__badge {
    padding: 2px 8px;
    background: rgba(88, 215, 196, 0.1);
    border-radius: var(--radius-full);
    font-size: 11px;
    color: var(--accent-2);
}

.destination-list-item__badge--private {
    background: rgba(139, 156, 255, 0.1);
    color: var(--accent);
}

.destination-list-item__arrow {
    color: var(--muted);
    font-size: 16px;
    flex-shrink: 0;
}

/* === Movement Announcement Toast === */
.movement-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--line-accent);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    color: var(--text);
    z-index: 1000;
    animation: slideUpFade 0.3s var(--ease-out-expo);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* === Shared Space Activity (VAL-WEB-019, VAL-WEB-020) === */
.shared-space-activity-section {
    margin: 16px 0;
}

.shared-space-activity {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.shared-space-activity--active {
    background: linear-gradient(135deg, rgba(88, 215, 196, 0.1) 0%, rgba(139, 156, 255, 0.06) 100%);
    border: 1px solid rgba(88, 215, 196, 0.2);
}

.shared-space-activity--quiet {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
}

.shared-space-activity__icon {
    font-size: 28px;
    flex-shrink: 0;
}

.shared-space-activity__content {
    flex: 1;
}

.shared-space-activity__label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-transform: capitalize;
}

.shared-space-activity__detail {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

/* === Invitations Section (VAL-WEB-021) === */
.invitations-section {
    margin: 20px 0;
}

.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invitation-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(245, 184, 122, 0.08) 0%, rgba(245, 184, 122, 0.04) 100%);
    border: 1px solid rgba(245, 184, 122, 0.25);
    border-radius: var(--radius-lg);
}

.invitation-card__content {
    flex: 1;
}

.invitation-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.invitation-card__detail {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.invitation-card__actions {
    display: flex;
    gap: 8px;
}

/* === Message Badge in Header (VAL-WEB-021) === */
.message-badge-container {
    position: relative;
}

.message-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Full-screen modal host (backdrop click closes) === */
.habitat-modal-host {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 0px));
    box-sizing: border-box;
}

.habitat-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 9, 16, 0.58);
    -webkit-backdrop-filter: blur(8px) saturate(1.1);
    backdrop-filter: blur(8px) saturate(1.1);
}

.habitat-modal-surface {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(960px, 100%);
    max-height: min(92vh, 920px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Dream-step picker is much wider so it can present families and cards horizontally
 * instead of stacking each family into a tall vertical column. */
.habitat-modal-surface--wide {
    max-width: min(1480px, calc(100vw - 32px));
    max-height: min(94vh, 980px);
}

/* === Messages Panel (VAL-WEB-021) === */
.messages-panel {
    width: 100%;
    max-width: 560px;
    background: var(--bg-card);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.messages-panel__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.messages-panel__title {
    flex: 1;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.messages-panel__list {
    max-height: 480px;
    overflow-y: auto;
}

.messages-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 24px;
    text-align: center;
}

.messages-empty__icon {
    font-size: 48px;
    opacity: 0.5;
}

.messages-empty__text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.messages-empty__hint {
    font-size: 13px;
    color: var(--muted);
}

/* === Message Item (VAL-WEB-021) === */
.message-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background 0.15s;
}

.message-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.message-item--unread {
    background: rgba(88, 215, 196, 0.04);
}

.message-item--unread:hover {
    background: rgba(88, 215, 196, 0.08);
}

.message-item__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--bg-deep);
    flex-shrink: 0;
}

.message-item__content {
    flex: 1;
    min-width: 0;
}

.message-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.message-item__sender {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.message-item__time {
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
}

.message-item__preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-item__unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-2);
    flex-shrink: 0;
    margin-top: 6px;
}

/* === Message Detail (VAL-WEB-021) === */
.message-detail {
    width: 100%;
    max-width: 560px;
    background: var(--bg-card);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.message-detail__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.message-detail__content {
    padding: 24px 20px;
}

.message-detail__from {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.message-detail__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--bg-deep);
}

.message-detail__sender {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.message-detail__meta {
    margin-bottom: 20px;
}

.message-detail__time {
    font-size: 13px;
    color: var(--muted);
}

.message-detail__body {
    font-size: 15px;
    color: var(--text);
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 24px;
}

.message-detail__actions {
    display: flex;
    gap: 12px;
}

/* === Compose Message (VAL-WEB-021) === */
.compose-message {
    width: 100%;
    max-width: 560px;
    background: var(--bg-card);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.compose-message__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.compose-message__title {
    flex: 1;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.compose-message__form {
    padding: 24px 20px;
}

.compose-message__field {
    margin-bottom: 20px;
}

.compose-message__field:last-child {
    margin-bottom: 0;
}

.compose-message__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.compose-message__input,
.compose-message__textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
}

.compose-message__input::placeholder,
.compose-message__textarea::placeholder {
    color: var(--muted);
}

.compose-message__input:focus,
.compose-message__textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 156, 255, 0.2);
}

.compose-message__textarea {
    resize: vertical;
    min-height: 120px;
}

/* === Neighborhood Presence Indicator (VAL-WEB-014) === */
.neighborhood-presence {
    margin-top: 8px;
}

.neighborhood-presence-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(88, 215, 196, 0.1);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--accent-2);
}

.neighborhood-presence-indicator__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-2);
    animation: pulse 2s ease-in-out infinite;
}

/* === Presence Roster Status Variants === */
.presence-roster__resident-status--self {
    color: var(--accent-2);
    font-weight: 600;
}

/* === Mode Picker === */
.mode-picker {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.mode-picker__inner {
    max-width: 720px;
    width: 100%;
    text-align: center;
}

.mode-picker__kicker {
    font-family: var(--font-label);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-2);
    margin: 0 0 12px;
}

.mode-picker__title {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px;
    line-height: 1.2;
}

.mode-picker__subtitle {
    font-size: 15px;
    color: var(--muted);
    margin: 0 0 36px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.mode-picker__cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

@media (max-width: 560px) {
    .mode-picker__cards {
        grid-template-columns: 1fr;
    }
}

.mode-picker__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 24px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-family: inherit;
    color: inherit;
    font-size: inherit;
}

.mode-picker__card:hover {
    background: var(--bg-card-hover);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.mode-picker__card--shared:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.mode-picker__card--private:hover {
    border-color: var(--accent-warm);
    box-shadow: var(--shadow-glow-warm);
}

.mode-picker__card-icon {
    font-size: 40px;
    line-height: 1;
}

.mode-picker__card-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.mode-picker__card-desc {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.mode-picker__back {
    margin-top: 16px;
}

/* === Wizard === */
.wizard {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px 40px;
}

.wizard__inner {
    max-width: 680px;
    width: 100%;
}

.wizard--dream {
    /* Dream picker lives inside a tall modal — no need to claim the full viewport
     * (which would force the modal to vertical-scroll past its content). */
    min-height: 0;
    padding: 40px 24px 28px;
}

.wizard--dream .wizard__inner,
.wizard__inner--dream {
    max-width: min(1440px, calc(100vw - 40px));
}

.wizard--dream .wizard__content {
    /* Keep the family stack vertical, but make every family row use the full width
     * so its archetype carousel can lay multiple cards out horizontally instead of
     * showing one card per visible row. */
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wizard--dream .wizard__family {
    margin-bottom: 0;
}

.wizard__progress {
    height: 3px;
    background: var(--line);
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}

.wizard__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 2px;
    transition: width 0.4s var(--ease-out-expo);
}

.wizard__step-indicator {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.wizard__title {
    font-family: var(--font-display);
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
}

.wizard__subtitle {
    font-size: 15px;
    color: var(--muted);
    margin: 0 0 32px;
}

.wizard__content {
    min-height: 200px;
    margin-bottom: 32px;
}

.wizard__nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* Archetype carousel */
.wizard__archetype-selected {
    --family-primary: var(--accent-2);
    --family-secondary: var(--accent);
    --family-soft: rgba(88, 215, 196, 0.18);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        radial-gradient(circle at 12% -12%, color-mix(in oklab, var(--family-primary) 24%, transparent), transparent 54%),
        radial-gradient(circle at 88% 112%, color-mix(in oklab, var(--family-secondary) 22%, transparent), transparent 52%),
        linear-gradient(145deg, rgba(18, 28, 46, 0.96), rgba(10, 17, 30, 0.92));
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.wizard__archetype-selected::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%);
    pointer-events: none;
}

.wizard__archetype-selected-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.wizard__archetype-selected-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(22px, 3.2vw, 30px);
    line-height: 1.05;
    color: var(--text);
}

.wizard__archetype-selected-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid color-mix(in oklab, var(--family-primary) 55%, transparent);
    background: color-mix(in oklab, var(--family-primary) 18%, transparent);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.wizard__archetype-selected-body {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
}

.wizard__archetype-selected-promise {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    max-width: 72ch;
}

.wizard__archetype-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wizard__archetype-meta-item,
.wizard__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1;
}

.wizard__archetype-scene {
    position: relative;
    min-height: 126px;
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in oklab, var(--family-primary) 35%, var(--line));
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 25%, color-mix(in oklab, var(--family-primary) 24%, transparent), transparent 58%),
        radial-gradient(circle at 82% 78%, color-mix(in oklab, var(--family-secondary) 20%, transparent), transparent 55%),
        linear-gradient(180deg, rgba(12, 20, 32, 0.9), rgba(7, 11, 20, 0.95));
}

.wizard__archetype-scene::before {
    content: '';
    position: absolute;
    inset: 16% 10% -24%;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 48%),
        radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.2), transparent 64%);
    filter: blur(18px);
    opacity: 0.45;
    pointer-events: none;
}

.wizard__archetype-diff-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.wizard__archetype-diff-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.wizard__archetype-diff-item::before {
    content: '✦';
    color: var(--family-primary);
    font-size: 11px;
    line-height: 1.7;
    flex-shrink: 0;
}

.wizard__family {
    --family-primary: var(--accent-2);
    --family-secondary: var(--accent);
    --family-soft: rgba(88, 215, 196, 0.2);
    margin-bottom: 24px;
}

.wizard__family-row {
    display: grid;
    gap: 12px;
}

.wizard__family-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wizard__family-title-wrap {
    display: grid;
    gap: 4px;
}

.wizard__family-title {
    font-family: var(--font-label);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: color-mix(in oklab, var(--family-primary) 82%, #f6fbff);
    margin: 0;
}

.wizard__family-subtitle {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
}

.wizard__carousel-controls {
    display: inline-flex;
    gap: 8px;
}

.wizard__carousel-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.wizard__carousel-btn:hover:not(:disabled) {
    border-color: color-mix(in oklab, var(--family-primary) 55%, transparent);
    background: color-mix(in oklab, var(--family-primary) 14%, transparent);
    transform: translateY(-1px);
}

.wizard__carousel-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.wizard__archetype-carousel {
    position: relative;
}

.wizard__archetype-carousel-track,
.wizard__archetype-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scroll-padding-inline: 10px;
    padding: 4px 10px 12px;
    margin: 0;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in oklab, var(--family-primary) 40%, var(--line)) transparent;
    -ms-overflow-style: auto;
    touch-action: pan-x;
    cursor: grab;
}

.wizard__archetype-carousel-track:active,
.wizard__archetype-grid:active {
    cursor: grabbing;
}

.wizard__archetype-carousel-track::-webkit-scrollbar,
.wizard__archetype-grid::-webkit-scrollbar {
    height: 8px;
}

.wizard__archetype-carousel-track::-webkit-scrollbar-thumb,
.wizard__archetype-grid::-webkit-scrollbar-thumb {
    background: color-mix(in oklab, var(--family-primary) 40%, var(--line));
    border-radius: 999px;
}

.wizard__archetype-carousel-track::-webkit-scrollbar-track,
.wizard__archetype-grid::-webkit-scrollbar-track {
    background: transparent;
}

.wizard__archetype-card {
    position: relative;
    overflow: hidden;
    flex: 0 0 clamp(250px, 33vw, 312px);
    min-height: 290px;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in oklab, var(--family-primary) 26%, var(--line));
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.08), transparent 52%),
        linear-gradient(142deg, color-mix(in oklab, var(--family-primary) 9%, #101724), color-mix(in oklab, var(--family-secondary) 8%, #0c1524));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
    cursor: pointer;
    transition: transform 0.2s var(--ease-out-expo), border-color 0.2s var(--ease-out-expo), box-shadow 0.2s var(--ease-out-expo), background 0.2s var(--ease-out-expo);
    text-align: left;
    font-family: inherit;
    color: inherit;
    font-size: inherit;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.wizard__archetype-card::before {
    content: '';
    position: absolute;
    inset: auto 12px 8px;
    height: 40%;
    border-radius: 999px;
    background: radial-gradient(ellipse at center, color-mix(in oklab, var(--family-primary) 40%, transparent), transparent 70%);
    filter: blur(18px);
    opacity: 0.45;
    pointer-events: none;
}

.wizard__archetype-card:hover {
    border-color: color-mix(in oklab, var(--family-primary) 52%, var(--line));
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42), 0 0 26px color-mix(in oklab, var(--family-primary) 34%, transparent);
    transform: translateY(-2px);
}

.wizard__archetype-card--selected {
    border-color: color-mix(in oklab, var(--family-primary) 70%, #fff);
    box-shadow: 0 24px 44px rgba(0, 0, 0, 0.45), 0 0 36px color-mix(in oklab, var(--family-primary) 45%, transparent);
    transform: translateY(-3px);
}

.wizard__archetype-card-preview {
    position: relative;
    min-height: 126px;
    border-radius: calc(var(--radius-md) - 2px);
    border: 1px solid color-mix(in oklab, var(--family-primary) 30%, var(--line));
    overflow: hidden;
    background:
        radial-gradient(circle at 24% 18%, color-mix(in oklab, var(--family-primary) 26%, transparent), transparent 58%),
        radial-gradient(circle at 82% 82%, color-mix(in oklab, var(--family-secondary) 24%, transparent), transparent 56%),
        linear-gradient(160deg, rgba(28, 40, 62, 0.9), rgba(10, 18, 30, 0.92));
}

.wizard__archetype-card-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 44%),
        repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.045) 0 2px, transparent 2px 8px);
    opacity: 0.45;
    pointer-events: none;
}

.wizard__archetype-card-glow {
    position: absolute;
    inset: 20% -12% -24%;
    border-radius: 999px;
    background: radial-gradient(ellipse at center, color-mix(in oklab, var(--family-primary) 34%, transparent), transparent 72%);
    filter: blur(16px);
    opacity: 0.52;
    pointer-events: none;
}

/* === Archetype Scene Elements === */
.wizard__archetype-scene-elements {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: calc(var(--radius-md) - 2px);
}

.wizard__scene-layer-1,
.wizard__scene-layer-2,
.wizard__scene-layer-3 {
    position: absolute;
    inset: 0;
}

.wizard__scene-label {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    font-size: 7.5px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.wizard__scene-icon {
    position: absolute;
    top: 4px;
    right: 5px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

.wizard__scene-swatch {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

.wizard__scene-detail {
    position: absolute;
    bottom: 18px;
    left: 4px;
    right: 4px;
    font-size: 7px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.wizard__scene-mood {
    position: absolute;
    top: 6px;
    left: 28px;
    font-size: 6.5px;
    color: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    max-width: calc(100% - 32px);
}

/* porchlight_starter */
[data-archetype="porchlight_starter"] .wizard__scene-swatch { background: linear-gradient(135deg, #f59e0b 0%, #78350f 50%, #fef3c7 100%); }
[data-archetype="porchlight_starter"] .scene-ground { position: absolute; bottom: 0; left: 0; right: 0; height: 20%; background: linear-gradient(180deg, #1a1a2e, #16213e); }
[data-archetype="porchlight_starter"] .scene-roof { position: absolute; top: 12px; left: 10%; right: 10%; height: 35%; background: linear-gradient(160deg, #374151, #1f2937); clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
[data-archetype="porchlight_starter"] .scene-wall { position: absolute; bottom: 20%; left: 20%; right: 20%; height: 40%; background: linear-gradient(180deg, #4b5563, #374151); border-radius: 2px 2px 0 0; }
[data-archetype="porchlight_starter"] .scene-door { position: absolute; bottom: 20%; left: 38%; width: 24%; height: 38%; background: linear-gradient(180deg, #d97706, #b45309); border-radius: 2px 2px 0 0; box-shadow: 0 0 12px rgba(251, 191, 36, 0.6); }
[data-archetype="porchlight_starter"] .scene-lamp { position: absolute; top: 8px; right: 18%; width: 8%; height: 14%; background: linear-gradient(180deg, #fbbf24, #f59e0b); border-radius: 2px; }
[data-archetype="porchlight_starter"] .scene-glow { position: absolute; top: 10%; right: 10%; width: 40%; height: 60%; background: radial-gradient(ellipse at 70% 20%, rgba(251, 191, 36, 0.35), transparent 60%); filter: blur(8px); }

/* garden_hearth_cottage */
[data-archetype="garden_hearth_cottage"] .wizard__scene-swatch { background: linear-gradient(135deg, #22c55e 0%, #78350f 50%, #fef3c7 100%); }
[data-archetype="garden_hearth_cottage"] .scene-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #1e3a5f 0%, #2d4a6f 60%); }
[data-archetype="garden_hearth_cottage"] .scene-garden { position: absolute; bottom: 0; left: 0; right: 0; height: 25%; background: linear-gradient(180deg, #166534, #14532d); border-radius: 60% 60% 0 0 / 20% 20% 0 0; }
[data-archetype="garden_hearth_cottage"] .scene-garden::before { content: ''; position: absolute; top: -8px; left: 10%; right: 10%; height: 16px; background: radial-gradient(ellipse at center, #22c55e, transparent 70%); border-radius: 50% 50% 0 0; }
[data-archetype="garden_hearth_cottage"] .scene-chimney { position: absolute; top: 18px; right: 25%; width: 12%; height: 25%; background: linear-gradient(90deg, #78716c, #57534e); border-radius: 2px; }
[data-archetype="garden_hearth_cottage"] .scene-cottage-body { position: absolute; bottom: 22%; left: 18%; right: 18%; height: 42%; background: linear-gradient(180deg, #a8a29e, #78716c); border-radius: 3px 3px 0 0; }
[data-archetype="garden_hearth_cottage"] .scene-cottage-roof { position: absolute; top: 20%; left: 12%; right: 12%; height: 32%; background: linear-gradient(160deg, #7f1d1d, #991b1b); clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
[data-archetype="garden_hearth_cottage"] .scene-window-glow { position: absolute; bottom: 32%; left: 32%; width: 36%; height: 22%; background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.8), rgba(251, 191, 36, 0.3) 60%, transparent 80%); filter: blur(3px); }
[data-archetype="garden_hearth_cottage"] .scene-smoke { position: absolute; top: 8px; right: 26%; width: 8%; height: 18%; background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent); border-radius: 50%; filter: blur(3px); }

/* courtyard_nest */
[data-archetype="courtyard_nest"] .wizard__scene-swatch { background: linear-gradient(135deg, #d4a574 0%, #0077b6 50%, #c9a959 100%); }
[data-archetype="courtyard_nest"] .scene-courtyard-bg { position: absolute; inset: 8%; background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.15), transparent 70%); }
[data-archetype="courtyard_nest"] .scene-courtyard-wall-t { position: absolute; top: 8%; left: 12%; right: 12%; height: 18%; background: linear-gradient(180deg, #c9a959, #a68a3a); border-radius: 2px; }
[data-archetype="courtyard_nest"] .scene-courtyard-wall-b { position: absolute; bottom: 8%; left: 12%; right: 12%; height: 18%; background: linear-gradient(0deg, #c9a959, #a68a3a); border-radius: 2px; }
[data-archetype="courtyard_nest"] .scene-courtyard-wall-l { position: absolute; top: 12%; bottom: 12%; left: 8%; width: 18%; background: linear-gradient(90deg, #c9a959, #a68a3a); border-radius: 2px; }
[data-archetype="courtyard_nest"] .scene-courtyard-wall-r { position: absolute; top: 12%; bottom: 12%; right: 8%; width: 18%; background: linear-gradient(270deg, #c9a959, #a68a3a); border-radius: 2px; }
[data-archetype="courtyard_nest"] .scene-courtyard-window-t { position: absolute; top: 10%; left: 50%; transform: translateX(-50%); width: 8%; height: 6%; background: rgba(251, 191, 36, 0.7); border-radius: 2px; box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
[data-archetype="courtyard_nest"] .scene-courtyard-window-b { position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%); width: 8%; height: 6%; background: rgba(251, 191, 36, 0.7); border-radius: 2px; box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
[data-archetype="courtyard_nest"] .scene-courtyard-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30%; height: 30%; background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.3), transparent 70%); border-radius: 50%; filter: blur(6px); }

/* hill_cabin_retreat */
[data-archetype="hill_cabin_retreat"] .wizard__scene-swatch { background: linear-gradient(135deg, #78350f 0%, #166534 50%, #a78bfa 100%); }
[data-archetype="hill_cabin_retreat"] .scene-mountain { position: absolute; top: 0; left: 0; right: 0; height: 40%; background: linear-gradient(180deg, #1e3a5f, #374151); clip-path: polygon(0% 100%, 20% 30%, 35% 60%, 50% 20%, 65% 55%, 80% 35%, 100% 100%); }
[data-archetype="hill_cabin_retreat"] .scene-mist { position: absolute; top: 25%; left: 0; right: 0; height: 25%; background: linear-gradient(180deg, rgba(203, 213, 225, 0.25), transparent); filter: blur(4px); }
[data-archetype="hill_cabin_retreat"] .scene-cabin-body { position: absolute; bottom: 15%; left: 22%; right: 22%; height: 35%; background: linear-gradient(180deg, #78350f, #92400e); border-radius: 2px; }
[data-archetype="hill_cabin_retreat"] .scene-cabin-roof { position: absolute; top: 32%; left: 18%; right: 18%; height: 22%; background: linear-gradient(160deg, #57534e, #44403c); clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
[data-archetype="hill_cabin_retreat"] .scene-cabin-window { position: absolute; bottom: 25%; left: 40%; width: 20%; height: 18%; background: rgba(251, 191, 36, 0.85); border-radius: 2px; }
[data-archetype="hill_cabin_retreat"] .scene-cabin-glow { position: absolute; bottom: 20%; left: 30%; width: 40%; height: 40%; background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.4), transparent 70%); filter: blur(6px); }

/* lake_edge_refuge */
[data-archetype="lake_edge_refuge"] .wizard__scene-swatch { background: linear-gradient(135deg, #1e3a5f 0%, #94a3b8 50%, #d4a574 100%); }
[data-archetype="lake_edge_refuge"] .scene-water { position: absolute; bottom: 0; left: 0; right: 0; height: 35%; background: linear-gradient(180deg, #1e3a5f, #0077b6); }
[data-archetype="lake_edge_refuge"] .scene-water::before { content: ''; position: absolute; top: 20%; left: 0; right: 0; height: 2px; background: rgba(255, 255, 255, 0.2); }
[data-archetype="lake_edge_refuge"] .scene-reeds-l { position: absolute; bottom: 30%; left: 5%; width: 4%; height: 20%; background: linear-gradient(180deg, #166534, #14532d); border-radius: 2px 2px 0 0; transform: rotate(-5deg); }
[data-archetype="lake_edge_refuge"] .scene-reeds-r { position: absolute; bottom: 32%; right: 8%; width: 4%; height: 16%; background: linear-gradient(180deg, #166534, #14532d); border-radius: 2px 2px 0 0; transform: rotate(3deg); }
[data-archetype="lake_edge_refuge"] .scene-moon-reflection { position: absolute; top: 15%; left: 30%; width: 15%; height: 4%; background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.7), transparent); border-radius: 50%; filter: blur(2px); }
[data-archetype="lake_edge_refuge"] .scene-dock { position: absolute; bottom: 28%; right: 20%; width: 25%; height: 6%; background: linear-gradient(90deg, #a68a3a, #78350f); border-radius: 1px; }
[data-archetype="lake_edge_refuge"] .scene-dock::after { content: ''; position: absolute; bottom: -20%; left: 10%; width: 8%; height: 25%; background: #78350f; }
[data-archetype="lake_edge_refuge"] .scene-lake-house { position: absolute; bottom: 34%; left: 35%; width: 30%; height: 28%; background: linear-gradient(180deg, #78716c, #57534e); border-radius: 2px 2px 0 0; }
[data-archetype="lake_edge_refuge"] .scene-window-warm { position: absolute; bottom: 40%; left: 42%; width: 16%; height: 12%; background: rgba(251, 191, 36, 0.8); border-radius: 2px; box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }

/* writers_hideaway */
[data-archetype="writers_hideaway"] .wizard__scene-swatch { background: linear-gradient(135deg, #166534 0%, #fef3c7 50%, #1a1a2e 100%); }
[data-archetype="writers_hideaway"] .scene-night-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #0f172a, #1e293b); }
[data-archetype="writers_hideaway"] .scene-night-sky::before { content: ''; position: absolute; top: 10%; left: 20%; width: 2px; height: 2px; background: #fff; border-radius: 50%; box-shadow: 8px 5px 0 #fff, 20px 12px 0 #fff, 35px 8px 0 #fff, 55px 15px 0 #fff, 70px 4px 0 #fff; }
[data-archetype="writers_hideaway"] .scene-bookshelf { position: absolute; top: 15%; left: 5%; width: 22%; height: 55%; background: linear-gradient(90deg, #78350f, #92400e); border-radius: 2px; }
[data-archetype="writers_hideaway"] .scene-bookshelf::before { content: ''; position: absolute; top: 15%; left: 10%; right: 10%; height: 3px; background: #fef3c7; }
[data-archetype="writers_hideaway"] .scene-bookshelf::after { content: ''; position: absolute; top: 35%; left: 10%; right: 10%; height: 3px; background: #fef3c7; }
[data-archetype="writers_hideaway"] .scene-window-frame { position: absolute; top: 12%; right: 18%; width: 35%; height: 35%; background: linear-gradient(180deg, #1e3a5f, #0f172a); border: 3px solid #57534e; border-radius: 2px; }
[data-archetype="writers_hideaway"] .scene-lamp-glow { position: absolute; top: 35%; left: 30%; width: 40%; height: 45%; background: radial-gradient(ellipse at 30% 40%, rgba(251, 191, 36, 0.5), transparent 60%); filter: blur(8px); }
[data-archetype="writers_hideaway"] .scene-typewriter { position: absolute; bottom: 18%; left: 28%; width: 20%; height: 14%; background: linear-gradient(180deg, #374151, #1f2937); border-radius: 2px; }
[data-archetype="writers_hideaway"] .scene-ink-bottle { position: absolute; bottom: 20%; left: 52%; width: 6%; height: 10%; background: linear-gradient(180deg, #1e3a5f, #0f172a); border-radius: 1px 1px 2px 2px; }

/* monastic_courtyard */
[data-archetype="monastic_courtyard"] .wizard__scene-swatch { background: linear-gradient(135deg, #f5f5f4 0%, #78716c 50%, #fbbf24 100%); }
[data-archetype="monastic_courtyard"] .scene-gravel { position: absolute; inset: 0; background: linear-gradient(160deg, #d6d3d1, #a8a29e); }
[data-archetype="monastic_courtyard"] .scene-gravel::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent 0 8px, rgba(0,0,0,0.03) 8px 10px); }
[data-archetype="monastic_courtyard"] .scene-colonnade { position: absolute; top: 15%; left: 10%; right: 10%; height: 8%; background: repeating-linear-gradient(90deg, #e7e5e4 0 15%, transparent 15% 25%); }
[data-archetype="monastic_courtyard"] .scene-arch { position: absolute; top: 12%; left: 35%; width: 30%; height: 50%; border: 4px solid #d6d3d1; border-bottom: none; border-radius: 50% 50% 0 0; background: transparent; }
[data-archetype="monastic_courtyard"] .scene-fountain { position: absolute; top: 55%; left: 50%; transform: translateX(-50%); width: 20%; height: 12%; background: radial-gradient(ellipse at center, rgba(147, 197, 253, 0.6), rgba(59, 130, 246, 0.3) 60%, transparent 80%); border-radius: 50%; filter: blur(2px); }
[data-archetype="monastic_courtyard"] .scene-candle-glow { position: absolute; top: 30%; left: 42%; width: 16%; height: 30%; background: radial-gradient(ellipse at center top, rgba(251, 191, 36, 0.6), rgba(251, 191, 36, 0.2) 50%, transparent 80%); filter: blur(4px); }
[data-archetype="monastic_courtyard"] .scene-shadow-arc { position: absolute; top: 15%; left: 38%; width: 24%; height: 45%; background: radial-gradient(ellipse at center, rgba(0,0,0,0.15), transparent 70%); border-radius: 50% 50% 0 0; }

/* starlight_observatory */
[data-archetype="starlight_observatory"] .wizard__scene-swatch { background: linear-gradient(135deg, #0f172a 0%, #a78bfa 50%, #fbbf24 100%); }
[data-archetype="starlight_observatory"] .scene-starfield { position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 20%, #1e3a5f, #0f172a 60%); }
[data-archetype="starlight_observatory"] .scene-starfield::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 12px 12px; opacity: 0.6; }
[data-archetype="starlight_observatory"] .scene-dome { position: absolute; top: 20%; left: 25%; width: 50%; height: 40%; background: linear-gradient(180deg, #475569, #334155); border-radius: 50% 50% 0 0; }
[data-archetype="starlight_observatory"] .scene-dome-slit { position: absolute; top: 22%; left: 38%; width: 24%; height: 35%; background: linear-gradient(180deg, #1e3a5f, #0f172a); border-radius: 50% 50% 0 0; }
[data-archetype="starlight_observatory"] .scene-base { position: absolute; bottom: 15%; left: 30%; right: 30%; height: 15%; background: linear-gradient(180deg, #57534e, #44403c); border-radius: 2px; }
[data-archetype="starlight_observatory"] .scene-telescope { position: absolute; top: 35%; left: 45%; width: 25%; height: 8%; background: linear-gradient(90deg, #a78bfa, #7c3aed); border-radius: 4px; transform: rotate(-35deg); transform-origin: left center; }
[data-archetype="starlight_observatory"] .scene-dome-glow { position: absolute; top: 25%; left: 35%; width: 30%; height: 25%; background: radial-gradient(ellipse at center, rgba(167, 139, 250, 0.3), transparent 70%); filter: blur(6px); }

/* guesthouse_constellation */
[data-archetype="guesthouse_constellation"] .wizard__scene-swatch { background: linear-gradient(135deg, #fef3c7 0%, #ea580c 50%, #1e3a5f 100%); }
[data-archetype="guesthouse_constellation"] .scene-night-hills { position: absolute; inset: 0; background: linear-gradient(180deg, #1e3a5f, #0f172a 70%); }
[data-archetype="guesthouse_constellation"] .scene-main-house { position: absolute; bottom: 22%; left: 35%; width: 30%; height: 28%; background: linear-gradient(180deg, #78716c, #57534e); border-radius: 3px; }
[data-archetype="guesthouse_constellation"] .scene-satellite-1 { position: absolute; bottom: 28%; left: 12%; width: 16%; height: 18%; background: linear-gradient(180deg, #57534e, #44403c); border-radius: 2px; }
[data-archetype="guesthouse_constellation"] .scene-satellite-2 { position: absolute; bottom: 30%; right: 12%; width: 16%; height: 16%; background: linear-gradient(180deg, #57534e, #44403c); border-radius: 2px; }
[data-archetype="guesthouse_constellation"] .scene-satellite-3 { position: absolute; bottom: 18%; right: 25%; width: 14%; height: 14%; background: linear-gradient(180deg, #57534e, #44403c); border-radius: 2px; }
[data-archetype="guesthouse_constellation"] .scene-paths { position: absolute; bottom: 20%; left: 20%; width: 60%; height: 20%; background: linear-gradient(90deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.4) 50%, rgba(251, 191, 36, 0.2)); border-radius: 2px; filter: blur(2px); }
[data-archetype="guesthouse_constellation"] .scene-guesthouse-glow-1 { position: absolute; bottom: 32%; left: 14%; width: 12%; height: 10%; background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.7), transparent 70%); filter: blur(3px); }
[data-archetype="guesthouse_constellation"] .scene-guesthouse-glow-2 { position: absolute; bottom: 36%; right: 14%; width: 10%; height: 8%; background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.6), transparent 70%); filter: blur(3px); }
[data-archetype="guesthouse_constellation"] .scene-guesthouse-glow-3 { position: absolute; bottom: 26%; right: 28%; width: 8%; height: 6%; background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.5), transparent 70%); filter: blur(2px); }

/* intergenerational_court */
[data-archetype="intergenerational_court"] .wizard__scene-swatch { background: linear-gradient(135deg, #d97706 0%, #22c55e 50%, #fef3c7 100%); }
[data-archetype="intergenerational_court"] .scene-garden-center { position: absolute; bottom: 30%; left: 25%; right: 25%; height: 20%; background: radial-gradient(ellipse at center, #22c55e, #166534); border-radius: 50% 50% 0 0; }
[data-archetype="intergenerational_court"] .scene-elder-wing { position: absolute; bottom: 15%; left: 8%; width: 35%; height: 35%; background: linear-gradient(180deg, #92400e, #78350f); border-radius: 3px 3px 0 0; }
[data-archetype="intergenerational_court"] .scene-child-wing { position: absolute; bottom: 15%; right: 8%; width: 30%; height: 30%; background: linear-gradient(180deg, #166534, #14532d); border-radius: 3px 3px 0 0; }
[data-archetype="intergenerational_court"] .scene-connecting-hall { position: absolute; bottom: 25%; left: 30%; right: 30%; height: 18%; background: linear-gradient(180deg, #a8a29e, #78716c); border-radius: 2px; }
[data-archetype="intergenerational_court"] .scene-elder-porch { position: absolute; bottom: 35%; left: 10%; width: 20%; height: 12%; background: linear-gradient(180deg, #d97706, #b45309); border-radius: 2px 2px 0 0; }
[data-archetype="intergenerational_court"] .scene-child-silhouette { position: absolute; bottom: 32%; right: 20%; width: 8%; height: 14%; background: rgba(0, 0, 0, 0.4); border-radius: 50% 50% 0 0; }
[data-archetype="intergenerational_court"] .scene-garden-bloom { position: absolute; bottom: 38%; left: 40%; width: 20%; height: 10%; background: radial-gradient(ellipse at center bottom, #f472b6, transparent 70%); border-radius: 50% 50% 0 0; }


/* co_living_commons (Archetype 11) */
[data-archetype~=co_living_commons] .wizard__scene-swatch { background: linear-gradient(135deg, #f59e0b 0%, #0ea5e9 50%, #e9d5ff 100%); }
[data-archetype~=co_living_commons] .scene-commons-wall-shelf { position: absolute; top: 12%; left: 4%; width: 30%; height: 8%; background: linear-gradient(180deg, #92400e, #78350f); border-radius: 2px; }
[data-archetype~=co_living_commons] .scene-commons-wall-shelf::before { content: ''; position: absolute; top: 20%; left: 8%; right: 8%; height: 2px; background: #a8a29e; }
[data-archetype~=co_living_commons] .scene-commons-wall-shelf::after { content: ''; position: absolute; top: 50%; left: 8%; right: 8%; height: 2px; background: #a8a29e; }
[data-archetype~=co_living_commons] .scene-commons-kitchen-corner { position: absolute; top: 8%; left: 4%; width: 25%; height: 18%; background: linear-gradient(135deg, #78716c, #57534e); border-radius: 2px; }
[data-archetype~=co_living_commons] .scene-commons-table { position: absolute; bottom: 22%; left: 30%; width: 40%; height: 25%; background: linear-gradient(180deg, #a68a3a, #78350f); border-radius: 3px; }
[data-archetype~=co_living_commons] .scene-commons-chair--1 { position: absolute; bottom: 18%; left: 26%; width: 10%; height: 16%; background: linear-gradient(180deg, #f59e0b, #d97706); border-radius: 3px 3px 1px 1px; }
[data-archetype~=co_living_commons] .scene-commons-chair--2 { position: absolute; bottom: 18%; right: 26%; width: 10%; height: 16%; background: linear-gradient(180deg, #0ea5e9, #0284c7); border-radius: 3px 3px 1px 1px; }
[data-archetype~=co_living_commons] .scene-commons-chair--3 { position: absolute; bottom: 30%; left: 32%; width: 10%; height: 16%; background: linear-gradient(180deg, #e9d5ff, #c4b5fd); border-radius: 3px 3px 1px 1px; }
[data-archetype~=co_living_commons] .scene-commons-chair--4 { position: absolute; bottom: 30%; right: 32%; width: 10%; height: 16%; background: linear-gradient(180deg, #86efac, #22c55e); border-radius: 3px 3px 1px 1px; }
[data-archetype~=co_living_commons] .scene-commons-hanging-pots { position: absolute; top: 5%; left: 38%; width: 24%; height: 20%; }
[data-archetype~=co_living_commons] .scene-commons-pot-1 { position: absolute; top: 0; left: 10%; width: 10%; height: 14%; background: linear-gradient(180deg, #dc2626, #b91c1c); border-radius: 50% 50% 40% 40%; }
[data-archetype~=co_living_commons] .scene-commons-pot-2 { position: absolute; top: 2%; left: 45%; width: 10%; height: 14%; background: linear-gradient(180deg, #22c55e, #16a34a); border-radius: 50% 50% 40% 40%; }
[data-archetype~=co_living_commons] .scene-commons-pot-3 { position: absolute; top: 0; right: 10%; width: 10%; height: 14%; background: linear-gradient(180deg, #fbbf24, #f59e0b); border-radius: 50% 50% 40% 40%; }

/* maker_house (Archetype 12) */
[data-archetype~=maker_house] .wizard__scene-swatch { background: linear-gradient(135deg, #b45309 0%, #f59e0b 50%, #a8a29e 100%); }
[data-archetype~=maker_house] .scene-maker-workbench { position: absolute; bottom: 20%; left: 8%; width: 45%; height: 22%; background: linear-gradient(180deg, #a8a29e, #78716c); border-radius: 2px; }
[data-archetype~=maker_house] .scene-maker-sawdust { position: absolute; bottom: 5%; left: 10%; width: 40%; height: 12%; background: radial-gradient(ellipse at center, #d4a574, #a68a3a); border-radius: 50%; filter: blur(3px); }
[data-archetype~=maker_house] .scene-maker-lamp { position: absolute; top: 10%; left: 20%; width: 12%; height: 18%; background: linear-gradient(180deg, #fbbf24, #f59e0b); border-radius: 2px; }
[data-archetype~=maker_house] .scene-maker-lamp::after { content: ''; position: absolute; bottom: -30%; left: 30%; width: 40%; height: 30%; background: radial-gradient(ellipse at top, rgba(251, 191, 36, 0.4), transparent); filter: blur(4px); }
[data-archetype~=maker_house] .scene-maker-blade { position: absolute; top: 15%; right: 15%; width: 18%; height: 18%; background: linear-gradient(135deg, #a8a29e, #78716c); border-radius: 50%; border: 2px solid #57534e; }
[data-archetype~=maker_house] .scene-maker-tool-1 { position: absolute; top: 18%; right: 22%; width: 4%; height: 12%; background: linear-gradient(180deg, #57534e, #44403c); border-radius: 1px; }
[data-archetype~=maker_house] .scene-maker-tool-2 { position: absolute; top: 22%; right: 30%; width: 6%; height: 4%; background: linear-gradient(90deg, #57534e, #44403c); border-radius: 1px; }
[data-archetype~=maker_house] .scene-maker-tool-3 { position: absolute; top: 28%; right: 18%; width: 3%; height: 10%; background: linear-gradient(180deg, #78716c, #57534e); border-radius: 1px 1px 2px 2px; }
[data-archetype~=maker_house] .scene-maker-tool-4 { position: absolute; top: 25%; right: 38%; width: 5%; height: 8%; background: linear-gradient(180deg, #92400e, #78350f); border-radius: 2px; }

/* caretaker_compound (Archetype 13) */
[data-archetype~=caretaker_compound] .wizard__scene-swatch { background: linear-gradient(135deg, #16a34a 0%, #7dd3fc 50%, #fef9c3 100%); }
[data-archetype~=caretaker_compound] .scene-caretaker-greenhouse { position: absolute; top: 10%; right: 8%; width: 40%; height: 50%; background: linear-gradient(180deg, rgba(125, 211, 252, 0.4), rgba(125, 211, 252, 0.15)); border: 3px solid rgba(125, 211, 252, 0.5); border-radius: 8px 8px 2px 2px; }
[data-archetype~=caretaker_compound] .scene-caretaker-glass { position: absolute; top: 12%; right: 12%; width: 32%; height: 40%; background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 60%); border-radius: 6px; }
[data-archetype~=caretaker_compound] .scene-caretaker-animal-hutch { position: absolute; bottom: 18%; left: 8%; width: 25%; height: 22%; background: linear-gradient(180deg, #a8a29e, #78716c); border-radius: 2px; }
[data-archetype~=caretaker_compound] .scene-caretaker-water-barrel { position: absolute; bottom: 12%; left: 18%; width: 14%; height: 20%; background: linear-gradient(180deg, #57534e, #44403c); border-radius: 3px; }
[data-archetype~=caretaker_compound] .scene-caretaker-herbs { position: absolute; bottom: 8%; left: 35%; width: 30%; height: 15%; background: radial-gradient(ellipse at center, #22c55e, #16a34a); border-radius: 50%; filter: blur(2px); }
[data-archetype~=caretaker_compound] .scene-caretaker-heat-glow { position: absolute; top: 20%; right: 15%; width: 25%; height: 30%; background: radial-gradient(ellipse at center, rgba(254, 240, 138, 0.35), transparent 70%); filter: blur(8px); }

/* rowhouse_atelier (Archetype 14) */
[data-archetype~=rowhouse_atelier] .wizard__scene-swatch { background: linear-gradient(135deg, #9f1239 0%, #e11d48 50%, #f9a8d4 100%); }
[data-archetype~=rowhouse_atelier] .scene-rowhouse-body { position: absolute; bottom: 10%; left: 30%; width: 40%; height: 60%; background: linear-gradient(180deg, #9f1239, #831a32); border-radius: 2px; }
[data-archetype~=rowhouse_atelier] .scene-rowhouse-stairs { position: absolute; bottom: 12%; left: 38%; width: 15%; height: 35%; background: linear-gradient(180deg, #e11d48, #be123c); border-radius: 50% 50% 0 0 / 30% 30% 0 0; }
[data-archetype~=rowhouse_atelier] .scene-rowhouse-easel { position: absolute; top: 18%; right: 18%; width: 20%; height: 25%; background: linear-gradient(180deg, #f9a8d4, #f472b6); border-radius: 2px; clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
[data-archetype~=rowhouse_atelier] .scene-rowhouse-palette { position: absolute; top: 22%; right: 12%; width: 10%; height: 12%; background: radial-gradient(ellipse at center, #e11d48, #9f1239); border-radius: 50%; }
[data-archetype~=rowhouse_atelier] .scene-rowhouse-door { position: absolute; bottom: 10%; left: 42%; width: 16%; height: 28%; background: linear-gradient(180deg, #831a32, #6b1827); border-radius: 50% 50% 0 0; }

/* corner_shop_house (Archetype 15) */
[data-archetype~=corner_shop_house] .wizard__scene-swatch { background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #fef3c7 100%); }
[data-archetype~=corner_shop_house] .scene-corner-awning { position: absolute; top: 12%; left: 8%; width: 50%; height: 12%; background: repeating-linear-gradient(90deg, #a855f7 0 8%, #fef3c7 8% 16%); border-radius: 2px 2px 0 0; }
[data-archetype~=corner_shop_house] .scene-corner-window { position: absolute; top: 25%; left: 12%; width: 40%; height: 30%; background: linear-gradient(180deg, rgba(167, 139, 250, 0.3), rgba(124, 58, 237, 0.2)); border: 3px solid #7c3aed; border-radius: 2px; }
[data-archetype~=corner_shop_house] .scene-corner-goods { position: absolute; top: 30%; left: 18%; width: 28%; height: 20%; background: radial-gradient(ellipse at center, #fbbf24, #f59e0b, #a855f7); border-radius: 30% 70% 50% 50%; }
[data-archetype~=corner_shop_house] .scene-corner-street { position: absolute; bottom: 0; left: 0; right: 0; height: 15%; background: linear-gradient(180deg, #78716c, #57534e); }
[data-archetype~=corner_shop_house] .scene-corner-lamppost { position: absolute; bottom: 12%; right: 15%; width: 6%; height: 35%; background: linear-gradient(180deg, #44403c, #57534e); border-radius: 2px; }
[data-archetype~=corner_shop_house] .scene-corner-lamppost::before { content: ''; position: absolute; top: -8%; left: -40%; width: 80%; height: 15%; background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.6), transparent); filter: blur(3px); border-radius: 50%; }

/* rooftop_aerie (Archetype 16) */
[data-archetype~=rooftop_aerie] .wizard__scene-swatch { background: linear-gradient(135deg, #0369a1 0%, #7dd3fc 50%, #cffafe 100%); }
[data-archetype~=rooftop_aerie] .scene-rooftop-skyline { position: absolute; bottom: 25%; left: 0; right: 0; height: 25%; background: linear-gradient(180deg, #1e3a5f, #0f172a); clip-path: polygon(0% 100%, 5% 60%, 12% 80%, 20% 40%, 30% 70%, 40% 30%, 55% 65%, 65% 45%, 75% 75%, 85% 50%, 92% 70%, 100% 100%); }
[data-archetype~=rooftop_aerie] .scene-rooftop-deck { position: absolute; bottom: 15%; left: 15%; right: 15%; height: 12%; background: linear-gradient(180deg, #78716c, #57534e); border-radius: 2px; }
[data-archetype~=rooftop_aerie] .scene-rooftop-potted-plants { position: absolute; bottom: 22%; left: 18%; width: 15%; height: 18%; background: radial-gradient(ellipse at center bottom, #22c55e, #166534); border-radius: 50% 50% 40% 40%; }
[data-archetype~=rooftop_aerie] .scene-rooftop-potted-plants::after { content: ''; position: absolute; bottom: -5%; left: 30%; width: 40%; height: 12%; background: linear-gradient(180deg, #78350f, #92400e); border-radius: 2px; }
[data-archetype~=rooftop_aerie] .scene-rooftop-person { position: absolute; bottom: 24%; left: 55%; width: 6%; height: 16%; background: rgba(0, 0, 0, 0.5); border-radius: 50% 50% 0 0; }
[data-archetype~=rooftop_aerie] .scene-rooftop-birds { position: absolute; top: 15%; left: 20%; width: 20%; height: 8%; background: repeating-linear-gradient(90deg, transparent 0 8px, rgba(0,0,0,0.3) 8px 12px, transparent 12px 20px); border-radius: 50%; filter: blur(1px); }
[data-archetype~=rooftop_aerie] .scene-rooftop-wind { position: absolute; top: 25%; left: 30%; width: 35%; height: 6%; background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.3), transparent); border-radius: 50%; filter: blur(2px); transform: rotate(-5deg); }

/* micro_loft_lab (Archetype 17) */
[data-archetype~=micro_loft_lab] .wizard__scene-swatch { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #dbeafe 100%); }
[data-archetype~=micro_loft_lab] .scene-loft-mezzanine { position: absolute; top: 15%; left: 10%; right: 10%; height: 18%; background: linear-gradient(180deg, #1e3a8a, #1e40af); border-radius: 2px; }
[data-archetype~=micro_loft_lab] .scene-loft-mezzanine::after { content: ''; position: absolute; bottom: -15%; left: 10%; width: 80%; height: 15%; background: linear-gradient(180deg, rgba(59, 130, 246, 0.3), transparent); filter: blur(4px); }
[data-archetype~=micro_loft_lab] .scene-loft-workbench { position: absolute; bottom: 20%; left: 12%; width: 35%; height: 18%; background: linear-gradient(180deg, #3b82f6, #2563eb); border-radius: 2px; }
[data-archetype~=micro_loft_lab] .scene-loft-stairs-storage { position: absolute; bottom: 15%; right: 15%; width: 20%; height: 35%; background: repeating-linear-gradient(180deg, #1e3a8a 0 12%, #1e40af 12% 16%); border-radius: 2px; }
[data-archetype~=micro_loft_lab] .scene-loft-flask { position: absolute; bottom: 30%; left: 20%; width: 8%; height: 14%; background: linear-gradient(180deg, rgba(219, 234, 254, 0.6), rgba(59, 130, 246, 0.4)); border-radius: 30% 30% 50% 50%; border: 1px solid rgba(255,255,255,0.3); }
[data-archetype~=micro_loft_lab] .scene-loft-magnifier { position: absolute; bottom: 28%; left: 32%; width: 10%; height: 10%; background: radial-gradient(circle, rgba(255,255,255,0.2), transparent 70%); border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; }
[data-archetype~=micro_loft_lab] .scene-loft-compact-glow { position: absolute; bottom: 22%; left: 15%; width: 30%; height: 25%; background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.4), transparent 70%); filter: blur(6px); }

/* live_work_archive (Archetype 18) */
[data-archetype~=live_work_archive] .wizard__scene-swatch { background: linear-gradient(135deg, #14532d 0%, #22c55e 50%, #dcfce7 100%); }
[data-archetype~=live_work_archive] .scene-archive-bookshelf-l { position: absolute; top: 10%; left: 5%; width: 25%; height: 65%; background: linear-gradient(90deg, #78350f, #92400e); border-radius: 2px; }
[data-archetype~=live_work_archive] .scene-archive-bookshelf-l::before { content: ''; position: absolute; top: 10%; left: 8%; right: 8%; height: 2px; background: #dcfce7; }
[data-archetype~=live_work_archive] .scene-archive-bookshelf-l::after { content: ''; position: absolute; top: 25%; left: 8%; right: 8%; height: 2px; background: #dcfce7; }
[data-archetype~=live_work_archive] .scene-archive-bookshelf-r { position: absolute; top: 10%; right: 5%; width: 25%; height: 65%; background: linear-gradient(90deg, #92400e, #78350f); border-radius: 2px; }
[data-archetype~=live_work_archive] .scene-archive-nook { position: absolute; top: 30%; left: 35%; width: 30%; height: 35%; background: linear-gradient(180deg, #14532d, #166534); border-radius: 50% 50% 0 0; }
[data-archetype~=live_work_archive] .scene-archive-lamp { position: absolute; top: 35%; left: 42%; width: 16%; height: 20%; background: radial-gradient(ellipse at center top, rgba(34, 197, 94, 0.8), rgba(34, 197, 94, 0.3) 60%, transparent 80%); filter: blur(3px); }
[data-archetype~=live_work_archive] .scene-archive-globe { position: absolute; top: 18%; right: 12%; width: 12%; height: 12%; background: radial-gradient(circle at 30% 30%, #7dd3fc, #0ea5e9, #0369a1); border-radius: 50%; }
[data-archetype~=live_work_archive] .scene-archive-papers { position: absolute; bottom: 15%; left: 38%; width: 24%; height: 12%; background: linear-gradient(135deg, #fef3c7, #fef9c3); border-radius: 1px; transform: rotate(-3deg); }
[data-archetype~=live_work_archive] .scene-archive-box { position: absolute; bottom: 10%; right: 18%; width: 18%; height: 15%; background: linear-gradient(180deg, #a68a3a, #78350f); border-radius: 2px; }

/* tree_canopy_dwelling (Archetype 19) */
[data-archetype~=tree_canopy_dwelling] .wizard__scene-swatch { background: linear-gradient(135deg, #15803d 0%, #22c55e 50%, #bbf7d0 100%); }
[data-archetype~=tree_canopy_dwelling] .scene-tree-trunk { position: absolute; bottom: 10%; left: 45%; width: 18%; height: 55%; background: linear-gradient(90deg, #78350f, #92400e, #78350f); border-radius: 4px; }
[data-archetype~=tree_canopy_dwelling] .scene-tree-platform { position: absolute; top: 35%; left: 25%; width: 50%; height: 15%; background: linear-gradient(180deg, #a68a3a, #78350f); border-radius: 3px; }
[data-archetype~=tree_canopy_dwelling] .scene-tree-foliage-top { position: absolute; top: 5%; left: 20%; width: 60%; height: 25%; background: radial-gradient(ellipse at center, #22c55e, #15803d); border-radius: 50% 50% 40% 40%; filter: blur(2px); }
[data-archetype~=tree_canopy_dwelling] .scene-tree-branch-l { position: absolute; top: 25%; left: 8%; width: 25%; height: 10%; background: linear-gradient(135deg, #15803d, #22c55e); border-radius: 50% 0 0 50%; transform: rotate(-10deg); }
[data-archetype~=tree_canopy_dwelling] .scene-tree-branch-r { position: absolute; top: 28%; right: 8%; width: 25%; height: 10%; background: linear-gradient(225deg, #15803d, #22c55e); border-radius: 0 50% 50% 0; transform: rotate(10deg); }
[data-archetype~=tree_canopy_dwelling] .scene-tree-rope { position: absolute; top: 40%; left: 18%; width: 25%; height: 4%; background: repeating-linear-gradient(90deg, #a68a3a 0 4px, transparent 4px 8px); border-radius: 2px; }
[data-archetype~=tree_canopy_dwelling] .scene-tree-dappled { position: absolute; top: 15%; left: 25%; width: 50%; height: 30%; background: radial-gradient(ellipse at 30% 40%, rgba(255, 255, 255, 0.2), transparent 60%); filter: blur(4px); }

/* desert_wind_house (Archetype 20) */
[data-archetype~=desert_wind_house] .wizard__scene-swatch { background: linear-gradient(135deg, #b45309 0%, #fbbf24 50%, #fef3c7 100%); }
[data-archetype~=desert_wind_house] .scene-desert-sun { position: absolute; top: 8%; left: 50%; transform: translateX(-50%); width: 20%; height: 20%; background: radial-gradient(circle, #fbbf24, #f59e0b); border-radius: 50%; box-shadow: 0 0 20px rgba(251, 191, 36, 0.6); }
[data-archetype~=desert_wind_house] .scene-desert-silhouette { position: absolute; bottom: 15%; left: 25%; width: 50%; height: 40%; background: linear-gradient(180deg, #92400e, #78350f); clip-path: polygon(10% 100%, 10% 50%, 20% 30%, 30% 50%, 40% 20%, 50% 40%, 60% 10%, 70% 35%, 80% 25%, 90% 50%, 90% 100%); }
[data-archetype~=desert_wind_house] .scene-desert-shadow { position: absolute; bottom: 18%; left: 28%; width: 15%; height: 20%; background: rgba(0, 0, 0, 0.4); border-radius: 2px; filter: blur(3px); }
[data-archetype~=desert_wind_house] .scene-desert-window { position: absolute; bottom: 35%; left: 38%; width: 8%; height: 10%; background: linear-gradient(180deg, #fef3c7, rgba(251, 191, 36, 0.5)); border-radius: 50% 50% 0 0; }
[data-archetype~=desert_wind_house] .scene-desert-cactus { position: absolute; bottom: 12%; left: 12%; width: 8%; height: 25%; background: linear-gradient(180deg, #22c55e, #15803d); border-radius: 40% 40% 0 0; }
[data-archetype~=desert_wind_house] .scene-desert-cactus::before { content: ''; position: absolute; top: 30%; left: -40%; width: 40%; height: 30%; background: linear-gradient(180deg, #22c55e, #15803d); border-radius: 40% 0 0 40%; }
[data-archetype~=desert_wind_house] .scene-desert-rocks { position: absolute; bottom: 10%; right: 15%; width: 20%; height: 12%; background: linear-gradient(135deg, #78716c, #57534e); border-radius: 30% 70% 50% 50%; }
[data-archetype~=desert_wind_house] .scene-desert-ground { position: absolute; bottom: 0; left: 0; right: 0; height: 12%; background: linear-gradient(180deg, #d4a574, #a68a3a); }

/* tidal_marsh_home (Archetype 21) */
[data-archetype~=tidal_marsh_home] .wizard__scene-swatch { background: linear-gradient(135deg, #0c4a6e 0%, #0891b2 50%, #a5f3fc 100%); }
[data-archetype~=tidal_marsh_home] .scene-tidal-water { position: absolute; bottom: 0; left: 0; right: 0; height: 35%; background: linear-gradient(180deg, #0891b2, #0c4a6e); }
[data-archetype~=tidal_marsh_home] .scene-tidal-water::before { content: ''; position: absolute; top: 30%; left: 0; right: 0%; height: 2px; background: rgba(255, 255, 255, 0.2); }
[data-archetype~=tidal_marsh_home] .scene-tidal-stilts { position: absolute; bottom: 25%; left: 35%; width: 6%; height: 25%; background: linear-gradient(180deg, #57534e, #44403c); border-radius: 2px; }
[data-archetype~=tidal_marsh_home] .scene-tidal-dock { position: absolute; bottom: 38%; right: 18%; width: 30%; height: 8%; background: linear-gradient(90deg, #a68a3a, #78350f); border-radius: 2px; }
[data-archetype~=tidal_marsh_home] .scene-tidal-reeds { position: absolute; bottom: 30%; left: 5%; width: 5%; height: 25%; background: linear-gradient(180deg, #166534, #14532d); border-radius: 2px 2px 0 0; transform: rotate(-3deg); }
[data-archetype~=tidal_marsh_home] .scene-tidal-reeds::after { content: ''; position: absolute; bottom: 32%; right: 8%; width: 4%; height: 22%; background: linear-gradient(180deg, #15803d, #166534); border-radius: 2px 2px 0 0; transform: rotate(2deg); }
[data-archetype~=tidal_marsh_home] .scene-tidal-moon { position: absolute; top: 12%; right: 20%; width: 14%; height: 14%; background: radial-gradient(circle at 30% 30%, #fef9c3, #fef3c7); border-radius: 50%; }
[data-archetype~=tidal_marsh_home] .scene-tidal-reflection { position: absolute; top: 30%; right: 22%; width: 10%; height: 3%; background: radial-gradient(ellipse at center, rgba(254, 240, 138, 0.5), transparent); border-radius: 50%; filter: blur(2px); }
[data-archetype~=tidal_marsh_home] .scene-tidal-boat { position: absolute; bottom: 32%; left: 48%; width: 14%; height: 8%; background: linear-gradient(180deg, #78716c, #57534e); border-radius: 0 0 50% 50%; }

/* glasshouse_habitat (Archetype 22) */
[data-archetype~=glasshouse_habitat] .wizard__scene-swatch { background: linear-gradient(135deg, #065f46 0%, #10b981 50%, #d1fae5 100%); }
[data-archetype~=glasshouse_habitat] .scene-glass-structure { position: absolute; inset: 8%; background: linear-gradient(180deg, rgba(209, 250, 229, 0.3), rgba(16, 185, 129, 0.2)); border: 3px solid rgba(16, 185, 129, 0.5); border-radius: 8px; }
[data-archetype~=glasshouse_habitat] .scene-glass-plants { position: absolute; top: 20%; left: 20%; width: 60%; height: 50%; background: radial-gradient(ellipse at center, #22c55e, #16a34a); border-radius: 50% 50% 30% 30%; filter: blur(2px); }
[data-archetype~=glasshouse_habitat] .scene-glass-condensation { position: absolute; top: 15%; left: 15%; width: 25%; height: 30%; background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.15), transparent 60%); border-radius: 50%; }
[data-archetype~=glasshouse_habitat] .scene-glass-night-glow { position: absolute; bottom: 20%; left: 30%; width: 40%; height: 35%; background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.4), transparent 70%); filter: blur(10px); }
[data-archetype~=glasshouse_habitat] .scene-glass-rain { position: absolute; top: 10%; right: 15%; width: 15%; height: 40%; background: repeating-linear-gradient(180deg, transparent 0 8px, rgba(165, 243, 252, 0.2) 8px 10px); filter: blur(1px); }

/* memory_manor (Archetype 23) */
[data-archetype~=memory_manor] .wizard__scene-swatch { background: linear-gradient(135deg, #78350f 0%, #d97706 50%, #fef3c7 100%); }
[data-archetype~=memory_manor] .scene-memory-frames { position: absolute; top: 12%; left: 15%; width: 70%; height: 35%; background: linear-gradient(180deg, #92400e, #78350f); border-radius: 50% 50% 0 0; }
[data-archetype~=memory_manor] .scene-memory-frames::before { content: ''; position: absolute; top: 15%; left: 15%; width: 20%; height: 25%; background: linear-gradient(135deg, rgba(254, 240, 138, 0.3), rgba(217, 119, 6, 0.2)); border: 2px solid #d97706; border-radius: 50%; }
[data-archetype~=memory_manor] .scene-memory-frames::after { content: ''; position: absolute; top: 20%; right: 20%; width: 18%; height: 22%; background: linear-gradient(135deg, rgba(254, 240, 138, 0.25), rgba(217, 119, 6, 0.15)); border: 2px solid #d97706; border-radius: 50%; }
[data-archetype~=memory_manor] .scene-memory-clock { position: absolute; top: 10%; left: 40%; width: 20%; height: 30%; background: linear-gradient(180deg, #44403c, #1c1917); border-radius: 2px; }
[data-archetype~=memory_manor] .scene-memory-clock::before { content: ''; position: absolute; top: 20%; left: 35%; width: 30%; height: 30%; background: radial-gradient(circle, #fef3c7, #d97706); border-radius: 50%; }
[data-archetype~=memory_manor] .scene-memory-bookshelf { position: absolute; bottom: 20%; left: 12%; width: 35%; height: 35%; background: linear-gradient(90deg, #78350f, #92400e); border-radius: 2px; }
[data-archetype~=memory_manor] .scene-memory-curtain { position: absolute; top: 8%; right: 8%; width: 25%; height: 55%; background: linear-gradient(180deg, #9f1239, #831a32); border-radius: 0 0 0 50%; filter: blur(2px); }
[data-archetype~=memory_manor] .scene-memory-sepia { position: absolute; inset: 0; background: radial-gradient(ellipse at 40% 60%, rgba(254, 240, 138, 0.15), transparent 60%); }
[data-archetype~=memory_manor] .scene-memory-candle { position: absolute; top: 28%; left: 46%; width: 8%; height: 12%; background: radial-gradient(ellipse at center top, rgba(251, 191, 36, 0.8), rgba(251, 191, 36, 0.3) 60%, transparent 80%); filter: blur(3px); }
/* Three.js Canvas Previews */
.wizard__archetype-canvas {
    display: block;
    width: 100%;
    height: 126px;
    border-radius: calc(var(--radius-md) - 2px);
    border: 0;
}

.wizard__archetype-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wizard__archetype-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: var(--radius-full);
    border: 1px solid color-mix(in oklab, var(--family-primary) 30%, transparent);
    background: color-mix(in oklab, var(--family-primary) 14%, transparent);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.wizard__archetype-card-title,
.wizard__archetype-name {
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--text);
}

.wizard__archetype-card-promise,
.wizard__archetype-promise {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.wizard__archetype-card-spaces,
.wizard__archetype-card-placements {
    margin: 0;
    font-size: 11px;
    color: color-mix(in oklab, var(--family-primary) 58%, var(--text-secondary));
    letter-spacing: 0.03em;
}

.wizard__family[data-family="hearth"],
.wizard__archetype-card[data-family="hearth"],
.wizard__archetype-selected[data-family="hearth"] {
    --family-primary: #ffb26b;
    --family-secondary: #ff7a6e;
    --family-soft: rgba(255, 178, 107, 0.24);
}

.wizard__family[data-family="retreat"],
.wizard__archetype-card[data-family="retreat"],
.wizard__archetype-selected[data-family="retreat"] {
    --family-primary: #7db8ff;
    --family-secondary: #8fd8f0;
    --family-soft: rgba(125, 184, 255, 0.24);
}

.wizard__family[data-family="social"],
.wizard__archetype-card[data-family="social"],
.wizard__archetype-selected[data-family="social"] {
    --family-primary: #ff7cc7;
    --family-secondary: #ff5f9f;
    --family-soft: rgba(255, 124, 199, 0.24);
}

.wizard__family[data-family="urban"],
.wizard__archetype-card[data-family="urban"],
.wizard__archetype-selected[data-family="urban"] {
    --family-primary: #a98bff;
    --family-secondary: #7987ff;
    --family-soft: rgba(169, 139, 255, 0.24);
}

.wizard__family[data-family="ecological"],
.wizard__archetype-card[data-family="ecological"],
.wizard__archetype-selected[data-family="ecological"] {
    --family-primary: #5fdfa2;
    --family-secondary: #41c9bb;
    --family-soft: rgba(95, 223, 162, 0.22);
}

@media (max-width: 900px) {
    .wizard__archetype-selected {
        padding: 18px;
    }

    .wizard__archetype-meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wizard__archetype-card {
        flex-basis: 228px;
        min-height: 274px;
    }
}

@media (max-width: 640px) {
    .wizard__archetype-selected {
        padding: 16px;
    }

    .wizard__archetype-selected-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .wizard__archetype-meta {
        grid-template-columns: 1fr;
    }

    .wizard__family-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .wizard__carousel-controls {
        align-self: flex-end;
    }

    .wizard__archetype-carousel-track,
    .wizard__archetype-grid {
        gap: 10px;
        padding: 4px 1px 8px;
    }

    .wizard__archetype-card {
        flex-basis: min(80vw, 250px);
        min-height: 256px;
        padding: 12px;
    }

    .wizard__archetype-card-preview {
        min-height: 110px;
    }
}

/* Archetype enlarged glass modal */
.wizard__archetype-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 7, 14, 0.72);
    backdrop-filter: blur(14px) saturate(1.2);
}

.wizard__archetype-modal {
    position: relative;
    width: min(960px, 96vw);
    max-height: min(92vh, 1080px);
    overflow: auto;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(10, 16, 28, 0.88);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 60px rgba(88, 215, 196, 0.12);
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

.wizard__archetype-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.wizard__archetype-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Hero preview — the centerpiece */
.wizard__archetype-modal-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 26px 26px 0 0;
}

.wizard__archetype-modal-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
}

.wizard__archetype-modal-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(5, 9, 18, 0.04) 0%, rgba(5, 9, 18, 0.2) 44%, rgba(5, 9, 18, 0.8) 100%),
        radial-gradient(circle at 82% 12%, rgba(255,255,255,0.18), transparent 28%);
    z-index: 1;
}

.wizard__archetype-modal-hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 34px 36px 24px;
    width: 100%;
    max-width: 660px;
}

.wizard__archetype-modal-hero-content--left {
    position: absolute;
    left: 0;
    bottom: 0;
}

.wizard__archetype-modal-family-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
}

.wizard__archetype-modal-hero-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 6vw, 54px);
    font-weight: 800;
    line-height: 1.05;
    color: #fff;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    margin: 0;
}

.wizard__archetype-modal-hero-promise {
    font-size: clamp(14px, 2.2vw, 18px);
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.55;
    max-width: 560px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* Detail body */
.wizard__archetype-modal-body {
    padding: 20px 24px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.wizard__archetype-modal-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wizard__archetype-modal-section {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.wizard__archetype-modal-section-title {
    margin: 0 0 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.wizard__archetype-modal-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.wizard__archetype-modal-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    font-size: 12px;
}

.wizard__archetype-modal-list {
    margin: 0;
    padding-left: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.wizard__archetype-modal-list--muted {
    color: var(--muted);
}

.wizard__archetype-modal-section--full {
    grid-column: 1 / -1;
}

@media (max-width: 820px) {
    .wizard__archetype-modal-backdrop {
        padding: 12px;
    }
    .wizard__archetype-modal {
        width: min(98vw, 980px);
        max-height: 94vh;
    }
    .wizard__archetype-modal-hero {
        aspect-ratio: 16 / 9;
        min-height: 0;
        max-height: 50vh;
    }
    .wizard__archetype-modal-hero-content {
        padding: 22px 18px 18px;
        max-width: 100%;
    }
    .wizard__archetype-modal-hero-title {
        font-size: clamp(26px, 9vw, 42px);
    }
    .wizard__archetype-modal-body {
        grid-template-columns: 1fr;
        padding: 14px;
    }
}

/* Spirit cards */
.wizard__spirit-card,
.wizard__pattern-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
    color: inherit;
    font-size: inherit;
    margin-bottom: 8px;
}

.wizard__spirit-card:hover,
.wizard__pattern-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--line-strong);
}

.wizard__spirit-card--selected,
.wizard__pattern-card--selected {
    border-color: var(--accent-warm);
    background: rgba(255, 126, 179, 0.08);
}

.wizard__spirit-label,
.wizard__pattern-label {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.wizard__spirit-desc,
.wizard__pattern-desc {
    font-size: 13px;
    color: var(--muted);
}

/* Place tabs */
.wizard__place-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 4px;
}

.wizard__place-tab {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.wizard__place-tab:hover {
    color: var(--text);
}

.wizard__place-tab--active {
    background: var(--bg-elevated);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.wizard__place-content {
    min-height: 120px;
}

.wizard__place-empty {
    text-align: center;
    padding: 32px;
    color: var(--muted);
}

.wizard__place-search input {
    width: 100%;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.wizard__place-search input:focus {
    border-color: var(--accent);
}

.wizard__place-sanctuary {
    padding: 24px;
    color: var(--muted);
    text-align: center;
}

.wizard__placement-card {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
    color: inherit;
    font-size: inherit;
    margin-bottom: 8px;
}

.wizard__placement-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.wizard__placement-card--selected {
    border-color: var(--accent);
    background: rgba(111, 111, 255, 0.08);
    box-shadow: 0 0 0 1px rgba(120, 194, 255, 0.18);
}

.wizard__placement-name {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
}

.wizard__placement-reason {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}

.wizard__placement-city {
    display: block;
    font-size: 12px;
    color: var(--muted);
    opacity: 0.7;
}

/* Control slider */
.wizard__control-slider {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wizard__control-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
    color: inherit;
    font-size: inherit;
}

.wizard__control-option:hover {
    background: var(--bg-card-hover);
    border-color: var(--line-strong);
}

.wizard__control-option--active {
    border-color: var(--accent-3);
    background: rgba(245, 184, 122, 0.08);
}

.wizard__control-label {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
}

.wizard__control-desc {
    font-size: 13px;
    color: var(--muted);
}

/* Summary */
.wizard__summary {
    text-align: center;
}

.wizard__summary-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: left;
    margin-bottom: 24px;
}

.wizard__summary-card h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 16px;
}

.wizard__summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.wizard__summary-row:last-child {
    border-bottom: none;
}

.wizard__summary-label {
    font-size: 13px;
    color: var(--muted);
}

.wizard__summary-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.wizard__loading {
    text-align: center;
    padding: 40px;
    color: var(--muted);
}

/* === Mission HQ === */
.mission-hq {
    min-height: 100vh;
    padding: 40px 20px;
}

.mission-hq__inner {
    max-width: 840px;
    margin: 0 auto;
}

.mission-hq__header {
    text-align: center;
    margin-bottom: 32px;
}

.mission-hq__mode-badge {
    display: inline-block;
    padding: 4px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-2);
    background: rgba(88, 215, 196, 0.1);
    border: 1px solid rgba(88, 215, 196, 0.3);
    border-radius: var(--radius-full);
    margin-bottom: 12px;
}

.mission-hq__title {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
}

.mission-hq__subtitle {
    font-size: 15px;
    color: var(--muted);
    margin: 0;
    font-style: italic;
}

.mission-hq__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

@media (max-width: 640px) {
    .mission-hq__grid {
        grid-template-columns: 1fr;
    }
}

.mission-hq__card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.mission-hq__card h2 {
    font-family: var(--font-label);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 12px;
}

.mission-hq__intent {
    font-size: 16px;
    color: var(--text);
    line-height: 1.5;
    margin: 0 0 12px;
}

.mission-hq__phase {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mission-hq__phase-label {
    font-size: 12px;
    color: var(--muted);
}

.mission-hq__phase-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-3);
    background: rgba(245, 184, 122, 0.12);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.mission-hq__agent-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.mission-hq__suggestions {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mission-hq__suggestion {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    color: var(--text-secondary);
}

.mission-hq__suggestion:last-child {
    border-bottom: none;
}

.mission-hq__suggestion::before {
    content: "\\2192\\00a0";
    color: var(--accent);
}

.mission-hq__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.mission-hq__empty {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--muted);
}
