:root {
    color-scheme: light;
    --bg: #fff6f8;
    --surface: #ffffff;
    --surface-soft: #fff1f5;
    --surface-glass: rgba(255, 255, 255, 0.72);
    --ink: #392126;
    --muted: #73545b;
    --line: rgba(215, 95, 131, 0.18);
    --accent: #c84f74;
    --accent-soft: #ffe4eb;
    --primary: #d75f83;
    --primary-deep: #9f3659;
    --primary-soft: #ffdbe5;
    --warm: #c84f74;
    --warm-soft: #fff0f4;
    --amber: #a84462;
    --danger: #b91c1c;
    --focus: #d75f83;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --radius-ios: 18px;
    --radius-ios-lg: 24px;
    --shadow: 0 18px 44px rgba(121, 48, 70, 0.1);
    --shadow-soft: 0 8px 22px rgba(121, 48, 70, 0.07);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% -10%, rgba(255, 221, 230, 0.72), transparent 34%),
        linear-gradient(180deg, #fff8fa 0%, #fff3f6 46%, #fff8fa 100%);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    background: rgba(255, 255, 255, 0.88);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 24px;
    backdrop-filter: blur(16px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    color: var(--ink);
    font-size: 21px;
    font-weight: 900;
}

.brand span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    color: transparent;
    background: var(--primary);
    box-shadow: 0 0 0 7px rgba(215, 95, 131, 0.14);
}

nav {
    display: grid;
    gap: 8px;
}

nav a,
.logout,
.button,
.ghost {
    min-height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid transparent;
    font-weight: 800;
}

nav a {
    gap: 9px;
    justify-content: flex-start;
    color: var(--muted);
}

nav a svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

nav a span {
    min-width: 0;
}

.secondary-tab {
    display: inline-flex;
}

nav a:hover,
nav a.active {
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink);
    border-color: var(--line);
    box-shadow: var(--shadow-soft);
}

nav a.active {
    color: var(--primary-deep);
}

.logout {
    margin-top: auto;
    color: var(--danger);
}

.content {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px;
    display: grid;
    align-content: start;
    gap: 16px;
}

