        :root {
            --bg-main: #f4f7fb;
            --panel: rgba(255, 255, 255, 0.82);
            --panel-strong: rgba(255, 255, 255, 0.94);
            --border: rgba(15, 23, 42, 0.09);
            --text-main: #111827;
            --text-secondary: #475569;
            --muted: #64748b;
            --accent: #4f46e5;
            --accent-strong: #6a5cff;
            --accent-blue: #4f7cff;
            --accent-soft: rgba(79, 70, 229, 0.10);
            --green: #16a34a;
            --blue: #2563eb;
            --violet: #7c3aed;
            --shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
            --glow-a: rgba(186, 230, 253, 0.70);
            --glow-b: rgba(221, 214, 254, 0.62);
            --grad-start: #eef6ff;
            --detail-surface: rgba(255,255,255,0.52);
            --metric-bg: rgba(255,255,255,0.58);
            --keyword-bg: rgba(226,232,240,0.86);
            --keyword-text: #475569;
            --canvas-bg: #ffffff;
            --chart-grid: rgba(100, 116, 139, 0.18);
            --chart-x: #64748b;
        }

        body[data-theme="dark"] {
            --bg-main: #020617;
            --panel: rgba(15, 23, 42, 0.84);
            --panel-strong: rgba(15, 23, 42, 0.96);
            --border: rgba(255, 255, 255, 0.09);
            --text-main: #f8fafc;
            --text-secondary: #cbd5e1;
            --muted: #94a3b8;
            --accent: #a5b4fc;
            --accent-strong: #6a5cff;
            --accent-blue: #4f7cff;
            --accent-soft: rgba(165, 180, 252, 0.14);
            --green: #22c55e;
            --blue: #60a5fa;
            --violet: #a78bfa;
            --shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
            --glow-a: rgba(37, 99, 235, 0.22);
            --glow-b: rgba(139, 92, 246, 0.18);
            --grad-start: #07112a;
            --detail-surface: rgba(7, 14, 30, 0.58);
            --metric-bg: rgba(15, 23, 42, 0.72);
            --keyword-bg: rgba(71, 85, 105, 0.32);
            --keyword-text: #cbd5e1;
            --canvas-bg: #f8fafc;
            --chart-grid: rgba(148, 163, 184, 0.16);
            --chart-x: #94a3b8;
        }

        * { box-sizing: border-box; }

        body {
            margin: 0;
            min-height: 100vh;
            font-family: 'Inter', sans-serif;
            background:
                radial-gradient(circle at 12% 18%, var(--glow-a), transparent 34%),
                radial-gradient(circle at 88% 22%, var(--glow-b), transparent 30%),
                linear-gradient(135deg, var(--grad-start), var(--bg-main));
            color: var(--text-main);
        }

        .shell {
            max-width: 1220px;
            margin: 0 auto;
            padding: 24px 18px 36px;
        }

        .topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            margin-bottom: 24px;
        }

        .nav-group {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            text-decoration: none;
            color: var(--text-main);
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 999px;
            padding: 10px 14px;
            font-size: 13px;
            font-weight: 800;
            box-shadow: var(--shadow);
        }

        .user-pill {
            width: 44px;
            height: 44px;
            min-height: 44px;
            max-width: 44px;
            padding: 3px;
            display: grid;
            place-items: center;
            gap: 0;
            overflow: hidden;
            color: var(--text-secondary);
            background: color-mix(in srgb, var(--panel) 88%, transparent);
            border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
        }

        .user-pill img {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            object-fit: cover;
            object-position: center center;
            display: block;
            flex: 0 0 auto;
            border: 1px solid var(--accent);
            box-shadow: 0 0 0 3px var(--accent-soft), 0 0 14px rgba(79, 70, 229, 0.16);
        }

        .user-pill span {
            display: none;
        }

        .user-pill i,
        .user-pill svg {
            width: 20px;
            height: 20px;
            color: var(--accent);
        }

        .hero {
            margin-bottom: 20px;
        }

        .hero-title-row {
            display: flex;
            align-items: center;
            gap: 11px;
        }

        .hero-mark {
            width: 42px;
            height: 42px;
            flex: 0 0 42px;
            display: inline-grid;
            place-items: center;
            color: var(--accent);
            border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
            border-radius: 15px;
            background: color-mix(in srgb, var(--panel) 74%, transparent);
            box-shadow: 0 0 22px color-mix(in srgb, var(--accent-strong) 22%, transparent);
            animation: gardenMarkFloat 4.6s ease-in-out infinite;
        }

        @keyframes gardenMarkFloat {
            50% { transform: translateY(-3px) rotate(6deg); }
        }

        .garden-meta {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            margin-top: 11px;
            color: var(--accent);
            font-size: 11px;
            font-weight: 800;
        }

        .garden-meta svg {
            width: 15px;
            height: 15px;
        }

        .hero .oraculo-page-title {
            font-family: 'Sora', 'Plus Jakarta Sans', sans-serif !important;
            font-size: clamp(1.98rem, 3.55vw, 2.72rem) !important;
            font-weight: 700 !important;
            line-height: 0.96 !important;
            margin: 0;
            letter-spacing: -0.052em !important;
            text-shadow:
                0 1px 0 rgba(255, 255, 255, 0.08),
                0 14px 30px rgba(0, 0, 0, 0.28),
                0 0 22px color-mix(in srgb, var(--accent-strong) 22%, transparent);
        }

        .hero p {
            color: var(--text-secondary);
            margin: 10px 0 0;
            font-size: 15px;
            font-weight: 600;
        }

        .toolbar {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto auto;
            gap: 12px;
            margin-bottom: 18px;
        }

        .toolbar-sync {
            min-height: 48px;
            border-radius: 16px;
            white-space: nowrap;
        }

        html.sleep-phases-disabled .toolbar-sync,
        html.sleep-phases-disabled .sleep-phase-card {
            display: none !important;
        }

        .search {
            width: 100%;
            border: 1px solid var(--border);
            background: var(--panel-strong);
            color: var(--text-main);
            border-radius: 16px;
            padding: 14px 16px;
            font: inherit;
            outline: none;
        }

        .search:focus,
        .select:focus {
            border-color: color-mix(in srgb, var(--accent-strong) 52%, var(--border));
            box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-strong) 12%, transparent);
        }

        .select {
            border: 1px solid var(--border);
            background: var(--panel-strong);
            color: var(--text-main);
            border-radius: 16px;
            padding: 0 38px 0 14px;
            min-height: 48px;
            font-size: 14px;
            font-weight: 700;
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 14px center;
            background-size: 16px 16px;
            text-overflow: ellipsis;
        }

        .layout {
            display: grid;
            grid-template-columns: 390px 1fr;
            gap: 18px;
            align-items: start;
        }

        .list,
        .detail {
            min-width: 0;
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 24px;
            box-shadow: var(--shadow);
            backdrop-filter: blur(18px);
        }

        .list {
            max-height: calc(100vh - 230px);
            overflow: auto;
            padding: 10px;
        }

        .dream-card {
            display: block;
            width: 100%;
            height: auto;
            min-height: unset;
            border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
            background: color-mix(in srgb, var(--panel-strong) 46%, transparent);
            border-radius: 18px;
            padding: 14px;
            text-align: left;
            cursor: pointer;
            color: var(--text-main);
            margin-bottom: 4px;
        }

        .dream-month {
            position: sticky;
            top: -10px;
            z-index: 2;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin: 0 -2px 4px;
            padding: 9px 8px 7px;
            background: color-mix(in srgb, var(--panel) 94%, transparent);
            color: var(--muted);
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 1px;
            text-transform: uppercase;
            backdrop-filter: blur(16px);
        }

        .dream-month span:last-child {
            color: var(--accent);
        }

        .dream-card:hover,
        .dream-card.active {
            background: var(--panel-strong);
            border-color: color-mix(in srgb, var(--accent-strong) 30%, transparent);
        }

        .dream-card.global-card {
            background:
                linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 92%, transparent), color-mix(in srgb, var(--detail-surface) 88%, transparent)),
                radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 12%, transparent), transparent 40%);
        }

        .dream-card.active {
            box-shadow: inset 3px 0 0 var(--accent-strong), 0 10px 22px rgba(15, 23, 42, 0.06);
        }

        .dream-date {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            color: var(--muted);
            font-size: 12px;
            font-weight: 800;
            margin-bottom: 8px;
        }

        .dream-date span:last-child {
            flex: 0 0 auto;
            max-width: 58%;
            overflow: hidden;
            text-align: right;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .dream-summary {
            font-size: 14px;
            line-height: 1.48;
            color: var(--text-main);
            margin: 0 0 10px;
            display: -webkit-box;
            overflow: hidden;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
        }

        .dream-card-title {
            margin: 0 0 6px;
            color: var(--text-main);
            font-size: 13px;
            font-weight: 800;
            line-height: 1.25;
        }

        .dream-card-foot {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-top: 10px;
        }

        .dream-card-status {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            color: var(--muted);
            font-size: 10px;
            font-weight: 800;
        }

        .dream-card-status svg {
            width: 14px;
            height: 14px;
        }

        .scope-chip {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 5px 8px;
            border-radius: 999px;
            background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
            color: var(--accent);
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.7px;
            text-transform: uppercase;
        }

        .detail-note {
            border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
            border-radius: 16px;
            padding: 14px 15px;
            background:
                linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 88%, transparent), color-mix(in srgb, var(--detail-surface) 90%, transparent)),
                radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 12%, transparent), transparent 45%);
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.65;
        }

        .global-detail-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }

        .global-detail-meta-item {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 7px 10px;
            border-radius: 999px;
            border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
            background: color-mix(in srgb, var(--panel-strong) 92%, transparent);
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 800;
            line-height: 1.2;
        }

        .global-detail-meta-item svg {
            width: 14px;
            height: 14px;
            color: var(--accent);
        }

        .detail.global-detail .metric-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }

        .detail.global-detail .metric {
            min-width: 0;
        }

        .tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }

        .tag {
            border-radius: 999px;
            background: var(--accent-soft);
            color: var(--accent);
            padding: 5px 8px;
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.8px;
        }

        .detail {
            min-height: 580px;
            padding: 26px;
            overflow-x: hidden;
        }

        .empty {
            min-height: 520px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            text-align: center;
            padding: 30px;
        }

        .detail-head {
            display: flex;
            justify-content: space-between;
            gap: 14px;
            align-items: flex-start;
            border-bottom: 1px solid var(--border);
            padding-bottom: 18px;
            margin-bottom: 18px;
        }

        .detail-head-copy {
            min-width: 0;
            flex: 1;
        }

        .entry-meta-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 7px;
            margin-top: 8px;
        }

        .entry-meta-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            min-height: 29px;
            padding: 6px 10px;
            border: 1px solid var(--border);
            border-radius: 999px;
            background: color-mix(in srgb, var(--detail-surface) 82%, transparent);
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 900;
            letter-spacing: 0.2px;
        }

        .entry-meta-pill strong {
            color: var(--text-main);
            font-weight: 950;
        }

        .entry-meta-pill svg {
            width: 14px;
            height: 14px;
            color: var(--accent);
        }

        .detail h2 {
            font-family: 'Manrope', sans-serif;
            font-size: 22px;
            line-height: 1.08;
            margin: 0 0 10px;
            letter-spacing: 0;
            overflow-wrap: anywhere;
        }

        .dream-detected-card {
            display: inline-flex;
            align-items: center;
            gap: 9px;
            max-width: 100%;
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 8px 10px;
            background: color-mix(in srgb, var(--detail-surface) 86%, transparent);
            color: var(--text-secondary);
            box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
        }

        .dream-detected-card > i,
        .dream-detected-card > svg {
            width: 18px;
            height: 18px;
            flex: 0 0 auto;
            color: var(--accent);
        }

        .dream-detected-copy {
            display: grid;
            gap: 3px;
            min-width: 0;
        }

        .dream-detected-label {
            color: var(--accent);
            font-size: 9px;
            font-weight: 900;
            letter-spacing: 0.85px;
            text-transform: uppercase;
        }

        .dream-detected-range {
            display: flex;
            align-items: center;
            gap: 7px;
            min-width: 0;
            color: var(--text-main);
            font-size: 12px;
            font-weight: 850;
            line-height: 1.15;
        }

        .dream-detected-range span {
            min-width: 0;
            overflow-wrap: anywhere;
        }

        .dream-detected-range em {
            color: var(--accent);
            font-style: normal;
            font-weight: 900;
        }

        .detail.dream-entry-detail .dream-detected-card {
            margin-top: 8px;
        }

        .moon-phase-card {
            display: flex;
            align-items: center;
            gap: 11px;
            width: 100%;
            max-width: 360px;
            border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
            border-radius: 18px;
            padding: 9px 11px;
            margin: 12px 0 16px;
            background:
                radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 38%),
                linear-gradient(135deg, color-mix(in srgb, var(--panel-strong) 88%, transparent), color-mix(in srgb, var(--detail-surface) 82%, transparent));
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
        }

        .moon-phase-visual {
            position: relative;
            display: inline-grid;
            place-items: center;
            width: 46px;
            height: 46px;
            flex: 0 0 46px;
            border-radius: 16px;
            color: var(--accent);
            background:
                radial-gradient(circle at 35% 26%, rgba(255,255,255,0.72), transparent 28%),
                linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 92%, transparent), color-mix(in srgb, var(--panel-strong) 78%, transparent));
            box-shadow:
                inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
                0 10px 24px color-mix(in srgb, var(--accent-strong) 14%, transparent);
        }

        .moon-phase-svg {
            width: 34px;
            height: 34px;
            display: block;
            filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent-strong) 22%, transparent));
        }

        .moon-phase-halo {
            fill: color-mix(in srgb, var(--accent-soft) 74%, transparent);
            stroke: color-mix(in srgb, var(--accent) 28%, transparent);
            stroke-width: 1.4;
        }

        .moon-phase-lit {
            fill: color-mix(in srgb, #ffffff 70%, #facc15);
        }

        .moon-phase-shadow {
            fill: color-mix(in srgb, var(--bg-main) 72%, #111827);
            opacity: 0.9;
        }

        body[data-theme="dark"] .moon-phase-lit {
            fill: color-mix(in srgb, #f8fafc 78%, #c4b5fd);
        }

        body[data-theme="dark"] .moon-phase-shadow {
            fill: #020617;
            opacity: 0.96;
        }

        .moon-phase-copy {
            min-width: 0;
            display: grid;
            gap: 2px;
        }

        .moon-phase-copy span {
            color: var(--accent);
            font-size: 9px;
            font-weight: 900;
            letter-spacing: 0.95px;
            text-transform: uppercase;
        }

        .moon-phase-copy strong {
            color: var(--text-main);
            font-size: 16px;
            line-height: 1.12;
            overflow-wrap: anywhere;
        }

        .moon-phase-badge {
            margin-left: auto;
            flex: 0 0 auto;
            border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
            border-radius: 999px;
            padding: 5px 8px;
            color: var(--text-secondary);
            background: color-mix(in srgb, var(--panel-strong) 80%, transparent);
            font-size: 9px;
            font-weight: 900;
            letter-spacing: 0.75px;
            text-transform: uppercase;
        }

        .metric-grid {
            display: grid;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 8px;
            margin: 16px 0 22px;
        }

        .metric {
            border: 1px solid var(--border);
            border-radius: 14px;
            padding: 10px;
            background: var(--metric-bg);
        }

        .metric strong {
            display: block;
            font-family: 'Manrope', sans-serif;
            font-size: 18px;
        }

        .metric span {
            display: block;
            margin-top: 3px;
            font-size: 10px;
            font-weight: 800;
            color: var(--accent);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .metric.moon-metric strong {
            font-size: 15px;
            line-height: 1.18;
        }

        .sleep-phase-card {
            width: 100%;
            border: 1px solid var(--border);
            border-radius: 22px;
            background:
                radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%),
                linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 88%, transparent), color-mix(in srgb, var(--detail-surface) 92%, transparent));
            padding: 14px;
            margin: 4px 0 20px;
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
            box-sizing: border-box;
            max-width: 100%;
            min-width: 0;
            overflow: hidden;
        }

        .sleep-phase-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 10px;
            min-width: 0;
            max-width: 100%;
        }

        .sleep-phase-title {
            display: flex;
            align-items: center;
            gap: 9px;
            min-width: 0;
        }

        .sleep-phase-title > div {
            min-width: 0;
        }

        .sleep-phase-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 34px;
            height: 34px;
            flex: 0 0 34px;
            border-radius: 12px;
            background: var(--accent-soft);
            color: var(--accent);
        }

        .sleep-phase-icon svg {
            width: 18px;
            height: 18px;
        }

        .sleep-phase-head strong {
            display: block;
            font-size: 13px;
            color: var(--text-main);
            overflow-wrap: anywhere;
        }

        .sleep-phase-title > div > span {
            display: block;
            margin-top: 2px;
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 800;
        }

        .sleep-phase-source {
            display: block;
            margin: -4px 0 8px auto;
            color: var(--accent);
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.8px;
            text-transform: uppercase;
            text-align: right;
            overflow-wrap: normal;
            max-width: 100%;
            line-height: 1.22;
        }

        .sleep-phase-metrics {
            display: grid;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 8px;
            margin: 10px 0 0;
        }

        .sleep-phase-metric {
            min-width: 0;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: color-mix(in srgb, var(--metric-bg) 88%, transparent);
            padding: 9px 10px;
            box-sizing: border-box;
        }

        .sleep-phase-metric strong {
            display: block;
            font-family: 'Manrope', sans-serif;
            color: var(--text-main);
            font-size: 17px;
            line-height: 1.05;
            overflow-wrap: anywhere;
        }

        .sleep-phase-metric span {
            display: block;
            margin-top: 4px;
            color: var(--accent);
            font-size: 9px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.8px;
        }

        .sleep-phase-chart {
            width: 100%;
            max-width: 100%;
            min-width: 0;
            height: 285px;
            box-sizing: border-box;
            overflow: hidden;
            border: 1px solid var(--border);
            border-radius: 18px;
            background:
                radial-gradient(circle at 22% 12%, rgba(139, 92, 246, 0.12), transparent 32%),
                rgba(99, 102, 241, 0.07);
        }

        .sleep-phase-chart canvas {
            display: block;
            width: 100%;
            height: 100%;
            max-width: 100%;
        }

        .sleep-phase-visual {
            width: 100%;
            max-width: 100%;
            min-width: 0;
            margin-top: 12px;
            overflow: hidden;
        }

        .sleep-phase-visual[hidden] {
            display: none;
        }

        .sleep-phase-toggle {
            border: 1px solid var(--border);
            background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
            color: var(--accent);
            border-radius: 999px;
            padding: 8px 11px;
            font-size: 11px;
            font-weight: 900;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            white-space: nowrap;
        }

        .sleep-phase-toggle svg {
            width: 15px;
            height: 15px;
            transition: transform 0.18s ease;
        }

        .sleep-phase-card.sleep-phase-open .sleep-phase-toggle svg {
            transform: rotate(180deg);
        }

        .sleep-phase-svg {
            display: block;
            width: 100%;
            height: auto;
            max-width: 100%;
            overflow: visible;
        }

        .sleep-phase-lane {
            stroke: color-mix(in srgb, var(--text-secondary) 18%, transparent);
            stroke-width: 1;
        }

        .sleep-phase-label,
        .sleep-phase-axis {
            fill: var(--text-secondary);
            font-family: 'Manrope', sans-serif;
            font-weight: 800;
        }

        .sleep-phase-label {
            font-size: 11px;
        }

        .sleep-phase-axis {
            font-size: 10px;
            opacity: 0.78;
        }

        .sleep-phase-link {
            stroke: color-mix(in srgb, var(--text-secondary) 32%, transparent);
            stroke-width: 1.4;
            stroke-linecap: round;
        }

        .sleep-phase-timeline {
            display: flex;
            width: 100%;
            height: 16px;
            min-height: 16px;
            overflow: hidden;
            border-radius: 999px;
            border: 1px solid var(--border);
            background: rgba(99, 102, 241, 0.08);
        }

        .sleep-phase-segment {
            flex: var(--phase-flex, 1) 1 0;
            min-width: 3px;
            background: rgba(99, 102, 241, 0.38);
        }

        .sleep-phase-segment.light { background: linear-gradient(90deg, #a5b4fc, #c4b5fd); }
        .sleep-phase-segment.sleep { background: linear-gradient(90deg, #a5b4fc, #c4b5fd); }
        .sleep-phase-segment.deep { background: linear-gradient(90deg, #4338ca, #6d28d9); }
        .sleep-phase-segment.rem { background: linear-gradient(90deg, #14b8a6, #38bdf8); }
        .sleep-phase-segment.awake { background: linear-gradient(90deg, #fbbf24, #fb7185); }

        .sleep-phase-line {
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-width: 5;
            filter: drop-shadow(0 4px 7px rgba(15, 23, 42, 0.16));
        }

        .sleep-phase-point {
            filter: drop-shadow(0 3px 5px rgba(15, 23, 42, 0.18));
        }

        .sleep-phase-axis-row {
            display: flex;
            justify-content: space-between;
            gap: 10px;
            margin-top: 7px;
            color: var(--text-secondary);
            font-size: 10px;
            font-weight: 900;
            letter-spacing: 0.45px;
        }

        .sleep-phase-summary {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-top: 8px;
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 800;
        }

        .sleep-phase-summary strong {
            color: var(--text-main);
            font-size: 11px;
            font-weight: 900;
        }

        .sleep-phase-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 800;
        }

        .sleep-phase-legend span {
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }

        .sleep-phase-dot {
            width: 8px;
            height: 8px;
            border-radius: 999px;
            background: rgba(99, 102, 241, 0.5);
        }

        .sleep-phase-dot.light { background: #a5b4fc; }
        .sleep-phase-dot.sleep { background: #a5b4fc; }
        .sleep-phase-dot.deep { background: #6d28d9; }
        .sleep-phase-dot.rem { background: #14b8a6; }
        .sleep-phase-dot.awake { background: #fbbf24; }

        .sleep-phase-strip {
            display: flex;
            gap: 8px;
            width: 100%;
            max-width: 100%;
            min-width: 0;
            overflow-x: auto;
            padding: 8px 2px 2px;
            scrollbar-width: thin;
            -webkit-overflow-scrolling: touch;
        }

        .sleep-phase-chip {
            flex: 0 0 auto;
            min-width: 116px;
            max-width: 168px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: color-mix(in srgb, var(--panel-strong) 78%, transparent);
            padding: 8px 10px;
            box-sizing: border-box;
        }

        .sleep-phase-chip strong,
        .sleep-phase-chip span {
            display: block;
            overflow-wrap: anywhere;
        }

        .sleep-phase-chip strong {
            color: var(--text-main);
            font-size: 11px;
            font-weight: 900;
        }

        .sleep-phase-chip span {
            margin-top: 3px;
            color: var(--text-secondary);
            font-size: 10px;
            font-weight: 800;
        }

        .section-title {
            font-size: 11px;
            color: var(--accent);
            text-transform: uppercase;
            letter-spacing: 1.3px;
            font-weight: 900;
            margin: 24px 0 10px;
        }

        .dream-text,
        .analysis-text {
            white-space: pre-wrap;
            line-height: 1.75;
            color: var(--text-main);
            font-size: 15px;
        }

        .audio-only-note {
            display: flex;
            align-items: center;
            gap: 10px;
            border: 1px solid rgba(99, 102, 241, 0.24);
            border-radius: 14px;
            padding: 12px 14px;
            background: rgba(99, 102, 241, 0.08);
            color: var(--text-main);
            font-size: 14px;
            font-weight: 800;
        }

        .audio-only-note svg {
            flex: 0 0 auto;
            width: 18px;
            height: 18px;
            color: var(--accent);
        }

        .analysis-box {
            border: 1px solid var(--border);
            border-radius: 18px;
            background: var(--detail-surface);
            padding: 16px;
            margin-bottom: 12px;
        }

        .analysis-mode {
            font-size: 11px;
            font-weight: 900;
            color: var(--violet);
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 10px;
        }

        .analysis-render {
            display: grid;
            gap: 15px;
        }

        .analysis-render p,
        .analysis-render li,
        .analysis-render blockquote {
            margin: 0;
            font-family: 'Lora', Georgia, serif;
            font-size: 17px;
            line-height: 1.82;
            letter-spacing: 0.004em;
            color: color-mix(in srgb, var(--text-main) 95%, white 5%);
        }

        .analysis-render .analysis-intro {
            font-size: 19px;
            line-height: 1.76;
            color: color-mix(in srgb, var(--text-main) 90%, var(--accent) 10%);
        }

        .analysis-render h3 {
            margin: 6px 0 0;
            font-family: 'Playfair Display', serif;
            font-size: 26px;
            line-height: 1.14;
            font-weight: 800;
            letter-spacing: -0.02em;
            color: var(--text-main);
            text-wrap: balance;
        }

        .analysis-render h3:first-child {
            margin-top: 0;
        }

        .analysis-render strong {
            color: color-mix(in srgb, var(--text-main) 82%, var(--accent) 18%);
            font-weight: 700;
        }

        .analysis-render em {
            color: color-mix(in srgb, var(--text-main) 82%, var(--violet) 18%);
            font-style: italic;
        }

        .analysis-render ul {
            margin: 2px 0 0;
            padding: 0;
            list-style: none;
            display: grid;
            gap: 10px;
        }

        .analysis-render li {
            position: relative;
            padding-left: 22px;
        }

        .analysis-render li::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0.82em;
            width: 8px;
            height: 8px;
            border-radius: 999px;
            background: linear-gradient(135deg, var(--accent), var(--accent-blue));
            box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
            transform: translateY(-50%);
        }

        .analysis-render blockquote {
            padding: 14px 16px;
            border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
            border-radius: 0 16px 16px 0;
            background: color-mix(in srgb, var(--panel-strong) 84%, transparent);
            color: var(--text-secondary);
        }

        .analysis-render code {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 999px;
            background: color-mix(in srgb, var(--panel-strong) 86%, transparent);
            border: 1px solid var(--border);
            font-size: 0.88em;
            font-family: 'Plus Jakarta Sans', sans-serif;
            color: var(--accent);
        }

        .small-action {
            border: 1px solid var(--border);
            background: var(--panel-strong);
            color: var(--text-main);
            border-radius: 999px;
            padding: 9px 12px;
            font-size: 12px;
            font-weight: 900;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 7px;
        }

        .small-action:disabled {
            cursor: not-allowed;
            opacity: 0.5;
        }

        .mobile-detail-actions {
            display: none;
        }

        .mobile-detail-menu {
            position: relative;
        }

        .mobile-detail-menu summary {
            list-style: none;
        }

        .mobile-detail-menu summary::-webkit-details-marker {
            display: none;
        }

        .mobile-detail-menu-panel {
            position: absolute;
            z-index: 4;
            top: calc(100% + 7px);
            right: 0;
            display: grid;
            min-width: 174px;
            gap: 4px;
            padding: 6px;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: var(--panel-strong);
            box-shadow: var(--shadow);
            backdrop-filter: blur(18px);
        }

        .mobile-detail-menu-panel .small-action {
            width: 100%;
            justify-content: flex-start;
            border: 0;
            border-radius: 10px;
            background: transparent;
        }

        .detail-section {
            border-top: 1px solid var(--border);
            margin-top: 16px;
        }

        .detail-section summary {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 15px 0 10px;
            color: var(--accent);
            cursor: pointer;
            font-size: 11px;
            font-weight: 900;
            letter-spacing: 1.1px;
            list-style: none;
            text-transform: uppercase;
        }

        .detail-section summary::-webkit-details-marker {
            display: none;
        }

        .detail-section summary::after {
            content: '+';
            color: var(--muted);
            font-size: 18px;
            line-height: 1;
        }

        .detail-section[open] summary::after {
            content: '-';
        }

        .edit-panel {
            border: 1px solid var(--border);
            border-radius: 18px;
            background: var(--detail-surface);
            padding: 16px;
            margin-bottom: 18px;
        }

        .edit-grid {
            display: grid;
            grid-template-columns: 180px 1fr;
            gap: 10px;
            margin-bottom: 10px;
        }

        .edit-panel input,
        .edit-panel textarea {
            width: 100%;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: var(--panel-strong);
            color: var(--text-main);
            font: inherit;
            padding: 12px;
            outline: none;
        }

        .edit-panel textarea {
            min-height: 180px;
            resize: vertical;
        }

        .editor-tabs {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 5px;
            margin-bottom: 14px;
            padding: 4px;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: var(--panel-strong);
        }

        .editor-tab {
            min-height: 40px;
            border: 0;
            border-radius: 10px;
            background: transparent;
            color: var(--muted);
            cursor: pointer;
            font: inherit;
            font-size: 12px;
            font-weight: 800;
        }

        .editor-tab.active {
            background: var(--accent-soft);
            color: var(--accent);
        }

        .editor-panel {
            display: none;
        }

        .editor-panel.active {
            display: block;
        }

        .editor-field {
            display: grid;
            gap: 6px;
            margin-bottom: 10px;
        }

        .editor-field label {
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 900;
            letter-spacing: 0.8px;
            text-transform: uppercase;
        }

        .editor-field-help {
            margin: -1px 0 2px;
            color: var(--muted);
            font-size: 11px;
            line-height: 1.4;
        }

        .editor-save-bar {
            position: sticky;
            z-index: 3;
            bottom: 0;
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            padding-top: 12px;
            background: linear-gradient(180deg, transparent, var(--panel) 30%);
        }

        .edit-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: flex-end;
            margin-top: 12px;
        }

        .attachment-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 12px;
            margin: 10px 0 16px;
            align-items: stretch;
        }

        .attachment {
            display: grid;
            align-content: start;
            gap: 10px;
            min-width: 0;
            min-height: 158px;
            padding: 12px;
            border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
            border-radius: 18px;
            background:
                linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 92%, transparent), color-mix(in srgb, var(--detail-surface) 88%, transparent)),
                radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 10%, transparent), transparent 42%);
            box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10);
            overflow: hidden;
        }

        .attachment.audio-attachment {
            grid-column: span 2;
            min-width: 0;
            min-height: 148px;
            padding: 14px;
        }

        .attachment-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 0;
        }

        .attachment-head-copy {
            min-width: 0;
            display: grid;
            gap: 6px;
        }

        .attachment-kind {
            display: inline-flex;
            align-items: center;
            width: fit-content;
            min-height: 22px;
            padding: 3px 8px;
            border-radius: 999px;
            border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
            background: color-mix(in srgb, var(--accent-soft) 82%, transparent);
            color: var(--accent);
            font-size: 10px;
            font-weight: 900;
            letter-spacing: .7px;
            text-transform: uppercase;
        }

        .attachment-remove {
            border: 0;
            background: transparent;
            color: var(--muted);
            cursor: pointer;
            display: inline-grid;
            place-items: center;
            padding: 3px;
        }

        .attachment-remove:hover {
            color: #ef4444;
        }

        .attachment-head strong {
            display: -webkit-box;
            overflow: hidden;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            overflow-wrap: anywhere;
            font-size: 13px;
            line-height: 1.3;
        }

        .attachment-meta {
            color: var(--muted);
            font-size: 11px;
            font-weight: 700;
            line-height: 1.35;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .audio-player-shell {
            display: flex;
            align-items: center;
            min-height: 60px;
            border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
            border-radius: 24px;
            padding: 8px 10px;
            background: color-mix(in srgb, var(--panel-strong) 84%, transparent);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
        }

        .audio-player-shell audio {
            width: 100%;
            min-width: 0;
            height: 44px;
            display: block;
        }

        .attachment-visual {
            position: relative;
            display: block;
            width: 100%;
            min-height: 104px;
            border-radius: 14px;
            overflow: hidden;
            background: color-mix(in srgb, var(--panel-strong) 78%, transparent);
            border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
        }

        .attachment img {
            width: 100%;
            height: 116px;
            object-fit: cover;
            display: block;
            cursor: zoom-in;
        }

        .editor-tool {
            border: 1px solid var(--border);
            border-radius: 16px;
            background: var(--panel-strong);
            padding: 11px;
            margin-top: 8px;
        }

        .editor-tool-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 0;
        }

        .editor-tool-actions {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 6px;
            width: 236px;
            max-width: 100%;
        }

        .editor-tool-actions .small-action {
            width: 100%;
            min-height: 40px;
            justify-content: center;
            white-space: nowrap;
        }

        .editor-tool-actions.single-action {
            grid-template-columns: minmax(0, 1fr);
        }

        .drawing-actions {
            margin-bottom: 8px;
            margin-left: auto;
        }

        .editor-tool-title {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-main);
            font-size: 13px;
            font-weight: 900;
        }

        .editor-tool-help {
            display: none;
            margin: 8px 0 0;
            color: var(--text-secondary);
            font-size: 12px;
            line-height: 1.5;
        }

        .recording-indicator {
            display: none;
            align-items: center;
            gap: 9px;
            margin-top: 12px;
            border: 1px solid rgba(239, 68, 68, 0.24);
            border-radius: 14px;
            background: rgba(239, 68, 68, 0.08);
            color: var(--text-main);
            padding: 10px 12px;
            font-size: 12px;
            font-weight: 800;
        }

        .recording-indicator.active {
            display: flex;
        }

        .recording-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #ef4444;
            animation: recordingPulse 1.2s ease-in-out infinite;
        }

        @keyframes recordingPulse {
            50% { transform: scale(1.45); opacity: 0.45; }
        }

        @media (prefers-reduced-motion: reduce) {
            .hero-mark,
            .recording-dot {
                animation: none;
            }
        }

        .edit-status {
            min-height: 20px;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 800;
            margin-top: 12px;
        }

        #drawingCanvas {
            width: 100%;
            height: 180px;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: var(--canvas-bg);
            touch-action: none;
        }

        .drawing-panel {
            display: none;
            margin-top: 10px;
        }

        .drawing-panel.open {
            display: block;
        }

        .mobile-list-back {
            display: none;
        }

        @media (max-width: 900px) {
            .toolbar,
            .layout {
                grid-template-columns: 1fr;
            }

            .layout {
                align-items: stretch;
            }

            .list {
                max-height: 380px;
            }

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

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

        @media (max-width: 700px) {
            body:not(.mobile-dream-open) {
                overflow: hidden;
            }

            body.compact-garden:not(.mobile-dream-open) {
                overflow: auto;
            }

            .shell {
                padding: 14px 12px 12px;
            }

            body:not(.mobile-dream-open) .shell {
                height: calc(100dvh - 72px - env(safe-area-inset-bottom));
                display: grid;
                grid-template-rows: auto auto auto minmax(0, 1fr);
                align-content: stretch;
                overflow: hidden;
            }

            .topbar {
                justify-content: space-between;
                margin-bottom: 10px;
            }

            .nav-academy {
                display: none;
            }

            .topbar .user-pill {
                width: 44px;
                height: 44px;
            }

            .hero {
                margin-bottom: 8px;
            }

            .hero .oraculo-page-title {
                font-size: clamp(1.58rem, 6.55vw, 2.02rem) !important;
                line-height: 0.98 !important;
                letter-spacing: -0.045em !important;
                max-width: 305px;
            }

            .hero-title-row {
                gap: 9px;
            }

            .hero-mark {
                width: 34px;
                height: 34px;
                flex-basis: 34px;
                border-radius: 12px;
            }

            .hero-mark svg {
                width: 19px;
                height: 19px;
            }

            .hero p {
                display: none;
            }

            .garden-meta {
                margin-top: 5px;
                font-size: 12px;
                line-height: 1.45;
            }

            .toolbar {
                grid-template-columns: minmax(0, 1fr) minmax(156px, 0.45fr);
                gap: 8px;
                margin-bottom: 8px;
                flex: 0 0 auto;
            }

            .toolbar-sync {
                grid-column: 1 / -1;
                width: 100%;
                min-height: 42px;
                justify-content: center;
            }

            .search,
            .select {
                min-height: 44px;
                border-radius: 13px;
                padding: 11px 13px;
                font-size: 13px;
            }

            .select {
                min-width: 0;
                padding: 0 30px 0 11px;
                font-size: 11.5px;
                background-position: right 10px center;
                background-size: 14px 14px;
            }

            .list,
            .detail {
                border-radius: 18px;
            }

            .list {
                flex: 1 1 auto;
                height: auto;
                min-height: 0;
                max-height: none;
                overflow: auto;
                overscroll-behavior: contain;
                padding: 7px;
                scrollbar-width: thin;
            }

            .list.compact-list {
                flex: 0 0 auto;
                max-height: none;
                overflow: visible;
            }

            .list.compact-list .dream-card:last-child {
                margin-bottom: 0;
            }

            body.compact-garden:not(.mobile-dream-open) .shell {
                height: auto;
                min-height: 0;
                overflow: visible;
            }

            body.compact-garden:not(.mobile-dream-open) .layout {
                height: auto;
                flex: 0 0 auto;
                overflow: visible;
            }

            body.compact-garden:not(.mobile-dream-open) .list {
                flex: 0 0 auto;
                max-height: none;
                overflow: visible;
            }

            body:not(.mobile-dream-open) .layout {
                display: flex;
                flex-direction: column;
                align-items: stretch;
                height: 100%;
                min-height: 0;
                flex: 1 1 auto;
                overflow: hidden;
            }

            .dream-card {
                padding: 10px;
                border-radius: 14px;
            }

            .dream-card.active {
                background: color-mix(in srgb, var(--panel-strong) 46%, transparent);
                border-color: color-mix(in srgb, var(--border) 72%, transparent);
                box-shadow: none;
            }

            .dream-month {
                top: -7px;
                margin-bottom: 2px;
                padding: 8px 7px 6px;
            }

            .dream-date {
                margin-bottom: 5px;
                font-size: 11px;
            }

            .dream-summary {
                margin-bottom: 7px;
                font-size: 12px;
                line-height: 1.38;
                -webkit-line-clamp: 2;
            }

            .dream-card-title {
                margin-bottom: 4px;
                font-size: 12px;
            }

            .dream-card .tags {
                gap: 4px;
            }

            .dream-card .tag {
                padding: 4px 6px;
                font-size: 9px;
                letter-spacing: .55px;
            }

            .dream-card-foot {
                margin-top: 7px;
            }

            .dream-card-status {
                font-size: 9px;
            }

            .detail {
                display: none;
                padding: 14px;
            }

            body.mobile-dream-open .hero,
            body.mobile-dream-open .toolbar,
            body.mobile-dream-open .list {
                display: none;
            }

            body.mobile-dream-open .detail {
                display: block;
                animation: gardenDetailReveal .24s ease-out both;
            }

            @keyframes gardenDetailReveal {
                from { opacity: 0; transform: translateX(10px); }
                to { opacity: 1; transform: translateX(0); }
            }

            .mobile-list-back {
                display: inline-flex;
                margin-bottom: 12px;
            }

            .metric-grid {
                display: flex;
                gap: 7px;
                overflow-x: auto;
                margin: 10px 0;
                padding-bottom: 2px;
                scrollbar-width: none;
            }

            .edit-panel {
                padding: 12px;
            }

            .attachment-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 10px;
                overflow: visible;
                padding-bottom: 0;
            }

            .attachment {
                min-height: 156px;
                padding: 10px;
                border-radius: 16px;
                box-shadow: none;
            }

            .attachment.audio-attachment {
                grid-column: 1 / -1;
                min-width: 0;
                min-height: 140px;
                padding: 12px;
            }

            .attachment-head strong {
                font-size: 12px;
            }

            .attachment-meta {
                font-size: 10px;
            }

            .audio-player-shell {
                min-height: 60px;
                border-radius: 20px;
                padding: 8px;
            }

            .audio-player-shell audio {
                height: 42px;
            }

            .attachment-visual {
                min-height: 94px;
                border-radius: 12px;
            }

            .attachment img {
                height: 98px;
            }

            .editor-tool-head {
                display: grid;
                grid-template-columns: 1fr;
                gap: 8px;
            }

            .editor-tool-actions {
                width: 100%;
                min-width: 0;
            }

            .edit-panel textarea {
                min-height: 150px;
            }

            .editor-save-bar .small-action {
                min-height: 42px;
            }

            .editor-save-bar {
                bottom: calc(70px + env(safe-area-inset-bottom));
            }

            .metric-grid::-webkit-scrollbar {
                display: none;
            }

            .detail-head {
                gap: 10px;
                align-items: center;
                padding-bottom: 14px;
                margin-bottom: 12px;
            }

            .detail.dream-entry-detail .detail-head {
                display: grid;
                grid-template-columns: minmax(0, 1fr);
                align-items: stretch;
                gap: 12px;
            }

            .detail.dream-entry-detail .detail-head-copy {
                width: 100%;
            }

            .detail h2 {
                max-width: 100%;
                overflow-wrap: anywhere;
                font-size: 18px;
                line-height: 1.08;
                margin-bottom: 7px;
            }

            .entry-meta-row {
                gap: 5px;
                margin-top: 6px;
            }

            .detail.dream-entry-detail .entry-meta-row {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 7px;
            }

            .entry-meta-pill {
                min-height: 26px;
                padding: 5px 8px;
                font-size: 10px;
                gap: 5px;
            }

            .detail.dream-entry-detail .entry-meta-pill {
                width: 100%;
                min-height: 34px;
                justify-content: flex-start;
                border-radius: 14px;
                padding: 8px 10px;
                font-size: 10.5px;
                line-height: 1.15;
            }

            .entry-meta-pill svg {
                width: 12px;
                height: 12px;
            }

            .dream-detected-card {
                display: flex;
                width: 100%;
                padding: 8px 9px;
            }

            .detail.dream-entry-detail .dream-detected-card {
                align-items: flex-start;
                width: 100%;
                padding: 10px;
                border-radius: 18px;
            }

            .detail.dream-entry-detail .dream-detected-copy {
                width: 100%;
                gap: 6px;
            }

            .dream-detected-range {
                gap: 5px;
                font-size: 11px;
            }

            .detail.dream-entry-detail .dream-detected-range {
                display: grid;
                grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
                align-items: center;
                width: 100%;
                gap: 8px;
                font-size: 11.5px;
            }

            .detail.dream-entry-detail .dream-detected-range span {
                overflow-wrap: normal;
                word-break: normal;
            }

            .detail.dream-entry-detail .dream-detected-range em {
                justify-self: center;
            }

            .moon-phase-card {
                max-width: 100%;
                gap: 9px;
                padding: 8px 9px;
                margin: 8px 0 12px;
                border-radius: 16px;
            }

            .moon-phase-visual {
                width: 40px;
                height: 40px;
                flex-basis: 40px;
                border-radius: 14px;
            }

            .moon-phase-svg {
                width: 29px;
                height: 29px;
            }

            .moon-phase-copy span {
                font-size: 8px;
                letter-spacing: 0.75px;
            }

            .moon-phase-copy strong {
                font-size: 14px;
                line-height: 1.1;
            }

            .moon-phase-badge {
                padding: 4px 7px;
                font-size: 8px;
                letter-spacing: 0.55px;
            }

            .desktop-detail-actions {
                display: none !important;
            }

            .mobile-detail-actions {
                display: flex;
                align-items: center;
                gap: 7px;
                flex: 0 0 auto;
            }

            .detail.dream-entry-detail .mobile-detail-actions {
                width: 100%;
                justify-content: stretch;
            }

            .detail.dream-entry-detail .mobile-detail-actions > .small-action {
                flex: 1 1 auto;
                justify-content: center;
                min-height: 42px;
            }

            .detail.dream-entry-detail .mobile-detail-menu {
                flex: 0 0 auto;
            }

            .small-action {
                padding: 8px 10px;
                font-size: 11px;
            }

            .metric {
                flex: 0 0 92px;
                min-height: 64px;
                padding: 8px;
                border-radius: 12px;
            }

            .metric.moon-metric {
                flex-basis: 116px;
            }

            .metric strong {
                font-size: 15px;
                line-height: 1.1;
            }

            .metric.moon-metric strong {
                font-size: 14px;
                line-height: 1.12;
            }

            .metric span {
                margin-top: 5px;
                font-size: 8px;
                letter-spacing: 0.6px;
            }

            .sleep-phase-card {
                border-radius: 18px;
                padding: 12px;
                margin: 4px 0 16px;
            }

            .sleep-phase-head {
                align-items: flex-start;
                gap: 8px;
            }

            .sleep-phase-icon {
                width: 30px;
                height: 30px;
                flex-basis: 30px;
                border-radius: 11px;
            }

            .sleep-phase-icon svg {
                width: 16px;
                height: 16px;
            }

            .sleep-phase-head strong {
                font-size: 12px;
            }

            .sleep-phase-title > div > span,
            .sleep-phase-source {
                font-size: 9px;
                letter-spacing: 0.55px;
            }

            .sleep-phase-source {
                max-width: 100%;
                font-size: 8px;
                line-height: 1.18;
            }

            .detail.dream-entry-detail .sleep-phase-source {
                margin: -2px 0 8px;
                text-align: left;
                overflow-wrap: anywhere;
            }

            .sleep-phase-metrics {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 7px;
                margin: 8px 0 0;
            }

            .sleep-phase-metric:first-child {
                grid-column: 1 / -1;
            }

            .sleep-phase-metric {
                padding: 8px;
                border-radius: 12px;
            }

            .sleep-phase-metric strong {
                font-size: 15px;
            }

            .sleep-phase-metric span {
                font-size: 8px;
                letter-spacing: 0.55px;
            }

            .sleep-phase-chart {
                border-radius: 15px;
                height: 215px;
            }

            .sleep-phase-visual {
                margin-top: 10px;
            }

            .sleep-phase-toggle {
                padding: 7px 9px;
                font-size: 10px;
            }

            .sleep-phase-timeline {
                height: 13px;
                min-height: 13px;
            }

            .sleep-phase-label {
                font-size: 10px;
            }

            .sleep-phase-axis {
                font-size: 9px;
            }

            .sleep-phase-line {
                stroke-width: 4;
            }

            .sleep-phase-axis-row,
            .sleep-phase-summary {
                font-size: 9px;
            }

            .sleep-phase-strip {
                gap: 6px;
                padding-top: 7px;
            }

            .sleep-phase-chip {
                min-width: 104px;
                max-width: 142px;
                padding: 7px 8px;
            }

            .sleep-phase-chip strong {
                font-size: 10px;
            }

            .sleep-phase-chip span,
            .sleep-phase-legend {
                font-size: 9px;
            }

            .detail.global-detail {
                padding: 12px;
            }

            .detail.global-detail h2 {
                font-size: 19px;
                line-height: 1.1;
            }

            .detail.global-detail .global-detail-meta {
                display: grid;
                grid-template-columns: 1fr;
                gap: 7px;
                margin-top: 8px;
            }

            .detail.global-detail .global-detail-meta-item {
                width: 100%;
                justify-content: flex-start;
                padding: 8px 10px;
                font-size: 11px;
            }

            .detail.global-detail .metric-grid {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px;
                overflow: visible;
                padding-bottom: 0;
                margin: 10px 0 12px;
            }

            .detail.global-detail .metric {
                flex: none;
                min-height: 72px;
                padding: 9px;
            }

            .detail.global-detail .metric strong {
                font-size: 14px;
                line-height: 1.14;
                overflow-wrap: anywhere;
            }

            .detail.global-detail .metric span {
                font-size: 8px;
                letter-spacing: 0.55px;
            }

            .detail.global-detail .detail-note {
                padding: 12px;
                font-size: 13px;
                line-height: 1.58;
            }

            .detail.global-detail .analysis-render p,
            .detail.global-detail .analysis-render li,
            .detail.global-detail .analysis-render blockquote {
                font-size: 15px;
                line-height: 1.72;
            }

            .detail.global-detail .analysis-render h3 {
                font-size: 22px;
                line-height: 1.16;
            }
        }
