:root {
    --bg: #f4f7f6;
    --surface: #ffffff;
    --surface-2: #edf5f1;
    --ink: #17212b;
    --muted: #65727e;
    --line: #d9e2dd;
    --border: #d9e2dd;
    --primary: #14a38b;
    --primary-dark: #0d7d6c;
    --coral: #ff6b4a;
    --warning: #f5b94b;
    --good: #19a974;
    --bad: #df4c43;
    --shadow: 0 16px 38px rgba(23, 33, 43, 0.08);
    --glass: rgba(255, 255, 255, 0.72);
    --glass-strong: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(255, 255, 255, 0.58);
    --glass-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
    --radius: 8px;
    --mobile-bottom-nav-height: 0px;
    --mobile-fab-size: 56px;
    --mobile-fab-gap: 16px;
    --mobile-fab-z: 160;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink);
    font-family: "Manrope", "Trebuchet MS", sans-serif;
    background:
        linear-gradient(135deg, rgba(20, 163, 139, 0.12), transparent 34%),
        linear-gradient(315deg, rgba(255, 107, 74, 0.1), transparent 30%),
        repeating-linear-gradient(90deg, rgba(23, 33, 43, 0.025) 0 1px, transparent 1px 92px),
        var(--bg);
}

body.login-body {
    background:
        radial-gradient(circle at top left, rgba(20, 163, 139, 0.26), transparent 46%),
        linear-gradient(140deg, rgba(12, 20, 29, 0.95), rgba(15, 32, 39, 0.82)),
        var(--login-bg-image, none) center / cover no-repeat fixed;
}

body.login-body.login-body-has-bg {
    background:
        linear-gradient(130deg, rgba(10, 17, 24, 0.74), rgba(12, 24, 32, 0.72)),
        var(--login-bg-image, none) center / cover no-repeat fixed;
}

body.login-body .container {
    width: min(1160px, calc(100vw - 1.4rem));
    margin-top: 0.7rem;
    margin-bottom: 1.25rem;
}

h1,
h2,
h3,
strong,
.brand {
    font-family: "Plus Jakarta Sans", "Manrope", sans-serif;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0.4rem;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1;
}

h2 {
    margin-bottom: 0.8rem;
    font-size: 1.08rem;
}

a {
    color: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    width: min(1180px, calc(100vw - 1.5rem));
    margin: 0.75rem auto 6rem;
}

.container-with-nav {
    margin-top: 5.9rem;
}

.topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem max(0.85rem, calc((100vw - 1180px) / 2));
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
}

.brand-avatar,
.profile-avatar,
.settings-avatar-preview {
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    font-weight: 900;
    line-height: 1;
}

.brand-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid rgba(20, 163, 139, 0.28);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(20, 163, 139, 0.18), rgba(59, 130, 246, 0.12)),
        #fff;
    box-shadow: 0 8px 20px rgba(22, 35, 43, 0.12);
}

.brand-avatar img,
.profile-avatar img,
.settings-avatar-preview img,
img.brand-avatar,
img.profile-avatar,
img.settings-avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

img.brand-avatar,
img.profile-avatar,
img.settings-avatar-preview {
    display: block;
}

.brand-mark.large {
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.nav-links {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a,
.bottom-nav a {
    text-decoration: none;
}

.nav-links a {
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--ink);
    background: var(--surface-2);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    position: relative;
}

.topbar-context {
    position: relative;
}

.topbar-context summary {
    list-style: none;
}

.topbar-context summary::-webkit-details-marker {
    display: none;
}

.topbar-context-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.55rem);
    z-index: 180;
    display: grid;
    gap: 0.75rem;
    width: min(420px, calc(100vw - 1.5rem));
    padding: 0.9rem;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.team-layout-editor {
    display: grid;
    gap: 0.55rem;
    padding-top: 0.72rem;
    border-top: 1px solid var(--line);
}

.team-layout-editor-head {
    display: grid;
    gap: 0.1rem;
}

.team-layout-editor-head small {
    color: var(--muted);
    font-size: 0.78rem;
}

.team-layout-editor-list {
    display: grid;
    gap: 0.35rem;
}

.team-layout-editor-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.58rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
    cursor: grab;
    font-size: 0.86rem;
    font-weight: 750;
}

.team-layout-editor-item.is-dragging {
    opacity: 0.52;
}

.team-layout-drag-handle {
    color: var(--muted);
    font-weight: 900;
    letter-spacing: -0.08em;
}

.team-layout-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

.inline-context-sub {
    border-top: 1px solid var(--line);
    padding-top: 0.7rem;
}

.inline-context-sub summary {
    list-style: none;
}

.inline-context-sub summary::-webkit-details-marker {
    display: none;
}

.btn-topbar {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-height: 40px;
    padding: 0.48rem 0.74rem;
    border-radius: 999px;
    border-color: transparent;
    background: rgba(20, 163, 139, 0.1);
    color: var(--primary-dark);
    box-shadow: none;
}

.btn-topbar::after {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
}

.add-menu,
.user-menu {
    position: relative;
}

.add-menu summary,
.user-menu summary {
    list-style: none;
}

.add-menu summary::-webkit-details-marker,
.user-menu summary::-webkit-details-marker {
    display: none;
}

.add-menu-trigger {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 999px;
    font-size: 1.2rem;
    line-height: 1;
}

.topbar-add-menu .add-menu-trigger {
    display: inline-grid;
    place-items: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 999px;
    padding: 0;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
}

.topbar-add-menu .add-menu-trigger:hover,
.topbar-add-menu .add-menu-trigger:focus-visible {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.floating-log .add-menu-trigger {
    display: inline-grid;
    place-items: center;
    width: var(--mobile-fab-size);
    min-width: var(--mobile-fab-size);
    height: var(--mobile-fab-size);
    min-height: var(--mobile-fab-size);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 14px 28px rgba(23, 33, 43, 0.28);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.floating-log .add-menu-trigger:hover,
.floating-log .add-menu-trigger:focus-visible,
.floating-log.is-open .add-menu-trigger {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(23, 33, 43, 0.3);
}

.add-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 190;
    display: grid;
    gap: 0.45rem;
    width: 220px;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
}

.floating-add-panel {
    position: fixed;
    right: var(--mobile-fab-gap);
    left: auto;
    bottom: calc(
        env(safe-area-inset-bottom) +
        var(--mobile-fab-gap) +
        var(--mobile-bottom-nav-height) +
        var(--mobile-fab-size) +
        8px
    );
    top: auto;
    z-index: calc(var(--mobile-fab-z) + 1);
    width: min(240px, calc(100vw - 32px));
    max-width: 100vw;
    max-height: 80vh;
    overflow: auto;
    overscroll-behavior: contain;
}

.user-menu-trigger {
    display: inline-grid;
    place-items: center;
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
    overflow: hidden;
}

.user-menu-unread-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
}

.user-menu-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 190;
    display: grid;
    min-width: 210px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.user-menu-panel a {
    padding: 0.7rem 0.8rem;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
}

.user-menu-panel a:last-child {
    border-bottom: 0;
}

.user-menu-panel a:hover {
    background: var(--surface-2);
}

.locale-form select {
    min-width: 112px;
    padding: 0.5rem 0.65rem;
}

.auth-locale {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.auth-locale select {
    min-width: 104px;
    padding: 0.45rem 0.6rem;
    border-radius: 999px;
}

.spa-shell .settings-list {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}

.settings-list.hidden {
    display: none;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
    background: #fff;
}

.settings-row:last-child {
    border-bottom: 0;
}

.settings-row:hover,
.settings-row:focus-visible {
    background: var(--surface-2);
}

.settings-row span {
    display: grid;
    gap: 0.1rem;
}

.settings-row small {
    font-size: 0.78rem;
}

.settings-chevron {
    color: var(--muted);
    font-size: 1.3rem;
    line-height: 1;
}

.compact-list {
    margin-bottom: 0.85rem;
}

.workout-repeater {
    display: grid;
    gap: 0.6rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdfc;
}

.entry-data-panel {
    overflow: visible;
}

.entry-data-head {
    align-items: start;
    gap: 0.8rem;
}

.entry-data-form {
    gap: 0.85rem;
}

.entry-form-section {
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdfc;
}

.workout-toggle-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
}

.entry-workout-toggle {
    min-height: 42px;
    margin: 0;
    padding: 0.58rem 0.72rem;
    border: 1px solid rgba(20, 163, 139, 0.24);
    border-radius: 999px;
    background: #fff;
    font-weight: 850;
}

.workout-panel {
    display: grid;
    gap: 0.55rem;
}

.workout-panel > p {
    margin: 0;
}

.workout-head {
    align-items: center;
    margin: 0;
}

.workout-head h3 {
    margin: 0;
    font-size: 0.95rem;
}

.workout-head p {
    margin: 0.12rem 0 0;
}

.workout-rows {
    display: grid;
    gap: 0.55rem;
}

.workout-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: end;
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.workout-row .btn {
    min-height: 42px;
}

.workout-custom-field {
    min-width: 0;
}

.workout-subfields {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.55rem;
}

.workout-remove-btn {
    justify-self: end;
}

.admin-workout-fields {
    display: grid;
    gap: 0.65rem;
}

.workout-field-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    align-items: end;
}

.bottom-nav {
    position: fixed;
    left: 0.55rem;
    right: 0.55rem;
    bottom: calc(0.45rem + env(safe-area-inset-bottom));
    z-index: 120;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.18rem;
    padding: 0.24rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(214, 226, 221, 0.92);
    border-radius: 18px;
    box-shadow: 0 16px 38px rgba(22, 35, 43, 0.16);
    backdrop-filter: blur(18px);
    overflow: hidden;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.floating-log {
    position: fixed;
    right: var(--mobile-fab-gap);
    bottom: calc(env(safe-area-inset-bottom) + var(--mobile-fab-gap) + var(--mobile-bottom-nav-height));
    z-index: var(--mobile-fab-z);
    display: inline-grid;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.bottom-nav.nav-hidden,
.floating-log.nav-hidden {
    transform: translateY(120%);
    opacity: 0;
    pointer-events: none;
}

.bottom-nav a {
    display: grid;
    place-items: center;
    gap: 0.12rem;
    min-width: 0;
    min-height: 48px;
    padding: 0.34rem 0.16rem;
    color: var(--muted);
    border-radius: 14px;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
}

.bottom-nav a.active {
    color: var(--ink);
    background: rgba(20, 163, 139, 0.12);
    box-shadow: inset 0 0 0 1px rgba(20, 163, 139, 0.18);
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 999px;
    color: currentColor;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.bottom-nav a.active .nav-icon {
    color: var(--primary);
}

.stack,
.stack-lg {
    display: grid;
}

.stack {
    gap: 0.9rem;
}

.stack-lg {
    gap: 1rem;
}

.screen {
    animation: screenIn 0.22s ease both;
}

@keyframes screenIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-panel,
.panel,
.motivation-band,
.metric-card,
.user-edit-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.hero-panel {
    display: grid;
    gap: 1rem;
    padding: 1.05rem;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(20, 163, 139, 0.16), transparent 62%),
        linear-gradient(315deg, rgba(255, 107, 74, 0.12), transparent 58%),
        var(--surface);
}

.hero-panel .muted {
    max-width: 64ch;
}

.panel {
    padding: 1rem;
    min-width: 0;
}

.section-heading {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.section-heading h2,
.section-heading p {
    margin: 0;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.panel-head-help {
    align-items: center;
}

.metric-help-popover {
    position: relative;
    display: inline-block;
}

.metric-help-popover > summary {
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--primary-dark);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.metric-help-popover > summary::-webkit-details-marker {
    display: none;
}

.metric-help-popover-content {
    position: absolute;
    right: 0;
    top: 1.9rem;
    z-index: 30;
    width: min(320px, 78vw);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    padding: 0.7rem;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.eyebrow {
    margin-bottom: 0.35rem;
    color: var(--primary-dark);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.78rem;
}

.motivation-band {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    background: var(--ink);
    color: #fff;
}

.motivation-band span {
    color: #9fe4d6;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.motivation-band strong {
    font-size: 1.04rem;
    line-height: 1.35;
}

.metric-grid,
.grid-two,
.grid-inline,
.quick-stats {
    display: grid;
    gap: 0.85rem;
    min-width: 0;
}

.dashboard-layout {
    display: grid;
    gap: 0.85rem;
    min-width: 0;
    grid-template-columns: 1fr;
    grid-auto-flow: row dense;
}

.dashboard-layout > * {
    min-width: 0;
}

.dashboard-span-full {
    grid-column: 1 / -1;
}

.dashboard-quick-actions-grid {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-quick-action {
    min-height: 48px;
    text-align: center;
}

.dashboard-penalty-compact {
    display: grid;
    gap: 0.75rem;
}

.dashboard-penalty-compact-grid {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-penalty-compact-grid > span,
.penalties-history-list > span {
    display: grid;
    gap: 0.18rem;
    padding: 0.58rem 0.62rem;
    border: 1px solid rgba(217, 226, 221, 0.82);
    border-radius: 10px;
    background: #fbfdfc;
}

.dashboard-penalty-compact-grid small,
.penalties-history-list small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-penalty-compact-grid strong {
    font-size: 1.15rem;
}

.dashboard-analytics-cta,
.analytics-section,
.profile-data-overview {
    display: grid;
    gap: 0.85rem;
}

.analytics-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.analytics-controls {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    align-items: end;
}

.analytics-nav-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

.analytics-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.analytics-section-title h2,
.analytics-chart-card h3 {
    margin: 0;
}

.analytics-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: 1fr;
}

.analytics-chart-card {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.profile-data-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.profile-data-card {
    display: grid;
    gap: 0.18rem;
    padding: 0.78rem;
    border: 1px solid rgba(217, 226, 221, 0.86);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f7fbf9);
}

.profile-data-card span,
.profile-data-card small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.profile-data-card strong {
    color: var(--ink);
    font-size: 1.15rem;
}

.penalties-history-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: 1fr;
}

.penalties-history-card {
    display: grid;
    gap: 0.65rem;
}

.penalties-history-list {
    display: grid;
    gap: 0.48rem;
}

.penalties-history-list strong {
    font-size: 1rem;
}

.dashboard-week-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.dashboard-panel-action {
    justify-self: end;
    white-space: nowrap;
}

.dashboard-layout-editor {
    margin-top: 0.2rem;
}

.dashboard-edit-layout-trigger {
    justify-content: center;
    min-height: 38px;
    border-style: dashed;
}

.dashboard-layout-toggle {
    display: flex;
    align-items: center;
    gap: 0.48rem;
    min-width: 0;
    margin: 0;
    font-weight: 800;
}

.dashboard-layout-toggle span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-segmented-control {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    width: fit-content;
    max-width: 100%;
    margin-top: 0.65rem;
    padding: 0.22rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fbfdfc;
}

.compact-segmented-control .btn {
    min-height: 34px;
    padding: 0.34rem 0.68rem;
    border-radius: 999px;
    border-color: transparent;
    background: transparent;
}

.dashboard-mobile-card-list {
    display: none;
}

.dashboard-mobile-card {
    display: grid;
    gap: 0.68rem;
    padding: 0.78rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(22, 35, 43, 0.07);
}

.dashboard-mobile-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-mobile-card-head strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-mobile-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
}

.dashboard-mobile-metrics > span {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
    padding: 0.48rem 0.52rem;
    border: 1px solid rgba(217, 226, 221, 0.82);
    border-radius: 8px;
    background: #fbfdfc;
}

.dashboard-mobile-metrics small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-mobile-metrics strong {
    font-size: 0.9rem;
    line-height: 1.2;
}

.dashboard-mobile-metric-wide {
    grid-column: 1 / -1;
}

.dashboard-mobile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.36rem;
    flex-wrap: wrap;
}

.metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    min-height: 116px;
    padding: 0.85rem;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.45rem;
    line-height: 1.05;
}

.metric-card p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.metric-card-calorie-goal .progress-ring span {
    width: 52px;
    font-size: 0.74rem;
}

.progress-ring {
    --value: 0;
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--surface) 0 56%, transparent 57%),
        conic-gradient(var(--primary) calc(var(--value) * 1%), #e4ece8 0);
}

.progress-ring span {
    width: 48px;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
    text-transform: none;
}

label {
    display: grid;
    gap: 0.35rem;
    color: #2c3843;
    font-size: 0.9rem;
    font-weight: 700;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.68rem 0.72rem;
    background: #fff;
    color: var(--ink);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 163, 139, 0.14);
}

textarea {
    resize: vertical;
}