.auth-panel {
    min-height: calc(100vh - 64px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    align-items: center;
    gap: 48px;
}

.auth-panel h1,
.page-title h1,
.hero h1 {
    margin: 0;
    font-size: 44px;
    line-height: 1.08;
    letter-spacing: 0;
}

.auth-panel p,
.page-title p,
.hero p,
.card p {
    color: var(--muted);
    line-height: 1.7;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--primary-deep);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.page-title {
    display: grid;
    gap: 8px;
    padding: 4px 2px;
}

.message-title {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.message-appbar {
    min-height: 46px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    align-items: center;
    gap: 10px;
    margin: -6px 0 2px;
    padding: 0;
}

.message-appbar .round-add {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}

.top-menu-button {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(215, 95, 131, 0.18);
    border-radius: 14px;
    color: var(--primary-deep);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 10px 22px rgba(121, 48, 70, 0.1);
    cursor: pointer;
}

.top-menu-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.top-menu-button:hover,
.top-menu-button:focus-visible {
    color: #8e294b;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 12px 26px rgba(121, 48, 70, 0.14);
}

.top-menu-button:focus-visible {
    outline: 3px solid rgba(215, 95, 131, 0.22);
    outline-offset: 3px;
}

.countdown-appbar .countdown-add {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}

.contacts-appbar .contact-add {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}

.message-appbar > strong {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
}

.message-appbar > span {
    grid-column: 1;
    grid-row: 1;
}

.appbar-hint {
    margin: -4px 2px 4px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.page-title p {
    margin: 0;
}

.round-add {
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: var(--primary-deep);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(215, 95, 131, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 10px 22px rgba(121, 48, 70, 0.1);
    transition: transform 180ms var(--ease-out), background 180ms var(--ease-out), color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.round-add svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.round-add:hover,
.round-add:focus-visible {
    color: #8e294b;
    background: #fff;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 12px 26px rgba(121, 48, 70, 0.14);
}

.round-add:focus-visible {
    outline: 3px solid rgba(215, 95, 131, 0.22);
    outline-offset: 3px;
}

.round-add:active {
    transform: scale(0.96);
    background: var(--primary-soft);
}

.message-rule-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    margin-top: -2px;
    scrollbar-width: none;
}

.message-rule-list::-webkit-scrollbar {
    display: none;
}

.message-rule {
    min-width: 138px;
    min-height: 58px;
    display: grid;
    align-content: center;
    gap: 2px;
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid rgba(215, 95, 131, 0.14);
    border-radius: 18px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 8px 20px rgba(121, 48, 70, 0.06);
    transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out), background 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.message-rule:hover,
.message-rule:focus-visible {
    border-color: rgba(200, 79, 116, 0.28);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 24px rgba(121, 48, 70, 0.1);
    transform: translateY(-1px);
}

.message-rule:focus-visible {
    outline: 3px solid rgba(215, 95, 131, 0.18);
    outline-offset: 2px;
}

.message-rule:active {
    transform: scale(0.98);
}

.message-rule strong {
    font-size: 16px;
    color: var(--primary-deep);
}

.message-rule span {
    max-width: 112px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-rule.active {
    border-color: rgba(200, 79, 116, 0.34);
    background: rgba(255, 232, 239, 0.92);
    box-shadow: 0 10px 24px rgba(200, 79, 116, 0.12);
}

.message-form-actions {
    display: grid;
    grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.message-form-actions .primary {
    width: 100%;
}

.message-form-actions.single {
    grid-template-columns: 1fr;
}

.danger-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid rgba(185, 28, 28, 0.16);
    border-radius: 14px;
    background: rgba(255, 241, 242, 0.9);
    color: var(--danger);
    font-weight: 900;
    cursor: pointer;
}

.home-topbar {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(232, 136, 160, 0.26);
    border-radius: var(--radius-ios-lg);
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 214, 225, 0.88), transparent 48%),
        linear-gradient(135deg, #fff9fb 0%, #ffe9f0 52%, #fff7f9 100%);
    box-shadow: 0 14px 34px rgba(121, 48, 70, 0.1);
}

.home-appbar {
    min-height: 42px;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 8px;
}

.home-appbar > strong {
    justify-self: center;
    color: #5a2635;
    font-size: 18px;
    line-height: 1;
}

.home-greeting {
    display: grid;
    gap: 7px;
}

.home-greeting h1 {
    margin: 0;
    color: #392126;
    font-size: 31px;
    line-height: 1.12;
    letter-spacing: 0;
}

.home-greeting p {
    margin: 0;
    color: #73545b;
    line-height: 1.65;
}

.home-menu-button {
    width: 44px;
    height: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(199, 76, 113, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.66);
    color: var(--primary-deep);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 8px 18px rgba(199, 76, 113, 0.1);
}

.home-menu-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.home-menu-toggle {
    position: fixed;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.app-menu-toggle {
    position: fixed;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.home-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 31;
    background: rgba(15, 23, 42, 0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s var(--ease-out), background 0.28s var(--ease-out);
}

.app-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 31;
    background: rgba(15, 23, 42, 0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s var(--ease-out), background 0.28s var(--ease-out);
}

.home-menu-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 32;
    width: min(84vw, 322px);
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 249, 251, 0.92);
    box-shadow: 18px 0 38px rgba(90, 38, 53, 0.16);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    overflow-y: auto;
    transform: translateX(-106%);
    transition: transform 0.34s var(--ease-out);
}

.app-menu-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 32;
    width: min(84vw, 322px);
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 249, 251, 0.92);
    box-shadow: 18px 0 38px rgba(90, 38, 53, 0.16);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    overflow-y: auto;
    transform: translateX(-106%);
    transition: transform 0.34s var(--ease-out);
}

.home-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.home-menu-head strong {
    color: var(--ink);
    font-size: 18px;
}

.home-menu-head label {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid rgba(199, 76, 113, 0.22);
    border-radius: 14px;
    background: rgba(255, 240, 244, 0.8);
    color: var(--amber);
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.home-menu-toggle:checked ~ .home-menu-backdrop {
    background: rgba(15, 23, 42, 0.2);
    opacity: 1;
    pointer-events: auto;
}

.app-menu-toggle:checked ~ .app-menu-backdrop {
    background: rgba(15, 23, 42, 0.2);
    opacity: 1;
    pointer-events: auto;
}

.home-menu-toggle:checked ~ .home-menu-drawer {
    transform: translateX(0);
}

.app-menu-toggle:checked ~ .app-menu-drawer {
    transform: translateX(0);
}

.hero,
.heartbeat-card,
.status-hero,
.card,
.metric {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: var(--radius-ios-lg);
    box-shadow: var(--shadow-soft);
}

.status-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: center;
    overflow: hidden;
    padding: 22px;
    background:
        radial-gradient(circle at 82% 48%, rgba(185, 225, 255, 0.34), transparent 34%),
        linear-gradient(135deg, #fffafd 0%, #ffedf3 62%, #fff9fb 100%);
    border-color: rgba(255, 255, 255, 0.76);
}

.status-copy {
    display: grid;
    gap: 8px;
}

.status-copy p,
.status-copy span {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.status-copy strong {
    font-size: 24px;
    line-height: 1.2;
    color: #5a2635;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 30px;
}

.heartbeat-card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 32px 22px 26px;
    overflow: hidden;
}

.heartbeat-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    text-align: center;
}

.heartbeat-form {
    position: relative;
    width: min(70vw, 286px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    justify-self: center;
}

.heartbeat-form::before,
.heartbeat-form::after {
    content: "";
    position: absolute;
    inset: 10% 8%;
    border-radius: 999px;
    border: 1px solid rgba(232, 136, 160, 0.38);
    background: rgba(255, 214, 225, 0.34);
    box-shadow: 0 0 34px rgba(199, 76, 113, 0.16);
    animation: heartbeat-wave 5.6s var(--ease-out) infinite;
}

.heartbeat-form::after {
    display: block;
    inset: 5%;
    border-radius: 999px;
    border: 1px solid rgba(226, 64, 104, 0.34);
    background:
        radial-gradient(circle, rgba(226, 64, 104, 0.2), rgba(226, 64, 104, 0.08) 44%, transparent 66%);
    box-shadow:
        0 0 24px rgba(226, 64, 104, 0.22),
        inset 0 0 28px rgba(226, 64, 104, 0.12);
    animation: heartbeat-wave 4.8s var(--ease-out) infinite;
}

.heartbeat-form::before {
    inset: 8%;
    border-radius: 999px;
    border: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 159, 193, 0.32), transparent 56%),
        radial-gradient(circle at 76% 76%, rgba(154, 216, 255, 0.34), transparent 36%),
        radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.72), transparent 22%);
    filter: blur(10px);
    opacity: 0.92;
    animation: heartbeat-glow 5.8s var(--ease-out) infinite;
}

.heartbeat-orb {
    position: relative;
    z-index: 1;
    width: 82%;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    padding: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 22% 17%, rgba(255, 255, 255, 0.9), transparent 0 6%, transparent 12%),
        radial-gradient(circle at 52% 45%, rgba(255, 120, 174, 0.78), transparent 0 43%, transparent 58%),
        radial-gradient(circle at 73% 76%, rgba(123, 207, 255, 0.58), transparent 0 28%, transparent 47%),
        radial-gradient(circle at 22% 78%, rgba(224, 251, 255, 0.62), transparent 0 24%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(255, 219, 232, 0.94), rgba(255, 188, 213, 0.82) 44%, rgba(215, 236, 255, 0.78) 76%, rgba(255, 255, 255, 0.86) 100%);
    box-shadow:
        0 20px 44px rgba(199, 76, 113, 0.16),
        0 0 36px rgba(157, 219, 255, 0.36),
        inset 18px 20px 38px rgba(255, 255, 255, 0.44),
        inset -18px -20px 42px rgba(119, 197, 255, 0.24);
    cursor: pointer;
    text-align: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: transform 0.22s var(--ease-out), border-color 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
}

