:root {
    --bg: #08111a;
    --bg-2: #101c2b;
    --surface: rgba(255, 255, 255, 0.1);
    --surface-strong: rgba(255, 255, 255, 0.16);
    --border: rgba(255, 255, 255, 0.16);
    --text: #f7fbff;
    --muted: rgba(233, 240, 250, 0.68);
    --mint: #91ffe5;
    --gold: #ffd89a;
    --sky: #8ea8ff;
    --rose: #ff9abc;
    --shadow: 0 20px 52px rgba(0, 0, 0, 0.28);
    --safe-bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 14%, rgba(124, 190, 255, 0.2), transparent 28%),
        radial-gradient(circle at 88% 10%, rgba(255, 208, 130, 0.15), transparent 24%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

body.is-sheet-open {
    overflow: hidden;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
}

.backdrop {
    position: fixed;
    inset: auto;
    border-radius: 999px;
    filter: blur(90px);
    pointer-events: none;
    opacity: 0.85;
}

.glow-a {
    width: 230px;
    height: 230px;
    top: 8%;
    right: -80px;
    background: rgba(144, 255, 229, 0.12);
}

.glow-b {
    width: 260px;
    height: 260px;
    left: -110px;
    bottom: 16%;
    background: rgba(146, 167, 255, 0.12);
}

.mobile-app {
    position: relative;
    z-index: 1;
    width: min(100vw, 560px);
    margin: 0 auto;
    padding: 18px 14px var(--safe-bottom);
}

.topbar,
.section-head,
.card-head,
.fact-meta,
.note-header,
.month-toolbar,
.sheet-head,
.sheet-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topbar {
    margin-bottom: 16px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 6px;
    color: var(--mint);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    font-weight: 800;
}

.topbar h1,
.section-head h2,
.card-head h3,
.agenda-item h3,
.next-event h3,
.note-card h3,
.sheet-head h3 {
    margin: 0;
}

.topbar h1 {
    font-family: "Sora", sans-serif;
    font-size: 1.18rem;
    line-height: 1.2;
}

.glass,
.card,
.time-switcher,
.bottom-nav,
.sheet-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.card,
.time-switcher,
.bottom-nav,
.sheet-panel {
    border-radius: 26px;
}

.status-chip,
.badge,
.pill-button {
    border-radius: 999px;
}

.status-chip,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    font-size: 0.82rem;
}

.stat-pill span,
.fact-meta span,
.note-header span,
.photo-body small {
    color: var(--muted);
}

.icon-button,
.pill-button,
.nav-tab,
.preview-shot,
.photo-button,
.day-cell,
.note-card,
.action-button {
    border: 0;
    cursor: pointer;
}

.icon-button,
.pill-button,
.nav-tab,
.action-button {
    transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.icon-button:active,
.pill-button:active,
.nav-tab:active,
.action-button:active {
    transform: scale(0.98);
}

.icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 1.3rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-switcher {
    display: grid;
    gap: 8px;
    min-width: 148px;
    padding: 8px;
}

.time-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.time-tab {
    min-height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}

.time-tab.is-active {
    background: rgba(145, 255, 229, 0.2);
    color: var(--text);
}

.time-display {
    display: grid;
    gap: 2px;
    padding: 2px 4px 0;
}

.time-display strong {
    font-family: "Sora", sans-serif;
    font-size: 1.02rem;
    line-height: 1;
}

.time-display small {
    color: var(--muted);
}

.screen-stack {
    display: grid;
}

.screen {
    display: none;
    gap: 14px;
}

.screen.is-active {
    display: grid;
}

.status-chip,
.badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--mint);
}

.card {
    padding: 16px;
}

.card-content,
.facts-list,
.preview-grid,
.agenda-list,
.canvas-list,
.gallery-grid {
    margin-top: 12px;
}