.control-strip,
.inline-form {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dashboard-toolbar {
    padding: 0.75rem;
}

.dashboard-toolbar .control-strip {
    align-items: center;
    justify-content: flex-end;
}

.entry-date-inline {
    min-width: 170px;
}

.entry-datetime-inline {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.entry-time-inline {
    min-width: 150px;
}

.entries-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entries-toggles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entries-toggles .check {
    min-width: 0;
}

.conditional-reason[data-reason="missing"] {
    grid-column: 1 / -1;
}

.control-strip label,
.inline-form label {
    min-width: 160px;
}

.toggle-row {
    display: grid;
    gap: 0.55rem;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.check input,
.spreadsheet input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.standalone-check {
    width: fit-content;
}

.pill-toggles .check {
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.72rem 0.95rem;
    background: rgba(229, 238, 235, 0.82);
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.btn:disabled {
    cursor: wait;
    opacity: 0.6;
    transform: none;
}

.btn.btn-primary {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
        var(--primary);
    color: #fff;
}

.btn.btn-primary:hover {
    background: var(--primary-dark);
}

.btn.btn-secondary {
    background: var(--ink);
    color: #fff;
}

.btn.btn-ghost {
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn.small {
    min-width: 78px;
    padding: 0.48rem 0.65rem;
    font-size: 0.82rem;
}

.btn-block {
    width: 100%;
}

.flash {
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.flash-success {
    border-color: rgba(25, 169, 116, 0.35);
    background: #edf9f3;
}

.flash-error {
    border-color: rgba(223, 76, 67, 0.35);
    background: #fff0ef;
}

.flash-info {
    border-color: rgba(20, 163, 139, 0.25);
    background: #eefaf7;
}

.table-wrap {
    position: relative;
    overflow: auto;
    max-width: 100%;
    margin-top: 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 760px;
}

.table th,
.table td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 0.72rem;
    vertical-align: middle;
}

.table th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: var(--muted);
    background: #f8fbfa;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.table tr:last-child td {
    border-bottom: 0;
}

.table.compact td,
.table.compact th {
    padding: 0.58rem;
    font-size: 0.86rem;
}

.spreadsheet-wrap {
    box-shadow: inset -16px 0 20px -20px rgba(23, 33, 43, 0.35);
}

.spreadsheet {
    min-width: 1180px;
}

.spreadsheet input[type="text"],
.spreadsheet input[type="number"] {
    min-width: 104px;
    padding: 0.48rem 0.5rem;
}

.spreadsheet .sticky-col {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 128px;
    background: #fff;
    box-shadow: 8px 0 14px -16px rgba(23, 33, 43, 0.9);
}

.spreadsheet th.sticky-col {
    z-index: 4;
    background: #f8fbfa;
}

.date-cell {
    display: grid;
    gap: 0.18rem;
}

.inline-actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: flex-end;
}

.week-save-all-row {
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.save-status {
    display: inline-block;
    margin-left: 0.4rem;
    min-width: 70px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.save-status.ok {
    color: var(--good);
}

.save-status.error {
    color: var(--bad);
}

.save-status.saving {
    color: var(--primary-dark);
}

.save-all-status {
    min-width: 180px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.save-all-status.ok {
    color: var(--good);
}

.save-all-status.error {
    color: var(--bad);
}

.save-all-status.saving {
    color: var(--primary-dark);
}

.photo-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}

.photo-grid figure {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 20px rgba(23, 33, 43, 0.08);
}

.photo-card-media {
    display: block;
    color: inherit;
    text-decoration: none;
}

.photo-grid img {
    display: block;
    width: 100%;
    height: 152px;
    object-fit: cover;
}

.photo-card-media .entries-calendar-empty {
    height: 152px;
}

.photo-grid figcaption {
    display: grid;
    gap: 0.24rem;
    padding: 0.62rem;
    font-size: 0.8rem;
    background: #fff;
}

.photo-nutrition-line {
    color: var(--primary-dark);
    font-weight: 700;
}

.proof-photo-panel {
    overflow: visible;
}

.proof-photo-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
    gap: 1.05rem;
    align-items: stretch;
}

.proof-photo-form {
    gap: 0.95rem;
}

.proof-photo-main-card,
.proof-photo-side-card {
    min-width: 0;
    gap: 0.8rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 14px 32px rgba(23, 33, 43, 0.06);
}

.proof-photo-main-card {
    background:
        linear-gradient(145deg, rgba(20, 163, 139, 0.07), rgba(20, 163, 139, 0.01) 45%),
        #fdfefe;
}

.proof-photo-side-card {
    background: #fff;
    display: grid;
    grid-template-rows: auto auto 1fr;
}

.photo-nutrition-tools {
    display: flex;
    justify-content: flex-start;
}

.photo-nutrition-panel {
    display: grid;
    gap: 0.55rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbfa;
}

.photo-nutrition-advanced {
    margin-top: 0.2rem;
}

.proof-photo-meta {
    margin-bottom: 0.15rem;
}

.proof-photo-preview {
    min-width: 0;
    display: flex;
    height: 100%;
}

.proof-photo-upload-block {
    display: grid;
    gap: 0.4rem;
    border: 1px dashed rgba(20, 163, 139, 0.32);
    background: #f6fbf9;
    border-radius: 12px;
    padding: 0.8rem;
}

.proof-photo-upload-label {
    display: grid;
    gap: 0.45rem;
}

.proof-photo-upload-label > span {
    font-size: 0.86rem;
    font-weight: 700;
    color: #1f2b35;
}

.proof-photo-upload-label input[type="file"] {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 0.6rem 0.6rem;
}

.proof-photo-upload-label input[type="file"]:focus-visible {
    outline: 2px solid rgba(20, 163, 139, 0.22);
    outline-offset: 1px;
}

.proof-photo-upload-state {
    margin: 0;
    font-weight: 700;
}

.proof-photo-submit {
    min-height: 42px;
}

.proof-photo-preview img {
    width: 100%;
    height: 100%;
    min-height: 300px;
    max-height: 420px;
    border-radius: 14px;
    border: 1px solid var(--line);
    object-fit: cover;
    background: #fff;
}

.proof-photo-server-hint {
    margin-top: 0.15rem;
}

.photo-placeholder {
    border: 1px dashed var(--border);
    border-radius: 14px;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    min-height: 200px;
    background: #fbfdfc;
}

.photo-placeholder-content {
    display: grid;
    gap: 0.35rem;
    justify-items: center;
    max-width: 250px;
    padding: 1rem;
}

.photo-placeholder-content svg {
    width: 34px;
    height: 34px;
    fill: currentColor;
    opacity: 0.72;
}

.photo-placeholder-content p {
    margin: 0;
    font-weight: 700;
}

.photo-placeholder-content small {
    color: var(--muted);
}

.photo-placeholder-unsupported {
    border-style: dashed;
    background: #fffaf7;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.chip-group > span {
    color: var(--muted);
    font-weight: 800;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.35rem 0.55rem;
    background: #fff;
    font-size: 0.84rem;
}

.chip input {
    width: auto;
    accent-color: var(--primary);
}

.chip input[type="number"] {
    width: 58px;
    min-height: 34px;
    padding: 0.35rem;
}

.user-edit-card {
    display: grid;
    gap: 0.75rem;
    padding: 0.9rem;
    box-shadow: none;
}

.auth-wrap {
    min-height: calc(100vh - 3rem);
    display: grid;
    place-items: center;
}

.auth-wrap-login {
    min-height: calc(100vh - 1.75rem);
    align-items: center;
}

.auth-shell {
    width: min(900px, 100%);
    display: grid;
    gap: 1rem;
}

.auth-shell-login {
    width: min(980px, 100%);
    gap: 1.2rem;
}

.auth-copy {
    padding: 0.5rem;
}

.auth-copy-login {
    display: grid;
    gap: 0.52rem;
    align-content: start;
    padding: 1.1rem 0.8rem;
    color: #e9f3f2;
}

body.login-body .auth-copy-login .eyebrow {
    color: rgba(202, 231, 226, 0.94);
}

.auth-copy-login h1 {
    margin: 0;
    color: #fff;
    line-height: 1.02;
}

body.login-body .auth-copy-login p:not(.eyebrow) {
    margin: 0;
    color: rgba(230, 242, 240, 0.95);
    max-width: 40ch;
}

.login-brand-image {
    width: 74px;
    height: 74px;
    border-radius: 16px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
}

.auth-copy p:not(.eyebrow) {
    max-width: 48ch;
    color: var(--muted);
    font-size: 1.08rem;
}

.auth-card {
    width: 100%;
}

.auth-card-login {
    border: 1px solid rgba(227, 239, 236, 0.74);
    box-shadow: 0 20px 38px rgba(6, 14, 24, 0.32);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
}

.remember-me-check {
    min-height: 40px;
    padding: 0.55rem 0.65rem;
}

.remember-me-check span {
    font-weight: 700;
}

.auth-footnote {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.facts {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
    list-style: none;
}

.facts li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--line);
}

.facts li:last-child {
    border-bottom: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border-radius: var(--radius);
    padding: 0.3rem 0.58rem;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.badge.badge-warn {
    border-color: rgba(245, 185, 75, 0.5);
    background: #fff8e8;
    color: #7b5608;
}

.badge.badge-ok {
    border-color: rgba(25, 169, 116, 0.38);
    background: #edf9f3;
    color: #116c50;
}

.penalty-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.78rem;
    font-weight: 800;
    background: #fff;
    color: #334155;
    text-decoration: none;
}

.penalty-link-inline {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.penalty-link-inline:hover,
.penalty-link-inline:focus-visible {
    text-decoration: underline;
}

.penalty-chip-good {
    border-color: rgba(25, 169, 116, 0.35);
    background: #edf9f3;
    color: #116c50;
}

.penalty-chip-warn {
    border-color: rgba(245, 185, 75, 0.5);
    background: #fff8e8;
    color: #7b5608;
}

.penalty-chip-bad {
    border-color: rgba(223, 76, 67, 0.4);
    background: #fff0ef;
    color: #9f1239;
}

.pending-grid {
    display: grid;
    gap: 0.7rem;
    max-height: 520px;
    overflow: auto;
}

.pending-card {
    display: grid;
    gap: 0.65rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdfc;
}

.pending-head {
    display: grid;
    gap: 0.22rem;
}

.pending-head span {
    color: var(--muted);
    font-size: 0.82rem;
}

.pending-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chart-card canvas {
    width: 100%;
    height: 220px !important;
    min-height: 0;
    max-height: 220px;
}

.chart-card {
    min-height: auto;
    overflow: hidden;
}

.team-cumulative-chart-card {
    min-height: 320px;
    overflow: visible;
}

.team-cumulative-chart-card canvas {
    height: 250px !important;
    max-height: 250px;
}

.range-form select {
    min-width: 120px;
}

.dashboard-calories {
    height: auto;
}

.dashboard-calories-head {
    align-items: flex-start;
    grid-template-columns: minmax(0, 1fr) auto;
}

.dashboard-calories-title {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
}

.dashboard-calories-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-wrap: wrap;
}

.dashboard-calories-title-row h2 {
    margin: 0;
}

.dashboard-calories-title-row .badge {
    white-space: nowrap;
}

.calories-overview {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: auto;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.calories-overview .metric-box {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.55rem;
}

.calories-overview .metric-title {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.calories-overview .metric-value {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.2;
}

.dashboard-calories #calorieChart {
    height: 175px !important;
    max-height: 175px;
}

.meal-calendar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.meal-calendar-month {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}

.meal-calendar article {
    position: relative;
    display: grid;
    gap: 0.35rem;
    min-height: 118px;
    padding: 0.55rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdfc;
}

.meal-calendar strong {
    font-size: 0.8rem;
}

.meal-calendar img,
.latest-meal img,
.achievement-card img {
    width: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius) - 2px);
}

.meal-calendar img {
    height: 82px;
}

.meal-thumb {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.meal-calendar .badge {
    position: absolute;
    right: 0.45rem;
    bottom: 0.45rem;
}

.latest-meal {
    margin: 0 0 0.85rem;
}

.latest-meal img {
    height: 190px;
}

.latest-meal figcaption {
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.meal-lightbox {
    width: min(920px, calc(100vw - 1.5rem));
    border: 0;
    border-radius: var(--radius);
    padding: 1rem;
    background: #fff;
    box-shadow: var(--shadow);
}

.meal-lightbox::backdrop {
    background: rgba(23, 33, 43, 0.62);
}

.meal-lightbox figure {
    margin: 0;
}

.meal-lightbox img {
    display: block;
    width: 100%;
    max-height: 74vh;
    object-fit: contain;
    border-radius: var(--radius);
    background: #0f171f;
}

.meal-lightbox figcaption {
    margin-top: 0.65rem;
    color: var(--muted);
    font-weight: 700;
}

.lightbox-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.layout-editor summary,
.user-edit-modal summary {
    cursor: pointer;
}

.leaderboard-list {
    display: grid;
    gap: 0.65rem;
}

.leaderboard-row {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdfc;
}

.leaderboard-name {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.leaderboard-avatar {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
}

.leaderboard-name-text {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
}

.leaderboard-name-text strong,
.leaderboard-name-text span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-stats {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.metric-card-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.metric-card-link:hover,
.metric-card-link:focus-visible {
    border-color: rgba(20, 163, 139, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(22, 35, 43, 0.12);
}

.team-layout-grid {
    display: grid;
    gap: 0.9rem;
}

.team-layout-item {
    order: var(--team-order, 50);
    min-width: 0;
}

.team-panel-create-btn {
    justify-self: end;
    min-width: 0;
    padding-inline: 0.78rem;
}

.team-leaderboard-user {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.team-leaderboard-user > span:last-child {
    min-width: 0;
}

.team-leaderboard-cards {
    display: grid;
    gap: 0.7rem;
}

.team-leaderboard-card {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.45fr);
    gap: 0.75rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.team-leaderboard-card:hover,
.team-leaderboard-card:focus-visible {
    border-color: rgba(20, 163, 139, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(22, 35, 43, 0.12);
}

.team-leaderboard-card.is-top {
    background: linear-gradient(90deg, rgba(20, 163, 139, 0.12), rgba(20, 163, 139, 0.03));
}

.team-leaderboard-card-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
}

.team-rank {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 32px;
    border-radius: 10px;
    background: #edf5f1;
    color: #0f766e;
    font-weight: 800;
}

.team-leaderboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.42rem;
}

.team-leaderboard-metrics > span {
    display: grid;
    gap: 0.1rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.45rem 0.55rem;
    background: #fbfdfc;
}

.team-leaderboard-metrics strong {
    font-size: 0.95rem;
    line-height: 1.2;
}

.team-leaderboard-metrics small {
    color: var(--muted);
    font-size: 0.72rem;
}

.team-leaderboard-strikes .penalty-chip {
    display: inline-flex;
    margin-left: 0.12rem;
    padding: 0.05rem 0.32rem;
    font-size: 0.68rem;
}

.team-leaderboard-top-row {
    background: linear-gradient(90deg, rgba(20, 163, 139, 0.12), rgba(20, 163, 139, 0.02));
}

.team-member-summary {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 0.85rem;
}

.team-member-avatar-wrap {
    display: grid;
    gap: 0.5rem;
    justify-items: start;
    align-content: start;
}

.member-avatar-lg {
    width: 88px;
    height: 88px;
    font-size: 1.2rem;
}

.team-member-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.team-active-challenge-panel {
    background:
        linear-gradient(120deg, rgba(20, 163, 139, 0.16), rgba(59, 130, 246, 0.08)),
        var(--glass-strong);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.team-active-challenge-panel.is-expired {
    background:
        linear-gradient(120deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.08)),
        #fff;
}

.team-active-challenge-panel.is-pending {
    background:
        linear-gradient(120deg, rgba(245, 158, 11, 0.16), rgba(251, 191, 36, 0.07)),
        #fff;
}

.team-active-challenge-head {
    align-items: center;
}

.team-active-challenge-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
}

.team-active-challenge-detail-btn {
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.team-active-challenge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.team-active-challenge-status.status-active {
    color: #0f766e;
    background: rgba(20, 163, 139, 0.16);
}

.team-active-challenge-status.status-expired {
    color: #475569;
    background: rgba(148, 163, 184, 0.26);
}

.team-active-challenge-status.status-pending {
    color: #92400e;
    background: rgba(251, 191, 36, 0.24);
}

.team-active-challenge-grid {
    display: grid;
    gap: 0.75rem;
}

.team-active-challenge-main {
    display: grid;
    gap: 0.65rem;
}

.team-active-challenge-values {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
}

.team-active-challenge-values span {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.05;
    color: #0f172a;
}

.team-active-challenge-values small {
    color: var(--muted);
    font-weight: 700;
}

.team-active-challenge-progress {
    gap: 0.35rem;
}

.team-active-challenge-objectives,
.team-challenge-detail-objectives {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
}

.team-active-challenge-objectives.has-two,
.team-challenge-detail-objectives.has-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-active-objective-card,
.team-challenge-detail-objective {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.62rem 0.7rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.team-active-objective-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.team-active-objective-card-head span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.team-active-objective-card-head strong {
    min-width: 0;
    color: #0f172a;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.team-active-objective-card small,
.team-challenge-detail-objective p {
    margin: 0;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
}

.mini-progress {
    height: 7px;
}

.team-active-challenge-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.team-active-challenge-meta > span {
    display: grid;
    gap: 0.15rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 0.45rem 0.55rem;
    background: rgba(255, 255, 255, 0.68);
}

.team-active-challenge-meta strong {
    font-size: 0.74rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.team-active-challenge-meta small {
    margin: 0;
    font-size: 0.88rem;
    color: #0f172a;
    line-height: 1.25;
}

.confirm-modal-card.team-challenge-detail-card {
    width: min(94vw, 760px);
    gap: 0.9rem;
    padding: 1.15rem;
}

.team-challenge-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    padding-right: 2rem;
}

.team-challenge-detail-head h3 {
    margin: 0;
}

.team-challenge-detail-average {
    display: grid;
    gap: 0.45rem;
    padding: 0.85rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(20, 163, 139, 0.16), rgba(255, 255, 255, 0.58)),
        rgba(255, 255, 255, 0.62);
}

.team-challenge-detail-average > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: baseline;
}

.team-challenge-detail-average strong {
    color: #0f172a;
}

.team-challenge-detail-average small {
    color: var(--muted);
    font-weight: 800;
}

.team-challenge-detail-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-goals-list {
    gap: 0.8rem;
}

.notifications-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
}

.notifications-list {
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.notification-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: start;
    padding: 0.72rem 0.78rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.26);
    background: #fff;
}

.notification-card:last-child {
    border-bottom: 0;
}

.notification-card.is-unread {
    box-shadow: inset 3px 0 0 rgba(20, 163, 139, 0.55);
}

.notification-card.is-read {
    background: #fbfdfc;
}

.notification-main {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
    text-decoration: none;
    color: inherit;
}

.notification-main strong {
    white-space: normal;
    line-height: 1.28;
    font-size: 0.94rem;
}

.notification-main p {
    margin: 0;
    color: #334155;
    font-size: 0.86rem;
    line-height: 1.34;
}

.notification-time {
    font-size: 0.74rem;
    letter-spacing: 0.01em;
}

.notification-card.is-read .notification-main strong {
    color: #334155;
    font-weight: 700;
}

.notification-actions {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.notification-actions form {
    margin: 0;
}

.notification-action-btn {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
}

.notification-action-btn:hover,
.notification-action-btn:focus-visible {
    border-color: rgba(20, 163, 139, 0.45);
}

.notification-action-read {
    color: #0f766e;
}

.notification-action-delete {
    color: #b91c1c;
}

.notification-delete-all-btn {
    color: #b91c1c;
}

.team-notifications-panel .card-list {
    gap: 0.6rem;
}

.team-notification-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
}

.team-notification-main {
    display: grid;
    gap: 0.2rem;
}

.team-notification-main p {
    margin: 0;
}

.team-notification-action {
    flex: 0 0 auto;
}

.team-goal-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(247, 253, 250, 0.72)),
        rgba(255, 255, 255, 0.74);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px) saturate(135%);
    -webkit-backdrop-filter: blur(14px) saturate(135%);
    align-items: start;
}

.team-goal-main {
    display: grid;
    gap: 0.35rem;
}

.team-goal-objective-grid,
.team-goal-meta-grid {
    display: grid;
    gap: 0.42rem;
}

.team-goal-objective-grid {
    grid-template-columns: 1fr;
}

.team-goal-objective-grid.has-two,
.team-goal-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-goal-objective-pill {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
    padding: 0.68rem 0.78rem;
    border: 1px solid rgba(20, 163, 139, 0.18);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(20, 163, 139, 0.12), rgba(255, 255, 255, 0.7)),
        rgba(255, 255, 255, 0.76);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.team-goal-meta-grid > span {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
    padding: 0.38rem 0.46rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.team-goal-objective-pill small,
.team-goal-meta-grid small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.team-goal-objective-pill strong,
.team-goal-meta-grid strong,
.team-goal-progress-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.team-goal-head {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: center;
}

.team-challenges-panel .panel-head {
    grid-template-columns: minmax(0, 1fr) auto;
}

.team-members-panel .card-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.team-members-panel .member-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}

.team-members-panel .member-card .btn {
    white-space: nowrap;
}

.team-mobile-title-badge {
    display: none;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.team-goal-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.team-goal-status.status-active {
    color: #0f766e;
    background: rgba(20, 163, 139, 0.14);
}

.team-goal-status.status-complete {
    color: #0f5132;
    background: rgba(34, 197, 94, 0.18);
}

.team-goal-status.status-archived {
    color: #4b5563;
    background: rgba(148, 163, 184, 0.24);
}

.team-goal-status.status-pending {
    color: #92400e;
    background: rgba(251, 191, 36, 0.24);
}

.team-goal-status.status-expired {
    color: #475569;
    background: rgba(148, 163, 184, 0.24);
}

.team-goal-progress-wrap {
    gap: 0.36rem;
}

.team-goal-progress-wrap small {
    font-weight: 700;
}

.team-goal-progress-secondary {
    color: var(--muted);
}

.team-goal-actions-menu {
    justify-self: end;
    align-self: start;
}

.team-goal-actions-menu > summary {
    min-width: 36px;
    padding-inline: 0.42rem;
}

.team-goal-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.team-goal-actions .inline-actions-mini {
    justify-content: flex-start;
    gap: 0.4rem;
}

.team-goal-action-btn {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
}

.team-goal-reward {
    color: #0f766e;
    font-weight: 700;
}

.team-goal-debug {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.72rem;
    color: #475569;
    line-height: 1.35;
}

.team-goal-form-helper {
    margin: -0.2rem 0 0;
}

.team-goal-reward-toggle {
    margin-top: -0.15rem;
}

.confirm-modal-card.team-goal-modal-card {
    width: min(94vw, 860px);
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    padding: 1.1rem 1.1rem 1rem;
}

.team-goal-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.team-goal-form-full {
    grid-column: 1 / -1;
}

.team-goal-secondary-toggle {
    margin-top: -0.1rem;
}

.team-metric-detail-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
    margin-bottom: 0.9rem;
}

.team-metric-total-card strong {
    font-size: 1.85rem;
    line-height: 1.05;
}

.team-metric-chart-card {
    min-height: 250px;
}

.team-metric-chart-card canvas {
    height: 100% !important;
    max-height: 250px;
}

.user-edit-modal > form {
    margin-top: 0.85rem;
}

.profile-hero {
    align-items: center;
}

.profile-title {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.profile-avatar {
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    font-size: 1.4rem;
    border-radius: 50%;
    border: 2px solid rgba(20, 163, 139, 0.26);
}

.settings-avatar-preview-round {
    border-radius: 50%;
    border: 2px solid rgba(20, 163, 139, 0.26);
}

.settings-avatar-preview {
    width: 104px;
    height: 104px;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.image-cropper {
    display: grid;
    gap: 0.55rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdfc;
}

.image-cropper canvas {
    width: min(100%, 320px);
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f3f7f6;
    touch-action: none;
    cursor: move;
}

.image-cropper input[type="range"] {
    padding: 0;
}

.admin-login-background {
    margin-top: 0.65rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
}

.admin-login-bg-active {
    margin: 0;
    display: grid;
    gap: 0.45rem;
}

.admin-login-bg-active img {
    width: 100%;
    max-width: 360px;
    border-radius: 12px;
    border: 1px solid var(--line);
    max-height: 190px;
    object-fit: cover;
}

.admin-login-bg-active figcaption {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.admin-login-bg-library {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.6rem;
}

.admin-login-bg-item {
    display: grid;
    gap: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.45rem;
    background: #fff;
}

.admin-login-bg-item.is-active {
    border-color: rgba(20, 163, 139, 0.62);
    box-shadow: inset 0 0 0 1px rgba(20, 163, 139, 0.24);
}

.admin-login-bg-item img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--line);
    height: 96px;
    object-fit: cover;
}

.admin-login-bg-item-meta {
    display: grid;
    gap: 0.32rem;
}

.admin-login-bg-item-meta strong {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-backup-list {
    gap: 0.6rem;
}

.admin-backup-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
}

.admin-backup-item.is-missing {
    border-color: rgba(223, 76, 67, 0.3);
    background: #fff8f7;
}

.admin-backup-meta {
    display: grid;
    gap: 0.18rem;
}

.admin-backup-meta span,
.admin-backup-meta small {
    font-size: 0.8rem;
    color: var(--muted);
}

.admin-backup-actions {
    display: grid;
    gap: 0.45rem;
    justify-items: end;
}

.admin-backup-actions form {
    margin: 0;
}

.admin-backup-restore-form {
    display: grid;
    gap: 0.4rem;
}

.admin-backup-restore-form label {
    font-size: 0.76rem;
    color: var(--muted);
}

.admin-backup-restore-form input {
    min-height: 36px;
    padding: 0.45rem 0.55rem;
    max-width: 152px;
}

.admin-section-help {
    margin: 0.2rem 0 0;
    max-width: 68ch;
}

.admin-achievement-row {
    display: grid;
    align-items: center;
    justify-content: stretch;
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.achievement-translation-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.7rem;
}

.achievement-translation-card {
    display: grid;
    gap: 0.52rem;
    min-width: 0;
    margin: 0;
    padding: 0.72rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdfc;
}

.achievement-translation-card legend {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.2rem;
    font-size: 0.78rem;
    font-weight: 900;
}

.admin-danger-zone {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(223, 76, 67, 0.22);
}

.admin-quote-form {
    margin-bottom: 1rem;
}

.mini-card.admin-quote-item {
    display: grid;
    align-items: flex-start;
    grid-template-columns: minmax(0, 1fr) auto;
}

.mini-card.admin-quote-item strong {
    line-height: 1.35;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
}

.mini-card.admin-quote-item span:not(.badge) {
    color: var(--muted);
    font-size: 0.8rem;
}

.profile-chip {
    display: grid;
    gap: 0.2rem;
    min-width: 150px;
    padding: 0.9rem;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
}

.profile-chip span {
    color: #9fe4d6;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.profile-chip strong {
    font-size: 1.25rem;
}

.member-card-title {
    display: inline-grid;
    align-self: center;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--line);
    object-fit: cover;
    background: #eef4f1;
}

.member-avatar-initials {
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--ink);
}

.compact-form {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.goal-editor {
    display: grid;
    gap: 0.65rem;
    align-items: stretch;
}

.goal-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    width: 100%;
}

.goal-editor-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.goal-subview {
    gap: 0.7rem;
}

.goal-detail-card {
    align-items: stretch;
}

.goal-detail-summary {
    display: grid;
    gap: 0.85rem;
    padding: 0.95rem;
}

.goal-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.goal-summary-item {
    min-width: 0;
    display: grid;
    gap: 0.1rem;
}

.goal-summary-item strong {
    font-size: 0.76rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.goal-summary-item span {
    font-size: 0.92rem;
    color: var(--ink);
}

.goal-status-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.goal-progress-wrap {
    display: grid;
    gap: 0.3rem;
}

.goal-progress-wrap small {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.goal-detail-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.grid-inline.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-list,
.stat-list,
.audit-list {
    display: grid;
    gap: 0.65rem;
}

.mini-card,
.stat-list article,
.audit-list article,
.achievement-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdfc;
}

.mini-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.75rem;
}

.mini-card > div,
.stat-list article,
.audit-list article {
    min-width: 0;
}

.mini-card strong,
.stat-list strong,
.audit-list strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-card span,
.stat-list span,
.audit-list span,
.achievement-card small {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.stat-list article,
.audit-list article {
    padding: 0.75rem;
}

.inline-actions-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.7rem;
}

.achievement-grid-collapsible {
    max-height: 360px;
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.achievement-grid-collapsible.expanded {
    max-height: 2000px;
}

.achievement-remove {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.profile-achievement-card {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    min-height: 100%;
}

.profile-achievement-media {
    width: 68px;
    min-height: 68px;
    border-radius: 12px;
    border: 1px solid rgba(20, 163, 139, 0.24);
    background: #f0f8f4;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.profile-achievement-card .profile-achievement-media img {
    width: 100%;
    height: 100%;
    min-height: 68px;
    object-fit: cover;
}

.profile-achievement-media span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    font-size: 0;
}

.profile-achievement-media span::before {
    content: "\2605";
    font-size: 1rem;
}

.profile-achievement-content {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
}

.profile-achievement-content strong {
    white-space: normal;
    overflow: visible;
}

.profile-achievement-content p {
    margin: 0;
}

.achievement-unlocked-date {
    color: var(--muted);
    font-size: 0.76rem;
}

.profile-achievement-card,
.team-achievement-card {
    border-color: rgba(20, 163, 139, 0.18);
    background:
        linear-gradient(135deg, rgba(20, 163, 139, 0.09), transparent 58%),
        #fff;
    box-shadow: 0 8px 22px rgba(22, 35, 43, 0.06);
}

.achievement-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-top: 0.12rem;
}

.achievement-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-height: 24px;
    padding: 0.16rem 0.46rem;
    border: 1px solid rgba(217, 226, 221, 0.9);
    border-radius: 999px;
    background: #fbfdfc;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
}

.achievement-toggle-wrap {
    display: flex;
    justify-content: center;
    padding-top: 0.1rem;
}

.achievement-toggle-btn {
    border-radius: 999px;
    min-width: 118px;
}

.achievement-card:hover .achievement-remove,
.achievement-card:focus-within .achievement-remove {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.achievement-delete-btn {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #9f1239;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.achievement-delete-btn:hover,
.achievement-delete-btn:focus-visible {
    background: #ef4444;
    color: #fff;
}

.achievement-delete-error {
    margin: 0.2rem 0 0;
    color: #b91c1c;
    font-size: 0.8rem;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 320;
    display: none;
    place-items: center;
    padding: clamp(0.85rem, 2.2vw, 1.4rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.confirm-modal:not([hidden]) {
    display: grid;
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(13px) saturate(145%);
    -webkit-backdrop-filter: blur(13px) saturate(145%);
}

.confirm-modal-card {
    position: relative;
    z-index: 1;
    width: min(92vw, 340px);
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
        var(--glass);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    display: grid;
    gap: 0.9rem;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
}

.goal-progress-list .mini-card {
    align-items: stretch;
}

.goal-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ecf5f1 0%, #e0ede8 100%);
    margin-top: 0.35rem;
    overflow: hidden;
    border: 1px solid rgba(20, 43, 36, 0.08);
}

.goal-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b981, #14a38b 55%, #0f766e);
    box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.1), 0 3px 10px rgba(20, 163, 139, 0.34);
    transition: width 0.2s ease;
}

.panel-inline-empty {
    padding: 0.85rem 1rem;
}

.entries-calendar {
    gap: 0.8rem;
}

.entries-calendar-controls {
    margin-bottom: 0.85rem;
}

.entries-calendar-day {
    color: inherit;
    text-decoration: none;
}

.entries-calendar-day article {
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.entries-calendar-day:hover article,
.entries-calendar-day:focus-visible article {
    border-color: rgba(20, 163, 139, 0.45);
    transform: translateY(-1px);
}

.entries-calendar-day.is-selected article {
    border-color: rgba(20, 163, 139, 0.65);
    box-shadow: 0 0 0 2px rgba(20, 163, 139, 0.12);
}

.entries-calendar-day.has-log article {
    background: #f4fbf8;
}

.entries-calendar-panel.is-loading .entries-calendar,
.entries-calendar-panel.is-loading + .entries-calendar-photos-panel {
    opacity: 0.62;
    pointer-events: none;
}

.entries-calendar-empty {
    display: grid;
    place-items: center;
    height: 82px;
    border-radius: calc(var(--radius) - 2px);
    background: #eef4f1;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.photo-post {
    display: grid;
    gap: 1.1rem;
    padding: 0.95rem;
}

.photo-post-title {
    margin-bottom: 0;
    font-size: clamp(1.5rem, 2.7vw, 2.1rem);
}

.photo-post-head {
    justify-content: space-between;
    align-items: center;
}

.photo-post-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.photo-back-btn {
    min-height: 34px;
    padding: 0.42rem 0.62rem;
}

.photo-post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
    gap: 1.1rem;
    align-items: start;
}

.photo-post-media {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 16px 36px rgba(23, 33, 43, 0.12);
}

.photo-post-media img {
    width: 100%;
    min-height: 300px;
    max-height: 72vh;
    object-fit: cover;
    display: block;
}

.photo-post-side {
    min-width: 0;
}

.photo-post-meta {
    display: grid;
    gap: 0.8rem;
    align-items: stretch;
}

.photo-post-meta-main {
    display: grid;
    gap: 0.72rem;
}

.photo-post-author {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.photo-post-author .profile-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}

.photo-post-author span {
    margin-top: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.photo-post-author strong {
    display: block;
    margin-bottom: 0.12rem;
}

.photo-post-tags {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.photo-post-tags .badge {
    margin-top: 0;
    display: inline-flex;
}

.photo-post-divider {
    width: 100%;
    height: 1px;
    background: var(--line);
}

.photo-post-caption {
    margin: 0;
    color: #26323d;
}

.photo-post-actions {
    display: grid;
    gap: 0.55rem;
    justify-items: end;
}

.photo-post-actions h3 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: var(--muted);
}

.photo-post-menu {
    position: relative;
}

.photo-post-menu > summary {
    list-style: none;
    min-width: 42px;
    justify-content: center;
}

.photo-post-menu > summary::-webkit-details-marker {
    display: none;
}

.photo-post-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 8;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    padding: 0.42rem;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(16px) saturate(145%);
    -webkit-backdrop-filter: blur(16px) saturate(145%);
    min-width: 170px;
    display: grid;
    gap: 0.32rem;
}

.photo-post-menu-panel .btn {
    justify-content: flex-start;
    width: 100%;
    min-height: 34px;
}

.photo-post-menu-panel form {
    margin: 0;
}

.photo-post-head-menu > summary {
    min-width: 36px;
    padding-inline: 0.42rem;
}

.photo-delete-text-btn {
    color: #b91c1c;
    justify-self: stretch;
    width: 100%;
}

.photo-edit-modal-card {
    width: min(660px, calc(100vw - 1.5rem));
    max-height: min(88vh, 760px);
    overflow: auto;
}

.photo-post-nutrition h3 {
    margin: 0;
}

.photo-post-nutrition ul {
    list-style: none;
    margin: 0.55rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.photo-post-nutrition li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.84rem;
}

.photo-comments {
    padding-top: 0.72rem;
    border-top: 1px solid var(--line);
}

.photo-comments-head {
    align-items: center;
}

.photo-comment-form {
    margin-top: 0.15rem;
}

.photo-comment-form input[type="text"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.62rem 0.82rem;
    background: #fff;
}

.photo-comment-actions {
    justify-content: flex-start;
}

.photo-comments-empty {
    display: grid;
    gap: 0.18rem;
    padding: 0.72rem;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: #f8fcfa;
}

.photo-comments-empty strong {
    font-size: 0.9rem;
}

.photo-comments-empty span {
    color: var(--muted);
    font-size: 0.82rem;
}

.photo-comment-list {
    display: grid;
    gap: 0.65rem;
}

.photo-comment-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f9fcfb;
    padding: 0.72rem;
    display: grid;
    gap: 0.5rem;
    box-shadow: 0 8px 18px rgba(23, 33, 43, 0.06);
}

.photo-comment-item p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.photo-comment-head {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: flex-start;
}

.photo-comment-author {
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.photo-comment-author .profile-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

.photo-comment-author span {
    color: var(--muted);
    font-size: 0.78rem;
}

.strike-review-form {
    gap: 0.35rem;
}

.strike-review-form input[type="text"] {
    min-width: 220px;
}

.strike-review-form textarea {
    min-height: 110px;
    resize: vertical;
}

.strike-review-vote .btn {
    min-width: 88px;
}

.team-settings-bottom {
    display: none;
}

.week-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.05rem;
    margin-top: 0.9rem;
    align-items: start;
}

.week-day-card {
    border: 1px solid rgba(20, 43, 36, 0.18);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #f6fbf9 0%, #fbfdfc 100%);
    box-shadow: 0 12px 24px rgba(18, 37, 32, 0.06);
    padding: 0.92rem;
    display: grid;
    gap: 0.82rem;
    align-content: start;
}

.week-day-card:nth-child(even) {
    background: linear-gradient(180deg, #f4f9fb 0%, #fbfdfd 100%);
}

.week-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px dashed rgba(20, 43, 36, 0.16);
    padding-bottom: 0.42rem;
}

.week-section {
    display: grid;
    gap: 0.62rem;
    border: 1px solid rgba(20, 43, 36, 0.18);
    border-radius: calc(var(--radius) - 2px);
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    padding: 0.72rem;
}

.week-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.week-section-head h3 {
    margin: 0;
    color: var(--muted);
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 800;
}

.week-section-grid {
    display: grid;
    gap: 0.58rem;
}

.week-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.week-workout-grid,
.week-excuses-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.week-field {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.week-field > span {
    font-size: 0.76rem;
    color: var(--muted);
    line-height: 1.3;
    font-weight: 700;
}

.week-field-secondary {
    opacity: 0.92;
}

.week-workout-grid .week-check {
    min-width: 0;
}

.week-workout-grid > .week-help-wrap,
.week-workout-grid > .week-extra-toolbar,
.week-workout-grid > .week-extra-panel {
    grid-column: 1 / -1;
}

.week-request-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-top: 1px dashed var(--line);
    padding-top: 0.45rem;
}

.workout-type-control {
    display: grid;
    gap: 0.48rem;
}

.workout-type-custom {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.workout-type-custom .btn {
    white-space: nowrap;
}

.workout-type-custom input {
    flex: 1;
}

.week-extra-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.week-extra-panel {
    display: grid;
    gap: 0.55rem;
    border: 1px dashed var(--line);
    border-radius: calc(var(--radius) - 3px);
    padding: 0.55rem;
    background: #f9fcfb;
}

.week-extra-list {
    display: grid;
    gap: 0.5rem;
}

.week-extra-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.52rem;
    align-items: end;
}

.week-extra-row .btn {
    align-self: stretch;
    white-space: nowrap;
}

.week-custom-habit {
    display: grid;
    gap: 0.52rem;
    border: 1px dashed var(--line);
    border-radius: calc(var(--radius) - 3px);
    padding: 0.55rem;
    background: #f9fcfb;
}

.week-custom-habit-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.week-day-notes {
    width: 100%;
}

.week-day-habits {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.week-day-habits .check {
    min-width: 0;
}

.week-help-wrap {
    min-width: 0;
    position: relative;
}

.week-day-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
}