.heartbeat-orb:hover,
.heartbeat-orb:focus-visible {
    transform: translateY(-2px) scale(1.01);
    box-shadow:
        0 24px 52px rgba(199, 76, 113, 0.18),
        0 0 42px rgba(157, 219, 255, 0.42),
        inset 18px 20px 38px rgba(255, 255, 255, 0.46),
        inset -18px -20px 42px rgba(119, 197, 255, 0.25);
}

.heartbeat-orb strong {
    color: rgba(255, 255, 255, 0.96);
    font-size: clamp(34px, 8vw, 50px);
    line-height: 1;
    text-shadow: 0 2px 12px rgba(117, 35, 60, 0.16);
}

.heartbeat-orb em {
    color: rgba(255, 255, 255, 0.92);
    font-style: normal;
    font-size: clamp(16px, 4vw, 24px);
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(117, 35, 60, 0.14);
}

.orb-label,
.orb-action {
    font-size: 13px;
    font-weight: 900;
    opacity: 0.92;
}

.orb-action {
    margin-top: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.orb-label {
    color: rgba(255, 255, 255, 0.88);
}

.heartbeat-hint {
    color: var(--primary-deep);
    font-weight: 900;
}

.warm-tip {
    margin: -6px 2px 0;
    padding: 0 2px;
    color: #73545b;
    font-size: 14px;
    line-height: 1.65;
}

@keyframes heartbeat-wave {
    0% {
        transform: scale(0.74);
        opacity: 0.58;
    }

    18% {
        opacity: 0.36;
    }

    70%,
    100% {
        transform: scale(1.36);
        opacity: 0;
    }
}

@keyframes heartbeat-glow {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.035);
    }

    28% {
        transform: scale(0.995);
    }

    42% {
        transform: scale(1.025);
    }

    70%,
    100% {
        transform: scale(1);
    }
}

.card,
.metric {
    padding: 20px;
}

.card h2 {
    margin: 0 0 14px;
    font-size: 21px;
    line-height: 1.2;
}

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

.status-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.metric {
    display: grid;
    gap: 8px;
}

.metric span {
    color: var(--muted);
    font-size: 14px;
}

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

.split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: start;
}

.vault-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 16px;
    align-items: start;
}

.vault-upload-card,
.vault-list-card {
    border-radius: var(--radius-ios-lg);
}

.vault-file-input {
    min-height: 48px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 7px;
    border: 1px solid rgba(215, 95, 131, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    cursor: pointer;
}

.vault-file-input input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.vault-file-input > span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 13px;
    font-weight: 900;
}

.vault-file-input strong {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.vault-file-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border: 1px solid rgba(215, 95, 131, 0.12);
    border-radius: 18px;
    background: rgba(255, 248, 250, 0.72);
}

.vault-file-item > div:first-child {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.vault-file-item strong,
.vault-file-item span,
.vault-file-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-file-item strong {
    color: var(--ink);
}

.vault-file-item span,
.vault-file-item small {
    color: var(--muted);
    font-size: 12px;
}

.vault-file-actions {
    display: inline-flex;
    gap: 7px;
    align-items: center;
}

.vault-file-actions form {
    margin: 0;
}

.vault-empty {
    min-height: 112px;
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 20px;
    border: 1px dashed rgba(215, 95, 131, 0.22);
    border-radius: 20px;
    background: rgba(255, 248, 250, 0.62);
    text-align: center;
}

.vault-empty strong {
    color: var(--ink);
}

.vault-empty span {
    max-width: 260px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

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

.form {
    display: grid;
    gap: 15px;
}

.auth-form {
    gap: 13px;
    padding: 22px;
}

.auth-form label {
    gap: 7px;
}

.form.wide {
    max-width: 860px;
}

label {
    display: grid;
    gap: 8px;
    color: #6f4653;
    font-size: 13px;
    font-weight: 800;
}

.check {
    grid-template-columns: auto 1fr;
    align-items: center;
    color: var(--ink);
}

.privacy-consent {
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
}

.auth-form .privacy-consent {
    margin: 2px 0 0;
}

.privacy-policy {
    display: grid;
    gap: 16px;
    max-width: 860px;
}

.privacy-policy .card {
    padding: 22px;
}

.privacy-policy h2 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: 20px;
}

.privacy-policy p,
.privacy-policy li {
    color: var(--muted);
    line-height: 1.8;
}

.privacy-policy ul {
    margin: 0;
    padding-left: 20px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.84);
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:disabled,
textarea:disabled,
select:disabled {
    cursor: not-allowed;
    color: #9f7580;
    background: rgba(255, 244, 247, 0.82);
    border-color: rgba(232, 136, 160, 0.26);
}

.form-note {
    margin: -8px 0 2px;
    font-size: 12px;
    line-height: 1.55;
}

.realname-panel {
    display: grid;
    gap: 14px;
}

.realname-status-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.72fr);
    gap: 16px;
    align-items: start;
}

.realname-status-card h2 {
    margin-top: 12px;
}

.realname-badge {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 240, 244, 0.92);
    color: var(--primary-deep);
    font-size: 12px;
    font-weight: 900;
}

.realname-badge.pending {
    background: #e0f2fe;
    color: #075985;
}

.realname-badge.verified {
    background: #dcfce7;
    color: #166534;
}

.realname-badge.rejected {
    background: #fee2e2;
    color: #991b1b;
}

.realname-meta {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(215, 95, 131, 0.14);
    border-radius: 18px;
    background: rgba(255, 248, 250, 0.74);
}

.realname-meta span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.realname-meta strong {
    color: var(--ink);
}

.chain-list {
    display: grid;
    gap: 8px;
}

.chain-item {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid rgba(215, 95, 131, 0.12);
    border-radius: 14px;
    background: rgba(255, 248, 250, 0.7);
}

.chain-item strong {
    color: var(--ink);
    font-size: 13px;
}

.chain-item span {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.email-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 108px;
    align-items: end;
    gap: 0;
}

.email-code-row label {
    gap: 8px;
}

.email-code-row input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.email-code-button {
    min-height: 47px;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 14px 14px 0;
    padding: 0 10px;
    background: rgba(255, 241, 245, 0.88);
    color: var(--primary-deep);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
    transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}

