@font-face {
    font-family: "Cormorant Garamond";
    src: url("assets/cormorant-regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Cormorant Garamond";
    src: url("assets/cormorant-italic.woff2") format("woff2");
    font-style: italic;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "DM Sans";
    src: url("assets/dm-sans.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
}

:root {
    color-scheme: light;
    --paper: #faf7f2;
    --card: #fffdf9;
    --ink: #4d3739;
    --rose: #986071;
    --rose-deep: #7a4859;
    --rose-soft: #b77e8c;
    --blush: #f4e9e6;
    --blush-strong: #ecd9d6;
    --muted: #84736c;
    --line: #e9dfd6;
    --cream: #f8edda;
    --rob: #5f8584;
    --jacky: #b0697f;
    --shadow: 0 1px 2px rgb(77 55 57 / 4%), 0 8px 24px -12px rgb(77 55 57 / 16%);
    --shadow-lift: 0 2px 4px rgb(77 55 57 / 5%), 0 18px 40px -16px rgb(77 55 57 / 26%);
    --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
    --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif, var(--emoji);
    --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif, var(--emoji);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 300px;
    min-height: 100vh;
    background:
        radial-gradient(60rem 36rem at 12% -8%, rgb(244 221 221 / 55%), transparent 70%),
        radial-gradient(50rem 32rem at 100% 8%, rgb(227 236 220 / 60%), transparent 70%),
        var(--paper);
    background-attachment: fixed;
}

[hidden] {
    display: none !important;
}

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

button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 3px;
}

svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.sprite {
    display: none;
}

#i-flower .petals,
.petals {
    fill: var(--rose-soft);
    stroke: none;
}

#i-flower .pistil,
.pistil {
    fill: var(--cream);
    stroke: none;
}

#i-dice .dot,
.dot {
    fill: currentColor;
    stroke: none;
}

.screen-reader-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 0 14px;
    color: var(--rose);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2.4px;
    text-transform: uppercase;
}

.eyebrow span {
    width: 26px;
    height: 1px;
    background: #d9b9bc;
}

h1,
h2,
h3 {
    font-family: var(--serif);
    font-weight: 500;
    letter-spacing: -0.02em;
}

h1 em,
h2 em {
    color: var(--rose);
}

/* ---------- Buttons ---------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 11px 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1px;
    white-space: nowrap;
    transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button:active {
    transform: scale(0.97);
}

.button-primary {
    background: var(--rose);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgb(122 72 89 / 80%);
}

.button-primary:hover {
    background: var(--rose-deep);
}

.button-primary:disabled {
    opacity: 0.6;
    cursor: progress;
}

.button-soft {
    border-color: #e2cbcb;
    background: var(--blush);
    color: var(--rose-deep);
}

.button-soft:hover {
    background: var(--blush-strong);
}

.button-ghost {
    background: transparent;
    color: var(--muted);
}

.button-ghost:hover {
    background: rgb(77 55 57 / 5%);
    color: var(--ink);
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
    background: rgb(77 55 57 / 6%);
    color: var(--ink);
}

.icon-button:active {
    transform: scale(0.92);
}

/* ---------- Lock screen ---------- */

.lock {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px;
}

.lock-card {
    width: min(100%, 360px);
    text-align: center;
    animation: rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.lock-flower {
    width: 54px;
    height: 54px;
    margin-bottom: 18px;
    animation: bloom 6s ease-in-out infinite;
}

.lock-title {
    margin: 0;
    font-size: 52px;
    line-height: 1;
}

.lock-title em {
    font-style: italic;
}

.lock-hint {
    min-height: 22px;
    margin: 14px 0 26px;
    color: var(--muted);
    font-size: 14px;
    transition: color 200ms ease;
}

.lock-hint.is-error {
    color: var(--rose-deep);
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 34px;
}

.pin-dots span {
    width: 14px;
    height: 14px;
    border: 1.5px solid #cfaab2;
    border-radius: 50%;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.pin-dots span.is-filled {
    border-color: var(--rose);
    background: var(--rose);
    transform: scale(1.12);
}

.pin-dots.is-shaking {
    animation: shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.pin-dots.is-success span {
    border-color: var(--rob);
    background: var(--rob);
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 72px);
    justify-content: center;
    gap: 16px 26px;
}

.keypad button {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgb(255 253 249 / 80%);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 30px;
    font-variant-numeric: lining-nums;
    box-shadow: 0 1px 2px rgb(77 55 57 / 4%);
    transition: background 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.keypad button:hover {
    border-color: #dcc4c4;
    background: #fff;
}

.keypad button:active,
.keypad button.is-pressed {
    background: var(--blush-strong);
    transform: scale(0.94);
}

.keypad .keypad-back {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
}

.keypad .keypad-back svg {
    width: 24px;
    height: 24px;
}

.keypad:has(button:disabled) {
    opacity: 0.45;
}

/* ---------- App shell ---------- */

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    animation: fade 500ms ease both;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 20px 24px 0;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--serif);
    font-size: 25px;
    font-weight: 500;
    letter-spacing: -0.4px;
    white-space: nowrap;
}

.wordmark svg {
    width: 28px;
    height: 28px;
}

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

.me-switch {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgb(255 253 249 / 75%);
}

.me-switch button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px 6px 7px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    transition: background 160ms ease, color 160ms ease;
}