@media (min-width: 1300px) {
    .week-metrics-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (hover: hover) and (pointer: fine) {
    .week-help-wrap[data-help],
    .week-check[data-help] {
        position: relative;
    }

    .week-help-wrap[data-help]::before,
    .week-check[data-help]::before {
        content: '';
        position: absolute;
        left: 12px;
        top: calc(100% + 2px);
        border: 6px solid transparent;
        border-bottom-color: rgba(15, 24, 20, 0.95);
        opacity: 0;
        transform: translateY(4px);
        pointer-events: none;
        transition: opacity 0.15s ease, transform 0.15s ease;
        z-index: 22;
    }

    .week-help-wrap[data-help]::after,
    .week-check[data-help]::after {
        content: attr(data-help);
        position: absolute;
        left: 0;
        top: calc(100% + 13px);
        width: min(280px, calc(100vw - 2rem));
        border-radius: 10px;
        background: rgba(15, 24, 20, 0.95);
        color: #f9fcfb;
        padding: 0.55rem 0.62rem;
        font-size: 0.74rem;
        line-height: 1.35;
        box-shadow: 0 14px 28px rgba(15, 24, 20, 0.28);
        opacity: 0;
        transform: translateY(6px);
        pointer-events: none;
        transition: opacity 0.15s ease, transform 0.15s ease;
        z-index: 22;
    }

    .week-help-wrap[data-help]:hover::before,
    .week-help-wrap[data-help]:hover::after,
    .week-help-wrap[data-help]:focus-within::before,
    .week-help-wrap[data-help]:focus-within::after,
    .week-check[data-help]:hover::before,
    .week-check[data-help]:hover::after,
    .week-check[data-help]:focus-within::before,
    .week-check[data-help]:focus-within::after {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .week-editor-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .week-metrics-grid,
    .week-workout-grid,
    .week-excuses-grid,
    .week-extra-row,
    .week-day-habits {
        grid-template-columns: 1fr;
    }

    .workout-type-custom {
        flex-direction: column;
        align-items: stretch;
    }

    .workout-type-custom .btn {
        width: 100%;
    }

    .week-day-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .week-day-actions .btn {
        width: 100%;
    }

    .week-request-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .team-notification-card {
        flex-direction: column;
    }
}

.achievement-card {
    display: grid;
    gap: 0.35rem;
    padding: 0.8rem;
    position: relative;
    background:
        linear-gradient(135deg, rgba(20, 163, 139, 0.12), transparent 58%),
        #fff;
}

.achievement-card > span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
}

.achievement-card img {
    height: 118px;
}

.achievement-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.team-achievements-panel .achievement-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.team-achievement-card {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.72rem;
    min-height: 112px;
}

.team-achievement-media {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    border: 1px solid rgba(20, 163, 139, 0.18);
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(20, 163, 139, 0.18), rgba(255, 255, 255, 0.86)),
        #f0f8f4;
}

.team-achievement-media > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    font-size: 0;
}

.team-achievement-media > span::before {
    content: "\2605";
    font-size: 1rem;
}

.team-achievement-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-achievement-body {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
}

.team-achievement-date {
    font-weight: 750;
}

.team-add-form {
    align-items: end;
}

.inline-create {
    margin-top: 0.8rem;
}

.audit-filter label {
    min-width: 130px;
}

.audit-list details {
    margin-top: 0.45rem;
}

.audit-list pre {
    max-width: 100%;
    overflow: auto;
    padding: 0.55rem;
    border-radius: 6px;
    background: #eef4f1;
    color: #26323d;
    font-size: 0.72rem;
    white-space: pre-wrap;
}

@media (min-width: 680px) {
    .container {
        width: min(1180px, calc(100vw - 2.5rem));
        margin-bottom: 2.5rem;
    }

    .hero-panel {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        padding: 1.25rem;
    }

    .metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .grid-two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-inline,
    .quick-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid-inline.entries-two-col,
    .quick-stats.entries-two-col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-card canvas {
        height: 260px !important;
        max-height: 260px;
    }

    .dashboard-calories #calorieChart {
        height: 205px !important;
        max-height: 205px;
    }

    .meal-calendar {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .toggle-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .auth-shell {
        grid-template-columns: minmax(0, 1fr) 420px;
        align-items: center;
    }
}

@media (min-width: 900px) {
    .dashboard-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-grid,
    .penalties-history-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-chart-wide,
    .analytics-grid-single {
        grid-column: 1 / -1;
    }

    .team-layout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .team-widget-metrics,
    .team-widget-active-challenge,
    .team-widget-leaderboard,
    .team-widget-daily-charts,
    .team-widget-weekly-charts,
    .team-widget-achievements {
        grid-column: 1 / -1;
    }

    .team-widget-challenges,
    .team-widget-members,
    .team-widget-cumulative-steps,
    .team-widget-cumulative-distance {
        grid-column: span 1;
    }
}

@media (min-width: 900px) {
    .container-with-nav {
        margin-top: 6.3rem;
    }

    .nav-links {
        display: flex;
    }

    .bottom-nav {
        display: none;
    }

    .floating-log {
        display: none;
    }

    .proof-photo-grid {
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    }

    .proof-photo-preview img,
    .proof-photo-preview .photo-placeholder {
        min-height: 340px;
    }
}

@media (max-width: 899px) {
    .team-layout-editor {
        display: none;
    }
}

@media (max-width: 520px) {
    .brand > span:last-child {
        max-width: 150px;
    }

    .topbar {
        gap: 0.5rem;
    }

    .locale-form select {
        min-width: 92px;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .topbar-context-panel {
        position: fixed;
        top: 4.25rem;
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 5.2rem);
        overflow-y: auto;
    }

    .team-layout-editor {
        display: none;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 102px;
    }

    .dashboard-quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-kpis.metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .dashboard-kpis .metric-card {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 0.42rem;
        min-height: 86px;
        padding: 0.55rem;
    }

    .dashboard-kpis .progress-ring {
        width: 44px;
        height: 44px;
    }

    .dashboard-kpis .progress-ring span {
        width: 34px;
        font-size: 0.62rem;
    }

    .dashboard-kpis .metric-card span {
        font-size: 0.66rem;
        line-height: 1.05;
    }

    .dashboard-kpis .metric-card strong {
        font-size: 1rem;
        overflow-wrap: anywhere;
    }

    .dashboard-kpis .metric-card p {
        font-size: 0.68rem;
        line-height: 1.12;
    }

    .dashboard-quick-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .dashboard-quick-action {
        min-height: 44px;
        padding-inline: 0.45rem;
        font-size: 0.76rem;
        line-height: 1.15;
    }

    .dashboard-week-actions {
        display: grid;
        width: 100%;
    }

    .dashboard-week-actions .btn {
        width: 100%;
    }

    .facts li {
        display: grid;
        gap: 0.18rem;
    }

    .grid-inline.two {
        grid-template-columns: 1fr;
    }

    .mini-card {
        align-items: stretch;
        display: grid;
    }

    .inline-actions-mini {
        justify-content: flex-end;
    }

    .inline-actions-mini .btn,
    .mini-card form .btn {
        width: 100%;
    }

    .panel-head > .btn,
    .panel-head > .inline-actions-mini {
        justify-self: end;
    }

    .panel-head > .btn,
    .panel-head .inline-actions-mini .btn {
        width: auto;
    }

    .table {
        min-width: 620px;
    }

    .spreadsheet {
        min-width: 1120px;
    }

    .dashboard-toolbar .control-strip,
    .dashboard-toolbar label,
    .dashboard-toolbar select {
        width: 100%;
    }

    .notifications-toolbar {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .notifications-toolbar .btn {
        width: 100%;
        justify-content: center;
        font-size: 0.74rem;
        padding-inline: 0.45rem;
    }

    .panel-head {
        align-items: stretch;
        display: grid;
    }

    .dashboard-weekly-history > .panel-head,
    .dashboard-meal-calendar-panel > .panel-head,
    .entries-calendar-panel > .panel-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.55rem;
    }

    .dashboard-weekly-history .dashboard-panel-action,
    .entries-calendar-back {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .dashboard-meal-calendar-panel .control-strip {
        flex: 0 0 auto;
        justify-content: flex-end;
    }

    .dashboard-meal-calendar-panel .entry-date-inline {
        min-width: 136px;
        width: 136px;
    }

    .dashboard-meal-calendar-panel .entry-date-inline input {
        padding-inline: 0.48rem;
        font-size: 0.78rem;
    }

    .entries-calendar-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .entries-calendar-controls label,
    .entries-calendar-controls .entry-date-inline {
        min-width: 0;
        width: 100%;
    }

    .entries-calendar-controls input,
    .entries-calendar-controls select {
        padding-inline: 0.5rem;
        font-size: 0.8rem;
    }

    .profile-title {
        align-items: flex-start;
    }

    .entry-datetime-inline {
        justify-content: stretch;
        width: 100%;
    }

    .entry-date-inline,
    .entry-time-inline {
        min-width: 0;
        width: 100%;
    }

    .auth-copy-login {
        padding: 0.4rem 0.25rem;
    }

    .login-brand-image {
        width: 64px;
        height: 64px;
    }

    .admin-backup-item {
        grid-template-columns: 1fr;
    }

    .admin-backup-actions {
        justify-items: stretch;
    }

    .admin-backup-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .admin-backup-restore-form input {
        max-width: none;
    }

    .entry-data-head {
        gap: 0.65rem;
    }

    .entry-datetime-inline {
        width: 100%;
    }

    .workout-toggle-row {
        grid-template-columns: 1fr auto;
    }

    .entry-workout-toggle {
        width: 100%;
    }

    .goal-editor-grid,
    .goal-summary-grid,
    .entries-two-col,
    .workout-row,
    .team-metric-detail-grid,
    .team-active-challenge-meta,
    .team-active-challenge-objectives.has-two,
    .team-challenge-detail-objectives.has-two,
    .team-challenge-detail-meta,
    .team-member-summary,
    .team-member-stat-grid,
    .week-day-primary,
    .week-day-secondary,
    .week-day-habits {
        grid-template-columns: 1fr;
    }

    .profile-achievement-card {
        grid-template-columns: 1fr;
    }

    .profile-achievement-media {
        width: 100%;
        min-height: 120px;
    }

    .photo-post-layout {
        grid-template-columns: 1fr;
    }

    .photo-post {
        padding: 0.82rem;
    }

    .photo-post-head {
        gap: 0.55rem;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .photo-post-head-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    .photo-back-btn {
        width: fit-content;
    }

    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .photo-grid img,
    .photo-card-media .entries-calendar-empty {
        height: 132px;
    }

    .photo-grid figcaption {
        padding: 0.5rem;
        font-size: 0.76rem;
    }

    .calories-overview .metric-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.12rem;
    }

    .team-settings-top {
        display: none;
    }

    .team-settings-bottom {
        display: inline-flex;
        order: 999;
        margin-top: 0.4rem;
    }

    .team-goal-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-layout-item {
        order: var(--team-mobile-order, var(--team-order, 50));
    }

    .team-leaderboard-card {
        grid-template-columns: 1fr;
        gap: 0.58rem;
        padding: 0.68rem;
    }

    .team-leaderboard-card-head {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.48rem;
    }

    .team-leaderboard-card-head .badge {
        grid-column: 2;
        justify-self: start;
        width: fit-content;
    }

    .team-leaderboard-user strong,
    .team-leaderboard-user small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .team-rank {
        min-width: 34px;
        height: 30px;
    }

    .team-leaderboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .team-leaderboard-metrics > span {
        padding: 0.42rem 0.48rem;
    }

    .team-goal-card {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 0.68rem;
    }

    .team-goal-actions-menu > summary {
        width: 2rem;
        height: 2rem;
        min-width: 2rem;
        padding: 0;
    }

    .team-members-panel .card-list {
        grid-template-columns: 1fr;
    }

    .team-members-panel .member-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.55rem;
        padding: 0.62rem;
    }

    .team-members-panel .member-card .btn {
        width: auto;
        padding-inline: 0.55rem;
    }

    .team-achievement-card {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.58rem;
        min-height: 0;
        padding: 0.66rem;
    }

    .team-achievement-media {
        width: 52px;
        height: 52px;
        border-radius: 12px;
    }

    .team-active-challenge-values span {
        font-size: 1.18rem;
    }

    .notification-card {
        padding: 0.62rem 0.65rem;
        gap: 0.52rem;
    }

    .notification-main p {
        font-size: 0.82rem;
    }

    .notification-actions {
        gap: 0.3rem;
    }

    .notification-action-btn {
        width: 1.9rem;
        height: 1.9rem;
        min-width: 1.9rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .topbar .topbar-add-menu,
    .topbar .btn-add,
    .topbar [data-add-button],
    .topbar a[href*="entries"] {
        display: none !important;
    }

    .proof-photo-grid {
        grid-template-columns: 1fr;
    }

    .proof-photo-main-card,
    .proof-photo-side-card {
        padding: 0.78rem;
    }

    .photo-post {
        gap: 0.85rem;
    }

    .photo-post-head-actions {
        gap: 0.35rem;
    }

    .photo-post-layout {
        gap: 0.85rem;
    }

    .photo-post-media img {
        min-height: 220px;
        max-height: 60vh;
        object-fit: contain;
        background: #edf3f0;
    }

    .photo-post-nutrition li {
        font-size: 0.8rem;
    }

    .photo-comment-head {
        flex-direction: column;
        gap: 0.45rem;
    }

    .photo-comment-actions {
        justify-content: stretch;
    }

    .photo-comment-actions .btn {
        width: 100%;
    }

    .auth-shell-login {
        gap: 0.85rem;
    }

    .auth-copy-login {
        order: 1;
    }

    .auth-card-login {
        order: 2;
    }
}

@media (max-width: 899px) {
    .dashboard-layout-context {
        display: none;
    }
}

@media (max-width: 700px) {
    .dashboard-desktop-table-wrap {
        display: none;
    }

    .analytics-controls {
        grid-template-columns: 1fr;
    }

    .analytics-nav-links {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.2rem;
    }

    .analytics-nav-links .btn {
        flex: 0 0 auto;
    }

    .analytics-hero,
    .analytics-section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-mobile-card-list {
        display: grid;
        gap: 0.62rem;
    }

    .dashboard-weekly-history .panel-head {
        align-items: center;
        gap: 0.5rem;
    }

    .dashboard-weekly-history .panel-head h2 {
        margin-bottom: 0;
    }

    .dashboard-mobile-card {
        padding: 0.68rem;
        gap: 0.56rem;
    }

    .dashboard-mobile-card-head {
        gap: 0.38rem;
    }

    .dashboard-mobile-card-head .badge {
        padding: 0.14rem 0.44rem;
        font-size: 0.68rem;
        white-space: nowrap;
    }

    .dashboard-mobile-metrics {
        gap: 0.34rem;
    }

    .dashboard-mobile-metrics > span {
        padding: 0.4rem 0.42rem;
    }

    .dashboard-mobile-actions .btn {
        min-height: 32px;
        padding: 0.28rem 0.5rem;
        font-size: 0.72rem;
    }

    .dashboard-weekly-history .table-wrap {
        overflow: visible;
    }

    .responsive-card-table,
    .responsive-card-table thead,
    .responsive-card-table tbody,
    .responsive-card-table tr,
    .responsive-card-table th,
    .responsive-card-table td {
        display: block;
    }

    .responsive-card-table thead {
        display: none;
    }

    .responsive-card-table tbody {
        display: grid;
        gap: 0.65rem;
    }

    .responsive-card-table tr {
        display: grid;
        gap: 0.36rem;
        padding: 0.72rem;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        box-shadow: 0 8px 20px rgba(22, 35, 43, 0.07);
    }

    .responsive-card-table td {
        display: grid;
        grid-template-columns: minmax(95px, 0.75fr) minmax(0, 1fr);
        gap: 0.55rem;
        align-items: center;
        padding: 0;
        border: 0;
        text-align: right;
    }

    .responsive-card-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 800;
        text-align: left;
        text-transform: uppercase;
    }

    .responsive-card-table td:first-child {
        grid-template-columns: 1fr;
        text-align: left;
        font-weight: 850;
    }

    .responsive-card-table td:first-child::before {
        margin-bottom: -0.12rem;
    }

    .responsive-card-table .penalty-chip {
        justify-self: end;
    }

    .dashboard-week-actions {
        display: flex;
        justify-content: flex-end;
        width: auto;
        gap: 0.32rem;
    }

    .dashboard-week-actions .btn {
        width: auto;
        min-height: 32px;
        padding: 0.3rem 0.5rem;
        font-size: 0.74rem;
    }

    .compact-segmented-control {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .compact-segmented-control .btn {
        justify-content: center;
        min-width: 0;
        padding-inline: 0.38rem;
        font-size: 0.76rem;
    }

    .dashboard-calories-head {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.5rem;
    }

    .dashboard-calories-title-row {
        gap: 0.42rem;
    }

    .dashboard-calories-title-row .badge {
        font-size: 0.68rem;
        padding: 0.14rem 0.42rem;
    }

    .team-leaderboard-panel .panel-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.45rem;
        margin-bottom: 0.52rem;
    }

    .team-leaderboard-panel .panel-head > div {
        min-width: 0;
    }

    .team-leaderboard-panel .panel-head h2 {
        margin-bottom: 0;
        line-height: 1.1;
    }

    .team-leaderboard-panel .metric-help-popover {
        flex: 0 0 auto;
        align-self: center;
    }

    .team-leaderboard-card {
        grid-template-columns: 1fr;
        gap: 0.52rem;
        padding: 0.62rem;
    }

    .team-leaderboard-card-head {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.42rem;
    }

    .team-leaderboard-card-head .badge {
        grid-column: auto;
        justify-self: end;
        width: auto;
        max-width: 92px;
        padding: 0.12rem 0.42rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.68rem;
    }

    .team-rank {
        min-width: 32px;
        height: 30px;
        border-radius: 9px;
        font-size: 0.78rem;
    }

    .team-leaderboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.36rem;
    }

    .team-leaderboard-metrics > span {
        padding: 0.38rem 0.45rem;
    }

    .team-leaderboard-strikes small {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        flex-wrap: wrap;
    }

    .team-goal-card {
        position: relative;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.5rem;
        padding: 0.62rem;
    }

    .team-goal-main {
        gap: 0.45rem;
    }

    .team-goal-head {
        flex-direction: row;
        align-items: flex-start;
        padding-right: 0.2rem;
    }

    .team-goal-head strong {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .team-goal-status {
        flex: 0 0 auto;
        font-size: 0.66rem;
        padding: 0.1rem 0.42rem;
    }

    .team-goal-objective-grid,
    .team-goal-objective-grid.has-two,
    .team-goal-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.36rem;
    }

    .team-goal-objective-grid,
    .team-goal-objective-grid.has-two {
        grid-template-columns: 1fr;
    }

    .team-goal-objective-pill,
    .team-goal-meta-grid > span {
        padding: 0.34rem 0.4rem;
    }

    .team-goal-objective-pill small,
    .team-goal-meta-grid small {
        font-size: 0.62rem;
    }

    .team-goal-objective-pill strong,
    .team-goal-meta-grid strong,
    .team-goal-progress-text {
        font-size: 0.78rem;
    }

    .team-goal-actions-menu {
        align-self: start;
    }

    .team-goal-form {
        grid-template-columns: 1fr;
    }

    .team-goal-form-full {
        grid-column: auto;
    }

    .confirm-modal-card.team-goal-modal-card {
        width: min(96vw, 560px);
        max-height: calc(100dvh - 1rem);
        padding: 0.9rem;
    }

    .team-panel-count-badge {
        display: none;
    }

    .team-mobile-title-badge {
        display: inline-flex;
        transform: translateY(-1px);
    }

    .team-members-panel .member-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.48rem;
        padding: 0.56rem;
    }

    .team-members-panel .member-card .btn {
        min-height: 32px;
        padding: 0.28rem 0.48rem;
        font-size: 0.72rem;
    }

    .team-achievement-card {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.48rem;
        padding: 0.58rem;
        align-items: center;
    }

    .team-achievement-media {
        width: 48px;
        height: 48px;
        border-radius: 11px;
    }

    .team-achievement-body {
        gap: 0.1rem;
    }

    .team-achievement-body p {
        display: -webkit-box;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .profile-achievement-card {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 0.58rem;
        padding: 0.62rem;
        align-items: center;
    }

    .profile-achievement-media {
        width: 52px;
        height: 52px;
        min-height: 52px;
        border-radius: 12px;
    }

    .profile-achievement-card .profile-achievement-media img {
        min-height: 52px;
    }

    .achievement-card-meta {
        gap: 0.22rem;
    }

    .achievement-chip {
        min-height: 22px;
        padding: 0.12rem 0.38rem;
        font-size: 0.66rem;
    }

    .achievement-remove {
        opacity: 1;
        pointer-events: auto;
    }

    .achievement-delete-btn {
        width: 22px;
        height: 22px;
        font-size: 0.92rem;
    }
}
/* Achievement cards v2 */
.achievement-visual {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(59, 130, 246, 0.16));
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    overflow: hidden;
}

.achievement-visual svg,
.achievement-icon-option-media svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: #0f766e;
}

.achievement-visual-image img,
.achievement-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.achievement-card[data-achievement-modal] {
    cursor: pointer;
    outline: none;
}

.achievement-card[data-achievement-modal]:focus-visible {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.28), var(--shadow);
}

.profile-achievement-card,
.team-achievement-card,
.achievement-list-card,
.teamMemberDetail .achievement-card {
    position: relative;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: start;
    gap: 0.85rem;
    min-height: 150px;
    height: 150px;
    overflow: hidden;
}

.achievement-list-card {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 188px;
    height: 188px;
    padding-right: 2.5rem;
    border-color: rgba(255, 255, 255, 0.68);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(247, 253, 250, 0.7)),
        rgba(255, 255, 255, 0.72);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(12px) saturate(135%);
    -webkit-backdrop-filter: blur(12px) saturate(135%);
}

.achievement-list-card.is-locked {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(241, 245, 249, 0.7)),
        rgba(255, 255, 255, 0.66);
}

.team-achievements-panel .achievement-grid-collapsible {
    --achievement-panel-card-height: 150px;
    --achievement-panel-grid-gap: 0.7rem;
    max-height: calc((var(--achievement-panel-card-height) * 2) + var(--achievement-panel-grid-gap));
}

.team-achievements-panel .achievement-grid-collapsible.expanded {
    max-height: none;
}

.achievement-card .achievement-visual {
    align-self: start;
}

.profile-achievement-content,
.team-achievement-body,
.achievement-list-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.profile-achievement-content strong,
.team-achievement-body strong,
.achievement-card > strong,
.achievement-list-content h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.profile-achievement-content p,
.team-achievement-body p,
.achievement-card > p,
.achievement-list-content p {
    margin: 0;
    color: var(--muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.achievement-list-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
}

.achievement-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 24px;
}

.achievement-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-height: 22px;
    padding: 0.18rem 0.48rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.achievement-chip-ok {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.achievement-chip-muted {
    background: rgba(100, 116, 139, 0.13);
    color: #475569;
}

.achievement-progress {
    display: grid;
    gap: 0.25rem;
    margin-top: auto;
}

.achievement-progress small {
    color: var(--muted);
    font-weight: 800;
}

.achievement-card.is-locked .achievement-visual {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.18), rgba(203, 213, 225, 0.28));
}

.achievement-card.is-locked .achievement-visual svg {
    color: #64748b;
}

.achievement-page-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    background:
        radial-gradient(circle at top left, rgba(20, 163, 139, 0.18), transparent 42%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.68));
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.achievements-back-btn {
    align-self: flex-start;
}

.achievements-page-meter {
    width: min(360px, 100%);
    height: 9px;
    margin-top: 0.75rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
}

.achievements-page-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--coral));
}

.achievement-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.achievement-summary-card {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.achievement-summary-card strong {
    color: #0f172a;
    font-size: 1.35rem;
    line-height: 1;
}

.achievement-summary-card small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.achievement-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.85rem;
}

.achievement-toggle-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

@media (max-width: 700px) {
    .achievement-page-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .achievement-summary-strip {
        grid-template-columns: 1fr;
    }

    .team-active-challenge-head,
    .team-challenge-detail-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-active-challenge-head-actions {
        justify-content: flex-start;
    }
}

.achievement-info-modal-card {
    position: relative;
    max-width: 520px;
    width: min(520px, calc(100vw - 2rem));
    display: grid;
    gap: 0.75rem;
}

.achievement-info-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.07);
    color: var(--ink);
    font-weight: 900;
    cursor: pointer;
}

.achievement-info-modal-card h3 {
    margin: 0;
    padding-right: 2.5rem;
}

.achievement-info-modal-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.achievement-info-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.achievement-icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 0.5rem;
}

.achievement-icon-option {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
}

.achievement-icon-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.achievement-icon-option:has(input:checked) {
    border-color: rgba(14, 165, 233, 0.65);
    background: rgba(14, 165, 233, 0.1);
}

.achievement-icon-option-media {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.06);
}

.achievement-visual-fieldset {
    display: grid;
    gap: 0.75rem;
}

.dashboard-achievements-panel .panel-head {
    align-items: center;
}

.dashboard-achievements-summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.dashboard-achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.dashboard-achievement-card {
    position: relative;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0.65rem;
    min-height: 132px;
    height: 132px;
    overflow: hidden;
}

.dashboard-achievement-card .achievement-visual {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 14px;
}

.dashboard-achievement-card .achievement-visual svg {
    width: 24px;
    height: 24px;
}

.dashboard-achievement-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dashboard-achievement-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
}