.email-code-button:hover,
.email-code-button:focus-visible {
    background: var(--primary-soft);
    color: #8e294b;
}

.vault-share-picker {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(215, 95, 131, 0.12);
    border-radius: 20px;
    background: rgba(255, 248, 250, 0.68);
}

.vault-share-picker > div:first-child {
    display: grid;
    gap: 3px;
}

.vault-share-picker strong {
    color: var(--ink);
}

.vault-share-picker p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.vault-share-list {
    display: grid;
    gap: 8px;
}

.vault-share-item {
    min-height: 54px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(215, 95, 131, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.vault-share-item span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.vault-share-item strong,
.vault-share-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-share-item small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.rich-editor {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(215, 95, 131, 0.12);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
}

.rich-toolbar {
    order: 2;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-top: 1px solid rgba(215, 95, 131, 0.12);
    background: rgba(255, 248, 250, 0.82);
}

.rich-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: rgba(255, 255, 255, 0.86);
    color: var(--primary-deep);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 8px 18px rgba(121, 48, 70, 0.08);
    transition: transform 180ms var(--ease-out), background 180ms var(--ease-out), color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.rich-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rich-icon:hover,
.rich-icon:focus-visible {
    background: #fff;
    color: #8e294b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 22px rgba(121, 48, 70, 0.12);
    transform: translateY(-1px);
}

.rich-icon:focus-visible {
    outline: 3px solid rgba(215, 95, 131, 0.2);
    outline-offset: 2px;
}

.rich-icon:active {
    transform: scale(0.96);
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.rich-surface {
    order: 1;
    min-height: 360px;
    padding: 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    line-height: 1.9;
    outline: none;
    overflow-wrap: anywhere;
}

.rich-surface:empty::before {
    content: "写下想让亲人看到的话，也可以在光标处插入图片";
    color: var(--muted);
}

.rich-surface img,
.message-article img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 12px auto;
    border-radius: 16px;
}

.rich-surface span[data-pending-attachment],
.rich-surface a[data-message-file-id],
.message-article .article-attachment {
    min-height: 48px;
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    margin: 8px 0;
    padding: 10px 13px;
    border: 1px solid rgba(215, 95, 131, 0.18);
    border-radius: 15px;
    background: rgba(255, 241, 245, 0.88);
    color: var(--primary-deep);
    font-weight: 900;
    overflow-wrap: anywhere;
}

.rich-surface span[data-pending-attachment]::before,
.rich-surface a[data-message-file-id]::before,
.message-article .article-attachment::before {
    content: "附件";
    flex: 0 0 auto;
    margin-right: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(215, 95, 131, 0.13);
    color: var(--primary-deep);
    font-size: 12px;
}

.message-article {
    color: var(--ink);
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.message-article p {
    color: var(--ink);
}

.shared-vault {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.shared-vault h2 {
    margin: 0;
    color: var(--ink);
    font-size: 17px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(215, 95, 131, 0.52);
    box-shadow: 0 0 0 4px rgba(215, 95, 131, 0.12);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(215, 95, 131, 0.34);
    outline-offset: 3px;
}

input[type="range"] {
    padding: 0;
    accent-color: var(--primary);
}

button,
.button {
    cursor: pointer;
    font: inherit;
}

.primary {
    min-height: 46px;
    border: 0;
    border-radius: 15px;
    padding: 0 18px;
    background: linear-gradient(180deg, #b94267, #963152);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(169, 58, 94, 0.2);
    transition: background 0.22s var(--ease-out), transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
}

.primary:hover,
.primary:focus-visible {
    background: var(--primary-deep);
    box-shadow: 0 12px 26px rgba(159, 54, 89, 0.22);
}

.primary:active,
.button:active,
.ghost:active,
nav a:active,
.profile-menu-link:active {
    transform: scale(0.98);
}

.primary.large {
    min-width: 220px;
    min-height: 54px;
}

.button {
    background: rgba(255, 241, 245, 0.86);
    border-color: var(--line);
    color: var(--ink);
    transition: background 0.22s var(--ease-out), color 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}

.button:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.ghost {
    background: rgba(255, 255, 255, 0.86);
    color: var(--danger);
    border-color: #fecaca;
    transition: background 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}

.muted {
    color: var(--muted);
}

.flash {
    border-radius: 18px;
    padding: 13px 15px;
    background:
        radial-gradient(circle at 14% 0%, rgba(255, 214, 225, 0.78), transparent 46%),
        linear-gradient(135deg, #fff9fb 0%, #ffe9f0 100%);
    color: #76324d;
    border: 1px solid rgba(232, 136, 160, 0.28);
    box-shadow: 0 10px 24px rgba(199, 76, 113, 0.08);
}

.flash.error {
    background: #fff1f2;
    color: var(--danger);
    border-color: #fecdd3;
}

.flash.warning {
    background: #fffbeb;
    color: var(--amber);
    border-color: #fde68a;
}

.checkin-popup {
    position: fixed;
    left: 50%;
    top: 26px;
    z-index: 50;
    width: min(calc(100vw - 28px), 390px);
    transform: translateX(-50%);
    display: grid;
    gap: 6px;
    padding: 17px 18px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 214, 225, 0.82), transparent 48%),
        linear-gradient(135deg, rgba(255, 249, 251, 0.96), rgba(255, 233, 240, 0.94));
    border: 1px solid rgba(232, 136, 160, 0.3);
    box-shadow: 0 20px 48px rgba(199, 76, 113, 0.16);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: checkin-popup 4.2s ease both;
}

.checkin-popup strong {
    color: #76324d;
    font-size: 20px;
    line-height: 1.2;
}

.checkin-popup span {
    color: #73545b;
    line-height: 1.55;
}

@keyframes checkin-popup {
    0% {
        opacity: 0;
        transform: translate(-50%, -14px);
    }

    10%,
    82% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -14px);
        pointer-events: none;
    }
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    text-align: left;
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

tr:last-child td {
    border-bottom: 0;
}

th {
    color: var(--muted);
    font-size: 13px;
}

code {
    display: inline-block;
    overflow-wrap: anywhere;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 14px;
    color: #334155;
}

td code,
.card > code,
p code {
    display: block;
}

.muted code {
    display: inline-flex;
    margin: 3px 4px 3px 0;
    padding: 5px 8px;
}

.public-message {
    max-width: 760px;
    min-height: 100vh;
    justify-content: center;
}

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

.section-head h2 {
    margin: 0;
}

.button.compact,
.ghost.compact {
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
}

.reminder-list,
.checkin-list {
    display: grid;
    gap: 11px;
}

.checkin-list {
    gap: 10px;
}

.compact-list {
    gap: 9px;
}

.reminder-item {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    padding: 14px;
}

.reminder-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.reminder-item.due {
    border-color: #f9a8d4;
    background: var(--primary-soft);
}

.reminder-item.completed {
    color: var(--muted);
    background: #f3f4f6;
}

.reminder-item strong,
.reminder-item span,
.reminder-item p {
    display: block;
}

.reminder-item span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.reminder-item p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.checkin-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(126px, 0.95fr) minmax(0, 1fr) minmax(92px, 0.72fr);
    gap: 10px;
    align-items: center;
    padding: 13px;
    border: 1px solid rgba(215, 95, 131, 0.12);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 249, 251, 0.8)),
        var(--surface);
    box-shadow: 0 8px 20px rgba(121, 48, 70, 0.06);
}