.me-switch button[aria-pressed="true"] {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 3px rgb(77 55 57 / 12%);
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--person, var(--rose));
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    flex: none;
}

[data-person="Rob"] {
    --person: var(--rob);
}

[data-person="Jacky"] {
    --person: var(--jacky);
}

.hero {
    padding: 54px 24px 40px;
    text-align: center;
}

.hero h1 {
    margin: 0;
    font-size: clamp(42px, 6.4vw, 72px);
    line-height: 1.02;
}

.hero h1 em {
    font-style: italic;
}

.hero-note {
    margin: 16px auto 0;
    max-width: 440px;
    color: var(--muted);
    font-size: 15px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

/* ---------- Board ---------- */

.board {
    flex: 1;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px 64px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgb(77 55 57 / 5%);
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    transition: background 160ms ease, color 160ms ease;
}

.tab[aria-selected="true"] {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 3px rgb(77 55 57 / 12%);
}

.count {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgb(77 55 57 / 7%);
    font-size: 12px;
    text-align: center;
}

.tab[aria-selected="true"] .count {
    background: var(--blush);
    color: var(--rose-deep);
}

.toolbar-tools {
    display: flex;
    gap: 10px;
}

.search,
.select {
    position: relative;
    display: flex;
    align-items: center;
}

.search svg {
    position: absolute;
    left: 13px;
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
}

.search input,
.select select {
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgb(255 253 249 / 85%);
    font-size: 14px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search input {
    width: 190px;
    padding: 0 14px 0 36px;
}

.select select {
    padding: 0 34px 0 14px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2384736c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px;
    cursor: pointer;
}

.search input:focus,
.select select:focus {
    border-color: #d5b1b8;
    outline: none;
    box-shadow: 0 0 0 3px rgb(152 96 113 / 14%);
}

.filters {
    display: flex;
    gap: 8px;
    margin: 18px -24px 24px;
    padding: 2px 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filters::-webkit-scrollbar {
    display: none;
}

.filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgb(255 253 249 / 70%);
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.filter:hover {
    border-color: #dcc7c3;
    color: var(--ink);
}

.filter[aria-pressed="true"] {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.filter .emoji {
    font-size: 14px;
}

/* ---------- Cards ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 18px;
}

.card {
    --tint: #efe9e2;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 20px 20px 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card);
    box-shadow: var(--shadow);
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.card.is-entering {
    animation: rise 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 35ms);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
}

.card[data-category="food"] { --tint: #f7e4d7; }
.card[data-category="outdoors"] { --tint: #e2ecdb; }
.card[data-category="culture"] { --tint: #e9e1f2; }
.card[data-category="cozy"] { --tint: #f6e8cf; }
.card[data-category="adventure"] { --tint: #dde9f0; }
.card[data-category="getaway"] { --tint: #f4dde3; }

.card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-emoji {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: var(--tint);
    font-size: 20px;
    line-height: 1;
}

.card-kind {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.4px;
}

.card-budget {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.card-budget .faded {
    opacity: 0.28;
}

.card-title {
    margin: 4px 0 0;
    font-size: 25px;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.card-notes {
    margin: 0;
    color: #6e5c58;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    max-width: 100%;
    padding: 4px 10px 4px 9px;
    border-radius: 999px;
    background: var(--tint);
    color: var(--ink);
    font-size: 12.5px;
    text-decoration: none;
    transition: filter 160ms ease;
}

.card-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-link:hover {
    filter: brightness(0.96);
}

.card-link svg {
    width: 13px;
    height: 13px;
}

.card-ribbon {
    position: absolute;
    top: -10px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    background: var(--rose);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    box-shadow: 0 6px 14px -6px rgb(122 72 89 / 70%);
}

.card-ribbon svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    stroke: none;
}

.card-done {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    color: var(--rob);
    font-size: 12.5px;
    font-weight: 500;
}

.card-done svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.2;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.card-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-size: 12.5px;
}

.card-meta .avatar {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

.card-meta span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.card-actions .icon-button {
    width: 36px;
    height: 36px;
}

.card-actions .icon-button svg {
    width: 17px;
    height: 17px;
}

.love {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 10px 0 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.love:hover {
    border-color: #dfbcc4;
    color: var(--rose);
}

.love svg {
    width: 16px;
    height: 16px;
    transition: transform 200ms cubic-bezier(0.3, 1.6, 0.5, 1);
}

.love[aria-pressed="true"] {
    border-color: #ecc9d1;
    background: #fbeef1;
    color: var(--rose-deep);
}

.love[aria-pressed="true"] svg {
    fill: var(--jacky);
    stroke: var(--jacky);
}

.love.is-popping svg {
    animation: pop 420ms cubic-bezier(0.3, 1.6, 0.5, 1);
}

.love-who {
    display: inline-flex;
}

.love-who .avatar {
    width: 18px;
    height: 18px;
    margin-left: -5px;
    border: 1.5px solid var(--card);
    font-size: 9px;
}

.love-who .avatar:first-child {
    margin-left: 0;
}

.icon-button.is-confirming {
    width: auto;
    padding: 0 12px;
    border-radius: 999px;
    background: #fbe9ea;
    color: #a2424f;
    font-size: 12.5px;
    font-weight: 500;
}

.icon-button.done-button:hover {
    background: #e6efe9;
    color: var(--rob);
}

.card.is-memory {
    background:
        linear-gradient(var(--card), var(--card)) padding-box,
        linear-gradient(135deg, #e9dfd6, #f0dfe2) border-box;
}

.card.is-memory .card-title {
    color: #5d4648;
}

.card.is-leaving {
    animation: leave 260ms ease forwards;
}

/* ---------- Empty state ---------- */

.empty {
    padding: 56px 24px;
    text-align: center;
}

.empty svg {
    width: 46px;
    height: 46px;
    opacity: 0.8;
}

.empty-title {
    margin: 14px 0 6px;
    font-family: var(--serif);
    font-size: 28px;
    font-style: italic;
}

.empty-text {
    margin: 0;
    color: var(--muted);
}

.footer {
    padding: 0 24px 40px;
    color: #b3a39b;
    font-family: var(--serif);
    font-size: 17px;
    font-style: italic;
    text-align: center;
}

/* ---------- Dialogs ---------- */

.sheet {
    width: min(100% - 32px, 540px);
    max-height: min(100% - 32px, 760px);
    padding: 0;
    border: 0;
    border-radius: 28px;
    background: var(--card);
    color: var(--ink);
    box-shadow: 0 30px 80px -24px rgb(61 36 42 / 45%);
}

.sheet[open] {
    animation: rise 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.sheet::backdrop {
    background: rgb(74 46 52 / 32%);
    backdrop-filter: blur(4px);
}

.sheet[open]::backdrop {
    animation: fade 240ms ease both;
}

.sheet-small {
    width: min(100% - 32px, 420px);
}

.sheet form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 26px 28px 24px;
}

.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: -4px;
}

.sheet h2 {
    margin: 0;
    font-size: 32px;
    font-style: italic;
    line-height: 1.1;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.field-label {
    padding: 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
}

.optional {
    margin-left: 4px;
    color: #ae9d95;
    font-weight: 400;
}

.field input,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    font-size: 15px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field textarea {
    min-height: 84px;
    resize: vertical;
    line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #bfb0a9;
}

.field input:focus,
.field textarea:focus {
    border-color: #d5b1b8;
    outline: none;
    box-shadow: 0 0 0 3px rgb(152 96 113 / 14%);
}

.field input[aria-invalid="true"] {
    border-color: #d18f9b;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.chip:hover {
    border-color: #dcc7c3;
    color: var(--ink);
}

.chip input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.chip:has(input:focus-visible) {
    outline: 2px solid var(--rose);
    outline-offset: 2px;
}

.chip:has(input:checked),
.chip[aria-pressed="true"] {
    border-color: var(--rose);
    background: #fbeef1;
    color: var(--rose-deep);
    font-weight: 500;
}

.field input[type="date"] {
    min-height: 48px;
    appearance: none;
    -webkit-appearance: none;
    text-align: left;
}

.field input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

.done-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 16px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    transition: background 180ms ease, border-color 180ms ease;
}

.done-box:has(input[name="done"]:checked) {
    border-style: solid;
    border-color: #cfe0dc;
    background: #f2f7f5;
}

.switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.switch-track {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #e5d9d3;
    flex: none;
    transition: background 180ms ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgb(61 36 42 / 25%);
    transition: transform 180ms cubic-bezier(0.3, 1.3, 0.5, 1);
}

.switch input:checked + .switch-track {
    background: var(--rob);
}

.switch input:checked + .switch-track::after {
    transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
    outline: 2px solid var(--rose);
    outline-offset: 2px;
}

.done-idea {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -6px 0 0;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 20px;
    font-style: italic;
    line-height: 1.25;
}

.done-idea span:first-child {
    font-style: normal;
}

.form-error {
    min-height: 0;
    margin: -6px 0 0;
    color: #a2424f;
    font-size: 13px;
}

.form-error:empty {
    display: none;
}

.sheet-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.who,
.surprise {
    padding: 34px 28px 26px;
    text-align: center;
}

.who-flower {
    width: 44px;
    height: 44px;
}

.who h2 {
    margin-top: 10px;
}

.who p {
    margin: 8px 0 24px;
    color: var(--muted);
}

.who-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.who-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    font-family: var(--serif);
    font-size: 24px;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.who-option:hover {
    border-color: var(--person);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.who-option .avatar {
    width: 48px;
    height: 48px;
    font-family: var(--sans);
    font-size: 20px;
}

.surprise-emoji {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    margin: 22px auto 18px;
    border-radius: 28px;
    background: var(--blush);
    font-size: 42px;
    line-height: 1;
}

.surprise h2 {
    min-height: 2.2em;
    font-size: 34px;
}

.surprise.is-shuffling h2,
.surprise.is-shuffling .surprise-emoji {
    opacity: 0.55;
    filter: blur(0.4px);
}

.surprise.is-landed .surprise-emoji {
    animation: pop 520ms cubic-bezier(0.3, 1.6, 0.5, 1);
}

.surprise-notes {
    margin: 10px 0 0;
    color: var(--muted);
    white-space: pre-line;
}

.surprise-notes:empty {
    display: none;
}

.surprise .sheet-actions {
    justify-content: center;
    margin-top: 26px;
}

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    inset: auto auto calc(24px + env(safe-area-inset-bottom)) 50%;
    z-index: 10;
    max-width: calc(100% - 32px);
    margin: 0;
    padding: 11px 18px;
    overflow: visible;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 14px 34px -14px rgb(61 36 42 / 70%);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Motion ---------- */

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

@keyframes fade {
    from {
        opacity: 0;
    }
}

@keyframes leave {
    to {
        opacity: 0;
        transform: scale(0.96);
    }
}

@keyframes pop {
    40% {
        transform: scale(1.35);
    }
}

@keyframes bloom {
    50% {
        transform: rotate(18deg) scale(1.05);
    }
}

@keyframes shake {
    15%, 85% { transform: translateX(-2px); }
    30%, 70% { transform: translateX(5px); }
    45%, 55% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
}

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

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
    .topbar {
        gap: 8px;
        padding: 14px 12px 0 16px;
    }

    .wordmark {
        gap: 8px;
        font-size: 21px;
    }

    .wordmark svg {
        width: 22px;
        height: 22px;
    }

    .topbar-actions {
        gap: 2px;
    }

    .me-switch button {
        gap: 6px;
        padding: 4px 9px 4px 4px;
        font-size: 12.5px;
    }

    .me-switch .avatar {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .hero {
        padding: 38px 18px 30px;
    }

    .hero-actions .button {
        flex: 1;
        max-width: 220px;
        padding: 11px 16px;
    }

    .board {
        padding: 0 16px 48px;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .tab {
        justify-content: center;
    }

    .toolbar-tools {
        width: 100%;
    }

    .search {
        flex: 1;
    }

    .search input {
        width: 100%;
    }

    .filters {
        margin: 14px -16px 18px;
        padding: 2px 16px;
    }

    .grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .sheet {
        width: 100%;
        max-width: none;
        max-height: calc(100% - 24px);
        margin: auto 0 0;
        border-radius: 26px 26px 0 0;
    }

    .sheet[open] {
        animation: slide-up 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    }

    .sheet form {
        padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
    }

    .sheet-actions .button {
        flex: 1;
    }

    .who,
    .surprise {
        padding-bottom: calc(26px + env(safe-area-inset-bottom));
    }

    .keypad {
        grid-template-columns: repeat(3, 68px);
        gap: 14px 24px;
    }

    .keypad button {
        width: 68px;
        height: 68px;
    }
}

@media (max-width: 370px) {
    .wordmark {
        gap: 0;
        font-size: 0;
    }
}

@keyframes slide-up {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
}
