:root {
    --purple: #6d4d9a;
    --purple-dark: #2b1558;
    --purple-ink: #21103f;
    --purple-soft: #efe8f8;
    --blue: #325fa5;
    --blue-deep: #164d89;
    --peach: #ebb16d;
    --cream: #fff8f0;
    --white: #ffffff;
    --ink: #211b2b;
    --muted: #6d6577;
    --line: #e9e3ee;
    --danger: #b93857;
    --success: #2d8a63;
    --shadow: 0 18px 55px rgba(48, 28, 84, .13);
    --soft-shadow: 0 10px 30px rgba(48, 28, 84, .08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    background: #f7f4fa;
    color: var(--ink);
    font-family: "Dongle", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
    outline: 3px solid rgba(50, 95, 165, .28);
    outline-offset: 3px;
}

svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
    color: var(--purple-ink);
    font-family: "Dela Gothic One", "Arial Black", "Trebuchet MS", sans-serif;
    letter-spacing: -.035em;
    line-height: 1.12;
}
p { color: var(--muted); }

.eyebrow {
    display: inline-block;
    margin-bottom: 5px;
    color: var(--purple);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.eyebrow.light { color: #f3cf9f; }
.muted { color: var(--muted); }

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 16px;
    background: var(--cream);
    color: var(--purple);
    font-weight: 800;
}
.loading-logo { width: 138px; }

.auth-layout { min-height: 100svh; background: var(--cream); }
.auth-visual {
    position: relative;
    min-height: 42svh;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 34px 24px;
    background: linear-gradient(145deg, #251051 0%, #6d4d9a 52%, #325fa5 100%);
}
.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .25;
    background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to top, #000, transparent 80%);
}
.ambient-orb { position: absolute; border-radius: 50%; filter: blur(4px); opacity: .72; }
.orb-one { width: 290px; height: 290px; right: -90px; top: -50px; background: radial-gradient(circle at 30% 30%, #ffd98f, #f77fa8 38%, #6641aa 72%); }
.orb-two { width: 210px; height: 210px; left: -75px; bottom: -80px; background: radial-gradient(circle at 65% 35%, #55d4e8, #246ab5 45%, #5d2c8c 75%); }
.auth-message { position: relative; z-index: 1; max-width: 560px; }
.auth-message h1 { color: #fff; font-size: clamp(2.15rem, 8vw, 4.6rem); margin-bottom: 15px; }
.auth-message h1 em { color: var(--peach); font-style: normal; }
.auth-message p { max-width: 480px; margin-bottom: 0; color: rgba(255,255,255,.78); font-size: 1.05rem; }
.auth-panel { display: grid; align-items: center; padding: 28px 20px 42px; }
.auth-card { width: min(100%, 430px); margin: auto; }
.auth-logo { width: 112px; margin-bottom: 22px; }
.auth-card h2 { font-size: 1.8rem; margin-bottom: 8px; }
.auth-card > div > p { margin-bottom: 24px; }

.stack-form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field > span { color: #3f3549; font-size: .93rem; font-weight: 750; }
.field strong { color: var(--danger); }
.field small:not(.field-error):not(.counter) { color: var(--muted); font-weight: 500; }
.field input, .field textarea, .memory-controls select, .search-field {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}
.field input, .field textarea, .memory-controls select { padding: 13px 14px; }
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus, .memory-controls select:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(109, 77, 154, .1); outline: none; }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--danger); }
.field-error { min-height: 1.1em; color: var(--danger); font-size: .78rem; }
.counter { justify-self: end; color: var(--muted); font-size: .75rem; }
.pin-field { position: relative; }
.pin-field input { padding-right: 50px; }
.pin-field .icon-button { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); }

.primary-button, .secondary-button {
    min-height: 50px;
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 800;
    transition: transform .18s, box-shadow .18s, background-color .18s;
}
.primary-button { background: var(--purple); color: #fff; box-shadow: 0 9px 24px rgba(109, 77, 154, .24); }
.primary-button:hover { background: #5d3c8b; transform: translateY(-1px); }
.primary-button:disabled { opacity: .58; cursor: wait; transform: none; }
.secondary-button { background: var(--purple-soft); color: var(--purple-dark); }
.secondary-button:hover { background: #e3d8f1; }
.compact-button { min-height: 42px; width: 100%; margin-top: 10px; }
.danger-button { background: var(--danger); }
.danger-text { color: var(--danger); background: #fbedf1; }
.icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--purple-ink);
}
.icon-button:hover { background: var(--purple-soft); }
.icon-button svg { width: 21px; height: 21px; }
.icon-button.danger { color: var(--danger); }
.text-button { border: 0; padding: 7px 0; background: transparent; color: var(--purple); font-weight: 800; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 20px 0 0; color: var(--muted); font-size: .8rem; }
.privacy-note svg { width: 16px; height: 16px; }

.app-shell { min-height: 100svh; padding-bottom: calc(88px + var(--safe-bottom)); }
.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px max(18px, env(safe-area-inset-left));
    border-bottom: 1px solid rgba(78, 50, 111, .08);
    background: rgba(255, 248, 240, .92);
    backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--purple-dark); text-decoration: none; line-height: .9; font-size: .75rem; }
.brand img { width: 43px; height: 48px; object-fit: contain; object-position: center top; }
.brand strong { font-size: .9rem; }
.avatar-button { width: 43px; height: 43px; border: 3px solid #fff; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 900; box-shadow: 0 5px 18px rgba(56,31,89,.2); }
.app-content { width: min(100%, 1120px); margin: 0 auto; padding: 24px 18px 36px; }
.view { animation: view-in .28s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }

.welcome-row, .page-heading { margin-bottom: 22px; }
.welcome-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.welcome-row h1, .page-heading h1 { font-size: clamp(2rem, 7vw, 3rem); margin-bottom: 6px; }
.welcome-row p, .page-heading p { margin: 0; }
.today-pill { flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: .75rem; font-weight: 750; }

.checkin-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(109,77,154,.11);
    border-radius: var(--radius-xl);
    background: #fff;
    box-shadow: var(--shadow);
}
.checkin-card::after { content: ""; position: absolute; width: 190px; height: 190px; right: -120px; top: -110px; border-radius: 50%; background: rgba(235,177,109,.3); }
.section-heading { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-heading h2, .section-heading h3 { margin: 0 0 5px; font-size: 1.22rem; }
.section-heading p { margin: 0; font-size: .88rem; }
.section-heading.compact { align-items: flex-end; margin-bottom: 14px; }
.step-badge { flex: 0 0 auto; border-radius: 999px; padding: 6px 9px; background: var(--purple-soft); color: var(--purple); font-size: .72rem; font-weight: 800; }
.emotion-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.emotion-button {
    min-height: 84px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid transparent;
    border-radius: 18px;
    padding: 12px;
    text-align: left;
    color: var(--ink);
    transition: transform .18s, border-color .18s, box-shadow .18s;
}
.emotion-button:hover { transform: translateY(-2px); box-shadow: var(--soft-shadow); }
.emotion-button.is-selected { border-color: currentColor; box-shadow: 0 0 0 3px rgba(109,77,154,.1); }
.emotion-button.joy { background: #fff4d6; color: #9a5c00; }
.emotion-button.sadness { background: #e8f0fa; color: #315d92; }
.emotion-button.anxiety { background: #f3e4f2; color: #843460; }
.emotion-button.nostalgia { background: #eee8df; color: #6c5a7d; }
.emotion-emoji { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: rgba(255,255,255,.7); font-size: 1.5rem; }
.emotion-button strong { display: block; color: currentColor; font-size: .95rem; }
.emotion-button small { display: block; margin-top: 2px; color: currentColor; opacity: .72; font-size: .7rem; }
.kind-note { margin: 15px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .78rem; text-align: center; }

.content-section { margin-top: 30px; }
.art-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(175px, 68%); gap: 13px; overflow-x: auto; padding: 3px 3px 14px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.art-strip::-webkit-scrollbar { display: none; }
.art-card { scroll-snap-align: start; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: #fff; box-shadow: var(--soft-shadow); text-align: left; padding: 0; }
.art-card canvas { display: block; width: 100%; aspect-ratio: 1.18; object-fit: cover; }
.art-card-info { display: flex; justify-content: space-between; gap: 8px; padding: 12px; }
.art-card-info strong { overflow: hidden; color: var(--purple-ink); text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.art-card-info span { flex: 0 0 auto; color: var(--muted); font-size: .7rem; }
.purpose-card { display: flex; gap: 13px; margin-top: 24px; padding: 18px; border-radius: 20px; background: var(--purple-ink); }
.purpose-card strong { color: #fff; }
.purpose-card p { margin: 4px 0 0; color: rgba(255,255,255,.7); font-size: .82rem; }
.purpose-mark { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--peach); color: var(--purple-dark); }

.bottom-nav {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: calc(69px + var(--safe-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: start;
    padding: 7px 7px var(--safe-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(18px);
}
.nav-item { display: grid; justify-items: center; gap: 3px; border: 0; background: transparent; color: #8a8191; font-size: .67rem; }
.nav-item svg { width: 23px; height: 23px; }
.nav-item.is-active { color: var(--purple); font-weight: 850; }
.create-nav { width: 52px; height: 52px; justify-self: center; transform: translateY(-18px); display: grid; place-items: center; border: 4px solid #f7f4fa; border-radius: 18px; background: var(--purple); color: #fff; box-shadow: 0 10px 24px rgba(109,77,154,.32); }
.create-nav svg { width: 25px; height: 25px; stroke-width: 2.2; }

.museum-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.summary-card { padding: 15px; border-radius: 18px; color: var(--ink); }
.summary-card strong { display: block; font-family: "Dela Gothic One", "Arial Black", sans-serif; font-size: 1.5rem; }
.summary-card span { font-size: .75rem; }
.summary-card.total { background: var(--purple-ink); color: #fff; }
.summary-card.streak { background: #ffe5b7; }
.museum-toolbar { margin: 0 -18px 18px; overflow: hidden; }
.filter-chips { display: flex; gap: 8px; padding: 2px 18px 8px; overflow-x: auto; scrollbar-width: none; }
.filter-chip { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; background: #fff; color: var(--muted); font-weight: 750; }
.filter-chip.is-active { border-color: var(--purple); background: var(--purple); color: #fff; }
.museum-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.museum-grid .art-card canvas { aspect-ratio: .95; }
.empty-state { grid-column: 1 / -1; padding: 36px 20px; border: 1.5px dashed #d7cde0; border-radius: 22px; background: rgba(255,255,255,.6); text-align: center; }
.empty-state span { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 18px; background: var(--purple-soft); color: var(--purple); font-size: 1.5rem; }
.empty-state h3 { margin-bottom: 7px; font-size: 1.05rem; }
.empty-state p { margin: 0; font-size: .82rem; }

.memory-controls { display: grid; gap: 10px; margin-bottom: 22px; }
.search-field { display: flex; align-items: center; gap: 8px; padding: 0 13px; }
.search-field svg { width: 20px; height: 20px; color: var(--muted); }
.search-field input { width: 100%; border: 0; padding: 12px 0; background: transparent; outline: none; }
.memory-controls select { min-height: 48px; }
.memory-group { margin-bottom: 26px; }
.memory-group h2 { margin-bottom: 12px; font-size: 1rem; }
.memory-list { display: grid; gap: 11px; }
.memory-item { display: grid; grid-template-columns: 78px 1fr auto; gap: 12px; align-items: center; width: 100%; border: 1px solid var(--line); border-radius: 17px; padding: 8px; background: #fff; text-align: left; }
.memory-item canvas { width: 78px; height: 68px; border-radius: 12px; }
.memory-item strong { display: block; overflow: hidden; color: var(--purple-ink); text-overflow: ellipsis; white-space: nowrap; }
.memory-item small { color: var(--muted); }
.memory-item .memory-arrow { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple); }

.app-dialog { width: 100%; max-width: 720px; height: 100%; max-height: none; margin: 0; border: 0; padding: 0; background: transparent; }
.app-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(22, 12, 37, .64); backdrop-filter: blur(4px); }
.app-dialog[open] { display: flex; margin-left: auto; }
.dialog-frame { width: 100%; min-height: 100%; display: flex; flex-direction: column; margin: 0; border: 0; padding: 0; background: #fbf9fc; }
.dialog-header { position: sticky; top: 0; z-index: 4; min-height: 68px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 9px; padding: 8px 13px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); }
.dialog-header > div { text-align: center; line-height: 1.1; }
.dialog-header .eyebrow { display: block; margin: 0 0 3px; font-size: .61rem; }
.dialog-header strong { color: var(--purple-ink); }
.dialog-progress-number { justify-self: center; color: var(--purple); font-weight: 850; font-size: .8rem; }
.progress-track { height: 4px; background: #ebe5f0; }
.progress-track span { display: block; width: 20%; height: 100%; background: var(--purple); transition: width .25s ease; }
.creation-body { flex: 1; padding: 25px 18px; overflow-y: auto; }
.creation-step { animation: view-in .25s ease both; }
.step-heading { margin-bottom: 22px; }
.step-heading h2 { margin: 3px 0 7px; font-size: clamp(1.55rem, 6vw, 2.2rem); }
.step-heading p { margin: 0; }
.step-kicker { color: var(--purple); font-size: .77rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.modal-emotions .emotion-button { min-height: 106px; flex-direction: column; justify-content: center; text-align: center; }
.step-error { display: block; min-height: 20px; margin-top: 8px; color: var(--danger); text-align: center; }
.intensity-card { padding: 27px 20px; border-radius: 25px; background: #fff; box-shadow: var(--soft-shadow); text-align: center; }
.intensity-emoji { width: 92px; height: 92px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 3rem; }
.intensity-card > strong { display: block; margin-bottom: 25px; color: var(--purple-dark); font-size: 1.2rem; }
.intensity-card input[type="range"] { width: 100%; accent-color: var(--purple); }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; }
.intensity-dots { display: flex; justify-content: space-between; padding: 15px 7px 0; }
.intensity-dots i { width: 8px; height: 8px; border-radius: 50%; background: #d6cedd; }
.element-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 11px; }
.element-grid button { min-height: 94px; display: grid; place-content: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); font-weight: 750; }
.element-grid button span { color: var(--purple); font-size: 1.6rem; }
.element-grid button.is-selected { border-color: var(--purple); background: var(--purple-soft); color: var(--purple-dark); }
.selection-count { margin-top: 15px; text-align: center; font-size: .8rem; }
.art-preview-card { overflow: hidden; border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.art-preview-card canvas, .success-step canvas, .detail-content > canvas { display: block; width: 100%; aspect-ratio: 1.18; background: #ddd; }
.art-caption { display: flex; justify-content: space-between; padding: 12px 14px; color: var(--muted); font-size: .78rem; }
.art-caption span:first-child { color: var(--purple-dark); font-weight: 850; }
.creation-step .field { margin-top: 18px; }
.success-step { padding-top: 8px; text-align: center; }
.success-symbol { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 24px; background: #ddf3e8; color: var(--success); font-size: 2rem; font-weight: 900; }
.success-step h2 { margin: 5px 0 8px; font-size: 1.7rem; }
.success-step p { max-width: 440px; margin: 0 auto 20px; }
.success-step canvas { border-radius: 23px; }
.dialog-actions { position: sticky; bottom: 0; z-index: 4; display: grid; grid-template-columns: 1fr 1.7fr; gap: 10px; padding: 12px 18px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); }
.dialog-actions .primary-button:only-child { grid-column: 1 / -1; }

.detail-dialog .dialog-frame { background: #fff; }
.detail-content { padding-bottom: 36px; }
.detail-content > canvas { max-height: 580px; object-fit: cover; }
.detail-title-row, .detail-note, .detail-elements, .visual-language, .education-panel, .support-note { margin-left: 18px; margin-right: 18px; }
.detail-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 20px; }
.detail-title-row h2 { margin: 3px 0 0; font-size: 1.4rem; }
.detail-title-row > div > span { color: var(--muted); font-size: .75rem; }
.intensity-pill { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); font-size: .73rem; font-weight: 850; }
.detail-note { margin-top: 13px; margin-bottom: 13px; white-space: pre-line; }
.detail-elements { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-elements span { padding: 6px 9px; border-radius: 999px; background: #f3f0f5; color: #62596a; font-size: .71rem; }
.visual-language, .education-panel { margin-top: 28px; padding-top: 23px; border-top: 1px solid var(--line); }
.language-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.language-grid > div { min-height: 96px; padding: 13px; border-radius: 16px; background: #f8f6fa; }
.language-grid span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.language-grid strong { color: var(--purple-ink); font-size: .8rem; }
.color-dots { display: flex; gap: 7px; }
.color-dots i { width: 19px; height: 19px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.education-cards { display: grid; gap: 10px; }
.education-card { padding: 16px; border-radius: 18px; background: #eef3fb; }
.education-card:nth-child(2) { background: #f4ecf6; }
.education-card strong { display: block; margin-bottom: 5px; color: var(--purple-dark); }
.education-card p { margin: 0; font-size: .82rem; }
.support-note { margin-top: 25px; padding: 13px; border-radius: 13px; background: #fff3dc; color: #76562a; font-size: .75rem; text-align: center; }

.profile-content { display: grid; gap: 17px; padding: 25px 18px 36px; }
.profile-identity { display: flex; align-items: center; gap: 14px; margin-bottom: 7px; padding: 17px; border-radius: 20px; background: var(--purple-ink); }
.profile-identity h2 { margin: 0 0 3px; color: #fff; font-size: 1.15rem; }
.profile-identity p { margin: 0; color: rgba(255,255,255,.68); font-size: .78rem; }
.large-avatar { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 20px; background: var(--peach); color: var(--purple-dark); font-weight: 950; font-size: 1.4rem; }

.confirm-dialog { width: min(92%, 410px); border: 0; border-radius: 24px; padding: 0; }
.confirm-card { padding: 25px; text-align: center; }
.confirm-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 18px; background: #fbedf1; color: var(--danger); font-weight: 900; font-size: 1.4rem; }
.confirm-card h2 { margin-bottom: 7px; font-size: 1.2rem; }
.confirm-card p { font-size: .83rem; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 19px; }

.toast-region { position: fixed; z-index: 1000; left: 50%; bottom: calc(86px + var(--safe-bottom)); width: min(calc(100% - 30px), 430px); transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; padding: 13px 15px; border-radius: 14px; background: var(--purple-ink); color: #fff; box-shadow: var(--shadow); animation: toast-in .25s ease both; }
.toast.error { background: #79253b; }
.toast.success::before { content: "✓"; color: #8ee3ba; font-weight: 900; }
.toast.error::before { content: "!"; color: #ffc3cf; font-weight: 900; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

.setup-page { min-height: 100svh; background: linear-gradient(145deg, #24104c, #6d4d9a 65%, #325fa5); }
.setup-shell { min-height: 100svh; display: grid; place-items: center; padding: 30px 18px; }
.setup-card { width: min(100%, 520px); padding: 26px; border-radius: 28px; background: var(--cream); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.setup-logo { width: 108px; margin-bottom: 14px; }
.setup-card h1 { margin-bottom: 8px; font-size: 1.8rem; }
.setup-copy { margin-bottom: 23px; }
.alert { margin-bottom: 17px; padding: 12px 14px; border-radius: 12px; font-size: .82rem; }
.alert-error { background: #fbedf1; color: var(--danger); }

@media (min-width: 720px) {
    .auth-layout { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(420px,.85fr); }
    .auth-visual { min-height: 100svh; padding: 64px; }
    .auth-panel { padding: 50px; }
    .app-content { padding: 35px 28px 54px; }
    .checkin-card { padding: 28px; }
    .emotion-grid { grid-template-columns: repeat(4, 1fr); }
    .emotion-button { flex-direction: column; justify-content: center; text-align: center; }
    .art-strip { grid-auto-columns: 235px; }
    .museum-summary { grid-template-columns: repeat(4,1fr); }
    .museum-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .memory-controls { grid-template-columns: 1fr 200px; }
    .element-grid { grid-template-columns: repeat(3,1fr); }
    .app-dialog { height: calc(100% - 36px); max-height: calc(100% - 36px); margin: 18px 18px 18px auto; border-radius: 28px; }
    .app-dialog[open] { overflow: hidden; }
    .dialog-frame { min-height: 100%; border-radius: 28px; overflow: hidden; }
    .creation-body { padding: 32px 38px; }
    .profile-content { padding: 32px 38px; }
    .bottom-nav { left: 50%; right: auto; bottom: 16px; width: min(94%, 640px); transform: translateX(-50%); border: 1px solid var(--line); border-radius: 22px; padding: 9px; box-shadow: var(--shadow); }
    .app-shell { padding-bottom: 112px; }
}

@media (min-width: 1040px) {
    .museum-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
    .checkin-card .emotion-button { min-height: 126px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