.checkin-time {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.checkin-time strong {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.25;
}

.checkin-time span {
    width: fit-content;
    margin: 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 228, 235, 0.82);
    color: var(--primary-deep);
    font-size: 12px;
    font-weight: 900;
}

.checkin-location,
.checkin-network {
    min-width: 0;
    display: grid;
    gap: 5px;
    padding: 9px 10px;
    border-radius: 14px;
    background: rgba(255, 244, 247, 0.72);
}

.checkin-location > span,
.checkin-network > span {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.checkin-location a,
.checkin-location em,
.checkin-network code {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkin-network em {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 13px;
    font-weight: 900;
}

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

.calendar-title {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.calendar-title p {
    margin-top: 5px;
}

.calendar-shell,
.calendar-secondary {
    display: grid;
    gap: 14px;
}

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

.day-tag,
.day-mark {
    display: inline-grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
}

.day-tag {
    min-width: 28px;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 8px;
    font-size: 13px;
}

.day-mark {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 1;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1;
}

.day-tag.rest,
.day-mark.rest {
    background: #ef4444;
}

.day-tag.work,
.day-mark.work {
    background: #64748b;
}

.calendar-card {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
}

.calendar-toolbar h2 {
    margin: 0;
    text-align: center;
    font-size: 22px;
}

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

.calendar-weekdays span {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.calendar-empty,
.calendar-day {
    min-height: 64px;
    border-radius: 16px;
}

.calendar-day {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 3px;
    padding: 8px 3px 6px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.76);
    overflow: hidden;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.calendar-day:hover,
.calendar-day.selected {
    border-color: var(--warm);
    background: var(--primary-soft);
}

.calendar-day:hover {
    transform: translateY(-1px);
}

.calendar-day.today strong {
    color: var(--primary-deep);
}

.calendar-day.is-rest {
    background: #fff1f2;
}

.calendar-day.is-work {
    background: #f8fafc;
}

.calendar-day.has-events {
    background: rgba(255, 255, 255, 0.9);
}

.calendar-day strong {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-size: 17px;
}

.calendar-day.selected strong {
    background: var(--primary);
    color: #fff;
}

.lunar-label {
    max-width: 100%;
    min-height: 14px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.15;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-day.is-rest strong,
.calendar-day.is-rest .lunar-label {
    color: #dc2626;
}

.calendar-day.is-work strong {
    color: #64748b;
}

.event-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 8px;
}

.event-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.calendar-day-panel {
    display: grid;
    gap: 14px;
}

.calendar-add {
    position: relative;
}

.calendar-add summary,
.calendar-secondary summary {
    cursor: pointer;
    list-style: none;
    font-weight: 900;
    color: var(--primary-deep);
}

.calendar-add summary::-webkit-details-marker,
.calendar-secondary summary::-webkit-details-marker {
    display: none;
}

.calendar-add summary {
    min-height: 40px;
    padding: 0 13px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 22px rgba(199, 76, 113, 0.16);
}

.calendar-add[open] summary {
    margin-bottom: 12px;
}

.calendar-form h2 {
    margin: 0;
    font-size: 21px;
}

.calendar-add .calendar-form {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    width: min(360px, calc(100vw - 40px));
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 20px;
    background: rgba(255, 251, 252, 0.96);
    box-shadow: 0 18px 42px rgba(121, 48, 70, 0.16);
}

.calendar-secondary .card {
    padding: 16px;
}

.calendar-secondary summary {
    min-height: 32px;
}

.calendar-secondary details[open] summary {
    margin-bottom: 12px;
}

.countdown-shell {
    display: grid;
    gap: 18px;
    align-items: start;
}

.countdown-title {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.countdown-add {
    position: relative;
    justify-self: end;
}

.countdown-add summary {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: var(--warm);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(199, 76, 113, 0.22);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform 0.22s var(--ease-out), background 0.22s var(--ease-out);
}

.countdown-add summary::-webkit-details-marker {
    display: none;
}

.countdown-add summary::marker {
    content: "";
}

.countdown-add summary::before,
.countdown-add summary::after {
    content: "";
    position: absolute;
    width: 19px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
}

.countdown-add summary::after {
    transform: rotate(90deg);
}

.countdown-add summary span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.countdown-add[open] summary {
    background: #fff;
}

.countdown-add[open] summary::after {
    transform: rotate(0deg);
}

.countdown-add summary:hover {
    transform: translateY(-1px);
}

.countdown-add-form {
    position: absolute;
    top: 54px;
    right: 0;
    z-index: 12;
    width: min(360px, calc(100vw - 28px));
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 20px 48px rgba(90, 38, 53, 0.16);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.ios-date-picker {
    min-height: 112px;
    display: grid;
    grid-template-columns: 1.15fr 0.9fr 0.9fr;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(215, 95, 131, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 244, 247, 0.74)),
        var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.ios-date-picker select {
    width: 100%;
    min-height: 90px;
    padding: 0 8px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    text-align-last: center;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(215, 95, 131, 0.12);
    appearance: auto;
}

.ios-date-picker select:focus {
    box-shadow: inset 0 0 0 2px rgba(215, 95, 131, 0.3);
}

.contact-list-card {
    overflow-x: auto;
}

.contact-list-card table {
    min-width: 100%;
    table-layout: fixed;
}

.contact-list-card th:nth-child(1),
.contact-list-card td:nth-child(1) {
    width: 22%;
}

.contact-list-card th:nth-child(2),
.contact-list-card td:nth-child(2) {
    width: 42%;
}

.contact-list-card th:nth-child(3),
.contact-list-card td:nth-child(3) {
    width: 20%;
}

.contact-list-card th:nth-child(4),
.contact-list-card td:nth-child(4) {
    width: 16%;
    text-align: right;
}

.contact-add-form {
    gap: 12px;
}

.contact-add-form .check {
    margin: 0;
}

.countdown-list {
    display: grid;
    gap: 12px;
    padding-bottom: 8px;
}

.countdown-list > h2 {
    margin: 2px 2px 0;
    color: #4b2831;
    font-size: 17px;
}

.countdown-showcase {
    display: grid;
    gap: 16px;
}

.daysmatter-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 13px;
    padding: 14px;
    border-radius: 24px;
    border: 1px solid rgba(215, 95, 131, 0.18);
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.92), transparent 34%),
        linear-gradient(145deg, #fff6f8 0%, #ffd8e4 48%, #f5a8bd 100%);
    box-shadow: 0 18px 38px rgba(121, 48, 70, 0.12);
}

.daysmatter-card::before,
.daysmatter-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.daysmatter-card::before {
    background:
        radial-gradient(circle at 20% 26%, rgba(255, 255, 255, 0.42), transparent 0 11%, transparent 12%),
        radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.34), transparent 0 16%, transparent 17%),
        linear-gradient(120deg, transparent 0 28%, rgba(255, 255, 255, 0.28) 29% 31%, transparent 32% 100%);
    opacity: 0.9;
}

.daysmatter-photo {
    position: relative;
    min-height: 258px;
    overflow: hidden;
    border-radius: 22px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    justify-items: center;
    align-items: center;
    padding: 24px 18px 22px;
    color: #562535;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.46) 0%, rgba(255, 255, 255, 0.18) 44%, rgba(255, 244, 248, 0.34) 100%),
        url("countdown-warm-bg.jpg");
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 -48px 70px rgba(255, 255, 255, 0.2);
}

.daysmatter-photo::before {
    content: "";
    position: absolute;
    left: -16%;
    right: -16%;
    top: 16%;
    height: 118px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom-color: transparent;
    transform: rotate(-9deg);
    background: transparent;
    box-shadow: 0 34px 80px rgba(255, 255, 255, 0.1);
}

.daysmatter-photo::after {
    content: "";
    position: absolute;
    right: -18%;
    bottom: -34%;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: -92px -88px 0 rgba(255, 255, 255, 0.06);
}

.daysmatter-label,
.daysmatter-number,
.daysmatter-target {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 18px rgba(255, 255, 255, 0.72);
}

.daysmatter-label {
    align-self: start;
    font-size: 23px;
    line-height: 1.2;
    font-weight: 900;
    text-align: center;
    text-wrap: balance;
}

.daysmatter-number {
    align-self: center;
    max-width: 100%;
    font-size: 96px;
    line-height: 0.9;
    font-weight: 900;
    letter-spacing: 0;
    color: #8f3556;
}

.daysmatter-target {
    align-self: end;
    font-size: 15px;
    font-weight: 900;
    text-align: center;
}

.daysmatter-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #6d2b41;
    font-size: 17px;
    text-shadow: none;
}

.daysmatter-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    align-content: center;
    overflow: hidden;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 8px 18px rgba(121, 48, 70, 0.12);
}