.dashboard-achievement-title-row strong {
    min-width: 0;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dashboard-achievement-content p {
    margin: 0;
    color: var(--muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 720px) {
    .achievement-page-hero {
        align-items: center;
        gap: 0.75rem;
    }

    .achievement-page-hero .btn {
        flex: 0 0 auto;
        min-height: 36px;
        padding-inline: 0.7rem;
    }

    .achievements-back-btn {
        align-self: center;
    }

    .profile-achievement-card,
    .team-achievement-card,
    .achievement-list-card,
    .teamMemberDetail .achievement-card {
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 0.7rem;
        min-height: 136px;
        height: 136px;
    }

    .achievement-list-card {
        min-height: 172px;
        height: 172px;
        padding-right: 2.1rem;
    }

    .achievement-visual {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        border-radius: 14px;
    }

    .achievement-visual svg {
        width: 24px;
        height: 24px;
    }

    .achievement-list-title-row {
        align-items: flex-start;
    }

    .achievement-list-content h3,
    .profile-achievement-content strong,
    .team-achievement-body strong {
        font-size: 0.95rem;
    }

    .achievement-chip {
        font-size: 0.7rem;
        padding-inline: 0.42rem;
    }

    .achievement-page-grid {
        grid-template-columns: 1fr;
    }

    .achievement-icon-picker {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-achievements-panel .panel-head {
        align-items: flex-start;
        gap: 0.7rem;
    }

    .dashboard-achievements-summary {
        width: 100%;
        justify-content: flex-start;
    }

    .dashboard-achievements-summary .dashboard-panel-action {
        margin-left: auto;
    }

    .dashboard-achievements-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .dashboard-achievement-card {
        min-height: 146px;
        height: 146px;
        grid-template-columns: 1fr;
        align-content: start;
        gap: 0.42rem;
        padding: 0.58rem;
    }

    .dashboard-achievement-card .achievement-visual {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .dashboard-achievement-title-row {
        display: grid;
        gap: 0.28rem;
    }

    .dashboard-achievement-content p {
        -webkit-line-clamp: 2;
        font-size: 0.78rem;
    }

    .dashboard-achievement-card:nth-child(n+3) {
        display: none;
    }
}

/* Mobile polish pass: Calendar, dashboard, analytics, team and profile. */
.bottom-nav {
    left: 0.65rem;
    right: 0.65rem;
    bottom: calc(0.55rem + env(safe-area-inset-bottom));
    gap: 0.12rem;
    padding: 0.32rem;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(247, 255, 251, 0.46)),
        rgba(255, 255, 255, 0.56);
    box-shadow: 0 18px 42px rgba(22, 35, 43, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(28px) saturate(1.55);
    -webkit-backdrop-filter: blur(28px) saturate(1.55);
}

.bottom-nav a {
    min-height: 54px;
    border-radius: 18px;
    font-size: 0.63rem;
}

.nav-icon {
    width: 28px;
    height: 28px;
}

.nav-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.15;
}

.bottom-nav a.active {
    background: linear-gradient(135deg, rgba(20, 163, 139, 0.22), rgba(255, 255, 255, 0.56));
    box-shadow: inset 0 0 0 1px rgba(20, 163, 139, 0.22), 0 8px 20px rgba(20, 163, 139, 0.16);
}

.entries-calendar-screen {
    gap: 0.75rem;
}

.entries-calendar-panel,
.entries-calendar-photos-panel {
    overflow: hidden;
}

.entries-calendar-head,
.dashboard-panel-head-compact,
.analytics-section-title {
    align-items: center;
    flex-direction: row;
}

.entries-calendar-create,
.entries-calendar-gallery,
.dashboard-panel-head-compact > .badge,
.dashboard-panel-head-compact .dashboard-achievements-summary {
    margin-left: auto;
}

.entries-calendar-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
}

.entries-calendar-head-actions .entries-calendar-gallery,
.entries-calendar-head-actions .entries-calendar-create {
    margin-left: 0;
}

.entries-calendar-controls {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.75rem;
}

.calendar-view-segments,
.analytics-period-segments {
    display: inline-flex;
    align-items: center;
    gap: 0.12rem;
    padding: 0.18rem;
    border: 1px solid rgba(210, 220, 215, 0.84);
    border-radius: 999px;
    background: rgba(247, 251, 249, 0.88);
}

.calendar-view-segments a,
.analytics-period-segments a {
    min-height: 34px;
    padding: 0.44rem 0.78rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.calendar-view-segments a.active,
.analytics-period-segments a.active {
    color: var(--ink);
    background: #fff;
    box-shadow: 0 6px 16px rgba(22, 35, 43, 0.1), inset 0 0 0 1px rgba(20, 163, 139, 0.14);
}

.entries-calendar {
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(222, 228, 225, 0.95);
    border-radius: 18px;
    background: rgba(222, 228, 225, 0.95);
}

.entries-calendar.meal-calendar-month {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.entries-calendar.meal-calendar-week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.entries-calendar.meal-calendar-day {
    grid-template-columns: minmax(0, 1fr);
}

.entries-calendar-day article {
    position: relative;
    aspect-ratio: 1 / 1;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #f6f8f7;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.entries-calendar-day strong {
    position: absolute;
    left: 0.36rem;
    top: 0.32rem;
    z-index: 2;
    padding: 0.16rem 0.34rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    font-size: 0.66rem;
    backdrop-filter: blur(10px);
}

.entries-calendar-day img,
.entries-calendar-empty {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 0;
    object-fit: cover;
}

.entries-calendar-empty {
    background: linear-gradient(135deg, #f2f5f3, #e9efec);
    font-size: 0.68rem;
}

.entries-calendar-day .badge {
    right: 0.28rem;
    bottom: 0.28rem;
    padding: 0.12rem 0.34rem;
    border: 0;
    background: rgba(255, 255, 255, 0.82);
    font-size: 0.62rem;
    backdrop-filter: blur(10px);
}

.entries-calendar-day:hover article,
.entries-calendar-day:focus-visible article {
    border-color: transparent;
    transform: scale(0.985);
}

.entries-calendar-day.is-selected article {
    box-shadow: inset 0 0 0 2px var(--primary), inset 0 0 0 4px rgba(255, 255, 255, 0.72);
}

.entries-calendar-photos-panel .photo-grid {
    gap: 1px;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(222, 228, 225, 0.95);
}

.entries-calendar-photos-panel .photo-card {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: #f6f8f7;
}

.entries-calendar-photos-panel .photo-card-media,
.entries-calendar-photos-panel .photo-card-media img,
.entries-calendar-photos-panel .photo-card-media .entries-calendar-empty {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 0;
    object-fit: cover;
}

.entries-calendar-photos-panel figcaption {
    display: none;
}

.dashboard-mobile-layout-context {
    display: none;
}

.dashboard-mobile-edit-entry {
    display: none;
}

.dashboard-layout-editor-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.38rem;
    padding: 0.34rem 0.42rem;
    cursor: default;
}

.dashboard-layout-toggle {
    min-height: 30px;
}

.dashboard-layout-toggle input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.dashboard-layout-mobile-actions {
    display: inline-flex;
    gap: 0.2rem;
}

.dashboard-layout-context .dashboard-layout-mobile-actions {
    display: none;
}

.dashboard-mobile-layout-context .dashboard-layout-mobile-actions {
    display: inline-flex;
}

.dashboard-layout-mobile-actions .btn {
    min-width: 30px;
    min-height: 30px;
    padding: 0;
}

.dashboard-penalty-head {
    gap: 0.6rem;
}

.dashboard-penalty-amount {
    margin-left: auto;
}

.dashboard-layout-edit-mode-panel,
.team-layout-edit-mode-panel {
    border-style: solid;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 252, 249, 0.9)),
        rgba(255, 255, 255, 0.82);
}

.dashboard-layout-edit-mode-panel .dashboard-layout-editor,
.team-layout-edit-mode-panel .team-layout-editor {
    display: grid;
    border-top: 0;
    padding-top: 0;
}

.dashboard-layout-edit-card,
.team-layout-edit-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.42rem;
    cursor: default;
}

.dashboard-layout-edit-card .dashboard-layout-mobile-actions,
.team-layout-edit-card .team-layout-mobile-actions {
    justify-content: flex-end;
    order: -1;
}

.dashboard-achievements-summary {
    justify-content: flex-end;
}

.dashboard-weekly-compact-list {
    gap: 0.34rem;
}

.dashboard-week-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.48rem;
    padding: 0.56rem 0.62rem;
    border: 1px solid rgba(217, 226, 221, 0.86);
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.dashboard-week-row-main,
.dashboard-week-row-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-width: 0;
}

.dashboard-week-row-main strong,
.dashboard-week-row-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-week-row-main small,
.dashboard-week-row-meta {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.analytics-filter-panel {
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.7fr);
}

.analytics-viewing-summary {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.analytics-viewing-summary strong {
    font-size: 1.05rem;
}

.analytics-viewing-summary small {
    color: var(--muted);
    font-weight: 750;
}

.analytics-period-segments,
.analytics-nav-links {
    grid-column: 1 / -1;
}

.analytics-date-filter {
    grid-column: span 1;
}

.profile-hero {
    position: relative;
    justify-content: space-between;
    gap: 0.85rem;
}

.profile-tagline-editor {
    position: relative;
    justify-self: end;
}

.profile-tagline-edit svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-tagline-editor summary::-webkit-details-marker {
    display: none;
}

.profile-tagline-form {
    position: absolute;
    right: 0;
    top: calc(100% + 0.45rem);
    z-index: 40;
    display: grid;
    gap: 0.55rem;
    width: min(340px, calc(100vw - 2rem));
    padding: 0.78rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 42px rgba(22, 35, 43, 0.18);
    backdrop-filter: blur(18px);
}

.profile-tagline-actions {
    display: flex;
    justify-content: flex-end;
}

.team-mobile-combo-card {
    display: none;
}

@media (max-width: 899px) {
    .bottom-nav {
        left: 0.5rem;
        right: 0.5rem;
    }

    .floating-log {
        --mobile-fab-size: 54px;
    }

    .dashboard-layout-edit-mode-panel,
    .entries-calendar-panel,
    .entries-calendar-mobile-gallery-panel {
        padding: 0.72rem;
    }

    .dashboard-layout-edit-mode-panel,
    .team-layout-edit-mode-panel {
        position: sticky;
        top: 4.45rem;
        z-index: 30;
        border-radius: 22px;
        box-shadow: 0 18px 46px rgba(22, 35, 43, 0.16);
    }

    .dashboard-layout-edit-mode-panel .team-layout-editor-actions,
    .team-layout-edit-mode-panel .team-layout-editor-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding-top: 0.48rem;
        background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.96) 35%);
    }

    .dashboard-layout-edit-card,
    .team-layout-edit-card {
        padding: 0.48rem;
        border-radius: 14px;
    }

    .dashboard-mobile-layout-context {
        display: grid;
        gap: 0.58rem;
    }

    .dashboard-mobile-layout-context[open] {
        position: fixed;
        left: 0.65rem;
        right: 0.65rem;
        bottom: calc(0.65rem + env(safe-area-inset-bottom));
        z-index: 90;
        max-height: min(78vh, 680px);
        overflow: auto;
        padding: 0.9rem;
        border-radius: 26px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 252, 249, 0.92)),
            rgba(255, 255, 255, 0.88);
        box-shadow: 0 24px 70px rgba(22, 35, 43, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.78);
        backdrop-filter: blur(26px) saturate(1.35);
        -webkit-backdrop-filter: blur(26px) saturate(1.35);
    }

    .dashboard-mobile-layout-context[open] .dashboard-edit-layout-trigger {
        justify-content: center;
        border-radius: 18px;
        background: rgba(237, 248, 244, 0.88);
    }

    .dashboard-mobile-edit-entry {
        display: inline-flex;
    }

    .dashboard-layout-context {
        display: none;
    }

    .dashboard-layout-editor-mobile {
        border-top: 0;
        padding-top: 0.2rem;
    }

    .dashboard-panel-head-compact {
        display: flex !important;
        align-items: center;
        flex-direction: row !important;
        gap: 0.48rem;
    }

    .dashboard-panel-head-compact > div {
        min-width: 0;
    }

    .dashboard-panel-head-compact > .badge {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .dashboard-panel-head-compact h2 {
        margin: 0;
        font-size: 1rem;
    }

    .dashboard-achievements-panel .panel-head {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .dashboard-achievements-summary .btn {
        min-height: 34px;
        padding: 0.34rem 0.58rem;
    }

    .dashboard-achievements-panel .muted.small {
        display: none;
    }

    .team-widget-metrics .team-metric-steps,
    .team-widget-metrics .team-metric-distance {
        display: none;
    }

    .team-mobile-combo-card {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        padding: 0;
        overflow: hidden;
    }

    .team-mobile-combo-card a {
        display: grid;
        gap: 0.2rem;
        padding: 0.68rem;
        color: inherit;
        text-decoration: none;
    }

    .team-mobile-combo-card a + a {
        border-left: 1px solid var(--line);
    }

    .team-mobile-combo-card span {
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 850;
        text-transform: uppercase;
    }

    .team-mobile-combo-card strong {
        font-size: 1.05rem;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 700px) {
    .entries-calendar-hero,
    .entries-calendar-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .entries-calendar-head {
        display: flex;
        align-items: center;
        flex-direction: row;
        gap: 0.55rem;
    }

    .entries-calendar-head > div {
        min-width: 0;
    }

    .entries-calendar-head h2 {
        font-size: 1.05rem;
        line-height: 1.08;
    }

    .entries-calendar-head-actions {
        gap: 0.32rem;
    }

    .entries-calendar-head-actions .btn {
        min-height: 40px;
        padding-inline: 0.68rem;
        font-size: 0.76rem;
    }

    .entries-calendar-create {
        flex: 0 0 auto;
        min-height: 42px;
        padding-inline: 0.82rem;
        border-radius: 999px;
        box-shadow: 0 10px 24px rgba(20, 163, 139, 0.16);
        white-space: nowrap;
    }

    .entries-calendar-controls {
        gap: 0.48rem;
    }

    .calendar-view-segments,
    .analytics-period-segments {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .analytics-period-segments {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-view-segments a,
    .analytics-period-segments a {
        text-align: center;
        padding-inline: 0.42rem;
    }

    .entries-calendar.meal-calendar-month,
    .entries-calendar.meal-calendar-week {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .entries-calendar-day strong {
        left: 0.18rem;
        top: 0.18rem;
        padding: 0.08rem 0.22rem;
        font-size: 0.56rem;
    }

    .entries-calendar-day .badge {
        display: none;
    }

    .entries-calendar-empty {
        font-size: 0;
    }

    .entries-calendar-photos-panel .photo-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .analytics-filter-panel {
        grid-template-columns: 1fr;
    }

    .analytics-user-filter,
    .analytics-date-filter,
    .analytics-viewing-summary {
        grid-column: 1 / -1;
    }

    .analytics-nav-links {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .profile-hero {
        align-items: flex-start;
    }

    .profile-tagline-editor {
        position: absolute;
        right: 0.75rem;
        top: 0.75rem;
    }

    .profile-title {
        padding-right: 2.4rem;
    }

    .gallery-page {
        gap: 0.45rem;
        margin-inline: -0.75rem;
    }

    .gallery-toolbar {
        padding: 0 0.75rem;
    }

    .gallery-toolbar h1 {
        font-size: 1.55rem;
    }

    .gallery-actions .btn {
        min-height: 38px;
        padding-inline: 0.62rem;
        font-size: 0.74rem;
    }

    .gallery-filter {
        padding-inline: 0.75rem;
    }

    .photos-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        border-inline: 0;
        border-radius: 0;
    }

    .photos-gallery-date {
        right: 0.32rem;
        bottom: 0.3rem;
        font-size: 0.62rem;
    }

    .gallery-pagination,
    .gallery-empty {
        margin-inline: 0.75rem;
    }
}

/* Theme mode + mobile photos calendar pass. */
body[data-theme="light"] {
    color-scheme: light;
}

body[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1117;
    --surface: #121b24;
    --surface-2: #182532;
    --ink: #edf7f4;
    --muted: #9fb0ba;
    --line: rgba(174, 194, 203, 0.18);
    --border: rgba(174, 194, 203, 0.18);
    --glass: rgba(20, 31, 42, 0.64);
    --glass-strong: rgba(22, 34, 46, 0.84);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 20px 52px rgba(0, 0, 0, 0.35);
    background:
        radial-gradient(circle at 12% 0%, rgba(20, 163, 139, 0.24), transparent 35%),
        radial-gradient(circle at 88% 18%, rgba(59, 130, 246, 0.16), transparent 30%),
        #0b1117;
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] {
        color-scheme: dark;
        --bg: #0b1117;
        --surface: #121b24;
        --surface-2: #182532;
        --ink: #edf7f4;
        --muted: #9fb0ba;
        --line: rgba(174, 194, 203, 0.18);
        --border: rgba(174, 194, 203, 0.18);
        --glass: rgba(20, 31, 42, 0.64);
        --glass-strong: rgba(22, 34, 46, 0.84);
        --glass-border: rgba(255, 255, 255, 0.14);
        --glass-shadow: 0 20px 52px rgba(0, 0, 0, 0.35);
        background:
            radial-gradient(circle at 12% 0%, rgba(20, 163, 139, 0.24), transparent 35%),
            radial-gradient(circle at 88% 18%, rgba(59, 130, 246, 0.16), transparent 30%),
            #0b1117;
    }
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .metric-card,
body[data-theme="dark"] .chart-card,
body[data-theme="dark"] .pending-card,
body[data-theme="dark"] .leaderboard-row,
body[data-theme="dark"] .dashboard-week-row,
body[data-theme="dark"] .photo-grid figure,
body[data-theme="dark"] .photo-grid figcaption,
body[data-theme="dark"] .add-menu-panel,
body[data-theme="dark"] .user-menu-panel,
body[data-theme="dark"] .topbar {
    background: rgba(18, 27, 36, 0.9);
    border-color: var(--line);
    color: var(--ink);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
    background: rgba(8, 14, 20, 0.78);
    border-color: var(--line);
    color: var(--ink);
}

body[data-theme="dark"] .entries-calendar,
body[data-theme="dark"] .entries-calendar-photos-panel .photo-grid,
body[data-theme="dark"] .entries-calendar-mobile-gallery,
body[data-theme="dark"] .photos-gallery-grid {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .entries-calendar-day article,
body[data-theme="dark"] .entries-calendar-empty,
body[data-theme="dark"] .entries-calendar-mobile-tile,
body[data-theme="dark"] .photos-gallery-tile,
body[data-theme="dark"] .calendar-empty-state,
body[data-theme="dark"] .gallery-empty {
    background: #17222d;
}

body[data-theme="dark"] .bottom-nav {
    background:
        linear-gradient(135deg, rgba(27, 39, 52, 0.82), rgba(12, 18, 25, 0.62)),
        rgba(15, 23, 31, 0.74);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] .panel,
    body[data-theme="auto"] .metric-card,
    body[data-theme="auto"] .chart-card,
    body[data-theme="auto"] .pending-card,
    body[data-theme="auto"] .leaderboard-row,
    body[data-theme="auto"] .dashboard-week-row,
    body[data-theme="auto"] .photo-grid figure,
    body[data-theme="auto"] .photo-grid figcaption,
    body[data-theme="auto"] .add-menu-panel,
    body[data-theme="auto"] .user-menu-panel,
    body[data-theme="auto"] .topbar {
        background: rgba(18, 27, 36, 0.9);
        border-color: var(--line);
        color: var(--ink);
        box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
    }

    body[data-theme="auto"] input,
    body[data-theme="auto"] select,
    body[data-theme="auto"] textarea {
        background: rgba(8, 14, 20, 0.78);
        border-color: var(--line);
        color: var(--ink);
    }

    body[data-theme="auto"] .entries-calendar,
    body[data-theme="auto"] .entries-calendar-photos-panel .photo-grid,
    body[data-theme="auto"] .entries-calendar-mobile-gallery,
    body[data-theme="auto"] .photos-gallery-grid {
        background: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.12);
    }

    body[data-theme="auto"] .entries-calendar-day article,
    body[data-theme="auto"] .entries-calendar-empty,
    body[data-theme="auto"] .entries-calendar-mobile-tile,
    body[data-theme="auto"] .photos-gallery-tile,
    body[data-theme="auto"] .calendar-empty-state,
    body[data-theme="auto"] .gallery-empty {
        background: #17222d;
    }

    body[data-theme="auto"] .bottom-nav {
        background:
            linear-gradient(135deg, rgba(27, 39, 52, 0.82), rgba(12, 18, 25, 0.62)),
            rgba(15, 23, 31, 0.74);
        border-color: rgba(255, 255, 255, 0.14);
        box-shadow: 0 20px 54px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }
}

.entries-calendar-mobile-gallery-panel {
    display: none;
}

.entries-calendar-mobile-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(222, 228, 225, 0.95);
    border-radius: 22px;
    background: rgba(222, 228, 225, 0.95);
}

.entries-calendar-mobile-tile {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eef4f1;
    color: #fff;
    text-decoration: none;
}

.entries-calendar-mobile-tile::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 46%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.48));
    pointer-events: none;
}

.entries-calendar-mobile-tile img,
.entries-calendar-mobile-tile .entries-calendar-empty {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.entries-calendar-mobile-tile span {
    position: absolute;
    right: 0.38rem;
    bottom: 0.34rem;
    z-index: 2;
    color: #fff;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.calendar-empty-state,
.gallery-empty {
    display: grid;
    justify-items: start;
    gap: 0.45rem;
    padding: 0.95rem;
    border: 1px solid rgba(210, 220, 215, 0.72);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(244, 251, 248, 0.72)),
        rgba(255, 255, 255, 0.68);
}

.calendar-empty-state p,
.gallery-empty p {
    margin: 0;
    color: var(--muted);
}

.gallery-page {
    display: grid;
    gap: 0.8rem;
}

.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-inline: 0.1rem;
}

.gallery-toolbar h1 {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    letter-spacing: -0.06em;
}

.gallery-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.gallery-filter {
    display: flex;
    justify-content: flex-end;
}

.gallery-filter label {
    min-width: min(260px, 100%);
}

.photos-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(222, 228, 225, 0.95);
    border-radius: 24px;
    background: rgba(222, 228, 225, 0.95);
}

.photos-gallery-tile {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(135deg, #eef4f1, #e5ece8);
    color: #fff;
    text-decoration: none;
}

.photos-gallery-tile::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 48%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.52));
    pointer-events: none;
}

.photos-gallery-tile img,
.photos-gallery-tile .entries-calendar-empty {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    transition: transform 0.24s ease;
}

.photos-gallery-tile:hover img,
.photos-gallery-tile:focus-visible img {
    transform: scale(1.025);
}

.photos-gallery-date {
    position: absolute;
    right: 0.42rem;
    bottom: 0.36rem;
    z-index: 2;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 7px rgba(0, 0, 0, 0.62);
}

.gallery-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding-block: 0.35rem;
}

.bottom-nav {
    overflow: visible;
}

.bottom-nav-plus {
    display: grid;
    min-width: 0;
}

.bottom-nav-plus > summary {
    display: grid;
    place-items: center;
    gap: 0.12rem;
    min-width: 0;
    min-height: 54px;
    padding: 0.34rem 0.16rem;
    border-radius: 18px;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.63rem;
    font-weight: 850;
    line-height: 1;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-plus > summary::-webkit-details-marker {
    display: none;
}

.bottom-nav-plus-icon {
    width: 30px;
    height: 30px;
    font-size: 1.86rem;
    font-weight: 900;
    line-height: 0.82;
}

.bottom-nav-plus[open] > summary,
.bottom-nav-plus > summary:focus-visible {
    color: var(--ink);
    background: linear-gradient(135deg, rgba(20, 163, 139, 0.22), rgba(255, 255, 255, 0.56));
    box-shadow: inset 0 0 0 1px rgba(20, 163, 139, 0.22), 0 8px 20px rgba(20, 163, 139, 0.16);
}

.bottom-nav-plus-menu {
    position: fixed;
    right: 0.75rem;
    bottom: calc(0.9rem + env(safe-area-inset-bottom) + var(--mobile-bottom-nav-height));
    top: auto;
    width: min(250px, calc(100vw - 1.5rem));
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(248, 255, 252, 0.7)),
        rgba(255, 255, 255, 0.72);
    box-shadow: 0 20px 54px rgba(22, 35, 43, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(26px) saturate(1.45);
    -webkit-backdrop-filter: blur(26px) saturate(1.45);
}

.bottom-nav .bottom-nav-plus-menu a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.62rem 0.8rem;
    border-radius: 16px;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1.1;
}

body[data-theme="dark"] .bottom-nav-plus-menu {
    background:
        linear-gradient(135deg, rgba(27, 39, 52, 0.88), rgba(12, 18, 25, 0.72)),
        rgba(15, 23, 31, 0.78);
}

body[data-theme="dark"] .dashboard-layout-edit-mode-panel .team-layout-editor-actions,
body[data-theme="dark"] .team-layout-edit-mode-panel .team-layout-editor-actions {
    background: linear-gradient(180deg, transparent, rgba(18, 27, 36, 0.96) 35%);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] .bottom-nav-plus-menu {
        background:
            linear-gradient(135deg, rgba(27, 39, 52, 0.88), rgba(12, 18, 25, 0.72)),
            rgba(15, 23, 31, 0.78);
    }

    body[data-theme="auto"] .dashboard-layout-edit-mode-panel .team-layout-editor-actions,
    body[data-theme="auto"] .team-layout-edit-mode-panel .team-layout-editor-actions {
        background: linear-gradient(180deg, transparent, rgba(18, 27, 36, 0.96) 35%);
    }
}

@media (max-width: 899px) {
    .floating-log {
        display: none;
    }

    .entries-calendar-panel .entries-calendar,
    .entries-calendar-photos-panel {
        display: none;
    }

    .entries-calendar-mobile-gallery-panel {
        display: grid;
    }

    .entries-calendar-mobile-gallery-panel .panel-head {
        display: flex;
        align-items: center;
        flex-direction: row;
    }
}

@media (max-width: 380px) {
    .bottom-nav a,
    .bottom-nav-plus > summary {
        font-size: 0.56rem;
    }

    .nav-icon,
    .bottom-nav-plus-icon {
        width: 27px;
        height: 27px;
    }
}

/* Liquid Glass system pass. Kept as an override layer so existing layout semantics stay intact. */
:root {
    --radius: 18px;
    --radius-lg: 24px;
    --radius-xl: 30px;
    --glass-bg: rgba(255, 255, 255, 0.58);
    --glass-bg-strong: rgba(255, 255, 255, 0.78);
    --glass-bg-soft: rgba(255, 255, 255, 0.38);
    --glass-border-bright: rgba(255, 255, 255, 0.72);
    --glass-highlight: rgba(255, 255, 255, 0.58);
    --glass-shadow-soft: 0 18px 44px rgba(15, 23, 42, 0.10), 0 2px 8px rgba(15, 23, 42, 0.05);
    --glass-shadow-deep: 0 28px 78px rgba(15, 23, 42, 0.18), 0 8px 24px rgba(15, 23, 42, 0.08);
    --glass-blur: 24px;
    --z-overlay: 180;
    --z-edit-panel: 220;
    --z-topbar: 240;
    --z-modal: 320;
}

body {
    background:
        radial-gradient(circle at 8% -6%, rgba(20, 163, 139, 0.22), transparent 32%),
        radial-gradient(circle at 92% 4%, rgba(59, 130, 246, 0.14), transparent 28%),
        radial-gradient(circle at 70% 92%, rgba(255, 107, 74, 0.13), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.42), transparent 46%),
        var(--bg);
}

body[data-theme="dark"] {
    --glass-bg: rgba(20, 31, 42, 0.52);
    --glass-bg-strong: rgba(22, 34, 46, 0.74);
    --glass-bg-soft: rgba(20, 31, 42, 0.36);
    --glass-border-bright: rgba(255, 255, 255, 0.16);
    --glass-highlight: rgba(255, 255, 255, 0.10);
    --glass-shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.28);
    --glass-shadow-deep: 0 30px 84px rgba(0, 0, 0, 0.44);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] {
        --glass-bg: rgba(20, 31, 42, 0.52);
        --glass-bg-strong: rgba(22, 34, 46, 0.74);
        --glass-bg-soft: rgba(20, 31, 42, 0.36);
        --glass-border-bright: rgba(255, 255, 255, 0.16);
        --glass-highlight: rgba(255, 255, 255, 0.10);
        --glass-shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.28);
        --glass-shadow-deep: 0 30px 84px rgba(0, 0, 0, 0.44);
    }
}

:where(.hero-panel, .panel, .motivation-band, .metric-card, .user-edit-card, .chart-card, .pending-card, .leaderboard-row, .modal, .auth-card, .confirm-modal-card, .topbar-context-panel, .add-menu-panel, .user-menu-panel, .analytics-controls, .calendar-empty-state, .gallery-empty) {
    position: relative;
    border: 1px solid var(--glass-border-bright);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08)),
        var(--glass-bg);
    box-shadow: var(--glass-shadow-soft), inset 0 1px 0 var(--glass-highlight);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
}

:where(.hero-panel, .panel, .motivation-band, .metric-card, .chart-card, .auth-card, .analytics-controls)::before {
    content: "";
    position: absolute;
    inset: 1px 1px auto;
    height: 42%;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.44), transparent);
    pointer-events: none;
    opacity: 0.55;
}

:where(.hero-panel, .panel, .motivation-band, .metric-card, .chart-card, .auth-card, .analytics-controls) > * {
    position: relative;
    z-index: 1;
}

.topbar {
    z-index: var(--z-topbar);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.50)),
        var(--glass-bg);
    border-bottom: 1px solid var(--glass-border-bright);
    box-shadow: 0 14px 42px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(28px) saturate(1.45);
    -webkit-backdrop-filter: blur(28px) saturate(1.45);
}

.nav-links a {
    border-radius: 999px;
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.nav-links a.active,
.nav-links a:hover {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.34)),
        rgba(255, 255, 255, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74), 0 10px 24px rgba(15, 23, 42, 0.08);
}

.btn,
button,
summary,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

.btn {
    border-color: rgba(255, 255, 255, 0.58);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.20)),
        rgba(255, 255, 255, 0.46);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px) saturate(1.35);
    -webkit-backdrop-filter: blur(16px) saturate(1.35);
    transition: transform 0.16s ease, background 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.btn.is-pressed,
button.is-pressed,
summary.is-pressed,
a.is-pressed {
    transform: scale(0.975);
    filter: brightness(1.03);
}

.btn.btn-primary {
    border-color: rgba(20, 163, 139, 0.55);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 45%),
        linear-gradient(135deg, var(--primary), #0b7f70);
    box-shadow: 0 14px 34px rgba(20, 163, 139, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.btn.btn-primary:hover {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.30), transparent 48%),
        linear-gradient(135deg, #19bda1, var(--primary-dark));
}

.btn.btn-secondary {
    border-color: rgba(255, 255, 255, 0.22);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent),
        var(--ink);
}

.btn.btn-ghost {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.24)),
        rgba(255, 255, 255, 0.34);
    border-color: rgba(255, 255, 255, 0.56);
}

input,
select,
textarea {
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.42)),
        rgba(255, 255, 255, 0.58);
    border-color: rgba(255, 255, 255, 0.64);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 8px 22px rgba(15, 23, 42, 0.04);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(20, 163, 139, 0.58);
    box-shadow: 0 0 0 4px rgba(20, 163, 139, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body.is-transitioning::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    background: radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.32), transparent 34%);
    opacity: 0;
    animation: liquidPagePulse 0.55s ease;
}

@keyframes liquidPagePulse {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}

.is-loading {
    position: relative;
}

.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.32) 42%, transparent 68%),
        rgba(255, 255, 255, 0.10);
    background-size: 220% 100%;
    animation: liquidShimmer 1.05s linear infinite;
}

@keyframes liquidShimmer {
    from { background-position: 160% 0; }
    to { background-position: -80% 0; }
}