.item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.inline-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-action {
    min-height: 34px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.mini-action.danger {
    background: rgba(255, 154, 188, 0.14);
    color: #ffd8e4;
}

.next-event p,
.fact-card p,
.agenda-item p,
.note-card p,
.photo-body p {
    margin: 0;
    line-height: 1.55;
}

.next-event {
    display: grid;
    gap: 10px;
}

.next-event strong {
    font-size: 1rem;
}

.facts-list {
    display: grid;
    gap: 10px;
}

.fact-card,
.agenda-item {
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.fact-card-button {
    width: 100%;
    text-align: left;
    color: var(--text);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.preview-shot,
.photo-button {
    display: block;
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
}

.preview-shot {
    aspect-ratio: 0.92;
}

.preview-shot img,
.photo-button img,
.note-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.month-toolbar {
    margin-bottom: 14px;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekdays {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.77rem;
    text-align: center;
}

.day-cell {
    min-height: 52px;
    padding: 8px 4px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    display: grid;
    place-items: center;
    gap: 3px;
}

.day-cell strong {
    font-size: 0.92rem;
}

.day-cell span {
    font-size: 0.72rem;
    color: var(--muted);
}

.day-cell.has-event {
    background: linear-gradient(180deg, rgba(145, 255, 229, 0.2), rgba(255, 255, 255, 0.06));
}

.day-cell.is-selected {
    outline: 1px solid rgba(145, 255, 229, 0.82);
}

.day-cell.is-muted {
    opacity: 0.34;
}

.canvas-card {
    overflow: hidden;
}

.canvas-list {
    display: grid;
    gap: 12px;
}

.memory-feed-card {
    overflow: hidden;
}

.memory-facts-list {
    margin-top: 12px;
    display: grid;
    gap: 12px;
}

.memory-fact {
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.memory-fact-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 10px;
}

.memory-fact p {
    margin: 0;
    line-height: 1.55;
}

.fact-owner {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(145, 255, 229, 0.12);
    color: var(--mint);
    font-size: 0.78rem;
    font-weight: 700;
}

.memory-fact.is-flashed {
    border-color: rgba(145, 255, 229, 0.72);
    box-shadow: 0 0 0 1px rgba(145, 255, 229, 0.35), 0 18px 36px rgba(0, 0, 0, 0.22);
    transform: translateY(-2px);
}

.note-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 24px;
    text-align: left;
    color: var(--text);
}

.note-card h3 {
    font-size: 1.05rem;
}

.note-card img {
    height: 132px;
    border-radius: 16px;
}

.note-aurora {
    background: linear-gradient(160deg, rgba(145, 255, 229, 0.26), rgba(142, 168, 255, 0.22));
}

.note-sunset {
    background: linear-gradient(160deg, rgba(255, 207, 133, 0.28), rgba(255, 154, 188, 0.2));
}

.note-ocean {
    background: linear-gradient(160deg, rgba(125, 176, 255, 0.32), rgba(82, 116, 219, 0.18));
}

.note-gold {
    background: linear-gradient(160deg, rgba(255, 216, 154, 0.32), rgba(199, 144, 58, 0.16));
}

.pill-button {
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(145, 255, 229, 0.88), rgba(142, 168, 255, 0.7));
    box-shadow: 0 10px 24px rgba(95, 195, 214, 0.22);
    color: #04131d;
    font-weight: 800;
}

.pill-button:hover,
.pill-button:focus-visible {
    background: linear-gradient(135deg, rgba(145, 255, 229, 0.96), rgba(142, 168, 255, 0.8));
}

.gallery-grid {
    display: grid;
    gap: 12px;
}

.photo-card {
    overflow: hidden;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.photo-body {
    padding: 12px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag-list span {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--mint);
    font-size: 0.78rem;
}

.empty-state {
    padding: 20px 16px;
    text-align: center;
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    color: var(--muted);
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    transform: translateX(-50%);
    width: min(calc(100vw - 24px), 532px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 8px;
    z-index: 20;
}

.nav-tab {
    min-height: 48px;
    border-radius: 18px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
}

.nav-tab.is-active {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text);
}

.sheet {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 40;
}

.sheet.is-active {
    display: block;
}

.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 11, 18, 0.66);
}

.sheet-panel {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 14px 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
    border-radius: 28px;
}

.sheet-handle {
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    margin: 2px auto 12px;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.field span,
.toggle span {
    color: var(--muted);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(7, 14, 22, 0.55);
    color: var(--text);
    padding: 13px 14px;
    resize: vertical;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 14px;
}

.sheet-actions {
    margin-top: 6px;
}

.action-button {
    flex: 1;
    min-height: 48px;
    border-radius: 18px;
    font-weight: 800;
}

.action-button.primary {
    background: linear-gradient(135deg, var(--mint), var(--sky));
    color: #03131d;
}

.action-button.danger {
    background: rgba(255, 154, 188, 0.16);
    color: #ffd9e5;
}

.action-button:disabled {
    opacity: 0.45;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.72);
}

.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(6, 9, 16, 0.88);
    padding: 16px;
    z-index: 50;
}

.lightbox.is-active {
    display: flex;
}

.lightbox img {
    width: min(100%, 560px);
    max-height: 78vh;
    object-fit: contain;
    border-radius: 22px;
}

.lightbox-close {
    align-self: flex-end;
    margin-bottom: 10px;
}

#lightbox-caption {
    color: #fff;
    margin-top: 12px;
    text-align: center;
}

@media (min-width: 561px) {
    .mobile-app {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (max-width: 420px) {
    .topbar {
        align-items: flex-start;
    }

    .topbar-actions {
        flex-direction: column;
        align-items: flex-end;
    }

    .time-switcher {
        min-width: 132px;
    }
}

@media (max-width: 420px) {
    .hero-actions {
        grid-template-columns: 1fr;
    }
}