.daysmatter-badge em {
    width: 100%;
    padding: 2px 0;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    text-align: center;
}

.daysmatter-badge strong {
    font-size: 21px;
    line-height: 1;
}

.daysmatter-card.empty .daysmatter-photo {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.18) 44%, rgba(255, 244, 248, 0.34) 100%),
        url("countdown-warm-bg.jpg");
    background-size: cover;
    background-position: center;
}

.countdown-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 26px rgba(121, 48, 70, 0.07);
}

.countdown-date {
    width: 78px;
    height: 78px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    background: linear-gradient(180deg, #fff1f5 0%, #ffe4eb 100%);
    color: var(--primary-deep);
}

.countdown-date span {
    font-size: 12px;
    font-weight: 900;
}

.countdown-date strong {
    font-size: 34px;
    line-height: 1;
}

.countdown-main {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.countdown-main h2 {
    margin: 0 0 6px;
    color: #3d2028;
    font-size: 18px;
}

.countdown-main p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.countdown-number {
    min-width: 86px;
    display: grid;
    justify-items: end;
    gap: 3px;
}

.countdown-number strong {
    color: var(--primary-deep);
    font-size: 34px;
    line-height: 1;
}

.countdown-number span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.countdown-card.is-past {
    background: rgba(248, 250, 252, 0.86);
}

.countdown-card.is-past .countdown-date,
.countdown-card.is-past .countdown-number strong {
    color: #64748b;
}

.empty-state {
    display: grid;
    gap: 4px;
}

.countdown-card .inline-actions {
    position: absolute;
    top: 10px;
    right: 10px;
}

.countdown-card .inline-actions .ghost {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--danger);
    font-size: 12px;
}

.empty-state h2 {
    margin-bottom: 0;
}

.profile-shell {
    display: grid;
    grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.38fr);
    gap: 16px;
    align-items: start;
}