.auth-shell-login {
    transform: translateY(-0.7rem);
}

.auth-copy-login {
    padding: 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
        rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.auth-card-login {
    border-radius: var(--radius-xl);
    border-color: rgba(255, 255, 255, 0.72);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58)),
        rgba(255, 255, 255, 0.62);
    box-shadow: var(--glass-shadow-deep), inset 0 1px 0 rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(30px) saturate(1.35);
    -webkit-backdrop-filter: blur(30px) saturate(1.35);
}

.bottom-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr)) 64px;
    gap: 0.28rem;
    padding: 0.34rem;
    border-radius: 30px;
    border-color: rgba(255, 255, 255, 0.66);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.34)),
        rgba(255, 255, 255, 0.48);
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(30px) saturate(1.55);
    -webkit-backdrop-filter: blur(30px) saturate(1.55);
}

.bottom-nav a {
    min-height: 58px;
    border-radius: 22px;
    font-size: 0.66rem;
    transition: transform 0.16s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.bottom-nav a.active {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(20, 163, 139, 0.18)),
        rgba(255, 255, 255, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 12px 28px rgba(20, 163, 139, 0.16);
}

.nav-icon {
    width: 31px;
    height: 31px;
}

.nav-icon svg {
    width: 23px;
    height: 23px;
    stroke-width: 2.15;
}

.bottom-nav-plus {
    align-self: center;
    justify-self: center;
}

.bottom-nav-plus > summary {
    width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 999px;
    background:
        radial-gradient(circle at 32% 20%, rgba(255, 255, 255, 0.92), transparent 32%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.28)),
        rgba(255, 255, 255, 0.50);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(24px) saturate(1.55);
    -webkit-backdrop-filter: blur(24px) saturate(1.55);
}

.bottom-nav-plus > summary > span:not(.nav-icon) {
    display: none;
}

.bottom-nav-plus-icon {
    width: 42px;
    height: 42px;
    font-size: 2.45rem;
    line-height: 0.8;
    color: var(--ink);
}

.bottom-nav-plus[open] > summary,
.bottom-nav-plus > summary:focus-visible {
    background:
        radial-gradient(circle at 32% 20%, rgba(255, 255, 255, 0.92), transparent 30%),
        linear-gradient(135deg, rgba(20, 163, 139, 0.38), rgba(255, 255, 255, 0.42));
    transform: scale(1.03);
}

.bottom-nav-plus-menu {
    right: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.70);
    border-radius: 26px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.btn-add,
.topbar-add-menu > summary.btn-add {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    padding: 0;
    border-radius: 999px;
    font-size: 1.75rem;
    line-height: 1;
    box-shadow: 0 16px 38px rgba(20, 163, 139, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.analytics-page {
    gap: 0.95rem;
}

.analytics-filter-panel {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(180px, 0.72fr);
    align-items: center;
    gap: 0.68rem;
    padding: 0.82rem;
    border-radius: var(--radius-xl);
}

.analytics-viewing-summary {
    padding: 0.35rem 0.48rem;
}

.analytics-viewing-summary strong {
    display: block;
    font-size: clamp(1.12rem, 2vw, 1.42rem);
    letter-spacing: -0.04em;
}

.analytics-user-filter,
.analytics-date-filter {
    display: grid;
    gap: 0.24rem;
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}

.analytics-period-segments,
.calendar-view-segments {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0.18rem;
    padding: 0.22rem;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.18)),
        rgba(255, 255, 255, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

.analytics-period-segments a,
.calendar-view-segments a {
    border-radius: 999px;
    padding: 0.56rem 0.72rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.16s ease;
}

.analytics-period-segments a.active,
.calendar-view-segments a.active {
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.42)),
        rgba(255, 255, 255, 0.52);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.analytics-nav-links {
    align-items: center;
    justify-content: flex-end;
}

.analytics-nav-group {
    display: inline-flex;
    gap: 0.28rem;
    padding: 0.18rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.30);
}

.analytics-apply-btn {
    justify-self: end;
    min-width: 108px;
}

.analytics-chart-card {
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.28)),
        var(--glass-bg);
    box-shadow: var(--glass-shadow-soft), inset 0 1px 0 var(--glass-highlight);
}

.entries-calendar-screen {
    gap: 0.55rem;
}

.entries-calendar-panel {
    padding: 0.76rem;
    border-radius: var(--radius-xl);
}

.entries-calendar-head {
    align-items: center;
}

.entries-calendar-head h2 {
    margin: 0;
    letter-spacing: -0.04em;
}

.entries-calendar-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.entries-calendar-gallery,
.entries-calendar-create {
    border-radius: 999px;
}

.entries-calendar-controls {
    position: sticky;
    top: calc(4.25rem + env(safe-area-inset-top));
    z-index: 20;
    align-items: center;
    gap: 0.55rem;
    padding: 0.48rem;
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.70), rgba(255, 255, 255, 0.32)),
        rgba(255, 255, 255, 0.44);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px) saturate(1.45);
    -webkit-backdrop-filter: blur(24px) saturate(1.45);
}

.calendar-visible-period {
    position: sticky;
    top: calc(7.9rem + env(safe-area-inset-top));
    z-index: 18;
    width: fit-content;
    margin: 0.1rem 0 0.45rem;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    color: var(--ink);
    font-size: clamp(1.12rem, 3.4vw, 1.72rem);
    font-weight: 900;
    letter-spacing: -0.06em;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.26)),
        rgba(255, 255, 255, 0.42);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.calendar-visible-period.is-updating {
    opacity: 0.66;
    transform: translateY(-3px);
}

.entries-calendar.meal-calendar-month,
.entries-calendar.meal-calendar-week,
.entries-calendar.meal-calendar-day {
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(222, 228, 225, 0.84);
    border-radius: var(--radius-lg);
    background: rgba(222, 228, 225, 0.86);
}

.entries-calendar-day article {
    position: relative;
    aspect-ratio: 1 / 1;
    min-height: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.16)),
        rgba(255, 255, 255, 0.34);
    box-shadow: none;
}

.entries-calendar-day.has-log article {
    background: #dfe8e4;
}

.entries-calendar-day strong {
    position: absolute;
    left: 0.38rem;
    top: 0.36rem;
    z-index: 3;
    max-width: calc(100% - 0.76rem);
    padding: 0.16rem 0.38rem;
    border-radius: 999px;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 950;
    line-height: 1.05;
    text-shadow: 0 1px 7px rgba(0, 0, 0, 0.52);
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.entries-calendar-day .badge {
    position: absolute;
    right: 0.36rem;
    bottom: 0.34rem;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    background: rgba(0, 0, 0, 0.24);
    text-shadow: 0 1px 7px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.entries-calendar-collage {
    display: grid;
    width: 100%;
    height: 100%;
    gap: 1px;
    background: rgba(255, 255, 255, 0.55);
}

.entries-calendar-collage img {
    width: 100%;
    height: 100%;
    min-width: 0;
    object-fit: cover;
}

.entries-calendar-collage.collage-count-1 {
    display: block;
}

.entries-calendar-collage.collage-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entries-calendar-collage.collage-count-3 {
    grid-template-columns: 1.15fr 0.85fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.entries-calendar-collage.collage-count-3 img:first-child {
    grid-row: 1 / 3;
}

.entries-calendar-empty {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 0;
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.56), transparent 34%),
        rgba(255, 255, 255, 0.24);
}

.entries-calendar-day:hover article,
.entries-calendar-day:focus-visible article {
    transform: scale(0.992);
    border-color: transparent;
}

.entries-calendar-day.is-selected article {
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.96), inset 0 0 0 5px rgba(20, 163, 139, 0.82);
}

.entries-calendar-mobile-gallery,
.photos-gallery-grid {
    border-color: rgba(255, 255, 255, 0.44);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.36);
    box-shadow: var(--glass-shadow-soft);
}

.entries-calendar-mobile-tile,
.photos-gallery-tile {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.10)),
        rgba(218, 229, 225, 0.76);
}

.dashboard-layout-edit-mode-panel,
.team-layout-edit-mode-panel {
    border-radius: var(--radius-xl);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.54)),
        var(--glass-bg-strong);
    box-shadow: var(--glass-shadow-deep), inset 0 1px 0 var(--glass-highlight);
}

.dashboard-layout-edit-card,
.team-layout-edit-card {
    border-radius: 20px;
    border-color: rgba(255, 255, 255, 0.62);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.22)),
        rgba(255, 255, 255, 0.42);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.dashboard-layout-mobile-actions,
.team-layout-mobile-actions {
    display: inline-flex;
    gap: 0.32rem;
}

@media (max-width: 899px) {
    body.layout-edit-active::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: var(--z-overlay);
        background:
            radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.38), transparent 42%),
            rgba(244, 248, 247, 0.44);
        backdrop-filter: blur(12px) saturate(1.22);
        -webkit-backdrop-filter: blur(12px) saturate(1.22);
    }

    body.layout-edit-active .screen > :not(.dashboard-layout-edit-mode-panel):not(.team-layout-edit-mode-panel) {
        filter: blur(8px);
        opacity: 0.42;
        pointer-events: none;
        user-select: none;
    }

    body.layout-edit-active .dashboard-layout-edit-mode-panel,
    body.layout-edit-active .team-layout-edit-mode-panel {
        position: fixed;
        left: 0.7rem;
        right: 0.7rem;
        top: calc(4.55rem + env(safe-area-inset-top));
        z-index: var(--z-edit-panel);
        max-height: min(74vh, 680px);
        overflow: auto;
        padding: 0.86rem;
    }

    body.layout-edit-active .topbar {
        z-index: var(--z-topbar);
    }

    .dashboard-layout-edit-card .dashboard-layout-mobile-actions,
    .team-layout-edit-card .team-layout-mobile-actions {
        justify-content: flex-start;
    }

    .bottom-nav {
        left: 0.7rem;
        right: 0.7rem;
        bottom: calc(0.56rem + env(safe-area-inset-bottom));
    }

    .analytics-filter-panel {
        grid-template-columns: 1fr;
        gap: 0.54rem;
        padding: 0.7rem;
    }

    .analytics-period-segments {
        overflow-x: auto;
        grid-auto-columns: max-content;
        justify-content: start;
        width: 100%;
        scrollbar-width: none;
    }

    .analytics-period-segments::-webkit-scrollbar {
        display: none;
    }

    .analytics-nav-links,
    .analytics-apply-btn {
        justify-self: stretch;
    }

    .analytics-nav-group,
    .analytics-nav-group .btn,
    .analytics-dashboard-link,
    .analytics-apply-btn {
        width: 100%;
    }

    .analytics-nav-group .btn {
        min-width: 0;
    }

    .entries-calendar-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .entries-calendar-head .eyebrow {
        display: none;
    }

    .entries-calendar-head-actions {
        display: flex;
        padding: 0.18rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.30);
    }

    .entries-calendar-head-actions .btn {
        min-height: 38px;
        padding: 0.5rem 0.68rem;
    }

    .entries-calendar-controls {
        top: calc(4.1rem + env(safe-area-inset-top));
        display: grid;
        grid-template-columns: 1fr;
        border-radius: 24px;
    }

    .entry-date-inline {
        width: 100%;
    }

    .calendar-visible-period {
        top: calc(8.6rem + env(safe-area-inset-top));
    }

    .entries-calendar-panel .entries-calendar {
        display: none;
    }
}

@media (max-width: 700px) {
    .auth-shell-login {
        transform: translateY(-0.35rem);
    }

    .auth-copy-login {
        padding: 0.9rem;
    }

    .calendar-view-segments {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .calendar-view-segments a {
        padding-inline: 0.4rem;
    }

    .entries-calendar-mobile-gallery-panel {
        margin-inline: -0.75rem;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .entries-calendar-mobile-gallery-panel::before {
        display: none;
    }

    .entries-calendar-mobile-gallery-panel .panel-head {
        padding: 0 0.75rem;
    }

    .entries-calendar-mobile-gallery {
        border-inline: 0;
        border-radius: 0;
    }
}

@media (max-width: 380px) {
    .bottom-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr)) 58px;
        padding: 0.28rem;
    }

    .bottom-nav-plus > summary {
        width: 52px;
        height: 52px;
        min-height: 52px;
    }
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .btn.btn-ghost,
body[data-theme="dark"] .analytics-period-segments,
body[data-theme="dark"] .calendar-view-segments,
body[data-theme="dark"] .entries-calendar-controls,
body[data-theme="dark"] .calendar-visible-period,
body[data-theme="dark"] .bottom-nav,
body[data-theme="dark"] .bottom-nav-plus > summary,
body[data-theme="dark"] .auth-card-login {
    color: var(--ink);
    border-color: rgba(255, 255, 255, 0.15);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)),
        rgba(14, 22, 31, 0.64);
}

body[data-theme="dark"] .nav-links a.active,
body[data-theme="dark"] .nav-links a:hover,
body[data-theme="dark"] .analytics-period-segments a.active,
body[data-theme="dark"] .calendar-view-segments a.active,
body[data-theme="dark"] .bottom-nav a.active {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(20, 163, 139, 0.18)),
        rgba(255, 255, 255, 0.06);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] input,
    body[data-theme="auto"] select,
    body[data-theme="auto"] textarea,
    body[data-theme="auto"] .btn.btn-ghost,
    body[data-theme="auto"] .analytics-period-segments,
    body[data-theme="auto"] .calendar-view-segments,
    body[data-theme="auto"] .entries-calendar-controls,
    body[data-theme="auto"] .calendar-visible-period,
    body[data-theme="auto"] .bottom-nav,
    body[data-theme="auto"] .bottom-nav-plus > summary,
    body[data-theme="auto"] .auth-card-login {
        color: var(--ink);
        border-color: rgba(255, 255, 255, 0.15);
        background:
            linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)),
            rgba(14, 22, 31, 0.64);
    }

    body[data-theme="auto"] .nav-links a.active,
    body[data-theme="auto"] .nav-links a:hover,
    body[data-theme="auto"] .analytics-period-segments a.active,
    body[data-theme="auto"] .calendar-view-segments a.active,
    body[data-theme="auto"] .bottom-nav a.active {
        background:
            linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(20, 163, 139, 0.18)),
            rgba(255, 255, 255, 0.06);
    }
}

/* Premium Liquid Glass mobile refresh. */
.liquid-nav-pill {
    display: contents;
}

.photo-mode-segments {
    display: none;
}

.flash {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    z-index: 99999;
    min-height: 50px;
    margin: 0;
    padding: 15px 18px 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 18px;
    color: rgba(10, 20, 18, 0.88);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.28;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.22)),
        rgba(255, 255, 255, 0.26);
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        inset 0 -1px 0 rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(34px) saturate(190%);
    -webkit-backdrop-filter: blur(34px) saturate(190%);
    animation:
        flashEnterMobile 260ms cubic-bezier(.2,.8,.2,1),
        flashExitMobile 320ms cubic-bezier(.4,0,1,1) 4s forwards;
}

.flash::before {
    content: "";
    position: absolute;
    inset: 1px 1px auto;
    height: 52%;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.08) 72%, transparent);
    opacity: 0.72;
    pointer-events: none;
}

.flash::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background:
        linear-gradient(90deg, rgba(52, 199, 89, 0.95), rgba(48, 209, 88, 0.55));
    transform-origin: left center;
    animation: flashTimer 4s linear forwards;
}

.flash-success {
    border-color: rgba(80, 220, 160, 0.34);
    background:
        linear-gradient(180deg, rgba(236, 255, 247, 0.52), rgba(205, 255, 235, 0.22)),
        rgba(255, 255, 255, 0.24);
}

.flash-error {
    border-color: rgba(255, 120, 112, 0.34);
    background:
        linear-gradient(180deg, rgba(255, 244, 242, 0.58), rgba(255, 214, 210, 0.24)),
        rgba(255, 255, 255, 0.24);
}

.flash-error::after {
    background:
        linear-gradient(90deg, rgba(255, 69, 58, 0.96), rgba(255, 149, 0, 0.58));
}

.flash-info::after {
    background:
        linear-gradient(90deg, rgba(10, 132, 255, 0.96), rgba(90, 200, 250, 0.58));
}

@keyframes flashTimer {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@keyframes flashEnterMobile {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes flashExitMobile {
    to {
        opacity: 0;
        transform: translateY(-18px) scale(0.96);
        pointer-events: none;
    }
}

@keyframes flashEnterDesktop {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes flashExitDesktop {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-18px) scale(0.96);
        pointer-events: none;
    }
}

@media (min-width: 768px) {
    .flash {
        left: 50%;
        right: auto;
        width: min(520px, calc(100vw - 24px));
        transform: translateX(-50%);
        animation:
            flashEnterDesktop 260ms cubic-bezier(.2,.8,.2,1),
            flashExitDesktop 320ms cubic-bezier(.4,0,1,1) 4s forwards;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }

    .topbar {
        padding: 0.68rem 0.82rem;
        border-bottom-color: rgba(255, 255, 255, 0.38);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.28)),
            rgba(255, 255, 255, 0.36);
        box-shadow:
            0 12px 34px rgba(15, 23, 42, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.58);
        backdrop-filter: blur(26px) saturate(180%);
        -webkit-backdrop-filter: blur(26px) saturate(180%);
    }

    .brand-avatar,
    .brand-mark,
    .user-menu-trigger,
    .user-menu-trigger img,
    .user-menu-trigger span {
        border-radius: 999px;
    }

    .mobile-liquid-nav {
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        z-index: 9999;
        display: flex;
        grid-template-columns: none;
        align-items: center;
        gap: 14px;
        padding: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        transition:
            transform 180ms cubic-bezier(.2,.8,.2,1),
            opacity 180ms cubic-bezier(.2,.8,.2,1);
    }

    .mobile-liquid-nav.nav-hidden {
        transform: translateY(calc(100% + 28px));
        opacity: 0;
        pointer-events: none;
    }

    .liquid-nav-pill {
        position: relative;
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        justify-content: space-around;
        min-width: 0;
        height: 78px;
        padding: 8px 10px;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.24);
        border-radius: 999px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.10)),
            rgba(255, 255, 255, 0.08);
        box-shadow:
            0 18px 40px rgba(0, 0, 0, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.35),
            inset 0 -1px 0 rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(40px) saturate(200%);
        -webkit-backdrop-filter: blur(40px) saturate(200%);
    }

    .liquid-nav-pill::before,
    .liquid-nav-plus > summary::before {
        content: "";
        position: absolute;
        inset: 1px 8px auto;
        height: 42%;
        border-radius: inherit;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent);
        opacity: 0.78;
        pointer-events: none;
    }

    .liquid-nav-item {
        position: relative;
        z-index: 1;
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        height: 66px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 0;
        border-radius: 999px;
        color: rgba(15, 15, 15, 0.72);
        font-size: 10px;
        font-weight: 800;
        line-height: 1;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        transition:
            transform 150ms cubic-bezier(.2,.8,.2,1),
            color 150ms cubic-bezier(.2,.8,.2,1),
            background 150ms cubic-bezier(.2,.8,.2,1);
    }

    .liquid-nav-item .nav-icon,
    .liquid-nav-item i,
    .liquid-nav-item .icon {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        font-size: 32px;
        line-height: 1;
        transition:
            transform 150ms cubic-bezier(.2,.8,.2,1),
            background 150ms cubic-bezier(.2,.8,.2,1);
    }

    .liquid-nav-item .nav-icon svg {
        width: 32px;
        height: 32px;
        stroke-width: 2;
    }

    .liquid-nav-item .nav-label {
        max-width: 100%;
        overflow: hidden;
        color: currentColor;
        font-size: clamp(8px, 2.35vw, 10px);
        font-weight: 800;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
        opacity: 0.86;
    }

    .liquid-nav-item.active {
        color: #0a84ff;
        background: transparent;
        box-shadow: none;
    }

    .liquid-nav-item.active .nav-icon,
    .liquid-nav-item.active i,
    .liquid-nav-item.active .icon {
        background: rgba(10, 132, 255, 0.16);
        transform: translateY(-1px);
    }

    .liquid-nav-item:active,
    .liquid-nav-item.is-pressed,
    .liquid-nav-plus > summary:active,
    .liquid-nav-plus > summary.is-pressed {
        transform: scale(0.90);
    }

    .liquid-nav-plus {
        width: 74px;
        height: 74px;
        flex: 0 0 74px;
        display: grid;
        min-width: 0;
    }

    .liquid-nav-plus > summary {
        position: relative;
        width: 74px;
        height: 74px;
        min-height: 74px;
        display: grid;
        place-items: center;
        padding: 0;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.26);
        border-radius: 999px;
        color: #111;
        cursor: pointer;
        list-style: none;
        text-decoration: none;
        background:
            radial-gradient(circle at 34% 20%, rgba(255, 255, 255, 0.34), transparent 34%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.10)),
            rgba(255, 255, 255, 0.10);
        box-shadow:
            0 18px 42px rgba(0, 0, 0, 0.14),
            inset 0 1px 0 rgba(255, 255, 255, 0.38),
            inset 0 -1px 0 rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(42px) saturate(220%);
        -webkit-backdrop-filter: blur(42px) saturate(220%);
        transition:
            transform 150ms cubic-bezier(.2,.8,.2,1),
            background 150ms cubic-bezier(.2,.8,.2,1);
        -webkit-tap-highlight-color: transparent;
    }

    .liquid-nav-plus > summary > span:not(.nav-icon) {
        display: none;
    }

    .liquid-nav-plus .nav-icon,
    .liquid-nav-plus i,
    .liquid-nav-plus .icon,
    .liquid-nav-plus .bottom-nav-plus-icon {
        width: 52px;
        height: 52px;
        font-size: 42px;
        line-height: 1;
    }

    .liquid-nav-plus[open] > summary,
    .liquid-nav-plus > summary:focus-visible {
        background:
            radial-gradient(circle at 34% 20%, rgba(255, 255, 255, 0.38), transparent 34%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(10, 132, 255, 0.12)),
            rgba(255, 255, 255, 0.14);
    }

    .bottom-nav-plus-menu {
        right: 14px;
        bottom: calc(104px + env(safe-area-inset-bottom));
        width: min(252px, calc(100vw - 28px));
        border-radius: 26px;
        border-color: rgba(255, 255, 255, 0.36);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.14)),
            rgba(255, 255, 255, 0.18);
        box-shadow:
            0 24px 64px rgba(0, 0, 0, 0.18),
            inset 0 1px 0 rgba(255, 255, 255, 0.48);
        backdrop-filter: blur(38px) saturate(190%);
        -webkit-backdrop-filter: blur(38px) saturate(190%);
    }

    .dashboard-mobile-controls .topbar-context-panel {
        position: fixed;
        top: calc(72px + env(safe-area-inset-top));
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 92px - env(safe-area-inset-top));
        padding: 16px;
        overflow-y: auto;
        border-radius: 28px;
        border: 1px solid rgba(255, 255, 255, 0.42);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.14)),
            rgba(255, 255, 255, 0.12);
        box-shadow:
            0 20px 50px rgba(0, 0, 0, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.62),
            inset 0 -1px 0 rgba(255, 255, 255, 0.14);
        backdrop-filter: blur(38px) saturate(190%);
        -webkit-backdrop-filter: blur(38px) saturate(190%);
    }

    .dashboard-control-form {
        gap: 12px;
    }

    .dashboard-control-field {
        display: grid;
        gap: 7px;
        color: rgba(23, 33, 43, 0.72);
        font-size: 12px;
        font-weight: 900;
    }

    .dashboard-control-field .glass-select {
        width: 100%;
        height: 56px;
        padding: 0 18px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.50);
        color: #17212b;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.36)),
            rgba(255, 255, 255, 0.24);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.75),
            0 10px 22px rgba(0, 0, 0, 0.06);
        backdrop-filter: blur(22px) saturate(180%);
        -webkit-backdrop-filter: blur(22px) saturate(180%);
        font-size: 17px;
        font-weight: 800;
    }

    .dashboard-mobile-edit-entry.edit-layout-button {
        display: inline-flex;
        width: 100%;
        min-height: 56px;
        border-radius: 999px;
        border-color: rgba(255, 255, 255, 0.22);
        color: #fff;
        background:
            linear-gradient(180deg, rgba(45, 212, 191, 0.96), rgba(13, 148, 136, 0.96));
        box-shadow:
            0 16px 34px rgba(13, 148, 136, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.34);
        font-size: 16px;
        font-weight: 900;
        transition:
            transform 150ms cubic-bezier(.2,.8,.2,1),
            filter 150ms cubic-bezier(.2,.8,.2,1);
    }

    .dashboard-mobile-edit-entry.edit-layout-button:active,
    .dashboard-mobile-edit-entry.edit-layout-button.is-pressed {
        transform: scale(0.97);
    }

    body.layout-edit-active .dashboard-layout-edit-mode-panel {
        border-radius: 28px;
        border: 1px solid rgba(255, 255, 255, 0.42);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.14)),
            rgba(255, 255, 255, 0.12);
        box-shadow:
            0 20px 50px rgba(0, 0, 0, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.62),
            inset 0 -1px 0 rgba(255, 255, 255, 0.14);
        backdrop-filter: blur(38px) saturate(190%);
        -webkit-backdrop-filter: blur(38px) saturate(190%);
    }

    .dashboard-layout-edit-card {
        border-radius: 22px;
        border-color: rgba(255, 255, 255, 0.38);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.50), rgba(255, 255, 255, 0.20)),
            rgba(255, 255, 255, 0.18);
        box-shadow:
            0 12px 26px rgba(15, 23, 42, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.56);
    }

    .dashboard-layout-edit-mode-panel .team-layout-editor-actions {
        background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.32) 38%);
    }

    .photo-mode-segments {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        margin: 2px 14px 14px;
        padding: 4px;
        border: 1px solid rgba(255, 255, 255, 0.42);
        border-radius: 999px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.12)),
            rgba(255, 255, 255, 0.12);
        box-shadow:
            0 12px 30px rgba(15, 23, 42, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.56);
        backdrop-filter: blur(26px) saturate(180%);
        -webkit-backdrop-filter: blur(26px) saturate(180%);
    }

    .photo-mode-segments a {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 12px;
        border-radius: 999px;
        color: rgba(23, 33, 43, 0.72);
        font-size: 14px;
        font-weight: 900;
        line-height: 1;
        text-decoration: none;
        white-space: nowrap;
        transition:
            transform 150ms cubic-bezier(.2,.8,.2,1),
            color 150ms cubic-bezier(.2,.8,.2,1),
            background 150ms cubic-bezier(.2,.8,.2,1);
    }

    .photo-mode-segments a.active {
        color: #111827;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.34)),
            rgba(255, 255, 255, 0.26);
        box-shadow:
            0 8px 18px rgba(15, 23, 42, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.74);
    }

    .gallery-page,
    .entries-calendar-screen {
        gap: 0;
        margin-inline: -0.75rem;
    }

    .gallery-toolbar,
    .entries-calendar-head {
        padding: 0 14px 10px;
    }

    .gallery-toolbar h1,
    .entries-calendar-head h2 {
        font-size: 28px;
        font-weight: 900;
        letter-spacing: 0;
        line-height: 1;
    }

    .gallery-toolbar .eyebrow,
    .entries-calendar-head .eyebrow {
        display: none;
    }

    .gallery-actions,
    .entries-calendar-head-actions {
        gap: 4px;
        padding: 3px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.16);
        backdrop-filter: blur(18px) saturate(160%);
        -webkit-backdrop-filter: blur(18px) saturate(160%);
    }

    .gallery-actions .btn,
    .entries-calendar-head-actions .btn {
        min-height: 36px;
        min-width: 0;
        padding: 0 11px;
        border-radius: 999px;
        font-size: 12px;
    }

    .entries-calendar-gallery {
        display: none;
    }

    .gallery-filter {
        padding: 0 14px 12px;
    }

    .gallery-filter select {
        border-radius: 999px;
    }

    .entries-calendar-panel {
        margin: 0;
        padding: 0 14px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .entries-calendar-panel::before {
        display: none;
    }

    .entries-calendar-controls {
        position: relative;
        top: auto;
        z-index: 1;
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
        margin: 0 0 8px;
        padding: 10px;
        border-radius: 28px;
        border: 1px solid rgba(255, 255, 255, 0.38);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.12)),
            rgba(255, 255, 255, 0.10);
        box-shadow:
            0 14px 34px rgba(15, 23, 42, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.50);
        backdrop-filter: blur(28px) saturate(180%);
        -webkit-backdrop-filter: blur(28px) saturate(180%);
    }

    .entries-calendar-controls input,
    .entries-calendar-controls select {
        min-height: 48px;
        border-radius: 999px;
        font-size: 16px;
        font-weight: 800;
    }

    .calendar-view-segments {
        position: relative;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        padding: 4px;
        border-radius: 999px;
        border-color: rgba(255, 255, 255, 0.36);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.10)),
            rgba(255, 255, 255, 0.10);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
        backdrop-filter: blur(22px) saturate(170%);
        -webkit-backdrop-filter: blur(22px) saturate(170%);
    }

    .calendar-view-segments a {
        min-height: 38px;
        padding: 0 8px;
        text-align: center;
        font-size: 12px;
        line-height: 1;
    }

    .calendar-visible-period {
        position: sticky;
        top: calc(64px + env(safe-area-inset-top));
        z-index: 5;
        width: auto;
        margin: 0 -14px;
        padding: 10px 14px;
        border: 0;
        border-radius: 0;
        color: #111827;
        background:
            linear-gradient(180deg, rgba(245, 247, 248, 0.82), rgba(245, 247, 248, 0.42));
        box-shadow: none;
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        font-size: 28px;
        font-weight: 900;
        letter-spacing: 0;
        line-height: 1;
    }

    .entries-calendar-mobile-gallery-panel {
        display: grid;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .entries-calendar-mobile-gallery-panel::before {
        display: none;
    }

    .entries-calendar-mobile-gallery-panel .panel-head {
        display: none;
    }

    .entries-calendar-mobile-gallery,
    .photos-gallery-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: calc((100vw - 2px) / 3);
        gap: 1px;
        margin: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: rgba(210, 218, 216, 0.84);
        box-shadow: none;
    }

    .entries-calendar-mobile-tile,
    .photos-gallery-tile {
        aspect-ratio: auto;
        min-height: 0;
        border-radius: 0;
        background: #e9efec;
        transition: transform 150ms cubic-bezier(.2,.8,.2,1);
    }

    .entries-calendar-mobile-tile:nth-child(11n + 1),
    .photos-gallery-tile:nth-child(11n + 1) {
        grid-row: span 2;
    }

    .entries-calendar-mobile-tile:nth-child(17n + 8),
    .photos-gallery-tile:nth-child(17n + 8) {
        grid-column: span 2;
    }

    .entries-calendar-mobile-tile img,
    .entries-calendar-mobile-tile .entries-calendar-empty,
    .photos-gallery-tile img,
    .photos-gallery-tile .entries-calendar-empty {
        width: 100%;
        height: 100%;
        border-radius: 0;
        object-fit: cover;
    }

    .entries-calendar-mobile-tile:active,
    .entries-calendar-mobile-tile.is-pressed,
    .photos-gallery-tile:active,
    .photos-gallery-tile.is-pressed {
        transform: scale(0.985);
    }

    .entries-calendar-mobile-tile span,
    .photos-gallery-date {
        right: 7px;
        bottom: 7px;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0;
        text-shadow: 0 1px 8px rgba(0, 0, 0, 0.58);
    }

    .calendar-empty-state,
    .gallery-empty {
        margin: 0 14px 14px;
        border-radius: 24px;
        border-color: rgba(255, 255, 255, 0.40);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.16)),
            rgba(255, 255, 255, 0.14);
        box-shadow:
            0 14px 34px rgba(15, 23, 42, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.52);
        backdrop-filter: blur(28px) saturate(180%);
        -webkit-backdrop-filter: blur(28px) saturate(180%);
    }
}