.profile-title {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.profile-title > div {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.profile-menu-button {
    min-height: 42px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    border: 1px solid rgba(199, 76, 113, 0.24);
    border-radius: 14px;
    background: rgba(255, 240, 244, 0.86);
    color: var(--amber);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(199, 76, 113, 0.1);
}

.profile-menu-toggle {
    position: fixed;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.profile-menu-backdrop {
    display: none;
}

.profile-menu {
    position: sticky;
    top: 24px;
}

.profile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.profile-menu-head h2,
.profile-panel h2 {
    margin: 0;
}

.profile-menu-head label {
    display: none;
}

.profile-menu-list {
    display: grid;
    gap: 9px;
}

.profile-menu-link {
    min-height: 58px;
    display: grid;
    gap: 4px;
    padding: 13px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: var(--surface-soft);
    color: var(--ink);
    transition: background 0.22s var(--ease-out), border-color 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}

.profile-menu-link:hover,
.profile-menu-link.active {
    background: var(--warm-soft);
    border-color: rgba(199, 76, 113, 0.24);
}

.profile-menu-link strong,
.profile-menu-link span {
    display: block;
}

.profile-menu-link span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.profile-menu-link.danger strong {
    color: var(--danger);
}

@media (max-width: 860px) {
    body {
        background:
            radial-gradient(circle at 50% -4%, rgba(255, 219, 229, 0.72), transparent 34%),
            linear-gradient(180deg, #fff8fa 0%, #fff4f7 48%, #fff9fb 100%);
    }

    .app-shell {
        grid-template-columns: 1fr;
        min-height: 100vh;
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    .content {
        max-width: 460px;
        padding: calc(10px + env(safe-area-inset-top)) 14px 34px;
        gap: 12px;
    }

    .message-appbar {
        margin: calc(-10px - env(safe-area-inset-top)) -14px 2px;
        min-height: calc(56px + env(safe-area-inset-top));
        padding: calc(10px + env(safe-area-inset-top)) 14px 0;
    }

    .sidebar {
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        top: auto;
        z-index: 20;
        height: auto;
        padding: 7px;
        background: rgba(255, 255, 255, 0.64);
        border: 1px solid rgba(255, 255, 255, 0.82);
        border-radius: 28px;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.86),
            0 16px 42px rgba(90, 38, 53, 0.16);
        backdrop-filter: blur(28px) saturate(170%);
        -webkit-backdrop-filter: blur(28px) saturate(170%);
        gap: 0;
    }

    .brand,
    .logout {
        display: none;
    }

    nav {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
        width: 100%;
    }

    nav .secondary-tab {
        display: none;
    }

    nav a {
        min-height: 58px;
        display: grid;
        justify-content: center;
        justify-items: center;
        align-content: center;
        gap: 3px;
        padding: 7px 2px 6px;
        font-size: 11px;
        line-height: 1.1;
        text-align: center;
        border-radius: 22px;
        color: rgba(57, 33, 38, 0.66);
        background: transparent;
        border-color: transparent;
        transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    }

    nav a svg {
        width: 22px;
        height: 22px;
        stroke-width: 1.75;
    }

    nav a span {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    nav a.active {
        background: rgba(255, 255, 255, 0.88);
        color: var(--primary-deep);
        border-color: rgba(255, 255, 255, 0.9);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.9),
            0 8px 18px rgba(199, 76, 113, 0.13);
    }

    .auth-panel,
    .split,
    .grid.three,
    .settings-grid,
    .profile-shell,
    .countdown-shell,
    .calendar-shell,
    .vault-shell {
        grid-template-columns: 1fr;
    }

    .vault-file-item {
        grid-template-columns: 1fr;
    }

    .vault-file-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .vault-file-actions .button,
    .vault-file-actions .ghost,
    .vault-file-actions form {
        width: 100%;
    }

    .profile-title {
        position: sticky;
        top: 0;
        z-index: 12;
        margin: -14px -14px 0;
        padding: 14px 14px 10px;
        background: linear-gradient(180deg, rgba(255, 248, 250, 0.92), rgba(255, 248, 250, 0.74) 72%, rgba(255, 248, 250, 0));
        backdrop-filter: blur(18px) saturate(160%);
        -webkit-backdrop-filter: blur(18px) saturate(160%);
    }

    .profile-menu-button {
        display: inline-flex;
        border-radius: 14px;
    }

    .profile-shell {
        display: block;
    }

    .profile-panel {
        width: 100%;
    }

    .profile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 31;
        display: block;
        background: rgba(15, 23, 42, 0);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s var(--ease-out), background 0.28s var(--ease-out);
    }

    .profile-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 32;
        width: min(82vw, 318px);
        padding: calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        border-color: rgba(255, 255, 255, 0.72);
        background: rgba(255, 249, 251, 0.92);
        box-shadow: -18px 0 38px rgba(90, 38, 53, 0.16);
        backdrop-filter: blur(22px) saturate(150%);
        -webkit-backdrop-filter: blur(22px) saturate(150%);
        overflow-y: auto;
        transform: translateX(106%);
        transition: transform 0.34s var(--ease-out);
    }

    .profile-menu-list {
        grid-template-columns: 1fr;
    }

    .profile-menu-head label {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 12px;
        border: 1px solid rgba(199, 76, 113, 0.22);
        border-radius: 14px;
        background: rgba(255, 240, 244, 0.82);
        color: var(--amber);
        font-size: 13px;
        font-weight: 900;
        cursor: pointer;
    }

    .profile-menu-toggle:checked ~ .profile-shell .profile-menu {
        transform: translateX(0);
    }

    .profile-menu-toggle:checked ~ .profile-shell .profile-menu-backdrop {
        background: rgba(15, 23, 42, 0.2);
        opacity: 1;
        pointer-events: auto;
    }

    .daysmatter-card {
        padding: 12px;
        border-radius: 22px;
    }

    .countdown-title {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .countdown-add-form {
        position: fixed;
        top: 74px;
        left: 14px;
        right: 14px;
        width: auto;
    }

    .daysmatter-photo {
        min-height: 236px;
        padding: 22px 14px 18px;
        border-radius: 20px;
    }

    .daysmatter-label {
        font-size: 21px;
    }

    .daysmatter-number {
        font-size: 88px;
    }

    .daysmatter-target {
        font-size: 14px;
    }

    .daysmatter-footer {
        font-size: 15px;
    }

    .daysmatter-badge {
        width: 44px;
        height: 44px;
    }

    .auth-panel {
        min-height: calc(100vh - 36px);
        align-content: center;
        gap: 18px;
    }

    .auth-panel h1,
    .page-title h1,
    .hero h1 {
        font-size: 34px;
    }

    .auth-panel > div {
        display: grid;
        gap: 8px;
    }

    .auth-panel > div p:last-child {
        margin: 0;
    }

    .auth-form {
        gap: 12px;
        padding: 18px 16px;
    }

    .home-topbar {
        position: sticky;
        top: 0;
        z-index: 12;
        margin: calc(-10px - env(safe-area-inset-top)) -14px 0;
        padding: calc(8px + env(safe-area-inset-top)) 14px 12px;
        border-top: 0;
        border-left: 0;
        border-right: 0;
        border-radius: 0 0 24px 24px;
        background:
            radial-gradient(circle at 12% 0%, rgba(255, 214, 225, 0.9), transparent 52%),
            linear-gradient(135deg, rgba(255, 249, 251, 0.82), rgba(255, 233, 240, 0.76));
        backdrop-filter: blur(24px) saturate(170%);
        -webkit-backdrop-filter: blur(24px) saturate(170%);
    }

    .home-appbar {
        min-height: 44px;
        grid-template-columns: 64px minmax(0, 1fr) 64px;
    }

    .home-appbar > strong {
        font-size: 17px;
    }

    .home-greeting {
        gap: 6px;
    }

    .home-greeting h1 {
        font-size: 28px;
    }

    .home-greeting p {
        font-size: 14px;
        line-height: 1.55;
    }

    .home-menu-button {
        width: 42px;
        min-height: 38px;
        padding: 0;
        border-radius: 14px;
    }

    .status-hero {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px 16px 20px;
        justify-items: center;
        background:
            radial-gradient(circle at 50% 62%, rgba(185, 225, 255, 0.28), transparent 42%),
            linear-gradient(180deg, #fffafd 0%, #ffedf3 100%);
    }

    .status-copy {
        justify-items: start;
        text-align: left;
        gap: 5px;
    }

    .status-copy strong {
        font-size: 16px;
    }

    .status-copy span {
        display: none;
    }

    .warm-tip {
        margin-top: -4px;
        font-size: 13px;
    }

    .heartbeat-form {
        width: min(72vw, 268px);
    }

    .heartbeat-orb {
        width: 84%;
    }

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

    .realname-status-card {
        grid-template-columns: 1fr;
    }

    .card,
    .metric {
        padding: 16px;
        border-radius: 22px;
        box-shadow: 0 8px 22px rgba(121, 48, 70, 0.06);
    }

    .grid.three {
        gap: 10px;
    }

    .metric {
        min-height: 78px;
        align-content: center;
    }

    .metric span {
        font-size: 12px;
    }

    .metric strong {
        font-size: 20px;
    }

    .calendar-card {
        padding: 14px;
        border-radius: 22px;
    }

    .calendar-title {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .calendar-toolbar {
        gap: 8px;
    }

    .calendar-toolbar h2 {
        font-size: 18px;
    }

    .calendar-weekdays,
    .calendar-grid {
        gap: 6px;
    }

    .calendar-empty,
    .calendar-day {
        min-height: 58px;
    }

    .calendar-day {
        gap: 2px;
        padding: 7px 2px 5px;
    }

    .day-mark {
        top: 4px;
        right: 4px;
        width: 14px;
        height: 14px;
        font-size: 9px;
    }

    .calendar-day strong {
        width: 26px;
        height: 26px;
        font-size: 15px;
    }

    .lunar-label {
        font-size: 9px;
        line-height: 1.1;
    }

    .event-dots {
        justify-content: center;
        min-height: 5px;
    }

    .event-dots i {
        width: 5px;
        height: 5px;
    }

    .calendar-day-panel .section-head {
        align-items: center;
    }

    .calendar-add {
        width: auto;
    }

    .calendar-add .calendar-form {
        position: static;
        width: 100%;
        margin-top: 10px;
        box-shadow: none;
    }

    .calendar-secondary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .reminder-item,
    .countdown-card,
    .countdown-main {
        grid-template-columns: 1fr;
    }

    .checkin-item {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .checkin-time {
        grid-column: 1 / -1;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .checkin-time span {
        justify-self: end;
    }

    .countdown-card {
        justify-items: stretch;
        padding: 15px 14px 14px;
    }

    .countdown-date {
        width: 70px;
        height: 70px;
        border-radius: 18px;
    }

    .countdown-number {
        min-width: 0;
        justify-items: start;
        padding-top: 2px;
    }

    .countdown-number strong {
        font-size: 32px;
    }

    .countdown-card .inline-actions {
        top: 12px;
        right: 12px;
    }

    .countdown-card .inline-actions .ghost {
        flex: 0 0 auto;
        min-height: 30px;
        padding: 0 10px;
    }

    .inline-actions {
        justify-content: stretch;
    }

    .inline-actions button {
        flex: 1;
        min-height: 44px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .contact-list-card {
        padding: 14px 16px;
        overflow: hidden;
    }

    .contact-list-card table {
        display: table;
        width: 100%;
        min-width: 100%;
        table-layout: fixed;
        white-space: normal;
    }

    .contact-list-card th,
    .contact-list-card td {
        padding: 13px 8px;
        overflow-wrap: anywhere;
    }

    .contact-list-card th:first-child,
    .contact-list-card td:first-child {
        padding-left: 0;
    }

    .contact-list-card th:last-child,
    .contact-list-card td:last-child {
        padding-right: 0;
    }

    .admin-shell {
        padding-bottom: 0;
    }

    .admin-shell .content {
        max-width: none;
        padding: 20px;
    }

    .admin-shell .sidebar {
        position: static;
        height: auto;
        padding: 18px;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-top: 0;
        box-shadow: none;
    }

    .admin-shell .brand,
    .admin-shell .logout {
        display: flex;
    }

    .admin-shell nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

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