@media (max-width: 380px) {
    .liquid-nav-pill {
        height: 72px;
        padding-inline: 8px;
    }

    .liquid-nav-item {
        height: 60px;
    }

    .liquid-nav-item .nav-icon {
        width: 38px;
        height: 38px;
    }

    .liquid-nav-item .nav-icon svg {
        width: 29px;
        height: 29px;
    }

    .liquid-nav-plus {
        width: 66px;
        height: 66px;
        flex-basis: 66px;
    }

    .liquid-nav-plus > summary {
        width: 66px;
        height: 66px;
        min-height: 66px;
    }

    .liquid-nav-plus .bottom-nav-plus-icon {
        width: 46px;
        height: 46px;
        font-size: 38px;
    }
}

body[data-theme="dark"] .flash {
    color: rgba(245, 250, 248, 0.90);
    border-color: rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(180deg, rgba(36, 48, 60, 0.58), rgba(13, 20, 28, 0.28)),
        rgba(12, 18, 24, 0.34);
}

body[data-theme="dark"] .flash-success {
    border-color: rgba(80, 220, 160, 0.26);
    background:
        linear-gradient(180deg, rgba(35, 74, 60, 0.54), rgba(16, 40, 34, 0.28)),
        rgba(10, 20, 18, 0.32);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] .flash {
        color: rgba(245, 250, 248, 0.90);
        border-color: rgba(255, 255, 255, 0.16);
        background:
            linear-gradient(180deg, rgba(36, 48, 60, 0.58), rgba(13, 20, 28, 0.28)),
            rgba(12, 18, 24, 0.34);
    }

    body[data-theme="auto"] .flash-success {
        border-color: rgba(80, 220, 160, 0.26);
        background:
            linear-gradient(180deg, rgba(35, 74, 60, 0.54), rgba(16, 40, 34, 0.28)),
            rgba(10, 20, 18, 0.32);
    }
}

@media (max-width: 768px) {
    body[data-theme="dark"] .topbar,
    body[data-theme="dark"] .liquid-nav-pill,
    body[data-theme="dark"] .liquid-nav-plus > summary,
    body[data-theme="dark"] .bottom-nav-plus-menu,
    body[data-theme="dark"] .dashboard-mobile-controls .topbar-context-panel,
    body[data-theme="dark"] .photo-mode-segments,
    body[data-theme="dark"] .entries-calendar-controls,
    body[data-theme="dark"] .calendar-visible-period {
        color: var(--ink);
        border-color: rgba(255, 255, 255, 0.16);
        background:
            linear-gradient(180deg, rgba(42, 54, 68, 0.46), rgba(12, 18, 25, 0.20)),
            rgba(10, 16, 22, 0.26);
        box-shadow:
            0 18px 44px rgba(0, 0, 0, 0.30),
            inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }

    body[data-theme="dark"] .calendar-visible-period {
        color: #f8fafc;
        background:
            linear-gradient(180deg, rgba(17, 24, 39, 0.82), rgba(17, 24, 39, 0.42));
        box-shadow: none;
    }

    body[data-theme="dark"] .liquid-nav-item {
        color: rgba(248, 250, 252, 0.72);
    }

    body[data-theme="dark"] .liquid-nav-item.active {
        color: #64d2ff;
    }

    body[data-theme="dark"] .dashboard-control-field {
        color: rgba(248, 250, 252, 0.72);
    }

    body[data-theme="dark"] .dashboard-control-field .glass-select,
    body[data-theme="dark"] .photo-mode-segments a.active {
        color: #f8fafc;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
            rgba(15, 23, 42, 0.42);
    }

    body[data-theme="dark"] .photo-mode-segments a {
        color: rgba(248, 250, 252, 0.70);
    }
}

@media (max-width: 768px) and (prefers-color-scheme: dark) {
    body[data-theme="auto"] .topbar,
    body[data-theme="auto"] .liquid-nav-pill,
    body[data-theme="auto"] .liquid-nav-plus > summary,
    body[data-theme="auto"] .bottom-nav-plus-menu,
    body[data-theme="auto"] .dashboard-mobile-controls .topbar-context-panel,
    body[data-theme="auto"] .photo-mode-segments,
    body[data-theme="auto"] .entries-calendar-controls,
    body[data-theme="auto"] .calendar-visible-period {
        color: var(--ink);
        border-color: rgba(255, 255, 255, 0.16);
        background:
            linear-gradient(180deg, rgba(42, 54, 68, 0.46), rgba(12, 18, 25, 0.20)),
            rgba(10, 16, 22, 0.26);
        box-shadow:
            0 18px 44px rgba(0, 0, 0, 0.30),
            inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }

    body[data-theme="auto"] .calendar-visible-period {
        color: #f8fafc;
        background:
            linear-gradient(180deg, rgba(17, 24, 39, 0.82), rgba(17, 24, 39, 0.42));
        box-shadow: none;
    }

    body[data-theme="auto"] .liquid-nav-item {
        color: rgba(248, 250, 252, 0.72);
    }

    body[data-theme="auto"] .liquid-nav-item.active {
        color: #64d2ff;
    }

    body[data-theme="auto"] .dashboard-control-field {
        color: rgba(248, 250, 252, 0.72);
    }

    body[data-theme="auto"] .dashboard-control-field .glass-select,
    body[data-theme="auto"] .photo-mode-segments a.active {
        color: #f8fafc;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
            rgba(15, 23, 42, 0.42);
    }

    body[data-theme="auto"] .photo-mode-segments a {
        color: rgba(248, 250, 252, 0.70);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

/* Coordinated layout and liquid glass polish pass. */
.topbar-context[open] .topbar-context-panel,
.add-menu[open] .add-menu-panel,
.user-menu[open] .user-menu-panel,
.photo-post-menu[open] .photo-post-menu-panel,
.metric-help-popover[open] .metric-help-popover-content {
    color: #111827;
    background: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
}

.topbar-context[open] .topbar-context-panel :where(label, small, p, span),
.add-menu[open] .add-menu-panel,
.user-menu[open] .user-menu-panel,
.photo-post-menu[open] .photo-post-menu-panel,
.metric-help-popover[open] .metric-help-popover-content {
    color: #111827;
}

.user-menu-panel {
    padding: 0.45rem;
    border-radius: 22px;
}

.user-menu-panel a {
    border-bottom: 0;
    border-radius: 14px;
    padding: 0.72rem 0.82rem;
}

.user-menu-panel a:hover,
.user-menu-panel a:focus-visible {
    background: rgba(15, 23, 42, 0.08);
}

.user-menu-trigger {
    position: relative;
}

.user-menu-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    background: #ef4444;
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.34);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.user-menu-unread-dot {
    display: none;
}

.gallery-page-clean {
    gap: 0.8rem;
}

.gallery-view-strip {
    position: sticky;
    top: calc(72px + env(safe-area-inset-top));
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: min(100%, 760px);
    margin: 0 auto 0.4rem;
    padding: 0.36rem;
    border: 1px solid rgba(255, 255, 255, 0.54);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.24)),
        rgba(255, 255, 255, 0.32);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
}

.gallery-user-control {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    min-width: 0;
    padding-left: 0.55rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 850;
}

.gallery-user-control select {
    max-width: 150px;
    border: 0;
    border-radius: 999px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.58);
    font: inherit;
    font-weight: 900;
}

.gallery-user-control strong {
    color: var(--ink);
}

.gallery-segment-control,
.gallery-segment-control a {
    display: inline-flex;
    align-items: center;
}

.gallery-segment-control {
    gap: 0.18rem;
    padding: 0.18rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.gallery-segment-control a {
    min-height: 34px;
    padding: 0 0.78rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.gallery-segment-control a.active {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.photos-gallery-grid-continuous {
    align-items: start;
}

.gallery-month-label {
    position: sticky;
    top: calc(126px + env(safe-area-inset-top));
    z-index: 5;
    grid-column: 1 / -1;
    width: fit-content;
    margin: 0.15rem 0 -0.15rem;
    padding: 0.34rem 0.76rem;
    border-radius: 999px;
    color: #111827;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.54);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.11);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    font-size: 0.82rem;
    font-weight: 900;
}

.gallery-calendar-panel,
.gallery-calendar-side-panel {
    background: rgba(255, 255, 255, 0.55);
}

.analytics-view-panel {
    width: min(420px, calc(100vw - 24px));
    padding: 0.68rem;
}

.analytics-filter-panel-topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.58rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.analytics-filter-panel-topbar .analytics-viewing-summary {
    padding: 0.2rem 0.1rem;
}

.analytics-filter-panel-topbar .analytics-viewing-summary strong {
    font-size: 1.08rem;
    letter-spacing: 0;
}

.analytics-filter-panel-topbar .analytics-period-segments {
    width: 100%;
}

.analytics-filter-panel-topbar .analytics-period-segments a {
    padding-inline: 0.42rem;
    text-align: center;
}

.analytics-filter-panel-topbar .analytics-nav-links,
.analytics-filter-panel-topbar .analytics-nav-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.analytics-section,
.analytics-chart-card,
.dashboard-calories .metric-box {
    border-color: rgba(255, 255, 255, 0.44);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.28)),
        rgba(255, 255, 255, 0.28);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
}

.profile-data-overview .panel-head {
    align-items: flex-start;
}

.profile-home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.profile-home-grid.hidden {
    display: none;
}

.profile-home-card {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 0.72rem;
}

.profile-home-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
}

.profile-home-card-head h2 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: 0;
}

.profile-home-goal-main,
.profile-home-list,
.profile-home-facts {
    min-width: 0;
}

.profile-home-goal-main {
    display: grid;
    gap: 0.34rem;
}

.profile-home-goal-main span,
.profile-home-goal-main small,
.profile-home-list span,
.profile-home-facts dd {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.profile-home-list {
    display: grid;
    gap: 0.45rem;
}

.profile-home-list > div {
    display: grid;
    gap: 0.08rem;
    padding: 0.55rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.profile-home-list > div:first-child {
    border-top: 0;
    padding-top: 0;
}

.profile-home-facts {
    display: grid;
    gap: 0.42rem;
    margin: 0;
}

.profile-home-facts > div {
    display: grid;
    grid-template-columns: minmax(94px, 0.5fr) minmax(0, 1fr);
    gap: 0.5rem;
    align-items: baseline;
}

.profile-home-facts dt {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
}

.profile-home-facts dd {
    margin: 0;
    font-weight: 800;
}

.profile-home-secondary {
    justify-self: start;
}

.notifications-page {
    gap: 0.8rem;
}

.notifications-panel {
    padding: 0.95rem;
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.notifications-header h1 {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    letter-spacing: 0;
}

.notifications-unread-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 0.74rem;
    border-radius: 999px;
    color: #991b1b;
    background: rgba(254, 226, 226, 0.82);
    font-size: 0.78rem;
    font-weight: 900;
}

.notifications-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    margin-bottom: 0.62rem;
}

.notifications-list {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.38);
}

.notification-card {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.72rem 0.78rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.20);
    background: transparent;
}

.notification-card:last-child {
    border-bottom: 0;
}

.notification-card.is-unread {
    background: rgba(255, 255, 255, 0.46);
}

.notification-main {
    min-width: 0;
    display: grid;
    gap: 0.1rem;
    color: inherit;
    text-decoration: none;
}

.notification-main strong,
.notification-main p {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.notification-main p {
    color: var(--muted);
    font-size: 0.88rem;
}

.notification-actions {
    display: inline-flex;
    gap: 0.26rem;
}

.notification-action-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.52);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.notification-action-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-action-delete {
    color: #991b1b;
}

.team-widget-metrics {
    min-width: 0;
}

.team-goal-card,
.team-goal-main,
.team-goal-head,
.team-goal-objective-grid,
.team-goal-meta-grid {
    min-width: 0;
}

.team-goal-card {
    position: relative;
    padding-right: 48px;
}

.team-goal-card strong,
.team-goal-card small,
.team-goal-progress-text,
.team-goal-reward,
.team-goal-objective-pill {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.team-goal-actions-menu {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 8;
}

.team-goal-actions-menu > summary {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 999px;
}

.team-goal-actions-menu .photo-post-menu-panel {
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 172px;
}

.team-active-challenge-meta,
.team-challenge-detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-active-challenge-meta > span {
    min-width: 0;
}

@media (max-width: 768px) {
    .team-widget-metrics.metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.68rem;
    }

    .team-widget-metrics .team-metric-steps,
    .team-widget-metrics .team-metric-distance {
        display: grid !important;
    }

    .team-mobile-combo-card {
        display: none !important;
    }

    .team-widget-metrics .metric-card {
        min-width: 0;
        padding: 0.74rem;
    }

    .team-active-challenge-meta,
    .team-challenge-detail-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.48rem;
    }

    .team-active-challenge-meta > span {
        padding: 0.58rem;
    }

    .profile-home-grid {
        grid-template-columns: 1fr;
    }

    .gallery-view-strip {
        top: calc(64px + env(safe-area-inset-top));
        width: 100%;
        border-radius: 24px;
        flex-wrap: wrap;
    }

    .gallery-user-control {
        flex: 1 1 160px;
    }

    .gallery-segment-control {
        flex: 1 1 180px;
        justify-content: stretch;
    }

    .gallery-segment-control a {
        flex: 1 1 0;
        justify-content: center;
    }

    .gallery-month-label {
        top: calc(128px + env(safe-area-inset-top));
    }

    .analytics-view-panel {
        width: calc(100vw - 18px);
    }

    .notification-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .notification-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .liquid-nav-item.active {
        color: rgba(15, 23, 42, 0.94) !important;
        border-radius: 24px !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.24)),
            rgba(255, 255, 255, 0.26) !important;
        box-shadow:
            0 10px 24px rgba(15, 23, 42, 0.10),
            inset 0 1px 0 rgba(255, 255, 255, 0.72),
            inset 0 -10px 22px rgba(15, 23, 42, 0.05) !important;
    }

    .liquid-nav-item.active .nav-icon,
    .liquid-nav-item.active i,
    .liquid-nav-item.active .icon {
        color: currentColor !important;
        background: transparent !important;
        transform: translateY(-1px);
    }
}

body[data-theme="dark"] .topbar-context[open] .topbar-context-panel,
body[data-theme="dark"] .add-menu[open] .add-menu-panel,
body[data-theme="dark"] .user-menu[open] .user-menu-panel,
body[data-theme="dark"] .photo-post-menu[open] .photo-post-menu-panel,
body[data-theme="dark"] .metric-help-popover[open] .metric-help-popover-content {
    color: #ffffff;
    background: rgba(15, 23, 42, 0.82) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}

body[data-theme="dark"] .topbar-context[open] .topbar-context-panel :where(label, small, p, span),
body[data-theme="dark"] .add-menu[open] .add-menu-panel,
body[data-theme="dark"] .user-menu[open] .user-menu-panel,
body[data-theme="dark"] .photo-post-menu[open] .photo-post-menu-panel,
body[data-theme="dark"] .metric-help-popover[open] .metric-help-popover-content {
    color: rgba(255, 255, 255, 0.92);
}

body[data-theme="dark"] .gallery-view-strip,
body[data-theme="dark"] .gallery-segment-control,
body[data-theme="dark"] .analytics-section,
body[data-theme="dark"] .analytics-chart-card,
body[data-theme="dark"] .notifications-list {
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(180deg, rgba(42, 54, 68, 0.48), rgba(12, 18, 25, 0.22)),
        rgba(10, 16, 22, 0.34);
}

body[data-theme="dark"] .gallery-segment-control a.active,
body[data-theme="dark"] .gallery-month-label,
body[data-theme="dark"] .notification-card.is-unread {
    color: #f8fafc;
    background: rgba(30, 41, 59, 0.86);
}

body[data-theme="dark"] .notification-action-btn {
    color: #f8fafc;
    background: rgba(30, 41, 59, 0.76);
    border-color: rgba(255, 255, 255, 0.16);
}

body[data-theme="dark"] .notification-action-delete {
    color: #fecaca;
}

@media (max-width: 768px) {
    body[data-theme="dark"] .liquid-nav-item.active {
        color: #f8fafc !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07)),
            rgba(15, 23, 42, 0.58) !important;
        box-shadow:
            0 10px 24px rgba(0, 0, 0, 0.22),
            inset 0 1px 0 rgba(255, 255, 255, 0.18),
            inset 0 -10px 20px rgba(255, 255, 255, 0.04) !important;
    }
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] .topbar-context[open] .topbar-context-panel,
    body[data-theme="auto"] .add-menu[open] .add-menu-panel,
    body[data-theme="auto"] .user-menu[open] .user-menu-panel,
    body[data-theme="auto"] .photo-post-menu[open] .photo-post-menu-panel,
    body[data-theme="auto"] .metric-help-popover[open] .metric-help-popover-content {
        color: #ffffff;
        background: rgba(15, 23, 42, 0.82) !important;
        border-color: rgba(255, 255, 255, 0.18) !important;
    }

    body[data-theme="auto"] .topbar-context[open] .topbar-context-panel :where(label, small, p, span),
    body[data-theme="auto"] .add-menu[open] .add-menu-panel,
    body[data-theme="auto"] .user-menu[open] .user-menu-panel,
    body[data-theme="auto"] .photo-post-menu[open] .photo-post-menu-panel,
    body[data-theme="auto"] .metric-help-popover[open] .metric-help-popover-content {
        color: rgba(255, 255, 255, 0.92);
    }

    body[data-theme="auto"] .gallery-view-strip,
    body[data-theme="auto"] .gallery-segment-control,
    body[data-theme="auto"] .analytics-section,
    body[data-theme="auto"] .analytics-chart-card,
    body[data-theme="auto"] .notifications-list {
        color: #f8fafc;
        border-color: rgba(255, 255, 255, 0.16);
        background:
            linear-gradient(180deg, rgba(42, 54, 68, 0.48), rgba(12, 18, 25, 0.22)),
            rgba(10, 16, 22, 0.34);
    }

    body[data-theme="auto"] .gallery-segment-control a.active,
    body[data-theme="auto"] .gallery-month-label,
    body[data-theme="auto"] .notification-card.is-unread {
        color: #f8fafc;
        background: rgba(30, 41, 59, 0.86);
    }

    body[data-theme="auto"] .notification-action-btn {
        color: #f8fafc;
        background: rgba(30, 41, 59, 0.76);
        border-color: rgba(255, 255, 255, 0.16);
    }

    body[data-theme="auto"] .notification-action-delete {
        color: #fecaca;
    }
}

@media (max-width: 768px) and (prefers-color-scheme: dark) {
    body[data-theme="auto"] .liquid-nav-item.active {
        color: #f8fafc !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07)),
            rgba(15, 23, 42, 0.58) !important;
        box-shadow:
            0 10px 24px rgba(0, 0, 0, 0.22),
            inset 0 1px 0 rgba(255, 255, 255, 0.18),
            inset 0 -10px 20px rgba(255, 255, 255, 0.04) !important;
    }
}

/* Final mobile, calendar and glass cleanup. */
body[data-theme="dark"] {
    --glass: rgba(15, 23, 42, 0.68);
    --glass-strong: rgba(15, 23, 42, 0.78);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --glass-bg: rgba(15, 23, 42, 0.68);
    --glass-bg-strong: rgba(15, 23, 42, 0.78);
    --glass-border-bright: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] {
        --glass: rgba(15, 23, 42, 0.68);
        --glass-strong: rgba(15, 23, 42, 0.78);
        --glass-border: rgba(255, 255, 255, 0.12);
        --glass-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
        --glass-bg: rgba(15, 23, 42, 0.68);
        --glass-bg-strong: rgba(15, 23, 42, 0.78);
        --glass-border-bright: rgba(255, 255, 255, 0.12);
        color: rgba(255, 255, 255, 0.92);
    }
}

:where(.topbar-context[open] .topbar-context-panel,
.add-menu[open] .add-menu-panel,
.user-menu[open] .user-menu-panel,
.photo-post-menu[open] .photo-post-menu-panel,
.metric-help-popover[open] .metric-help-popover-content,
.bottom-nav-plus[open] .bottom-nav-plus-menu) {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.74) !important;
    backdrop-filter: blur(22px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(150%) !important;
}

body[data-theme="dark"] :where(.topbar-context[open] .topbar-context-panel,
.add-menu[open] .add-menu-panel,
.user-menu[open] .user-menu-panel,
.photo-post-menu[open] .photo-post-menu-panel,
.metric-help-popover[open] .metric-help-popover-content,
.bottom-nav-plus[open] .bottom-nav-plus-menu) {
    background: rgba(15, 23, 42, 0.90) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28) !important;
    color: #fff !important;
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] :where(.topbar-context[open] .topbar-context-panel,
    .add-menu[open] .add-menu-panel,
    .user-menu[open] .user-menu-panel,
    .photo-post-menu[open] .photo-post-menu-panel,
    .metric-help-popover[open] .metric-help-popover-content,
    .bottom-nav-plus[open] .bottom-nav-plus-menu) {
        background: rgba(15, 23, 42, 0.90) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28) !important;
        color: #fff !important;
    }
}

.calendar-view-menu .btn-topbar {
    min-height: 38px;
    padding: 0.48rem 0.72rem;
}

.calendar-view-panel {
    width: min(360px, calc(100vw - 24px));
}

.calendar-view-form {
    gap: 0.72rem;
}

.calendar-view-form label,
.calendar-view-form .calendar-view-actions {
    display: grid;
    gap: 0.34rem;
}

.calendar-view-form select,
.calendar-view-form input {
    width: 100%;
    min-width: 0;
}

.calendar-view-static {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 0.48rem 0.7rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.calendar-view-summary {
    display: grid;
    gap: 0.18rem;
}

.calendar-view-summary strong {
    font-size: 1.02rem;
}

.calendar-view-actions {
    grid-template-columns: 1fr 1fr;
}

.entries-calendar-screen,
.gallery-page-clean {
    gap: 0.72rem;
}

.entries-calendar-focused {
    padding: clamp(0.72rem, 2.4vw, 1.18rem);
    overflow: clip;
}

.entries-calendar-titlebar {
    display: grid;
    gap: 0.18rem;
    margin-bottom: 0.72rem;
}

.entries-calendar-titlebar h1 {
    margin: 0;
    font-size: clamp(1.7rem, 4.4vw, 2.45rem);
    letter-spacing: 0;
}

.entries-calendar-focused .entries-calendar {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.entries-calendar-focused .entries-calendar-day article {
    min-height: clamp(78px, 12vw, 128px);
}

.entries-calendar-day strong {
    letter-spacing: 0;
}

.gallery-calendar-panel .calendar-visible-period {
    margin-bottom: 0.7rem;
}

.settings-page {
    gap: 0.88rem;
}

.settings-hero {
    align-items: flex-start;
}

.settings-top-grid {
    align-items: stretch;
}

.settings-avatar-card,
.settings-security-card,
.settings-goals-card,
.settings-preferences-card {
    min-width: 0;
}

.settings-focused-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.settings-avatar-focused-screen {
    max-width: 720px;
    margin-inline: auto;
}

.settings-avatar-current {
    display: flex;
    align-items: center;
    gap: 0.78rem;
}

.settings-avatar-preview-round,
.settings-avatar-preview {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar {
    width: 76px;
    height: 76px;
    min-width: 76px;
}

.settings-avatar-upload-trigger {
    width: fit-content;
}

.settings-image-cropper[hidden] {
    display: none !important;
}

.settings-goal-summary,
.admin-achievement-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.58rem;
}

.settings-goal-summary span,
.admin-achievement-stats span {
    min-width: 0;
    padding: 0.72rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.settings-goal-summary strong,
.admin-achievement-stats strong {
    display: block;
    font-size: 1.18rem;
}

.settings-goal-list,
.profile-home-goal-list {
    display: grid;
    gap: 0.58rem;
}

.settings-goal-row,
.profile-home-goal-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(88px, 24%);
    align-items: center;
    gap: 0.74rem;
    padding: 0.74rem;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.44);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.settings-goal-row span:first-child,
.profile-home-goal-row span:first-child {
    min-width: 0;
    display: grid;
    gap: 0.12rem;
}

.settings-goal-row strong,
.profile-home-goal-row strong {
    overflow-wrap: anywhere;
}

.settings-goal-progress,
.profile-home-goal-meter {
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.10);
    overflow: hidden;
}

.settings-goal-progress span,
.profile-home-goal-meter span {
    display: block;
    height: 100%;
    max-width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f766e, #2563eb);
}

.settings-completed-goals summary,
.admin-achievement-selector summary {
    cursor: pointer;
    padding: 0.7rem 0.8rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-user-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto 18px;
    gap: 0.68rem;
    align-items: center;
}

.admin-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.08);
    font-weight: 800;
}

.admin-user-main {
    min-width: 0;
    display: grid;
    gap: 0.05rem;
}

.admin-user-main strong,
.admin-user-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-achievement-spotlight {
    display: grid;
    gap: 0.82rem;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.50);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-achievement-spotlight-main {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.86rem;
    align-items: center;
}

.admin-achievement-spotlight-visual {
    width: 72px;
    height: 72px;
}

.admin-achievement-recent {
    display: grid;
    gap: 0.18rem;
    font-size: 0.9rem;
}

.admin-achievement-row.is-selected {
    background: rgba(37, 99, 235, 0.10);
    border-color: rgba(37, 99, 235, 0.26);
}

.audit-list-admin article {
    padding: 0.78rem 0.9rem;
    border-radius: 18px;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.18rem;
}

.admin-backup-item {
    padding: 0.82rem;
}

.admin-backup-actions {
    gap: 0.44rem;
}

.notification-card {
    border-radius: 18px;
    padding: 0.82rem 0.92rem;
    gap: 0.72rem;
}

.notification-card.is-unread {
    box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.58);
}

.team-goal-card,
.team-active-challenge-panel,
.team-challenge-card,
.challenge-card {
    min-width: 0;
    overflow: hidden;
}

.team-goal-card :where(h3, strong, p, small),
.team-active-challenge-panel :where(h3, strong, p, small),
.team-challenge-card :where(h3, strong, p, small),
.challenge-card :where(h3, strong, p, small) {
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .container {
        padding-inline: max(0.72rem, env(safe-area-inset-left));
    }

    .topbar {
        padding-inline: max(0.72rem, env(safe-area-inset-left)) max(0.72rem, env(safe-area-inset-right));
    }

    .calendar-view-menu[open] .calendar-view-panel {
        position: fixed;
        inset: auto 10px calc(env(safe-area-inset-bottom) + 82px) 10px;
        width: auto;
        max-height: min(74vh, 560px);
        overflow: auto;
        border-radius: 24px;
        padding: 0.9rem;
    }

    .calendar-view-actions {
        grid-template-columns: 1fr;
    }

    .entries-calendar-screen {
        margin-inline: -0.2rem;
    }

    .entries-calendar-focused {
        padding: 0.66rem;
        border-radius: 22px;
    }

    .entries-calendar-titlebar h1 {
        font-size: 1.72rem;
    }

    .entries-calendar-focused .entries-calendar.meal-calendar-month {
        gap: 0.34rem;
    }

    .entries-calendar-focused .entries-calendar-day article {
        min-height: 74px;
        padding: 0.42rem;
        border-radius: 14px;
    }

    .entries-calendar-day .badge {
        font-size: 0.64rem;
        padding: 0.16rem 0.34rem;
    }

    .settings-focused-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .settings-avatar-preview-round,
    .settings-avatar-preview,
    .profile-avatar {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
    }

    .settings-goal-summary,
    .admin-achievement-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-goal-row,
    .profile-home-goal-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-user-row {
        grid-template-columns: 38px minmax(0, 1fr) auto;
    }

    .admin-user-row .settings-chevron {
        display: none;
    }

    .admin-achievement-spotlight-main {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .admin-achievement-spotlight-visual {
        width: 56px;
        height: 56px;
    }

    .admin-backup-actions,
    .admin-backup-restore-form {
        grid-template-columns: 1fr;
    }

    .audit-filter {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .audit-filter .btn {
        grid-column: 1 / -1;
    }

    .notification-card {
        padding: 0.72rem 0.78rem;
    }

    .liquid-nav-pill,
    .bottom-nav {
        transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease, filter 0.26s ease;
    }

    .mobile-liquid-nav.nav-hidden,
    .bottom-nav.nav-hidden {
        transform: translate3d(-50%, calc(120% + env(safe-area-inset-bottom)), 0) !important;
        opacity: 0;
        pointer-events: none;
        filter: blur(2px);
    }

    .liquid-nav-item.active {
        color: rgba(15, 23, 42, 0.94) !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.24)),
            rgba(255, 255, 255, 0.34) !important;
        border-radius: 22px !important;
        box-shadow:
            0 10px 24px rgba(15, 23, 42, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.76) !important;
    }

    .liquid-nav-item.active .nav-icon,
    .liquid-nav-item.active i,
    .liquid-nav-item.active .icon {
        color: currentColor !important;
        background: transparent !important;
        box-shadow: none !important;
    }
}

body[data-theme="dark"] :where(.calendar-view-static,
.settings-goal-summary span,
.admin-achievement-stats span,
.settings-goal-row,
.profile-home-goal-row,
.settings-completed-goals summary,
.admin-achievement-selector summary,
.admin-achievement-spotlight) {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(15, 23, 42, 0.68);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

body[data-theme="dark"] :where(.settings-goal-progress, .profile-home-goal-meter) {
    background: rgba(255, 255, 255, 0.14);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] :where(.calendar-view-static,
    .settings-goal-summary span,
    .admin-achievement-stats span,
    .settings-goal-row,
    .profile-home-goal-row,
    .settings-completed-goals summary,
    .admin-achievement-selector summary,
    .admin-achievement-spotlight) {
        color: rgba(255, 255, 255, 0.92);
        background: rgba(15, 23, 42, 0.68);
        border-color: rgba(255, 255, 255, 0.12);
        box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
    }

    body[data-theme="auto"] :where(.settings-goal-progress, .profile-home-goal-meter) {
        background: rgba(255, 255, 255, 0.14);
    }
}

@media (max-width: 768px) {
    body[data-theme="dark"] .liquid-nav-item.active {
        color: #f8fafc !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
            rgba(15, 23, 42, 0.68) !important;
        box-shadow:
            0 10px 28px rgba(0, 0, 0, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
    }
}

@media (max-width: 768px) and (prefers-color-scheme: dark) {
    body[data-theme="auto"] .liquid-nav-item.active {
        color: #f8fafc !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
            rgba(15, 23, 42, 0.68) !important;
        box-shadow:
            0 10px 28px rgba(0, 0, 0, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
    }
}

/* Final gallery/calendar mobile sheet and nav motion pass. */
:root {
    --topbar-height: 64px;
}

.topbar,
.topbar-actions,
.topbar-context {
    overflow: visible;
}

.topbar {
    z-index: 1000;
}

.topbar-context[open] {
    z-index: 10040;
}

.topbar-context[open] .topbar-context-panel {
    z-index: 10050;
}

.calendar-view-panel {
    width: min(330px, calc(100vw - 24px));
}

.calendar-view-form {
    gap: 0.58rem;
}

.view-panel-section {
    display: grid;
    gap: 0.32rem;
    min-width: 0;
}

.view-panel-label,
.view-panel-section > span:first-child {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
}

.view-panel-section .calendar-view-segments {
    width: 100%;
}

.view-panel-section .btn {
    justify-content: center;
}

.calendar-view-actions {
    gap: 0.46rem;
}

@media (max-width: 768px) {
    .calendar-view-menu[open] .calendar-view-panel {
        position: fixed !important;
        top: calc(var(--topbar-height, 64px) + env(safe-area-inset-top)) !important;
        right: 12px !important;
        bottom: auto !important;
        left: 12px !important;
        width: auto !important;
        max-height: calc(100vh - var(--topbar-height, 64px) - 28px - env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        border-radius: 22px;
        padding: 0.82rem;
        transform: none !important;
    }

    .mobile-liquid-nav {
        transform: translateY(0) translateZ(0) !important;
        opacity: 1;
        transition:
            transform 0.28s cubic-bezier(.22, 1, .36, 1),
            opacity 0.22s ease !important;
        will-change: transform, opacity;
    }

    .mobile-liquid-nav.nav-hidden,
    .mobile-liquid-nav.is-hidden,
    .bottom-nav.nav-hidden,
    .bottom-nav.is-hidden {
        transform: translateY(calc(100% + 24px)) translateZ(0) !important;
        opacity: 0;
        pointer-events: none;
        filter: none;
    }
}

body[data-theme="dark"] .view-panel-label,
body[data-theme="dark"] .view-panel-section > span:first-child {
    color: rgba(255, 255, 255, 0.72);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] .view-panel-label,
    body[data-theme="auto"] .view-panel-section > span:first-child {
        color: rgba(255, 255, 255, 0.72);
    }
}

/* Bottom nav active item: integrated liquid outline, no green or isolated icon bubble. */
@media (max-width: 768px) {
    .mobile-liquid-nav .liquid-nav-item.active {
        color: rgba(15, 23, 42, 0.94) !important;
        border: 1px solid rgba(255, 255, 255, 0.42) !important;
        border-radius: 20px !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.14)),
            rgba(255, 255, 255, 0.18) !important;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.35),
            0 8px 22px rgba(15, 23, 42, 0.14) !important;
        outline: 0;
    }

    .mobile-liquid-nav .liquid-nav-item.active .nav-icon,
    .mobile-liquid-nav .liquid-nav-item.active .nav-label,
    .mobile-liquid-nav .liquid-nav-item.active svg,
    .mobile-liquid-nav .liquid-nav-item.active svg * {
        color: inherit !important;
        stroke: currentColor !important;
    }

    .mobile-liquid-nav .liquid-nav-item.active .nav-icon {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    body[data-theme="dark"] .mobile-liquid-nav .liquid-nav-item.active {
        color: rgba(255, 255, 255, 0.94) !important;
        border-color: rgba(255, 255, 255, 0.18) !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
            rgba(15, 23, 42, 0.68) !important;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.18),
            0 10px 28px rgba(0, 0, 0, 0.26) !important;
    }
}

@media (max-width: 768px) and (prefers-color-scheme: dark) {
    body[data-theme="auto"] .mobile-liquid-nav .liquid-nav-item.active {
        color: rgba(255, 255, 255, 0.94) !important;
        border-color: rgba(255, 255, 255, 0.18) !important;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
            rgba(15, 23, 42, 0.68) !important;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.18),
            0 10px 28px rgba(0, 0, 0, 0.26) !important;
    }
}

/* Gallery should feel like a Photos surface: edge-to-edge media, overlay month chip. */
.gallery-month-floating {
    position: fixed;
    top: calc(var(--topbar-height, 64px) + env(safe-area-inset-top) + 8px);
    left: max(12px, env(safe-area-inset-left));
    z-index: 980;
    width: fit-content;
    max-width: calc(100vw - 24px);
    padding: 0.34rem 0.74rem;
    border-radius: 999px;
    color: rgba(15, 23, 42, 0.94);
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    font-size: 0.82rem;
    font-weight: 900;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.gallery-month-floating.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-month-floating[hidden] {
    display: block;
    opacity: 0;
}

.admin-thumbnail-regenerate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.82rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

body[data-theme="dark"] .gallery-month-floating {
    color: rgba(255, 255, 255, 0.94);
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(255, 255, 255, 0.16);
}

body[data-theme="dark"] .admin-thumbnail-regenerate {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(15, 23, 42, 0.68);
    border-color: rgba(255, 255, 255, 0.12);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] .gallery-month-floating {
        color: rgba(255, 255, 255, 0.94);
        background: rgba(15, 23, 42, 0.82);
        border-color: rgba(255, 255, 255, 0.16);
    }

    body[data-theme="auto"] .admin-thumbnail-regenerate {
        color: rgba(255, 255, 255, 0.92);
        background: rgba(15, 23, 42, 0.68);
        border-color: rgba(255, 255, 255, 0.12);
    }
}

@media (max-width: 768px) {
    body[data-page="gallery"] .container {
        padding-inline: 0 !important;
    }

    body[data-page="gallery"] .gallery-page-clean {
        gap: 0;
        margin-inline: 0;
        padding-top: 0;
        padding-bottom: calc(var(--mobile-bottom-nav-height, 0px) + env(safe-area-inset-bottom) + 116px);
    }

    body[data-page="gallery"] .photos-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: auto;
        gap: 1px;
        border: 0;
        border-radius: 0;
    }

    body[data-page="gallery"] .photos-gallery-tile {
        aspect-ratio: 1 / 1;
        border-radius: 0;
    }

    body[data-page="gallery"] .photos-gallery-tile:nth-child(11n + 1),
    body[data-page="gallery"] .photos-gallery-tile:nth-child(17n + 8) {
        grid-row: auto;
        grid-column: auto;
    }

    body[data-page="gallery"] .gallery-calendar-panel {
        margin: 0;
        padding: 0.4rem 0.34rem 0.6rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    body[data-page="gallery"] .gallery-calendar-panel .calendar-visible-period {
        margin: 0 0 0.45rem;
        padding-inline: 0.28rem;
    }

    body[data-page="gallery"] .gallery-calendar-panel .entries-calendar {
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    body[data-page="gallery"] .gallery-calendar-panel .entries-calendar.meal-calendar-month {
        gap: 0.3rem;
    }

    body[data-page="gallery"] .gallery-calendar-panel .entries-calendar-day article {
        min-height: 72px;
        padding: 0.38rem;
        border-radius: 13px;
    }

    body[data-page="gallery"] .gallery-calendar-panel .entries-calendar-day strong {
        font-size: 0.78rem;
        line-height: 1;
    }

    body[data-page="gallery"] .gallery-calendar-panel .entries-calendar-day .badge {
        font-size: 0.62rem;
        padding: 0.14rem 0.34rem;
    }

    body[data-page="gallery"] .gallery-calendar-side-panel,
    body[data-page="gallery"] [data-meal-calendar-period-panel],
    body[data-page="gallery"] [data-meal-calendar-photos-panel] {
        display: none !important;
    }

    .admin-thumbnail-regenerate {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Final mobile implementation pass: compact approvals, full-bleed gallery, PJAX loader, Liquid Glass nav. */
@media (max-width: 768px) {
    .pending-grid {
        gap: 0.46rem;
    }

    .pending-card {
        gap: 0.38rem;
        padding: 0.56rem 0.62rem;
        border-radius: 14px;
    }

    .pending-card .pending-requested-by {
        display: none;
    }

    .pending-head {
        gap: 0.12rem;
    }

    .pending-head strong {
        font-size: 0.9rem;
        line-height: 1.05;
    }

    .pending-head span,
    .pending-card .muted,
    .pending-card label {
        font-size: 0.76rem;
        line-height: 1.18;
    }

    .pending-card p {
        margin-bottom: 0;
    }

    .pending-card label {
        gap: 0.24rem;
    }

    .pending-card input[type="text"] {
        min-height: 36px;
        padding: 0.46rem 0.58rem;
        border-radius: 12px;
        font-size: 0.82rem;
    }

    .pending-actions {
        gap: 0.38rem;
    }

    .pending-actions .btn {
        min-height: 34px;
        padding: 0.42rem 0.66rem;
        border-radius: 12px;
        font-size: 0.78rem;
    }

    body[data-page="gallery"] main.container {
        width: 100vw !important;
        max-width: none !important;
        margin-right: calc(50% - 50vw) !important;
        margin-left: calc(50% - 50vw) !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    body[data-page="gallery"] .gallery-page-clean {
        width: 100%;
    }
}

body.is-transitioning::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10020;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.16), transparent 36%),
        rgba(5, 9, 14, 0.10);
    opacity: 1;
    animation: none;
    backdrop-filter: blur(1.5px) saturate(116%);
    -webkit-backdrop-filter: blur(1.5px) saturate(116%);
}

body.is-transitioning::before {
    content: "Loading";
    position: fixed;
    top: calc(env(safe-area-inset-top) + 18px);
    left: 50%;
    z-index: 10021;
    min-width: 132px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px 0 48px;
    border-radius: 999px;
    border: 1px solid var(--liquid-glass-border, rgba(255, 255, 255, 0.34));
    color: var(--liquid-glass-text, rgba(255, 255, 255, 0.92));
    background:
        radial-gradient(circle at 24px 50%, #3f8cff 0 4px, rgba(63, 140, 255, 0.24) 5px 10px, transparent 11px),
        linear-gradient(110deg, transparent 0%, transparent 34%, rgba(255, 255, 255, 0.34) 47%, transparent 62%, transparent 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.055)),
        var(--liquid-glass-bg-strong, rgba(24, 24, 26, 0.84));
    background-size: auto, 220% 100%, auto, auto;
    background-position: 0 0, 120% 0, 0 0, 0 0;
    box-shadow:
        var(--liquid-glass-shadow, 0 18px 42px rgba(0, 0, 0, 0.34)),
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -1px 0 rgba(0, 0, 0, 0.16);
    transform: translateX(-50%) translateY(0);
    animation: liquidPageLoaderCapsule 1.18s cubic-bezier(0.22, 1, 0.36, 1) infinite;
    backdrop-filter: blur(var(--liquid-glass-blur, 26px)) saturate(var(--liquid-glass-saturation, 165%));
    -webkit-backdrop-filter: blur(var(--liquid-glass-blur, 26px)) saturate(var(--liquid-glass-saturation, 165%));
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Manrope", sans-serif;
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    line-height: 1;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.24);
    pointer-events: none;
}

@keyframes liquidPageLoaderCapsule {
    0% {
        background-position: 0 0, 120% 0, 0 0, 0 0;
        transform: translateX(-50%) translateY(-2px);
        opacity: 0.88;
    }
    45% {
        opacity: 1;
    }
    100% {
        background-position: 0 0, -120% 0, 0 0, 0 0;
        transform: translateX(-50%) translateY(0);
        opacity: 0.94;
    }
}

:root {
    --liquid-glass-blur: 26px;
    --liquid-glass-saturation: 165%;
    --liquid-glass-bg: rgba(255, 255, 255, 0.58);
    --liquid-glass-bg-strong: rgba(255, 255, 255, 0.72);
    --liquid-glass-clear: rgba(255, 255, 255, 0.34);
    --liquid-glass-border: rgba(255, 255, 255, 0.48);
    --liquid-glass-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
    --liquid-glass-tint: rgba(63, 140, 255, 0.11);
    --liquid-glass-text: rgba(18, 24, 33, 0.92);
    --ios-nav-height: 78px;
    --ios-nav-radius: 39px;
    --ios-nav-gap: 12px;
    --ios-nav-blue: #3f8cff;
    --ios-glass-bg: rgba(24, 24, 26, 0.84);
    --ios-glass-border: rgba(255, 255, 255, 0.12);
    --ios-text: rgba(255, 255, 255, 0.88);
    --ios-icon: rgba(255, 255, 255, 0.92);
    --ios-active-bg: rgba(255, 255, 255, 0.09);
    --ios-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
}

body[data-theme="light"] {
    --liquid-glass-bg: rgba(255, 255, 255, 0.58);
    --liquid-glass-bg-strong: rgba(255, 255, 255, 0.72);
    --liquid-glass-clear: rgba(255, 255, 255, 0.34);
    --liquid-glass-border: rgba(255, 255, 255, 0.48);
    --liquid-glass-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
    --liquid-glass-tint: rgba(63, 140, 255, 0.11);
    --liquid-glass-text: rgba(18, 24, 33, 0.92);
    --ios-glass-bg: rgba(245, 245, 247, 0.76);
    --ios-glass-border: rgba(0, 0, 0, 0.10);
    --ios-text: rgba(20, 20, 22, 0.78);
    --ios-icon: rgba(20, 20, 22, 0.82);
    --ios-active-bg: rgba(255, 255, 255, 0.58);
    --ios-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

body[data-theme="dark"] {
    --liquid-glass-bg: rgba(24, 24, 26, 0.62);
    --liquid-glass-bg-strong: rgba(24, 24, 26, 0.84);
    --liquid-glass-clear: rgba(255, 255, 255, 0.08);
    --liquid-glass-border: rgba(255, 255, 255, 0.13);
    --liquid-glass-shadow: 0 22px 52px rgba(0, 0, 0, 0.42);
    --liquid-glass-tint: rgba(63, 140, 255, 0.14);
    --liquid-glass-text: rgba(255, 255, 255, 0.92);
    --ios-glass-bg: rgba(24, 24, 26, 0.84);
    --ios-glass-border: rgba(255, 255, 255, 0.12);
    --ios-text: rgba(255, 255, 255, 0.88);
    --ios-icon: rgba(255, 255, 255, 0.92);
    --ios-active-bg: rgba(255, 255, 255, 0.09);
    --ios-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: light) {
    body[data-theme="auto"] {
        --liquid-glass-bg: rgba(255, 255, 255, 0.58);
        --liquid-glass-bg-strong: rgba(255, 255, 255, 0.72);
        --liquid-glass-clear: rgba(255, 255, 255, 0.34);
        --liquid-glass-border: rgba(255, 255, 255, 0.48);
        --liquid-glass-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
        --liquid-glass-tint: rgba(63, 140, 255, 0.11);
        --liquid-glass-text: rgba(18, 24, 33, 0.92);
        --ios-glass-bg: rgba(245, 245, 247, 0.76);
        --ios-glass-border: rgba(0, 0, 0, 0.10);
        --ios-text: rgba(20, 20, 22, 0.78);
        --ios-icon: rgba(20, 20, 22, 0.82);
        --ios-active-bg: rgba(255, 255, 255, 0.58);
        --ios-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
    }
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] {
        --liquid-glass-bg: rgba(24, 24, 26, 0.62);
        --liquid-glass-bg-strong: rgba(24, 24, 26, 0.84);
        --liquid-glass-clear: rgba(255, 255, 255, 0.08);
        --liquid-glass-border: rgba(255, 255, 255, 0.13);
        --liquid-glass-shadow: 0 22px 52px rgba(0, 0, 0, 0.42);
        --liquid-glass-tint: rgba(63, 140, 255, 0.14);
        --liquid-glass-text: rgba(255, 255, 255, 0.92);
    }
}

.liquid-glass-regular,
.liquid-glass-clear,
.liquid-glass-container {
    border: 1px solid var(--liquid-glass-border);
    box-shadow:
        var(--liquid-glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(var(--liquid-glass-blur)) saturate(var(--liquid-glass-saturation));
    -webkit-backdrop-filter: blur(var(--liquid-glass-blur)) saturate(var(--liquid-glass-saturation));
}

.liquid-glass-regular {
    color: var(--liquid-glass-text);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045)),
        var(--liquid-glass-bg);
}

.liquid-glass-clear {
    color: var(--liquid-glass-text);
    background:
        radial-gradient(circle at 50% 0%, var(--liquid-glass-tint), transparent 58%),
        var(--liquid-glass-clear);
}

.liquid-glass-container {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
        var(--liquid-glass-bg-strong);
}

.liquid-glass-interactive {
    transition:
        transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 180ms ease,
        background 180ms ease;
}

.liquid-glass-interactive:active,
.liquid-glass-interactive.is-pressed {
    transform: scale(0.985);
}

:where(.topbar,
.hero-panel,
.panel,
.analytics-controls,
.calendar-empty-state,
.gallery-empty,
.modal,
.confirm-modal-card) {
    border-color: var(--liquid-glass-border) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.045)),
        var(--liquid-glass-bg) !important;
    box-shadow:
        var(--liquid-glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: blur(var(--liquid-glass-blur)) saturate(var(--liquid-glass-saturation)) !important;
    -webkit-backdrop-filter: blur(var(--liquid-glass-blur)) saturate(var(--liquid-glass-saturation)) !important;
}

:where(.topbar-context[open] .topbar-context-panel,
.add-menu[open] .add-menu-panel,
.user-menu[open] .user-menu-panel,
.bottom-nav-plus-menu,
.photo-post-menu[open] .photo-post-menu-panel,
.metric-help-popover[open] .metric-help-popover-content) {
    color: var(--liquid-glass-text) !important;
    border-color: var(--liquid-glass-border) !important;
    background:
        radial-gradient(circle at 50% 0%, var(--liquid-glass-tint), transparent 56%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045)),
        var(--liquid-glass-bg-strong) !important;
    box-shadow:
        var(--liquid-glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12) !important;
    backdrop-filter: blur(var(--liquid-glass-blur)) saturate(var(--liquid-glass-saturation)) !important;
    -webkit-backdrop-filter: blur(var(--liquid-glass-blur)) saturate(var(--liquid-glass-saturation)) !important;
}

:where(.btn.btn-ghost,
.calendar-view-segments,
.photo-mode-segments,
.analytics-period-segments,
.view-panel-section input,
.view-panel-section select) {
    border-color: var(--liquid-glass-border) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
        var(--liquid-glass-clear) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 8px 24px rgba(15, 23, 42, 0.08) !important;
    backdrop-filter: blur(calc(var(--liquid-glass-blur) * 0.75)) saturate(var(--liquid-glass-saturation)) !important;
    -webkit-backdrop-filter: blur(calc(var(--liquid-glass-blur) * 0.75)) saturate(var(--liquid-glass-saturation)) !important;
}

@media (max-width: 768px) {
    .mobile-liquid-nav {
        left: max(12px, env(safe-area-inset-left)) !important;
        right: max(12px, env(safe-area-inset-right)) !important;
        bottom: max(12px, env(safe-area-inset-bottom)) !important;
        z-index: 9999;
        display: flex;
        align-items: center !important;
        gap: var(--ios-nav-gap) !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
        font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Manrope", sans-serif;
        transform: translate3d(0, 0, 0) !important;
        opacity: 1 !important;
        transition:
            transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
            opacity 180ms ease,
            filter 180ms ease !important;
        will-change: transform, opacity;
    }

    .mobile-liquid-nav.nav-hidden,
    .mobile-liquid-nav.is-hidden,
    .bottom-nav.nav-hidden,
    .bottom-nav.is-hidden {
        transform: translate3d(0, calc(100% + 24px), 0) !important;
        opacity: 0 !important;
        pointer-events: none;
        filter: none;
    }

    .mobile-liquid-nav .liquid-nav-pill {
        flex: 1 1 auto;
        height: var(--ios-nav-height);
        min-width: 0;
        display: flex;
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
        overflow: hidden;
        border: 1px solid var(--ios-glass-border);
        border-radius: var(--ios-nav-radius);
        background:
            linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015)),
            var(--ios-glass-bg);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.12),
            inset 0 -1px 0 rgba(0, 0, 0, 0.16),
            var(--ios-shadow);
        backdrop-filter: blur(26px) saturate(165%);
        -webkit-backdrop-filter: blur(26px) saturate(165%);
    }

    .mobile-liquid-nav .liquid-nav-item {
        position: relative;
        isolation: isolate;
        flex: 1 1 0;
        min-width: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 0 2px;
        border: 0 !important;
        border-radius: 0 !important;
        color: var(--ios-text) !important;
        background: transparent !important;
        box-shadow: none !important;
        text-decoration: none;
        font-size: 11.5px;
        line-height: 1;
        font-weight: 650;
        letter-spacing: -0.24px;
        -webkit-tap-highlight-color: transparent;
        transition:
            color 180ms ease,
            transform 180ms ease,
            opacity 180ms ease;
    }

    .mobile-liquid-nav .liquid-nav-item::before {
        content: "";
        position: absolute;
        inset: 4px;
        z-index: -1;
        border-radius: calc(var(--ios-nav-radius) - 4px);
        opacity: 0;
        background:
            radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.20), transparent 58%),
            var(--ios-active-bg);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.14),
            inset 0 -1px 0 rgba(0, 0, 0, 0.18);
        transition:
            opacity 180ms ease,
            transform 180ms ease;
    }

    .mobile-liquid-nav .liquid-nav-item .nav-icon {
        display: grid;
        place-items: center;
        width: 26px;
        height: 26px;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: var(--ios-icon) !important;
        transform: none !important;
        transition:
            color 180ms ease,
            transform 180ms ease;
    }

    .mobile-liquid-nav .liquid-nav-item .nav-icon svg {
        width: 24px;
        height: 24px;
        stroke: currentColor !important;
        stroke-width: 2;
    }

    .mobile-liquid-nav .liquid-nav-item .nav-label {
        max-width: 100%;
        overflow: hidden;
        color: currentColor !important;
        font-size: inherit;
        font-weight: 650;
        line-height: 1;
        letter-spacing: -0.24px;
        text-overflow: ellipsis;
        white-space: nowrap;
        opacity: 1;
    }

    .mobile-liquid-nav .liquid-nav-item.active,
    .mobile-liquid-nav .liquid-nav-item[aria-current="page"] {
        color: #3f8cff !important;
    }

    .mobile-liquid-nav .liquid-nav-item.active::before,
    .mobile-liquid-nav .liquid-nav-item[aria-current="page"]::before {
        opacity: 1;
    }

    .mobile-liquid-nav .liquid-nav-item:first-child::before {
        border-top-left-radius: var(--ios-nav-radius);
        border-bottom-left-radius: var(--ios-nav-radius);
    }

    .mobile-liquid-nav .liquid-nav-item:last-child::before {
        border-top-right-radius: var(--ios-nav-radius);
        border-bottom-right-radius: var(--ios-nav-radius);
    }

    .mobile-liquid-nav .liquid-nav-item.active .nav-icon,
    .mobile-liquid-nav .liquid-nav-item[aria-current="page"] .nav-icon {
        color: #3f8cff !important;
    }

    .mobile-liquid-nav .liquid-nav-item:active,
    .mobile-liquid-nav .liquid-nav-item.is-pressed {
        transform: scale(0.96) translateZ(0) !important;
    }

    .mobile-liquid-nav .liquid-nav-item:active::before,
    .mobile-liquid-nav .liquid-nav-item.is-pressed::before {
        transform: scale(0.97);
    }

    .mobile-liquid-nav .liquid-nav-plus > summary:active,
    .mobile-liquid-nav .liquid-nav-plus > summary.is-pressed {
        transform: scale(0.94) translateZ(0) !important;
    }

    .mobile-liquid-nav .liquid-nav-plus {
        width: var(--ios-nav-height);
        height: var(--ios-nav-height);
        flex: 0 0 var(--ios-nav-height);
        display: grid;
        min-width: 0;
    }

    .mobile-liquid-nav .liquid-nav-plus > summary {
        position: relative;
        width: var(--ios-nav-height);
        height: var(--ios-nav-height);
        min-height: var(--ios-nav-height);
        display: grid;
        place-items: center;
        padding: 0;
        overflow: hidden;
        border: 1px solid var(--ios-glass-border);
        border-radius: 50%;
        color: var(--ios-icon);
        background:
            linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015)),
            var(--ios-glass-bg);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.12),
            inset 0 -1px 0 rgba(0, 0, 0, 0.16),
            var(--ios-shadow);
        backdrop-filter: blur(26px) saturate(165%);
        -webkit-backdrop-filter: blur(26px) saturate(165%);
        -webkit-tap-highlight-color: transparent;
        transition: transform 180ms ease;
    }

    .mobile-liquid-nav .liquid-nav-plus > summary > span:not(.nav-icon) {
        display: none;
    }

    .mobile-liquid-nav .liquid-nav-plus .bottom-nav-plus-icon {
        width: 30px;
        height: 30px;
        color: var(--ios-icon);
        font-size: 34px;
        font-weight: 500;
        line-height: 0.86;
        text-shadow: none;
    }

    .mobile-liquid-nav .liquid-nav-plus[open] > summary,
    .mobile-liquid-nav .liquid-nav-plus > summary:focus-visible {
        color: var(--ios-icon);
        background:
            radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.20), transparent 58%),
            var(--ios-active-bg),
            var(--ios-glass-bg);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.14),
            inset 0 -1px 0 rgba(0, 0, 0, 0.18),
            var(--ios-shadow);
    }
}

@media (max-width: 420px) {
    .mobile-liquid-nav {
        left: max(8px, env(safe-area-inset-left)) !important;
        right: max(8px, env(safe-area-inset-right)) !important;
        gap: 8px !important;
    }

    .mobile-liquid-nav .liquid-nav-item {
        font-size: 10.5px;
    }

    .mobile-liquid-nav .liquid-nav-item .nav-icon {
        width: 23px;
        height: 23px;
    }

    .mobile-liquid-nav .liquid-nav-item .nav-icon svg {
        width: 21px;
        height: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.is-transitioning::before {
        animation: none !important;
    }

    body.is-transitioning::after {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* Final fixes: profile editor layering, compact daily log, persistent media nav. */
.profile-hero {
    overflow: visible !important;
    z-index: 30;
}

.profile-hero-actions {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 0.5rem;
    min-width: 0;
    position: relative;
    z-index: 35;
}

.profile-pdf-export-btn {
    min-height: 42px;
    gap: 0.46rem;
    padding-inline: 0.82rem;
    white-space: normal;
    text-align: left;
    line-height: 1.1;
}

.profile-pdf-export-btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-pdf-export-btn[aria-busy="true"] {
    cursor: wait;
}

.profile-tagline-editor {
    z-index: 36;
}

.profile-tagline-editor[open] {
    z-index: 10090;
}

.profile-tagline-form {
    z-index: 10091;
}

.entry-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.22rem;
    width: min(430px, 100%);
    padding: 0.22rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fbfa;
    box-shadow: 0 10px 28px rgba(22, 35, 43, 0.08);
}

.entry-mode-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.52rem 0.75rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 850;
    line-height: 1.1;
    text-align: center;
}

.entry-mode-tabs a.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 10px 22px rgba(20, 163, 139, 0.22);
}

.entry-data-toolbar {
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

.entry-date-time-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.34fr);
    align-items: end;
    width: 100%;
    gap: 0.55rem;
}

.entry-date-nav {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: end;
    gap: 0.4rem;
    min-width: 0;
}

.entry-day-arrow {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    align-self: end;
}

.entry-day-arrow svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.entry-date-nav .entry-date-inline,
.entry-date-time-row .entry-time-inline {
    display: grid;
    gap: 0.28rem;
    min-width: 0;
    width: 100%;
}

.entry-date-nav .entry-date-inline span,
.entry-date-time-row .entry-time-inline span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.entry-date-nav input,
.entry-date-time-row input {
    width: 100%;
}

.entry-data-form .entry-metric-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workout-type-field {
    min-width: 0;
}

.workout-remove-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    border-color: rgba(223, 76, 67, 0.28) !important;
    background: rgba(223, 76, 67, 0.10) !important;
    color: var(--bad) !important;
    box-shadow: none !important;
    font-size: 1.38rem;
    font-weight: 900;
    line-height: 1;
}

.workout-remove-btn span[aria-hidden="true"] {
    display: block;
    line-height: 1;
    transform: translateY(-1px);
}

.workout-remove-btn:hover,
.workout-remove-btn:focus-visible {
    border-color: rgba(223, 76, 67, 0.48) !important;
    background: rgba(223, 76, 67, 0.18) !important;
    color: #b42318 !important;
}

.workout-remove-btn[disabled],
.workout-remove-btn[aria-disabled="true"] {
    border-color: rgba(148, 163, 184, 0.22) !important;
    background: rgba(148, 163, 184, 0.08) !important;
    color: var(--muted) !important;
    opacity: 0.58;
}

.workout-subfields[hidden] {
    display: none !important;
}

.workout-row.has-workout-data {
    align-items: start;
}

@media (max-width: 899px) {
    body[data-page="gallery"] .bottom-nav,
    body[data-page="photo"] .bottom-nav {
        display: flex !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    body[data-page="gallery"] .bottom-nav.nav-hidden,
    body[data-page="gallery"] .bottom-nav.is-hidden,
    body[data-page="photo"] .bottom-nav.nav-hidden,
    body[data-page="photo"] .bottom-nav.is-hidden {
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    body[data-page="photo"] .floating-log {
        display: none !important;
    }

    body[data-page="photo"] .screen.stack-lg {
        padding-bottom: calc(var(--mobile-bottom-nav-height, 0px) + env(safe-area-inset-bottom) + 24px) !important;
    }

    body[data-page="photo"] .photo-comments {
        padding-bottom: calc(var(--mobile-bottom-nav-height, 0px) + env(safe-area-inset-bottom) + 110px) !important;
    }

    body[data-page="gallery"] .gallery-page-clean {
        padding-bottom: calc(var(--mobile-bottom-nav-height, 0px) + env(safe-area-inset-bottom) + 118px) !important;
    }

    body[data-page="gallery"] .photos-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    body[data-page="gallery"] .photos-gallery-tile {
        aspect-ratio: 1;
        min-height: 0;
        background: #edf4f1;
    }

    body[data-page="gallery"] .photos-gallery-tile img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

@media (max-width: 520px) {
    .profile-hero-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: 0.5rem;
        width: 100%;
        justify-self: stretch;
        align-items: stretch;
    }

    .profile-pdf-export-btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
        text-align: center;
    }

    .profile-tagline-editor {
        width: 44px;
        min-width: 44px;
        justify-self: end;
    }

    .profile-tagline-edit {
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 0 !important;
        display: inline-grid !important;
        place-items: center;
    }

    .profile-tagline-form {
        right: 0;
        width: min(340px, calc(100vw - 1.5rem));
        border-radius: 14px;
    }

    .entry-mode-tabs {
        width: 100%;
    }

    .entry-data-toolbar {
        margin-bottom: 0.55rem;
    }

    .entry-date-time-row {
        grid-template-columns: minmax(0, 1fr) minmax(98px, 0.36fr);
        gap: 0.42rem;
    }

    .entry-date-nav {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
        gap: 0.3rem;
    }

    .entry-day-arrow {
        width: 38px;
        height: 40px;
        min-width: 38px;
    }

    .entry-date-nav .entry-date-inline span,
    .entry-date-time-row .entry-time-inline span {
        font-size: 0.66rem;
    }

    .entry-date-nav input,
    .entry-date-time-row input {
        min-height: 40px;
        padding-inline: 0.42rem;
        font-size: 0.82rem;
    }

    .entry-data-form .entry-metric-pair {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.48rem;
    }

    .entry-data-form .entry-metric-pair label {
        min-width: 0;
        font-size: 0.78rem;
        line-height: 1.18;
    }

    .entry-data-form .entry-metric-pair input {
        min-width: 0;
        padding-inline: 0.55rem;
    }

    .workout-row {
        grid-template-columns: minmax(0, 1fr) 44px !important;
        align-items: end;
        gap: 0.48rem;
    }

    .workout-row .workout-type-field {
        grid-column: 1;
        grid-row: 1;
    }

    .workout-row .workout-remove-btn {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
    }

    .workout-row .workout-custom-field,
    .workout-row .workout-subfields {
        grid-column: 1 / -1;
    }

    .workout-row .workout-subfields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.48rem;
    }

    .workout-row .workout-subfields label {
        min-width: 0;
        font-size: 0.78rem;
        line-height: 1.18;
    }

    .workout-row .workout-subfields input {
        min-width: 0;
        padding-inline: 0.55rem;
    }
}

@media (max-width: 380px) {
    .workout-row .workout-subfields {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 1024px) {
  body:has(nav.bottom-nav.mobile-liquid-nav) .btn-add,
  body:has(nav.bottom-nav.mobile-liquid-nav) .add-menu-trigger.btn-add {
    display: none !important;
  }

  nav.bottom-nav.mobile-liquid-nav {
    position: fixed !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    z-index: 9999 !important;

    display: flex !important;
    grid-template-columns: none !important;
    align-items: center !important;
    gap: 10px !important;

    width: auto !important;
    height: auto !important;
    min-height: 0 !important;

    padding: 0 !important;
    margin: 0 !important;

    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;

    overflow: visible !important;
  }

  nav.bottom-nav.mobile-liquid-nav > .liquid-nav-pill {
    flex: 1 1 auto !important;
    height: 66px !important;
    min-height: 66px !important;

    display: flex !important;
    align-items: stretch !important;

    padding: 0 !important;
    margin: 0 !important;

    overflow: hidden !important;

    border-radius: 34px !important;
    border: 1px solid rgba(255,255,255,.78) !important;

    background:
      linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.42)),
      rgba(255,255,255,.62) !important;

    backdrop-filter: blur(28px) saturate(1.8) contrast(1.05) !important;
    -webkit-backdrop-filter: blur(28px) saturate(1.8) contrast(1.05) !important;

    box-shadow:
      0 18px 42px rgba(15,23,42,.14),
      inset 0 1px 0 rgba(255,255,255,.95),
      inset 0 -1px 0 rgba(255,255,255,.35) !important;
  }

  nav.bottom-nav.mobile-liquid-nav .liquid-nav-item {
    position: relative !important;
    isolation: isolate !important;

    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 100% !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;

    padding: 0 !important;
    margin: 0 !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;
    box-shadow: none !important;

    color: rgba(12,12,14,.92) !important;
    text-decoration: none !important;

    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Manrope", sans-serif !important;
    font-size: 13px !important;
    font-weight: 650 !important;
    line-height: 1 !important;
    letter-spacing: -0.2px !important;
  }

  nav.bottom-nav.mobile-liquid-nav .liquid-nav-item::before {
    content: "" !important;
    position: absolute !important;
    inset: 4px 2px !important;
    z-index: -1 !important;

    border-radius: 30px !important;
    opacity: 0 !important;

    background:
      radial-gradient(circle at 50% 0%, rgba(255,255,255,.95), transparent 62%),
      rgba(215,218,224,.56) !important;

    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.95),
      inset 0 -1px 0 rgba(0,0,0,.05),
      0 8px 22px rgba(15,23,42,.08) !important;

    transition: opacity 180ms ease, transform 180ms ease !important;
  }

  nav.bottom-nav.mobile-liquid-nav .liquid-nav-item.active,
  nav.bottom-nav.mobile-liquid-nav .liquid-nav-item[aria-current="page"] {
    color: #3388ff !important;
  }

  nav.bottom-nav.mobile-liquid-nav .liquid-nav-item.active::before,
  nav.bottom-nav.mobile-liquid-nav .liquid-nav-item[aria-current="page"]::before {
    opacity: 1 !important;
  }

  nav.bottom-nav.mobile-liquid-nav .nav-icon,
  nav.bottom-nav.mobile-liquid-nav .nav-icon svg {
    width: 25px !important;
    height: 25px !important;
  }

  nav.bottom-nav.mobile-liquid-nav .nav-icon svg {
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2.25 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }

  nav.bottom-nav.mobile-liquid-nav > .liquid-nav-plus {
    width: 66px !important;
    height: 66px !important;
    flex: 0 0 66px !important;

    padding: 0 !important;
    margin: 0 !important;

    border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,.78) !important;

    background:
      linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.42)),
      rgba(255,255,255,.62) !important;

    backdrop-filter: blur(28px) saturate(1.8) contrast(1.05) !important;
    -webkit-backdrop-filter: blur(28px) saturate(1.8) contrast(1.05) !important;

    box-shadow:
      0 18px 42px rgba(15,23,42,.14),
      inset 0 1px 0 rgba(255,255,255,.95),
      inset 0 -1px 0 rgba(255,255,255,.35) !important;

    overflow: visible !important;
  }

  nav.bottom-nav.mobile-liquid-nav > .liquid-nav-plus > summary {
    width: 100% !important;
    height: 100% !important;

    display: grid !important;
    place-items: center !important;

    padding: 0 !important;
    margin: 0 !important;

    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    list-style: none !important;
  }

  nav.bottom-nav.mobile-liquid-nav > .liquid-nav-plus > summary::-webkit-details-marker {
    display: none !important;
  }

  nav.bottom-nav.mobile-liquid-nav > .liquid-nav-plus summary span:not(.bottom-nav-plus-icon) {
    display: none !important;
  }

  nav.bottom-nav.mobile-liquid-nav .bottom-nav-plus-icon {
    width: auto !important;
    height: auto !important;
    font-size: 34px !important;
    line-height: 1 !important;
    color: #050505 !important;
    transform: translateY(-1px) !important;
  }
}
@media (max-width: 1024px) {
  nav.bottom-nav.mobile-liquid-nav > .liquid-nav-plus {
    position: relative !important;
  }

  nav.bottom-nav.mobile-liquid-nav > .liquid-nav-plus > summary {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  nav.bottom-nav.mobile-liquid-nav .bottom-nav-plus-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    font-size: 34px !important;
    line-height: 1 !important;

    transform: translateY(-2px) !important;
  }

  nav.bottom-nav.mobile-liquid-nav .bottom-nav-plus-menu,
  nav.bottom-nav.mobile-liquid-nav .add-menu-panel {
    position: absolute !important;
    right: 0 !important;
    bottom: calc(100% + 10px) !important;

    width: max-content !important;
    min-width: 172px !important;

    margin: 0 !important;
    padding: 8px !important;

    border-radius: 22px !important;

    background:
      linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,255,255,.48)),
      rgba(255,255,255,.70) !important;

    border: 1px solid rgba(255,255,255,.78) !important;

    backdrop-filter: blur(28px) saturate(1.8) contrast(1.05) !important;
    -webkit-backdrop-filter: blur(28px) saturate(1.8) contrast(1.05) !important;

    box-shadow:
      0 18px 42px rgba(15,23,42,.14),
      inset 0 1px 0 rgba(255,255,255,.95) !important;

    transform: none !important;
  }

  nav.bottom-nav.mobile-liquid-nav .bottom-nav-plus-menu a,
  nav.bottom-nav.mobile-liquid-nav .add-menu-panel a {
    display: block !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    white-space: nowrap !important;
  }

  .layout-edit-active [data-layout-item],
  .layout-edit-active .layout-item,
  .layout-edit-active .dashboard-widget,
  .layout-edit-active .team-widget,
  .layout-edit-active .dashboard-layout-edit-card,
  .layout-edit-active .team-layout-edit-card {
    position: relative;
  }

  .dashboard-layout-edit-card .dashboard-layout-mobile-actions,
  .team-layout-edit-card .team-layout-mobile-actions {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 20 !important;
    display: flex !important;
    gap: 6px !important;
    justify-content: flex-end !important;
  }

  .dashboard-layout-edit-card .dashboard-layout-mobile-actions .btn,
  .team-layout-edit-card .team-layout-mobile-actions .btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255,255,255,.7) !important;
    background:
      linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,255,255,.48)),
      rgba(255,255,255,.7) !important;
    backdrop-filter: blur(18px) saturate(1.6) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.6) !important;
    box-shadow:
      0 10px 24px rgba(15,23,42,.12),
      inset 0 1px 0 rgba(255,255,255,.9) !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    color: rgba(18,24,33,.86) !important;
    touch-action: manipulation !important;
  }

  .dashboard-layout-edit-card .dashboard-layout-mobile-actions .btn:disabled,
  .team-layout-edit-card .team-layout-mobile-actions .btn:disabled {
    opacity: .35 !important;
    pointer-events: none !important;
  }
}

@media (max-width: 768px) {
  body:not(.layout-edit-active) main,
  body:not(.layout-edit-active) .app-shell,
  body:not(.layout-edit-active) .page,
  body:not(.layout-edit-active) .dashboard-layout {
    filter: none !important;
  }

  body.view-changing main,
  body.is-view-changing main {
    filter: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* Regression recovery pass: team mobile, layout edit isolation, gallery incremental load. */
.photos-gallery-grid-continuous .photos-gallery-tile {
  content-visibility: auto;
  contain-intrinsic-size: 220px 220px;
}

.gallery-recent-root.is-loading .gallery-load-more {
  opacity: 0.72;
  pointer-events: none;
}

.gallery-load-more {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0.75rem auto 0;
}

.gallery-recent-sentinel {
  width: 100%;
  height: 1px;
  margin-top: 1px;
}

/* Gallery desktop/tablet performance and Photos-style refinement. */
.user-menu-trigger {
  overflow: visible;
  isolation: isolate;
}

.user-menu-trigger > img,
.user-menu-trigger > span:not(.user-menu-unread-badge) {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background: inherit;
}

.user-menu-unread-badge {
  z-index: 4;
  pointer-events: none;
}

@media (min-width: 769px) {
  body[data-page="gallery"] .container {
    width: min(1480px, calc(100vw - 2rem));
  }

  body[data-page="gallery"] .gallery-page-clean {
    gap: 0.72rem;
  }

  body[data-page="gallery"] .gallery-recent-root {
    display: grid;
    gap: 0.78rem;
  }

  body[data-page="gallery"] .photos-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 2px;
    border: 0;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.08);
    box-shadow: none;
  }

  body[data-page="gallery"] .photos-gallery-grid-continuous .photos-gallery-tile {
    contain-intrinsic-size: 170px 170px;
  }

  body[data-page="gallery"] .photos-gallery-tile {
    border-radius: 0;
    background: #e8efec;
    outline-offset: -3px;
  }

  body[data-page="gallery"] .photos-gallery-tile::after {
    height: 42%;
    opacity: 0.82;
    background: linear-gradient(180deg, transparent, rgba(3, 7, 18, 0.48));
  }

  body[data-page="gallery"] .photos-gallery-tile:hover,
  body[data-page="gallery"] .photos-gallery-tile:focus-visible {
    z-index: 2;
  }

  body[data-page="gallery"] .photos-gallery-tile:hover img,
  body[data-page="gallery"] .photos-gallery-tile:focus-visible img {
    transform: scale(1.035);
  }

  body[data-page="gallery"] .photos-gallery-date {
    right: 0.46rem;
    bottom: 0.42rem;
    max-width: calc(100% - 0.92rem);
    padding: 0.18rem 0.38rem;
    border-radius: 999px;
    background: rgba(3, 7, 18, 0.36);
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.66rem;
    line-height: 1.1;
    white-space: nowrap;
  }

  body[data-page="gallery"] .gallery-month-floating,
  body[data-page="gallery"] .gallery-month-label {
    padding: 0.3rem 0.66rem;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
    font-size: 0.78rem;
  }

  body[data-page="gallery"] .gallery-month-floating {
    left: max(16px, calc((100vw - 1480px) / 2 + 16px));
  }

  body[data-page="gallery"] .gallery-load-more {
    min-width: 154px;
    border-radius: 999px;
  }

  body[data-page="gallery"] .calendar-view-menu > summary {
    min-height: 38px;
    padding-inline: 0.72rem;
  }
}

@media (min-width: 1024px) {
  body[data-page="gallery"] .photos-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  }
}

@media (min-width: 1320px) {
  body[data-page="gallery"] .photos-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
  }
}

body[data-theme="dark"][data-page="gallery"] .photos-gallery-grid {
  background: rgba(255, 255, 255, 0.10);
}

body[data-theme="dark"][data-page="gallery"] .photos-gallery-tile {
  background: #17212b;
}

body[data-theme="dark"][data-page="gallery"] .gallery-month-floating,
body[data-theme="dark"][data-page="gallery"] .gallery-month-label {
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

@media (prefers-color-scheme: dark) {
  body[data-theme="auto"][data-page="gallery"] .photos-gallery-grid {
    background: rgba(255, 255, 255, 0.10);
  }

  body[data-theme="auto"][data-page="gallery"] .photos-gallery-tile {
    background: #17212b;
  }

  body[data-theme="auto"][data-page="gallery"] .gallery-month-floating,
  body[data-theme="auto"][data-page="gallery"] .gallery-month-label {
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  }
}

@media (min-width: 769px) {
  .team-active-challenge-detail-btn-mobile,
  .team-goal-mobile-preview {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .team-active-challenge-panel {
    padding: 1rem !important;
    border-radius: 24px !important;
  }

  .team-active-challenge-head {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
    flex-wrap: nowrap !important;
  }

  .team-active-challenge-head > div:first-child {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .team-active-challenge-head .eyebrow {
    margin-bottom: 0.25rem !important;
  }

  .team-active-challenge-head h2 {
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1.15 !important;
    max-width: 100% !important;
  }

  .team-active-challenge-head-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
  }

  .team-active-challenge-status {
    white-space: nowrap !important;
  }

  .team-active-challenge-head-actions .team-active-challenge-detail-btn:not(.team-active-challenge-detail-btn-mobile) {
    display: none !important;
  }

  .team-active-challenge-detail-btn-mobile {
    display: inline-flex !important;
    width: 100% !important;
    margin-top: 0.9rem !important;
    justify-content: center !important;
  }

  .team-active-challenge-grid {
    display: block !important;
    margin-top: 1rem !important;
  }

  .team-active-challenge-main {
    display: block !important;
  }

  .team-active-challenge-values {
    margin-bottom: 0.75rem !important;
  }

  .team-active-challenge-values span {
    font-size: 1.6rem !important;
    line-height: 1 !important;
  }

  .team-active-challenge-objectives,
  .team-active-challenge-meta {
    display: none !important;
  }

  .team-goal-card {
    position: relative !important;
    display: block !important;
    padding: 0 !important;
    overflow: visible !important;
    border-radius: 22px !important;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.46)),
      rgba(255, 255, 255, 0.68) !important;
    border: 1px solid rgba(255, 255, 255, 0.78) !important;
    box-shadow:
      0 12px 30px rgba(15, 23, 42, 0.10),
      inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(22px) saturate(1.6) !important;
    -webkit-backdrop-filter: blur(22px) saturate(1.6) !important;
  }

  .team-goal-mobile-preview {
    width: 100% !important;
    min-height: 78px !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "title status"
      "reward progress"
      "bar bar" !important;
    align-items: center !important;
    gap: 0.35rem 0.75rem !important;
    padding: 0.95rem 3rem 0.9rem 1rem !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: left !important;
    color: rgba(18, 24, 33, 0.92) !important;
    text-decoration: none !important;
  }

  .team-goal-mobile-preview-title {
    grid-area: title !important;
    display: block !important;
    font-size: 0.95rem !important;
    line-height: 1.15 !important;
    font-weight: 750 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .team-goal-mobile-preview-status {
    grid-area: status !important;
    justify-self: end !important;
    font-size: 0.66rem !important;
    line-height: 1 !important;
  }

  .team-goal-mobile-preview-progress {
    grid-area: progress !important;
    justify-self: end !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #3388ff !important;
    white-space: nowrap !important;
  }

  .team-goal-mobile-preview-reward {
    grid-area: reward !important;
    display: block !important;
    font-size: 0.78rem !important;
    line-height: 1.2 !important;
    color: rgba(18, 24, 33, 0.58) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .team-goal-mobile-preview-bar {
    grid-area: bar !important;
    display: block !important;
    height: 5px !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    background: rgba(15, 23, 42, 0.08) !important;
  }

  .team-goal-mobile-preview-bar span {
    display: block !important;
    height: 100% !important;
    border-radius: inherit !important;
    background: linear-gradient(90deg, #3388ff, #6fb0ff) !important;
  }

  .team-goal-card .team-goal-main {
    display: none !important;
  }

  .team-goal-card .team-goal-actions-menu {
    position: absolute !important;
    top: 0.65rem !important;
    right: 0.65rem !important;
    z-index: 4 !important;
  }

  .team-goal-card .team-goal-actions-menu > summary {
    width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    border-radius: 999px !important;
  }

  body[data-theme="dark"] .team-goal-card,
  body[data-theme="dark"] .team-active-challenge-panel {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.035)),
      rgba(24, 24, 26, 0.82) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow:
      0 18px 42px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  }

  body[data-theme="dark"] .team-goal-mobile-preview,
  body[data-theme="dark"] .team-goal-mobile-preview-title,
  body[data-theme="dark"] .team-active-challenge-head h2 {
    color: rgba(255, 255, 255, 0.9) !important;
  }

  body[data-theme="dark"] .team-goal-mobile-preview-reward {
    color: rgba(255, 255, 255, 0.56) !important;
  }

  body[data-theme="dark"] .team-goal-mobile-preview-bar {
    background: rgba(255, 255, 255, 0.10) !important;
  }

  body[data-page="gallery"] .entries-calendar-panel,
  body[data-page="entries"] .entries-calendar-panel,
  body[data-page="gallery"] .entries-calendar-mobile-gallery-panel,
  body[data-page="entries"] .entries-calendar-mobile-gallery-panel {
    padding: 0.82rem !important;
    border-radius: 22px !important;
  }

  body[data-page="profile"] .profile-hero {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.78rem !important;
  }

  body[data-page="profile"] .profile-title {
    min-width: 0 !important;
  }

  body[data-page="profile"] .profile-home-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.72rem !important;
  }
}

@media (max-width: 899px) {
  .team-layout-edit-mode-panel,
  body.layout-edit-active .team-layout-item {
    padding: 0 !important;
  }

  body.layout-edit-active::before {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 10040 !important;
    background: rgba(244, 248, 247, 0.86) !important;
    backdrop-filter: blur(8px) saturate(1.08) !important;
    -webkit-backdrop-filter: blur(8px) saturate(1.08) !important;
  }

  body.layout-edit-active .screen > :not(.dashboard-layout-edit-mode-panel):not(.team-layout-edit-mode-panel) {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    user-select: none !important;
    filter: none !important;
  }

  body.layout-edit-active .dashboard-layout-edit-mode-panel,
  body.layout-edit-active .team-layout-edit-mode-panel {
    position: fixed !important;
    left: 0.7rem !important;
    right: 0.7rem !important;
    top: calc(4.55rem + env(safe-area-inset-top)) !important;
    z-index: 10060 !important;
    max-height: min(74vh, 680px) !important;
    overflow: auto !important;
    border-radius: 22px !important;
    padding: 0.72rem !important;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2) !important;
    backdrop-filter: blur(12px) saturate(1.15) !important;
    -webkit-backdrop-filter: blur(12px) saturate(1.15) !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}
